1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package amplifybackend 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/amplifybackend/types" 10 smithy "github.com/aws/smithy-go" 11 "github.com/aws/smithy-go/encoding/httpbinding" 12 smithyjson "github.com/aws/smithy-go/encoding/json" 13 "github.com/aws/smithy-go/middleware" 14 smithyhttp "github.com/aws/smithy-go/transport/http" 15) 16 17type awsRestjson1_serializeOpCloneBackend struct { 18} 19 20func (*awsRestjson1_serializeOpCloneBackend) ID() string { 21 return "OperationSerializer" 22} 23 24func (m *awsRestjson1_serializeOpCloneBackend) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 25 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 26) { 27 request, ok := in.Request.(*smithyhttp.Request) 28 if !ok { 29 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 30 } 31 32 input, ok := in.Parameters.(*CloneBackendInput) 33 _ = input 34 if !ok { 35 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 36 } 37 38 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/environments/{BackendEnvironmentName}/clone") 39 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 40 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 41 request.Method = "POST" 42 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 43 if err != nil { 44 return out, metadata, &smithy.SerializationError{Err: err} 45 } 46 47 if err := awsRestjson1_serializeOpHttpBindingsCloneBackendInput(input, restEncoder); err != nil { 48 return out, metadata, &smithy.SerializationError{Err: err} 49 } 50 51 restEncoder.SetHeader("Content-Type").String("application/json") 52 53 jsonEncoder := smithyjson.NewEncoder() 54 if err := awsRestjson1_serializeOpDocumentCloneBackendInput(input, jsonEncoder.Value); err != nil { 55 return out, metadata, &smithy.SerializationError{Err: err} 56 } 57 58 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 59 return out, metadata, &smithy.SerializationError{Err: err} 60 } 61 62 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 63 return out, metadata, &smithy.SerializationError{Err: err} 64 } 65 in.Request = request 66 67 return next.HandleSerialize(ctx, in) 68} 69func awsRestjson1_serializeOpHttpBindingsCloneBackendInput(v *CloneBackendInput, encoder *httpbinding.Encoder) error { 70 if v == nil { 71 return fmt.Errorf("unsupported serialization of nil %T", v) 72 } 73 74 if v.AppId == nil || len(*v.AppId) == 0 { 75 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 76 } 77 if v.AppId != nil { 78 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 79 return err 80 } 81 } 82 83 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 84 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 85 } 86 if v.BackendEnvironmentName != nil { 87 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 88 return err 89 } 90 } 91 92 return nil 93} 94 95func awsRestjson1_serializeOpDocumentCloneBackendInput(v *CloneBackendInput, value smithyjson.Value) error { 96 object := value.Object() 97 defer object.Close() 98 99 if v.TargetEnvironmentName != nil { 100 ok := object.Key("targetEnvironmentName") 101 ok.String(*v.TargetEnvironmentName) 102 } 103 104 return nil 105} 106 107type awsRestjson1_serializeOpCreateBackend struct { 108} 109 110func (*awsRestjson1_serializeOpCreateBackend) ID() string { 111 return "OperationSerializer" 112} 113 114func (m *awsRestjson1_serializeOpCreateBackend) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 115 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 116) { 117 request, ok := in.Request.(*smithyhttp.Request) 118 if !ok { 119 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 120 } 121 122 input, ok := in.Parameters.(*CreateBackendInput) 123 _ = input 124 if !ok { 125 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 126 } 127 128 opPath, opQuery := httpbinding.SplitURI("/backend") 129 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 130 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 131 request.Method = "POST" 132 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 133 if err != nil { 134 return out, metadata, &smithy.SerializationError{Err: err} 135 } 136 137 restEncoder.SetHeader("Content-Type").String("application/json") 138 139 jsonEncoder := smithyjson.NewEncoder() 140 if err := awsRestjson1_serializeOpDocumentCreateBackendInput(input, jsonEncoder.Value); err != nil { 141 return out, metadata, &smithy.SerializationError{Err: err} 142 } 143 144 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 145 return out, metadata, &smithy.SerializationError{Err: err} 146 } 147 148 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 149 return out, metadata, &smithy.SerializationError{Err: err} 150 } 151 in.Request = request 152 153 return next.HandleSerialize(ctx, in) 154} 155func awsRestjson1_serializeOpHttpBindingsCreateBackendInput(v *CreateBackendInput, encoder *httpbinding.Encoder) error { 156 if v == nil { 157 return fmt.Errorf("unsupported serialization of nil %T", v) 158 } 159 160 return nil 161} 162 163func awsRestjson1_serializeOpDocumentCreateBackendInput(v *CreateBackendInput, value smithyjson.Value) error { 164 object := value.Object() 165 defer object.Close() 166 167 if v.AppId != nil { 168 ok := object.Key("appId") 169 ok.String(*v.AppId) 170 } 171 172 if v.AppName != nil { 173 ok := object.Key("appName") 174 ok.String(*v.AppName) 175 } 176 177 if v.BackendEnvironmentName != nil { 178 ok := object.Key("backendEnvironmentName") 179 ok.String(*v.BackendEnvironmentName) 180 } 181 182 if v.ResourceConfig != nil { 183 ok := object.Key("resourceConfig") 184 if err := awsRestjson1_serializeDocumentResourceConfig(v.ResourceConfig, ok); err != nil { 185 return err 186 } 187 } 188 189 if v.ResourceName != nil { 190 ok := object.Key("resourceName") 191 ok.String(*v.ResourceName) 192 } 193 194 return nil 195} 196 197type awsRestjson1_serializeOpCreateBackendAPI struct { 198} 199 200func (*awsRestjson1_serializeOpCreateBackendAPI) ID() string { 201 return "OperationSerializer" 202} 203 204func (m *awsRestjson1_serializeOpCreateBackendAPI) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 205 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 206) { 207 request, ok := in.Request.(*smithyhttp.Request) 208 if !ok { 209 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 210 } 211 212 input, ok := in.Parameters.(*CreateBackendAPIInput) 213 _ = input 214 if !ok { 215 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 216 } 217 218 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api") 219 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 220 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 221 request.Method = "POST" 222 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 223 if err != nil { 224 return out, metadata, &smithy.SerializationError{Err: err} 225 } 226 227 if err := awsRestjson1_serializeOpHttpBindingsCreateBackendAPIInput(input, restEncoder); err != nil { 228 return out, metadata, &smithy.SerializationError{Err: err} 229 } 230 231 restEncoder.SetHeader("Content-Type").String("application/json") 232 233 jsonEncoder := smithyjson.NewEncoder() 234 if err := awsRestjson1_serializeOpDocumentCreateBackendAPIInput(input, jsonEncoder.Value); err != nil { 235 return out, metadata, &smithy.SerializationError{Err: err} 236 } 237 238 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 239 return out, metadata, &smithy.SerializationError{Err: err} 240 } 241 242 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 243 return out, metadata, &smithy.SerializationError{Err: err} 244 } 245 in.Request = request 246 247 return next.HandleSerialize(ctx, in) 248} 249func awsRestjson1_serializeOpHttpBindingsCreateBackendAPIInput(v *CreateBackendAPIInput, encoder *httpbinding.Encoder) error { 250 if v == nil { 251 return fmt.Errorf("unsupported serialization of nil %T", v) 252 } 253 254 if v.AppId == nil || len(*v.AppId) == 0 { 255 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 256 } 257 if v.AppId != nil { 258 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 259 return err 260 } 261 } 262 263 return nil 264} 265 266func awsRestjson1_serializeOpDocumentCreateBackendAPIInput(v *CreateBackendAPIInput, value smithyjson.Value) error { 267 object := value.Object() 268 defer object.Close() 269 270 if v.BackendEnvironmentName != nil { 271 ok := object.Key("backendEnvironmentName") 272 ok.String(*v.BackendEnvironmentName) 273 } 274 275 if v.ResourceConfig != nil { 276 ok := object.Key("resourceConfig") 277 if err := awsRestjson1_serializeDocumentBackendAPIResourceConfig(v.ResourceConfig, ok); err != nil { 278 return err 279 } 280 } 281 282 if v.ResourceName != nil { 283 ok := object.Key("resourceName") 284 ok.String(*v.ResourceName) 285 } 286 287 return nil 288} 289 290type awsRestjson1_serializeOpCreateBackendAuth struct { 291} 292 293func (*awsRestjson1_serializeOpCreateBackendAuth) ID() string { 294 return "OperationSerializer" 295} 296 297func (m *awsRestjson1_serializeOpCreateBackendAuth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 298 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 299) { 300 request, ok := in.Request.(*smithyhttp.Request) 301 if !ok { 302 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 303 } 304 305 input, ok := in.Parameters.(*CreateBackendAuthInput) 306 _ = input 307 if !ok { 308 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 309 } 310 311 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/auth") 312 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 313 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 314 request.Method = "POST" 315 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 316 if err != nil { 317 return out, metadata, &smithy.SerializationError{Err: err} 318 } 319 320 if err := awsRestjson1_serializeOpHttpBindingsCreateBackendAuthInput(input, restEncoder); err != nil { 321 return out, metadata, &smithy.SerializationError{Err: err} 322 } 323 324 restEncoder.SetHeader("Content-Type").String("application/json") 325 326 jsonEncoder := smithyjson.NewEncoder() 327 if err := awsRestjson1_serializeOpDocumentCreateBackendAuthInput(input, jsonEncoder.Value); err != nil { 328 return out, metadata, &smithy.SerializationError{Err: err} 329 } 330 331 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 332 return out, metadata, &smithy.SerializationError{Err: err} 333 } 334 335 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 336 return out, metadata, &smithy.SerializationError{Err: err} 337 } 338 in.Request = request 339 340 return next.HandleSerialize(ctx, in) 341} 342func awsRestjson1_serializeOpHttpBindingsCreateBackendAuthInput(v *CreateBackendAuthInput, encoder *httpbinding.Encoder) error { 343 if v == nil { 344 return fmt.Errorf("unsupported serialization of nil %T", v) 345 } 346 347 if v.AppId == nil || len(*v.AppId) == 0 { 348 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 349 } 350 if v.AppId != nil { 351 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 352 return err 353 } 354 } 355 356 return nil 357} 358 359func awsRestjson1_serializeOpDocumentCreateBackendAuthInput(v *CreateBackendAuthInput, value smithyjson.Value) error { 360 object := value.Object() 361 defer object.Close() 362 363 if v.BackendEnvironmentName != nil { 364 ok := object.Key("backendEnvironmentName") 365 ok.String(*v.BackendEnvironmentName) 366 } 367 368 if v.ResourceConfig != nil { 369 ok := object.Key("resourceConfig") 370 if err := awsRestjson1_serializeDocumentCreateBackendAuthResourceConfig(v.ResourceConfig, ok); err != nil { 371 return err 372 } 373 } 374 375 if v.ResourceName != nil { 376 ok := object.Key("resourceName") 377 ok.String(*v.ResourceName) 378 } 379 380 return nil 381} 382 383type awsRestjson1_serializeOpCreateBackendConfig struct { 384} 385 386func (*awsRestjson1_serializeOpCreateBackendConfig) ID() string { 387 return "OperationSerializer" 388} 389 390func (m *awsRestjson1_serializeOpCreateBackendConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 391 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 392) { 393 request, ok := in.Request.(*smithyhttp.Request) 394 if !ok { 395 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 396 } 397 398 input, ok := in.Parameters.(*CreateBackendConfigInput) 399 _ = input 400 if !ok { 401 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 402 } 403 404 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/config") 405 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 406 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 407 request.Method = "POST" 408 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 409 if err != nil { 410 return out, metadata, &smithy.SerializationError{Err: err} 411 } 412 413 if err := awsRestjson1_serializeOpHttpBindingsCreateBackendConfigInput(input, restEncoder); err != nil { 414 return out, metadata, &smithy.SerializationError{Err: err} 415 } 416 417 restEncoder.SetHeader("Content-Type").String("application/json") 418 419 jsonEncoder := smithyjson.NewEncoder() 420 if err := awsRestjson1_serializeOpDocumentCreateBackendConfigInput(input, jsonEncoder.Value); err != nil { 421 return out, metadata, &smithy.SerializationError{Err: err} 422 } 423 424 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 425 return out, metadata, &smithy.SerializationError{Err: err} 426 } 427 428 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 429 return out, metadata, &smithy.SerializationError{Err: err} 430 } 431 in.Request = request 432 433 return next.HandleSerialize(ctx, in) 434} 435func awsRestjson1_serializeOpHttpBindingsCreateBackendConfigInput(v *CreateBackendConfigInput, encoder *httpbinding.Encoder) error { 436 if v == nil { 437 return fmt.Errorf("unsupported serialization of nil %T", v) 438 } 439 440 if v.AppId == nil || len(*v.AppId) == 0 { 441 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 442 } 443 if v.AppId != nil { 444 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 445 return err 446 } 447 } 448 449 return nil 450} 451 452func awsRestjson1_serializeOpDocumentCreateBackendConfigInput(v *CreateBackendConfigInput, value smithyjson.Value) error { 453 object := value.Object() 454 defer object.Close() 455 456 if v.BackendManagerAppId != nil { 457 ok := object.Key("backendManagerAppId") 458 ok.String(*v.BackendManagerAppId) 459 } 460 461 return nil 462} 463 464type awsRestjson1_serializeOpCreateToken struct { 465} 466 467func (*awsRestjson1_serializeOpCreateToken) ID() string { 468 return "OperationSerializer" 469} 470 471func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 472 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 473) { 474 request, ok := in.Request.(*smithyhttp.Request) 475 if !ok { 476 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 477 } 478 479 input, ok := in.Parameters.(*CreateTokenInput) 480 _ = input 481 if !ok { 482 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 483 } 484 485 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/challenge") 486 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 487 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 488 request.Method = "POST" 489 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 490 if err != nil { 491 return out, metadata, &smithy.SerializationError{Err: err} 492 } 493 494 if err := awsRestjson1_serializeOpHttpBindingsCreateTokenInput(input, restEncoder); err != nil { 495 return out, metadata, &smithy.SerializationError{Err: err} 496 } 497 498 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 499 return out, metadata, &smithy.SerializationError{Err: err} 500 } 501 in.Request = request 502 503 return next.HandleSerialize(ctx, in) 504} 505func awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error { 506 if v == nil { 507 return fmt.Errorf("unsupported serialization of nil %T", v) 508 } 509 510 if v.AppId == nil || len(*v.AppId) == 0 { 511 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 512 } 513 if v.AppId != nil { 514 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 515 return err 516 } 517 } 518 519 return nil 520} 521 522type awsRestjson1_serializeOpDeleteBackend struct { 523} 524 525func (*awsRestjson1_serializeOpDeleteBackend) ID() string { 526 return "OperationSerializer" 527} 528 529func (m *awsRestjson1_serializeOpDeleteBackend) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 530 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 531) { 532 request, ok := in.Request.(*smithyhttp.Request) 533 if !ok { 534 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 535 } 536 537 input, ok := in.Parameters.(*DeleteBackendInput) 538 _ = input 539 if !ok { 540 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 541 } 542 543 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/environments/{BackendEnvironmentName}/remove") 544 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 545 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 546 request.Method = "POST" 547 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 548 if err != nil { 549 return out, metadata, &smithy.SerializationError{Err: err} 550 } 551 552 if err := awsRestjson1_serializeOpHttpBindingsDeleteBackendInput(input, restEncoder); err != nil { 553 return out, metadata, &smithy.SerializationError{Err: err} 554 } 555 556 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 557 return out, metadata, &smithy.SerializationError{Err: err} 558 } 559 in.Request = request 560 561 return next.HandleSerialize(ctx, in) 562} 563func awsRestjson1_serializeOpHttpBindingsDeleteBackendInput(v *DeleteBackendInput, encoder *httpbinding.Encoder) error { 564 if v == nil { 565 return fmt.Errorf("unsupported serialization of nil %T", v) 566 } 567 568 if v.AppId == nil || len(*v.AppId) == 0 { 569 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 570 } 571 if v.AppId != nil { 572 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 573 return err 574 } 575 } 576 577 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 578 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 579 } 580 if v.BackendEnvironmentName != nil { 581 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 582 return err 583 } 584 } 585 586 return nil 587} 588 589type awsRestjson1_serializeOpDeleteBackendAPI struct { 590} 591 592func (*awsRestjson1_serializeOpDeleteBackendAPI) ID() string { 593 return "OperationSerializer" 594} 595 596func (m *awsRestjson1_serializeOpDeleteBackendAPI) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 597 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 598) { 599 request, ok := in.Request.(*smithyhttp.Request) 600 if !ok { 601 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 602 } 603 604 input, ok := in.Parameters.(*DeleteBackendAPIInput) 605 _ = input 606 if !ok { 607 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 608 } 609 610 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api/{BackendEnvironmentName}/remove") 611 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 612 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 613 request.Method = "POST" 614 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 615 if err != nil { 616 return out, metadata, &smithy.SerializationError{Err: err} 617 } 618 619 if err := awsRestjson1_serializeOpHttpBindingsDeleteBackendAPIInput(input, restEncoder); err != nil { 620 return out, metadata, &smithy.SerializationError{Err: err} 621 } 622 623 restEncoder.SetHeader("Content-Type").String("application/json") 624 625 jsonEncoder := smithyjson.NewEncoder() 626 if err := awsRestjson1_serializeOpDocumentDeleteBackendAPIInput(input, jsonEncoder.Value); err != nil { 627 return out, metadata, &smithy.SerializationError{Err: err} 628 } 629 630 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 631 return out, metadata, &smithy.SerializationError{Err: err} 632 } 633 634 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 635 return out, metadata, &smithy.SerializationError{Err: err} 636 } 637 in.Request = request 638 639 return next.HandleSerialize(ctx, in) 640} 641func awsRestjson1_serializeOpHttpBindingsDeleteBackendAPIInput(v *DeleteBackendAPIInput, encoder *httpbinding.Encoder) error { 642 if v == nil { 643 return fmt.Errorf("unsupported serialization of nil %T", v) 644 } 645 646 if v.AppId == nil || len(*v.AppId) == 0 { 647 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 648 } 649 if v.AppId != nil { 650 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 651 return err 652 } 653 } 654 655 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 656 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 657 } 658 if v.BackendEnvironmentName != nil { 659 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 660 return err 661 } 662 } 663 664 return nil 665} 666 667func awsRestjson1_serializeOpDocumentDeleteBackendAPIInput(v *DeleteBackendAPIInput, value smithyjson.Value) error { 668 object := value.Object() 669 defer object.Close() 670 671 if v.ResourceConfig != nil { 672 ok := object.Key("resourceConfig") 673 if err := awsRestjson1_serializeDocumentBackendAPIResourceConfig(v.ResourceConfig, ok); err != nil { 674 return err 675 } 676 } 677 678 if v.ResourceName != nil { 679 ok := object.Key("resourceName") 680 ok.String(*v.ResourceName) 681 } 682 683 return nil 684} 685 686type awsRestjson1_serializeOpDeleteBackendAuth struct { 687} 688 689func (*awsRestjson1_serializeOpDeleteBackendAuth) ID() string { 690 return "OperationSerializer" 691} 692 693func (m *awsRestjson1_serializeOpDeleteBackendAuth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 694 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 695) { 696 request, ok := in.Request.(*smithyhttp.Request) 697 if !ok { 698 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 699 } 700 701 input, ok := in.Parameters.(*DeleteBackendAuthInput) 702 _ = input 703 if !ok { 704 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 705 } 706 707 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/auth/{BackendEnvironmentName}/remove") 708 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 709 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 710 request.Method = "POST" 711 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 712 if err != nil { 713 return out, metadata, &smithy.SerializationError{Err: err} 714 } 715 716 if err := awsRestjson1_serializeOpHttpBindingsDeleteBackendAuthInput(input, restEncoder); err != nil { 717 return out, metadata, &smithy.SerializationError{Err: err} 718 } 719 720 restEncoder.SetHeader("Content-Type").String("application/json") 721 722 jsonEncoder := smithyjson.NewEncoder() 723 if err := awsRestjson1_serializeOpDocumentDeleteBackendAuthInput(input, jsonEncoder.Value); err != nil { 724 return out, metadata, &smithy.SerializationError{Err: err} 725 } 726 727 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 728 return out, metadata, &smithy.SerializationError{Err: err} 729 } 730 731 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 732 return out, metadata, &smithy.SerializationError{Err: err} 733 } 734 in.Request = request 735 736 return next.HandleSerialize(ctx, in) 737} 738func awsRestjson1_serializeOpHttpBindingsDeleteBackendAuthInput(v *DeleteBackendAuthInput, encoder *httpbinding.Encoder) error { 739 if v == nil { 740 return fmt.Errorf("unsupported serialization of nil %T", v) 741 } 742 743 if v.AppId == nil || len(*v.AppId) == 0 { 744 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 745 } 746 if v.AppId != nil { 747 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 748 return err 749 } 750 } 751 752 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 753 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 754 } 755 if v.BackendEnvironmentName != nil { 756 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 757 return err 758 } 759 } 760 761 return nil 762} 763 764func awsRestjson1_serializeOpDocumentDeleteBackendAuthInput(v *DeleteBackendAuthInput, value smithyjson.Value) error { 765 object := value.Object() 766 defer object.Close() 767 768 if v.ResourceName != nil { 769 ok := object.Key("resourceName") 770 ok.String(*v.ResourceName) 771 } 772 773 return nil 774} 775 776type awsRestjson1_serializeOpDeleteToken struct { 777} 778 779func (*awsRestjson1_serializeOpDeleteToken) ID() string { 780 return "OperationSerializer" 781} 782 783func (m *awsRestjson1_serializeOpDeleteToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 784 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 785) { 786 request, ok := in.Request.(*smithyhttp.Request) 787 if !ok { 788 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 789 } 790 791 input, ok := in.Parameters.(*DeleteTokenInput) 792 _ = input 793 if !ok { 794 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 795 } 796 797 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/challenge/{SessionId}/remove") 798 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 799 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 800 request.Method = "POST" 801 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 802 if err != nil { 803 return out, metadata, &smithy.SerializationError{Err: err} 804 } 805 806 if err := awsRestjson1_serializeOpHttpBindingsDeleteTokenInput(input, restEncoder); err != nil { 807 return out, metadata, &smithy.SerializationError{Err: err} 808 } 809 810 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 811 return out, metadata, &smithy.SerializationError{Err: err} 812 } 813 in.Request = request 814 815 return next.HandleSerialize(ctx, in) 816} 817func awsRestjson1_serializeOpHttpBindingsDeleteTokenInput(v *DeleteTokenInput, encoder *httpbinding.Encoder) error { 818 if v == nil { 819 return fmt.Errorf("unsupported serialization of nil %T", v) 820 } 821 822 if v.AppId == nil || len(*v.AppId) == 0 { 823 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 824 } 825 if v.AppId != nil { 826 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 827 return err 828 } 829 } 830 831 if v.SessionId == nil || len(*v.SessionId) == 0 { 832 return &smithy.SerializationError{Err: fmt.Errorf("input member SessionId must not be empty")} 833 } 834 if v.SessionId != nil { 835 if err := encoder.SetURI("SessionId").String(*v.SessionId); err != nil { 836 return err 837 } 838 } 839 840 return nil 841} 842 843type awsRestjson1_serializeOpGenerateBackendAPIModels struct { 844} 845 846func (*awsRestjson1_serializeOpGenerateBackendAPIModels) ID() string { 847 return "OperationSerializer" 848} 849 850func (m *awsRestjson1_serializeOpGenerateBackendAPIModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 851 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 852) { 853 request, ok := in.Request.(*smithyhttp.Request) 854 if !ok { 855 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 856 } 857 858 input, ok := in.Parameters.(*GenerateBackendAPIModelsInput) 859 _ = input 860 if !ok { 861 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 862 } 863 864 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api/{BackendEnvironmentName}/generateModels") 865 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 866 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 867 request.Method = "POST" 868 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 869 if err != nil { 870 return out, metadata, &smithy.SerializationError{Err: err} 871 } 872 873 if err := awsRestjson1_serializeOpHttpBindingsGenerateBackendAPIModelsInput(input, restEncoder); err != nil { 874 return out, metadata, &smithy.SerializationError{Err: err} 875 } 876 877 restEncoder.SetHeader("Content-Type").String("application/json") 878 879 jsonEncoder := smithyjson.NewEncoder() 880 if err := awsRestjson1_serializeOpDocumentGenerateBackendAPIModelsInput(input, jsonEncoder.Value); err != nil { 881 return out, metadata, &smithy.SerializationError{Err: err} 882 } 883 884 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 885 return out, metadata, &smithy.SerializationError{Err: err} 886 } 887 888 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 889 return out, metadata, &smithy.SerializationError{Err: err} 890 } 891 in.Request = request 892 893 return next.HandleSerialize(ctx, in) 894} 895func awsRestjson1_serializeOpHttpBindingsGenerateBackendAPIModelsInput(v *GenerateBackendAPIModelsInput, encoder *httpbinding.Encoder) error { 896 if v == nil { 897 return fmt.Errorf("unsupported serialization of nil %T", v) 898 } 899 900 if v.AppId == nil || len(*v.AppId) == 0 { 901 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 902 } 903 if v.AppId != nil { 904 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 905 return err 906 } 907 } 908 909 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 910 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 911 } 912 if v.BackendEnvironmentName != nil { 913 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 914 return err 915 } 916 } 917 918 return nil 919} 920 921func awsRestjson1_serializeOpDocumentGenerateBackendAPIModelsInput(v *GenerateBackendAPIModelsInput, value smithyjson.Value) error { 922 object := value.Object() 923 defer object.Close() 924 925 if v.ResourceName != nil { 926 ok := object.Key("resourceName") 927 ok.String(*v.ResourceName) 928 } 929 930 return nil 931} 932 933type awsRestjson1_serializeOpGetBackend struct { 934} 935 936func (*awsRestjson1_serializeOpGetBackend) ID() string { 937 return "OperationSerializer" 938} 939 940func (m *awsRestjson1_serializeOpGetBackend) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 941 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 942) { 943 request, ok := in.Request.(*smithyhttp.Request) 944 if !ok { 945 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 946 } 947 948 input, ok := in.Parameters.(*GetBackendInput) 949 _ = input 950 if !ok { 951 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 952 } 953 954 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/details") 955 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 956 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 957 request.Method = "POST" 958 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 959 if err != nil { 960 return out, metadata, &smithy.SerializationError{Err: err} 961 } 962 963 if err := awsRestjson1_serializeOpHttpBindingsGetBackendInput(input, restEncoder); err != nil { 964 return out, metadata, &smithy.SerializationError{Err: err} 965 } 966 967 restEncoder.SetHeader("Content-Type").String("application/json") 968 969 jsonEncoder := smithyjson.NewEncoder() 970 if err := awsRestjson1_serializeOpDocumentGetBackendInput(input, jsonEncoder.Value); err != nil { 971 return out, metadata, &smithy.SerializationError{Err: err} 972 } 973 974 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 975 return out, metadata, &smithy.SerializationError{Err: err} 976 } 977 978 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 979 return out, metadata, &smithy.SerializationError{Err: err} 980 } 981 in.Request = request 982 983 return next.HandleSerialize(ctx, in) 984} 985func awsRestjson1_serializeOpHttpBindingsGetBackendInput(v *GetBackendInput, encoder *httpbinding.Encoder) error { 986 if v == nil { 987 return fmt.Errorf("unsupported serialization of nil %T", v) 988 } 989 990 if v.AppId == nil || len(*v.AppId) == 0 { 991 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 992 } 993 if v.AppId != nil { 994 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 995 return err 996 } 997 } 998 999 return nil 1000} 1001 1002func awsRestjson1_serializeOpDocumentGetBackendInput(v *GetBackendInput, value smithyjson.Value) error { 1003 object := value.Object() 1004 defer object.Close() 1005 1006 if v.BackendEnvironmentName != nil { 1007 ok := object.Key("backendEnvironmentName") 1008 ok.String(*v.BackendEnvironmentName) 1009 } 1010 1011 return nil 1012} 1013 1014type awsRestjson1_serializeOpGetBackendAPI struct { 1015} 1016 1017func (*awsRestjson1_serializeOpGetBackendAPI) ID() string { 1018 return "OperationSerializer" 1019} 1020 1021func (m *awsRestjson1_serializeOpGetBackendAPI) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1022 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1023) { 1024 request, ok := in.Request.(*smithyhttp.Request) 1025 if !ok { 1026 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1027 } 1028 1029 input, ok := in.Parameters.(*GetBackendAPIInput) 1030 _ = input 1031 if !ok { 1032 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1033 } 1034 1035 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api/{BackendEnvironmentName}/details") 1036 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1037 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1038 request.Method = "POST" 1039 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1040 if err != nil { 1041 return out, metadata, &smithy.SerializationError{Err: err} 1042 } 1043 1044 if err := awsRestjson1_serializeOpHttpBindingsGetBackendAPIInput(input, restEncoder); err != nil { 1045 return out, metadata, &smithy.SerializationError{Err: err} 1046 } 1047 1048 restEncoder.SetHeader("Content-Type").String("application/json") 1049 1050 jsonEncoder := smithyjson.NewEncoder() 1051 if err := awsRestjson1_serializeOpDocumentGetBackendAPIInput(input, jsonEncoder.Value); err != nil { 1052 return out, metadata, &smithy.SerializationError{Err: err} 1053 } 1054 1055 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1056 return out, metadata, &smithy.SerializationError{Err: err} 1057 } 1058 1059 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1060 return out, metadata, &smithy.SerializationError{Err: err} 1061 } 1062 in.Request = request 1063 1064 return next.HandleSerialize(ctx, in) 1065} 1066func awsRestjson1_serializeOpHttpBindingsGetBackendAPIInput(v *GetBackendAPIInput, encoder *httpbinding.Encoder) error { 1067 if v == nil { 1068 return fmt.Errorf("unsupported serialization of nil %T", v) 1069 } 1070 1071 if v.AppId == nil || len(*v.AppId) == 0 { 1072 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1073 } 1074 if v.AppId != nil { 1075 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1076 return err 1077 } 1078 } 1079 1080 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1081 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1082 } 1083 if v.BackendEnvironmentName != nil { 1084 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1085 return err 1086 } 1087 } 1088 1089 return nil 1090} 1091 1092func awsRestjson1_serializeOpDocumentGetBackendAPIInput(v *GetBackendAPIInput, value smithyjson.Value) error { 1093 object := value.Object() 1094 defer object.Close() 1095 1096 if v.ResourceConfig != nil { 1097 ok := object.Key("resourceConfig") 1098 if err := awsRestjson1_serializeDocumentBackendAPIResourceConfig(v.ResourceConfig, ok); err != nil { 1099 return err 1100 } 1101 } 1102 1103 if v.ResourceName != nil { 1104 ok := object.Key("resourceName") 1105 ok.String(*v.ResourceName) 1106 } 1107 1108 return nil 1109} 1110 1111type awsRestjson1_serializeOpGetBackendAPIModels struct { 1112} 1113 1114func (*awsRestjson1_serializeOpGetBackendAPIModels) ID() string { 1115 return "OperationSerializer" 1116} 1117 1118func (m *awsRestjson1_serializeOpGetBackendAPIModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1119 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1120) { 1121 request, ok := in.Request.(*smithyhttp.Request) 1122 if !ok { 1123 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1124 } 1125 1126 input, ok := in.Parameters.(*GetBackendAPIModelsInput) 1127 _ = input 1128 if !ok { 1129 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1130 } 1131 1132 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api/{BackendEnvironmentName}/getModels") 1133 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1134 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1135 request.Method = "POST" 1136 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1137 if err != nil { 1138 return out, metadata, &smithy.SerializationError{Err: err} 1139 } 1140 1141 if err := awsRestjson1_serializeOpHttpBindingsGetBackendAPIModelsInput(input, restEncoder); err != nil { 1142 return out, metadata, &smithy.SerializationError{Err: err} 1143 } 1144 1145 restEncoder.SetHeader("Content-Type").String("application/json") 1146 1147 jsonEncoder := smithyjson.NewEncoder() 1148 if err := awsRestjson1_serializeOpDocumentGetBackendAPIModelsInput(input, jsonEncoder.Value); err != nil { 1149 return out, metadata, &smithy.SerializationError{Err: err} 1150 } 1151 1152 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1153 return out, metadata, &smithy.SerializationError{Err: err} 1154 } 1155 1156 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1157 return out, metadata, &smithy.SerializationError{Err: err} 1158 } 1159 in.Request = request 1160 1161 return next.HandleSerialize(ctx, in) 1162} 1163func awsRestjson1_serializeOpHttpBindingsGetBackendAPIModelsInput(v *GetBackendAPIModelsInput, encoder *httpbinding.Encoder) error { 1164 if v == nil { 1165 return fmt.Errorf("unsupported serialization of nil %T", v) 1166 } 1167 1168 if v.AppId == nil || len(*v.AppId) == 0 { 1169 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1170 } 1171 if v.AppId != nil { 1172 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1173 return err 1174 } 1175 } 1176 1177 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1178 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1179 } 1180 if v.BackendEnvironmentName != nil { 1181 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1182 return err 1183 } 1184 } 1185 1186 return nil 1187} 1188 1189func awsRestjson1_serializeOpDocumentGetBackendAPIModelsInput(v *GetBackendAPIModelsInput, value smithyjson.Value) error { 1190 object := value.Object() 1191 defer object.Close() 1192 1193 if v.ResourceName != nil { 1194 ok := object.Key("resourceName") 1195 ok.String(*v.ResourceName) 1196 } 1197 1198 return nil 1199} 1200 1201type awsRestjson1_serializeOpGetBackendAuth struct { 1202} 1203 1204func (*awsRestjson1_serializeOpGetBackendAuth) ID() string { 1205 return "OperationSerializer" 1206} 1207 1208func (m *awsRestjson1_serializeOpGetBackendAuth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1209 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1210) { 1211 request, ok := in.Request.(*smithyhttp.Request) 1212 if !ok { 1213 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1214 } 1215 1216 input, ok := in.Parameters.(*GetBackendAuthInput) 1217 _ = input 1218 if !ok { 1219 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1220 } 1221 1222 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/auth/{BackendEnvironmentName}/details") 1223 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1224 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1225 request.Method = "POST" 1226 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1227 if err != nil { 1228 return out, metadata, &smithy.SerializationError{Err: err} 1229 } 1230 1231 if err := awsRestjson1_serializeOpHttpBindingsGetBackendAuthInput(input, restEncoder); err != nil { 1232 return out, metadata, &smithy.SerializationError{Err: err} 1233 } 1234 1235 restEncoder.SetHeader("Content-Type").String("application/json") 1236 1237 jsonEncoder := smithyjson.NewEncoder() 1238 if err := awsRestjson1_serializeOpDocumentGetBackendAuthInput(input, jsonEncoder.Value); err != nil { 1239 return out, metadata, &smithy.SerializationError{Err: err} 1240 } 1241 1242 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1243 return out, metadata, &smithy.SerializationError{Err: err} 1244 } 1245 1246 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1247 return out, metadata, &smithy.SerializationError{Err: err} 1248 } 1249 in.Request = request 1250 1251 return next.HandleSerialize(ctx, in) 1252} 1253func awsRestjson1_serializeOpHttpBindingsGetBackendAuthInput(v *GetBackendAuthInput, encoder *httpbinding.Encoder) error { 1254 if v == nil { 1255 return fmt.Errorf("unsupported serialization of nil %T", v) 1256 } 1257 1258 if v.AppId == nil || len(*v.AppId) == 0 { 1259 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1260 } 1261 if v.AppId != nil { 1262 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1263 return err 1264 } 1265 } 1266 1267 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1268 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1269 } 1270 if v.BackendEnvironmentName != nil { 1271 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1272 return err 1273 } 1274 } 1275 1276 return nil 1277} 1278 1279func awsRestjson1_serializeOpDocumentGetBackendAuthInput(v *GetBackendAuthInput, value smithyjson.Value) error { 1280 object := value.Object() 1281 defer object.Close() 1282 1283 if v.ResourceName != nil { 1284 ok := object.Key("resourceName") 1285 ok.String(*v.ResourceName) 1286 } 1287 1288 return nil 1289} 1290 1291type awsRestjson1_serializeOpGetBackendJob struct { 1292} 1293 1294func (*awsRestjson1_serializeOpGetBackendJob) ID() string { 1295 return "OperationSerializer" 1296} 1297 1298func (m *awsRestjson1_serializeOpGetBackendJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1299 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1300) { 1301 request, ok := in.Request.(*smithyhttp.Request) 1302 if !ok { 1303 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1304 } 1305 1306 input, ok := in.Parameters.(*GetBackendJobInput) 1307 _ = input 1308 if !ok { 1309 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1310 } 1311 1312 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}") 1313 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1314 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1315 request.Method = "GET" 1316 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1317 if err != nil { 1318 return out, metadata, &smithy.SerializationError{Err: err} 1319 } 1320 1321 if err := awsRestjson1_serializeOpHttpBindingsGetBackendJobInput(input, restEncoder); err != nil { 1322 return out, metadata, &smithy.SerializationError{Err: err} 1323 } 1324 1325 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1326 return out, metadata, &smithy.SerializationError{Err: err} 1327 } 1328 in.Request = request 1329 1330 return next.HandleSerialize(ctx, in) 1331} 1332func awsRestjson1_serializeOpHttpBindingsGetBackendJobInput(v *GetBackendJobInput, encoder *httpbinding.Encoder) error { 1333 if v == nil { 1334 return fmt.Errorf("unsupported serialization of nil %T", v) 1335 } 1336 1337 if v.AppId == nil || len(*v.AppId) == 0 { 1338 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1339 } 1340 if v.AppId != nil { 1341 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1342 return err 1343 } 1344 } 1345 1346 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1347 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1348 } 1349 if v.BackendEnvironmentName != nil { 1350 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1351 return err 1352 } 1353 } 1354 1355 if v.JobId == nil || len(*v.JobId) == 0 { 1356 return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} 1357 } 1358 if v.JobId != nil { 1359 if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { 1360 return err 1361 } 1362 } 1363 1364 return nil 1365} 1366 1367type awsRestjson1_serializeOpGetToken struct { 1368} 1369 1370func (*awsRestjson1_serializeOpGetToken) ID() string { 1371 return "OperationSerializer" 1372} 1373 1374func (m *awsRestjson1_serializeOpGetToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1375 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1376) { 1377 request, ok := in.Request.(*smithyhttp.Request) 1378 if !ok { 1379 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1380 } 1381 1382 input, ok := in.Parameters.(*GetTokenInput) 1383 _ = input 1384 if !ok { 1385 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1386 } 1387 1388 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/challenge/{SessionId}") 1389 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1390 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1391 request.Method = "GET" 1392 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1393 if err != nil { 1394 return out, metadata, &smithy.SerializationError{Err: err} 1395 } 1396 1397 if err := awsRestjson1_serializeOpHttpBindingsGetTokenInput(input, restEncoder); err != nil { 1398 return out, metadata, &smithy.SerializationError{Err: err} 1399 } 1400 1401 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1402 return out, metadata, &smithy.SerializationError{Err: err} 1403 } 1404 in.Request = request 1405 1406 return next.HandleSerialize(ctx, in) 1407} 1408func awsRestjson1_serializeOpHttpBindingsGetTokenInput(v *GetTokenInput, encoder *httpbinding.Encoder) error { 1409 if v == nil { 1410 return fmt.Errorf("unsupported serialization of nil %T", v) 1411 } 1412 1413 if v.AppId == nil || len(*v.AppId) == 0 { 1414 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1415 } 1416 if v.AppId != nil { 1417 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1418 return err 1419 } 1420 } 1421 1422 if v.SessionId == nil || len(*v.SessionId) == 0 { 1423 return &smithy.SerializationError{Err: fmt.Errorf("input member SessionId must not be empty")} 1424 } 1425 if v.SessionId != nil { 1426 if err := encoder.SetURI("SessionId").String(*v.SessionId); err != nil { 1427 return err 1428 } 1429 } 1430 1431 return nil 1432} 1433 1434type awsRestjson1_serializeOpListBackendJobs struct { 1435} 1436 1437func (*awsRestjson1_serializeOpListBackendJobs) ID() string { 1438 return "OperationSerializer" 1439} 1440 1441func (m *awsRestjson1_serializeOpListBackendJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1442 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1443) { 1444 request, ok := in.Request.(*smithyhttp.Request) 1445 if !ok { 1446 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1447 } 1448 1449 input, ok := in.Parameters.(*ListBackendJobsInput) 1450 _ = input 1451 if !ok { 1452 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1453 } 1454 1455 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/job/{BackendEnvironmentName}") 1456 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1457 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1458 request.Method = "POST" 1459 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1460 if err != nil { 1461 return out, metadata, &smithy.SerializationError{Err: err} 1462 } 1463 1464 if err := awsRestjson1_serializeOpHttpBindingsListBackendJobsInput(input, restEncoder); err != nil { 1465 return out, metadata, &smithy.SerializationError{Err: err} 1466 } 1467 1468 restEncoder.SetHeader("Content-Type").String("application/json") 1469 1470 jsonEncoder := smithyjson.NewEncoder() 1471 if err := awsRestjson1_serializeOpDocumentListBackendJobsInput(input, jsonEncoder.Value); err != nil { 1472 return out, metadata, &smithy.SerializationError{Err: err} 1473 } 1474 1475 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1476 return out, metadata, &smithy.SerializationError{Err: err} 1477 } 1478 1479 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1480 return out, metadata, &smithy.SerializationError{Err: err} 1481 } 1482 in.Request = request 1483 1484 return next.HandleSerialize(ctx, in) 1485} 1486func awsRestjson1_serializeOpHttpBindingsListBackendJobsInput(v *ListBackendJobsInput, encoder *httpbinding.Encoder) error { 1487 if v == nil { 1488 return fmt.Errorf("unsupported serialization of nil %T", v) 1489 } 1490 1491 if v.AppId == nil || len(*v.AppId) == 0 { 1492 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1493 } 1494 if v.AppId != nil { 1495 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1496 return err 1497 } 1498 } 1499 1500 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1501 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1502 } 1503 if v.BackendEnvironmentName != nil { 1504 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1505 return err 1506 } 1507 } 1508 1509 return nil 1510} 1511 1512func awsRestjson1_serializeOpDocumentListBackendJobsInput(v *ListBackendJobsInput, value smithyjson.Value) error { 1513 object := value.Object() 1514 defer object.Close() 1515 1516 if v.JobId != nil { 1517 ok := object.Key("jobId") 1518 ok.String(*v.JobId) 1519 } 1520 1521 if v.MaxResults != 0 { 1522 ok := object.Key("maxResults") 1523 ok.Integer(v.MaxResults) 1524 } 1525 1526 if v.NextToken != nil { 1527 ok := object.Key("nextToken") 1528 ok.String(*v.NextToken) 1529 } 1530 1531 if v.Operation != nil { 1532 ok := object.Key("operation") 1533 ok.String(*v.Operation) 1534 } 1535 1536 if v.Status != nil { 1537 ok := object.Key("status") 1538 ok.String(*v.Status) 1539 } 1540 1541 return nil 1542} 1543 1544type awsRestjson1_serializeOpRemoveAllBackends struct { 1545} 1546 1547func (*awsRestjson1_serializeOpRemoveAllBackends) ID() string { 1548 return "OperationSerializer" 1549} 1550 1551func (m *awsRestjson1_serializeOpRemoveAllBackends) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1552 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1553) { 1554 request, ok := in.Request.(*smithyhttp.Request) 1555 if !ok { 1556 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1557 } 1558 1559 input, ok := in.Parameters.(*RemoveAllBackendsInput) 1560 _ = input 1561 if !ok { 1562 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1563 } 1564 1565 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/remove") 1566 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1567 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1568 request.Method = "POST" 1569 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1570 if err != nil { 1571 return out, metadata, &smithy.SerializationError{Err: err} 1572 } 1573 1574 if err := awsRestjson1_serializeOpHttpBindingsRemoveAllBackendsInput(input, restEncoder); err != nil { 1575 return out, metadata, &smithy.SerializationError{Err: err} 1576 } 1577 1578 restEncoder.SetHeader("Content-Type").String("application/json") 1579 1580 jsonEncoder := smithyjson.NewEncoder() 1581 if err := awsRestjson1_serializeOpDocumentRemoveAllBackendsInput(input, jsonEncoder.Value); err != nil { 1582 return out, metadata, &smithy.SerializationError{Err: err} 1583 } 1584 1585 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1586 return out, metadata, &smithy.SerializationError{Err: err} 1587 } 1588 1589 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1590 return out, metadata, &smithy.SerializationError{Err: err} 1591 } 1592 in.Request = request 1593 1594 return next.HandleSerialize(ctx, in) 1595} 1596func awsRestjson1_serializeOpHttpBindingsRemoveAllBackendsInput(v *RemoveAllBackendsInput, encoder *httpbinding.Encoder) error { 1597 if v == nil { 1598 return fmt.Errorf("unsupported serialization of nil %T", v) 1599 } 1600 1601 if v.AppId == nil || len(*v.AppId) == 0 { 1602 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1603 } 1604 if v.AppId != nil { 1605 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1606 return err 1607 } 1608 } 1609 1610 return nil 1611} 1612 1613func awsRestjson1_serializeOpDocumentRemoveAllBackendsInput(v *RemoveAllBackendsInput, value smithyjson.Value) error { 1614 object := value.Object() 1615 defer object.Close() 1616 1617 if v.CleanAmplifyApp { 1618 ok := object.Key("cleanAmplifyApp") 1619 ok.Boolean(v.CleanAmplifyApp) 1620 } 1621 1622 return nil 1623} 1624 1625type awsRestjson1_serializeOpRemoveBackendConfig struct { 1626} 1627 1628func (*awsRestjson1_serializeOpRemoveBackendConfig) ID() string { 1629 return "OperationSerializer" 1630} 1631 1632func (m *awsRestjson1_serializeOpRemoveBackendConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1633 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1634) { 1635 request, ok := in.Request.(*smithyhttp.Request) 1636 if !ok { 1637 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1638 } 1639 1640 input, ok := in.Parameters.(*RemoveBackendConfigInput) 1641 _ = input 1642 if !ok { 1643 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1644 } 1645 1646 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/config/remove") 1647 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1648 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1649 request.Method = "POST" 1650 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1651 if err != nil { 1652 return out, metadata, &smithy.SerializationError{Err: err} 1653 } 1654 1655 if err := awsRestjson1_serializeOpHttpBindingsRemoveBackendConfigInput(input, restEncoder); err != nil { 1656 return out, metadata, &smithy.SerializationError{Err: err} 1657 } 1658 1659 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1660 return out, metadata, &smithy.SerializationError{Err: err} 1661 } 1662 in.Request = request 1663 1664 return next.HandleSerialize(ctx, in) 1665} 1666func awsRestjson1_serializeOpHttpBindingsRemoveBackendConfigInput(v *RemoveBackendConfigInput, encoder *httpbinding.Encoder) error { 1667 if v == nil { 1668 return fmt.Errorf("unsupported serialization of nil %T", v) 1669 } 1670 1671 if v.AppId == nil || len(*v.AppId) == 0 { 1672 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1673 } 1674 if v.AppId != nil { 1675 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1676 return err 1677 } 1678 } 1679 1680 return nil 1681} 1682 1683type awsRestjson1_serializeOpUpdateBackendAPI struct { 1684} 1685 1686func (*awsRestjson1_serializeOpUpdateBackendAPI) ID() string { 1687 return "OperationSerializer" 1688} 1689 1690func (m *awsRestjson1_serializeOpUpdateBackendAPI) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1691 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1692) { 1693 request, ok := in.Request.(*smithyhttp.Request) 1694 if !ok { 1695 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1696 } 1697 1698 input, ok := in.Parameters.(*UpdateBackendAPIInput) 1699 _ = input 1700 if !ok { 1701 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1702 } 1703 1704 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/api/{BackendEnvironmentName}") 1705 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1706 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1707 request.Method = "POST" 1708 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1709 if err != nil { 1710 return out, metadata, &smithy.SerializationError{Err: err} 1711 } 1712 1713 if err := awsRestjson1_serializeOpHttpBindingsUpdateBackendAPIInput(input, restEncoder); err != nil { 1714 return out, metadata, &smithy.SerializationError{Err: err} 1715 } 1716 1717 restEncoder.SetHeader("Content-Type").String("application/json") 1718 1719 jsonEncoder := smithyjson.NewEncoder() 1720 if err := awsRestjson1_serializeOpDocumentUpdateBackendAPIInput(input, jsonEncoder.Value); err != nil { 1721 return out, metadata, &smithy.SerializationError{Err: err} 1722 } 1723 1724 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1725 return out, metadata, &smithy.SerializationError{Err: err} 1726 } 1727 1728 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1729 return out, metadata, &smithy.SerializationError{Err: err} 1730 } 1731 in.Request = request 1732 1733 return next.HandleSerialize(ctx, in) 1734} 1735func awsRestjson1_serializeOpHttpBindingsUpdateBackendAPIInput(v *UpdateBackendAPIInput, encoder *httpbinding.Encoder) error { 1736 if v == nil { 1737 return fmt.Errorf("unsupported serialization of nil %T", v) 1738 } 1739 1740 if v.AppId == nil || len(*v.AppId) == 0 { 1741 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1742 } 1743 if v.AppId != nil { 1744 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1745 return err 1746 } 1747 } 1748 1749 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1750 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1751 } 1752 if v.BackendEnvironmentName != nil { 1753 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1754 return err 1755 } 1756 } 1757 1758 return nil 1759} 1760 1761func awsRestjson1_serializeOpDocumentUpdateBackendAPIInput(v *UpdateBackendAPIInput, value smithyjson.Value) error { 1762 object := value.Object() 1763 defer object.Close() 1764 1765 if v.ResourceConfig != nil { 1766 ok := object.Key("resourceConfig") 1767 if err := awsRestjson1_serializeDocumentBackendAPIResourceConfig(v.ResourceConfig, ok); err != nil { 1768 return err 1769 } 1770 } 1771 1772 if v.ResourceName != nil { 1773 ok := object.Key("resourceName") 1774 ok.String(*v.ResourceName) 1775 } 1776 1777 return nil 1778} 1779 1780type awsRestjson1_serializeOpUpdateBackendAuth struct { 1781} 1782 1783func (*awsRestjson1_serializeOpUpdateBackendAuth) ID() string { 1784 return "OperationSerializer" 1785} 1786 1787func (m *awsRestjson1_serializeOpUpdateBackendAuth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1788 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1789) { 1790 request, ok := in.Request.(*smithyhttp.Request) 1791 if !ok { 1792 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1793 } 1794 1795 input, ok := in.Parameters.(*UpdateBackendAuthInput) 1796 _ = input 1797 if !ok { 1798 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1799 } 1800 1801 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/auth/{BackendEnvironmentName}") 1802 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1803 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1804 request.Method = "POST" 1805 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1806 if err != nil { 1807 return out, metadata, &smithy.SerializationError{Err: err} 1808 } 1809 1810 if err := awsRestjson1_serializeOpHttpBindingsUpdateBackendAuthInput(input, restEncoder); err != nil { 1811 return out, metadata, &smithy.SerializationError{Err: err} 1812 } 1813 1814 restEncoder.SetHeader("Content-Type").String("application/json") 1815 1816 jsonEncoder := smithyjson.NewEncoder() 1817 if err := awsRestjson1_serializeOpDocumentUpdateBackendAuthInput(input, jsonEncoder.Value); err != nil { 1818 return out, metadata, &smithy.SerializationError{Err: err} 1819 } 1820 1821 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1822 return out, metadata, &smithy.SerializationError{Err: err} 1823 } 1824 1825 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1826 return out, metadata, &smithy.SerializationError{Err: err} 1827 } 1828 in.Request = request 1829 1830 return next.HandleSerialize(ctx, in) 1831} 1832func awsRestjson1_serializeOpHttpBindingsUpdateBackendAuthInput(v *UpdateBackendAuthInput, encoder *httpbinding.Encoder) error { 1833 if v == nil { 1834 return fmt.Errorf("unsupported serialization of nil %T", v) 1835 } 1836 1837 if v.AppId == nil || len(*v.AppId) == 0 { 1838 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1839 } 1840 if v.AppId != nil { 1841 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1842 return err 1843 } 1844 } 1845 1846 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 1847 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 1848 } 1849 if v.BackendEnvironmentName != nil { 1850 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 1851 return err 1852 } 1853 } 1854 1855 return nil 1856} 1857 1858func awsRestjson1_serializeOpDocumentUpdateBackendAuthInput(v *UpdateBackendAuthInput, value smithyjson.Value) error { 1859 object := value.Object() 1860 defer object.Close() 1861 1862 if v.ResourceConfig != nil { 1863 ok := object.Key("resourceConfig") 1864 if err := awsRestjson1_serializeDocumentUpdateBackendAuthResourceConfig(v.ResourceConfig, ok); err != nil { 1865 return err 1866 } 1867 } 1868 1869 if v.ResourceName != nil { 1870 ok := object.Key("resourceName") 1871 ok.String(*v.ResourceName) 1872 } 1873 1874 return nil 1875} 1876 1877type awsRestjson1_serializeOpUpdateBackendConfig struct { 1878} 1879 1880func (*awsRestjson1_serializeOpUpdateBackendConfig) ID() string { 1881 return "OperationSerializer" 1882} 1883 1884func (m *awsRestjson1_serializeOpUpdateBackendConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1885 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1886) { 1887 request, ok := in.Request.(*smithyhttp.Request) 1888 if !ok { 1889 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1890 } 1891 1892 input, ok := in.Parameters.(*UpdateBackendConfigInput) 1893 _ = input 1894 if !ok { 1895 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1896 } 1897 1898 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/config/update") 1899 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1900 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1901 request.Method = "POST" 1902 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1903 if err != nil { 1904 return out, metadata, &smithy.SerializationError{Err: err} 1905 } 1906 1907 if err := awsRestjson1_serializeOpHttpBindingsUpdateBackendConfigInput(input, restEncoder); err != nil { 1908 return out, metadata, &smithy.SerializationError{Err: err} 1909 } 1910 1911 restEncoder.SetHeader("Content-Type").String("application/json") 1912 1913 jsonEncoder := smithyjson.NewEncoder() 1914 if err := awsRestjson1_serializeOpDocumentUpdateBackendConfigInput(input, jsonEncoder.Value); err != nil { 1915 return out, metadata, &smithy.SerializationError{Err: err} 1916 } 1917 1918 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1919 return out, metadata, &smithy.SerializationError{Err: err} 1920 } 1921 1922 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1923 return out, metadata, &smithy.SerializationError{Err: err} 1924 } 1925 in.Request = request 1926 1927 return next.HandleSerialize(ctx, in) 1928} 1929func awsRestjson1_serializeOpHttpBindingsUpdateBackendConfigInput(v *UpdateBackendConfigInput, encoder *httpbinding.Encoder) error { 1930 if v == nil { 1931 return fmt.Errorf("unsupported serialization of nil %T", v) 1932 } 1933 1934 if v.AppId == nil || len(*v.AppId) == 0 { 1935 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 1936 } 1937 if v.AppId != nil { 1938 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 1939 return err 1940 } 1941 } 1942 1943 return nil 1944} 1945 1946func awsRestjson1_serializeOpDocumentUpdateBackendConfigInput(v *UpdateBackendConfigInput, value smithyjson.Value) error { 1947 object := value.Object() 1948 defer object.Close() 1949 1950 if v.LoginAuthConfig != nil { 1951 ok := object.Key("loginAuthConfig") 1952 if err := awsRestjson1_serializeDocumentLoginAuthConfigReqObj(v.LoginAuthConfig, ok); err != nil { 1953 return err 1954 } 1955 } 1956 1957 return nil 1958} 1959 1960type awsRestjson1_serializeOpUpdateBackendJob struct { 1961} 1962 1963func (*awsRestjson1_serializeOpUpdateBackendJob) ID() string { 1964 return "OperationSerializer" 1965} 1966 1967func (m *awsRestjson1_serializeOpUpdateBackendJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1968 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1969) { 1970 request, ok := in.Request.(*smithyhttp.Request) 1971 if !ok { 1972 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1973 } 1974 1975 input, ok := in.Parameters.(*UpdateBackendJobInput) 1976 _ = input 1977 if !ok { 1978 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1979 } 1980 1981 opPath, opQuery := httpbinding.SplitURI("/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}") 1982 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1983 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1984 request.Method = "POST" 1985 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1986 if err != nil { 1987 return out, metadata, &smithy.SerializationError{Err: err} 1988 } 1989 1990 if err := awsRestjson1_serializeOpHttpBindingsUpdateBackendJobInput(input, restEncoder); err != nil { 1991 return out, metadata, &smithy.SerializationError{Err: err} 1992 } 1993 1994 restEncoder.SetHeader("Content-Type").String("application/json") 1995 1996 jsonEncoder := smithyjson.NewEncoder() 1997 if err := awsRestjson1_serializeOpDocumentUpdateBackendJobInput(input, jsonEncoder.Value); err != nil { 1998 return out, metadata, &smithy.SerializationError{Err: err} 1999 } 2000 2001 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2002 return out, metadata, &smithy.SerializationError{Err: err} 2003 } 2004 2005 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2006 return out, metadata, &smithy.SerializationError{Err: err} 2007 } 2008 in.Request = request 2009 2010 return next.HandleSerialize(ctx, in) 2011} 2012func awsRestjson1_serializeOpHttpBindingsUpdateBackendJobInput(v *UpdateBackendJobInput, encoder *httpbinding.Encoder) error { 2013 if v == nil { 2014 return fmt.Errorf("unsupported serialization of nil %T", v) 2015 } 2016 2017 if v.AppId == nil || len(*v.AppId) == 0 { 2018 return &smithy.SerializationError{Err: fmt.Errorf("input member AppId must not be empty")} 2019 } 2020 if v.AppId != nil { 2021 if err := encoder.SetURI("AppId").String(*v.AppId); err != nil { 2022 return err 2023 } 2024 } 2025 2026 if v.BackendEnvironmentName == nil || len(*v.BackendEnvironmentName) == 0 { 2027 return &smithy.SerializationError{Err: fmt.Errorf("input member BackendEnvironmentName must not be empty")} 2028 } 2029 if v.BackendEnvironmentName != nil { 2030 if err := encoder.SetURI("BackendEnvironmentName").String(*v.BackendEnvironmentName); err != nil { 2031 return err 2032 } 2033 } 2034 2035 if v.JobId == nil || len(*v.JobId) == 0 { 2036 return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} 2037 } 2038 if v.JobId != nil { 2039 if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { 2040 return err 2041 } 2042 } 2043 2044 return nil 2045} 2046 2047func awsRestjson1_serializeOpDocumentUpdateBackendJobInput(v *UpdateBackendJobInput, value smithyjson.Value) error { 2048 object := value.Object() 2049 defer object.Close() 2050 2051 if v.Operation != nil { 2052 ok := object.Key("operation") 2053 ok.String(*v.Operation) 2054 } 2055 2056 if v.Status != nil { 2057 ok := object.Key("status") 2058 ok.String(*v.Status) 2059 } 2060 2061 return nil 2062} 2063 2064func awsRestjson1_serializeDocumentBackendAPIAppSyncAuthSettings(v *types.BackendAPIAppSyncAuthSettings, value smithyjson.Value) error { 2065 object := value.Object() 2066 defer object.Close() 2067 2068 if v.CognitoUserPoolId != nil { 2069 ok := object.Key("cognitoUserPoolId") 2070 ok.String(*v.CognitoUserPoolId) 2071 } 2072 2073 if v.Description != nil { 2074 ok := object.Key("description") 2075 ok.String(*v.Description) 2076 } 2077 2078 if v.ExpirationTime != 0 { 2079 ok := object.Key("expirationTime") 2080 ok.Double(v.ExpirationTime) 2081 } 2082 2083 if v.OpenIDAuthTTL != nil { 2084 ok := object.Key("openIDAuthTTL") 2085 ok.String(*v.OpenIDAuthTTL) 2086 } 2087 2088 if v.OpenIDClientId != nil { 2089 ok := object.Key("openIDClientId") 2090 ok.String(*v.OpenIDClientId) 2091 } 2092 2093 if v.OpenIDIatTTL != nil { 2094 ok := object.Key("openIDIatTTL") 2095 ok.String(*v.OpenIDIatTTL) 2096 } 2097 2098 if v.OpenIDIssueURL != nil { 2099 ok := object.Key("openIDIssueURL") 2100 ok.String(*v.OpenIDIssueURL) 2101 } 2102 2103 if v.OpenIDProviderName != nil { 2104 ok := object.Key("openIDProviderName") 2105 ok.String(*v.OpenIDProviderName) 2106 } 2107 2108 return nil 2109} 2110 2111func awsRestjson1_serializeDocumentBackendAPIAuthType(v *types.BackendAPIAuthType, value smithyjson.Value) error { 2112 object := value.Object() 2113 defer object.Close() 2114 2115 if len(v.Mode) > 0 { 2116 ok := object.Key("mode") 2117 ok.String(string(v.Mode)) 2118 } 2119 2120 if v.Settings != nil { 2121 ok := object.Key("settings") 2122 if err := awsRestjson1_serializeDocumentBackendAPIAppSyncAuthSettings(v.Settings, ok); err != nil { 2123 return err 2124 } 2125 } 2126 2127 return nil 2128} 2129 2130func awsRestjson1_serializeDocumentBackendAPIConflictResolution(v *types.BackendAPIConflictResolution, value smithyjson.Value) error { 2131 object := value.Object() 2132 defer object.Close() 2133 2134 if len(v.ResolutionStrategy) > 0 { 2135 ok := object.Key("resolutionStrategy") 2136 ok.String(string(v.ResolutionStrategy)) 2137 } 2138 2139 return nil 2140} 2141 2142func awsRestjson1_serializeDocumentBackendAPIResourceConfig(v *types.BackendAPIResourceConfig, value smithyjson.Value) error { 2143 object := value.Object() 2144 defer object.Close() 2145 2146 if v.AdditionalAuthTypes != nil { 2147 ok := object.Key("additionalAuthTypes") 2148 if err := awsRestjson1_serializeDocumentListOfBackendAPIAuthType(v.AdditionalAuthTypes, ok); err != nil { 2149 return err 2150 } 2151 } 2152 2153 if v.ApiName != nil { 2154 ok := object.Key("apiName") 2155 ok.String(*v.ApiName) 2156 } 2157 2158 if v.ConflictResolution != nil { 2159 ok := object.Key("conflictResolution") 2160 if err := awsRestjson1_serializeDocumentBackendAPIConflictResolution(v.ConflictResolution, ok); err != nil { 2161 return err 2162 } 2163 } 2164 2165 if v.DefaultAuthType != nil { 2166 ok := object.Key("defaultAuthType") 2167 if err := awsRestjson1_serializeDocumentBackendAPIAuthType(v.DefaultAuthType, ok); err != nil { 2168 return err 2169 } 2170 } 2171 2172 if v.Service != nil { 2173 ok := object.Key("service") 2174 ok.String(*v.Service) 2175 } 2176 2177 if v.TransformSchema != nil { 2178 ok := object.Key("transformSchema") 2179 ok.String(*v.TransformSchema) 2180 } 2181 2182 return nil 2183} 2184 2185func awsRestjson1_serializeDocumentBackendAuthSocialProviderConfig(v *types.BackendAuthSocialProviderConfig, value smithyjson.Value) error { 2186 object := value.Object() 2187 defer object.Close() 2188 2189 if v.ClientId != nil { 2190 ok := object.Key("client_id") 2191 ok.String(*v.ClientId) 2192 } 2193 2194 if v.ClientSecret != nil { 2195 ok := object.Key("client_secret") 2196 ok.String(*v.ClientSecret) 2197 } 2198 2199 return nil 2200} 2201 2202func awsRestjson1_serializeDocumentCreateBackendAuthForgotPasswordConfig(v *types.CreateBackendAuthForgotPasswordConfig, value smithyjson.Value) error { 2203 object := value.Object() 2204 defer object.Close() 2205 2206 if len(v.DeliveryMethod) > 0 { 2207 ok := object.Key("deliveryMethod") 2208 ok.String(string(v.DeliveryMethod)) 2209 } 2210 2211 if v.EmailSettings != nil { 2212 ok := object.Key("emailSettings") 2213 if err := awsRestjson1_serializeDocumentEmailSettings(v.EmailSettings, ok); err != nil { 2214 return err 2215 } 2216 } 2217 2218 if v.SmsSettings != nil { 2219 ok := object.Key("smsSettings") 2220 if err := awsRestjson1_serializeDocumentSmsSettings(v.SmsSettings, ok); err != nil { 2221 return err 2222 } 2223 } 2224 2225 return nil 2226} 2227 2228func awsRestjson1_serializeDocumentCreateBackendAuthIdentityPoolConfig(v *types.CreateBackendAuthIdentityPoolConfig, value smithyjson.Value) error { 2229 object := value.Object() 2230 defer object.Close() 2231 2232 if v.IdentityPoolName != nil { 2233 ok := object.Key("identityPoolName") 2234 ok.String(*v.IdentityPoolName) 2235 } 2236 2237 { 2238 ok := object.Key("unauthenticatedLogin") 2239 ok.Boolean(v.UnauthenticatedLogin) 2240 } 2241 2242 return nil 2243} 2244 2245func awsRestjson1_serializeDocumentCreateBackendAuthMFAConfig(v *types.CreateBackendAuthMFAConfig, value smithyjson.Value) error { 2246 object := value.Object() 2247 defer object.Close() 2248 2249 if len(v.MFAMode) > 0 { 2250 ok := object.Key("MFAMode") 2251 ok.String(string(v.MFAMode)) 2252 } 2253 2254 if v.Settings != nil { 2255 ok := object.Key("settings") 2256 if err := awsRestjson1_serializeDocumentSettings(v.Settings, ok); err != nil { 2257 return err 2258 } 2259 } 2260 2261 return nil 2262} 2263 2264func awsRestjson1_serializeDocumentCreateBackendAuthOAuthConfig(v *types.CreateBackendAuthOAuthConfig, value smithyjson.Value) error { 2265 object := value.Object() 2266 defer object.Close() 2267 2268 if v.DomainPrefix != nil { 2269 ok := object.Key("domainPrefix") 2270 ok.String(*v.DomainPrefix) 2271 } 2272 2273 if len(v.OAuthGrantType) > 0 { 2274 ok := object.Key("oAuthGrantType") 2275 ok.String(string(v.OAuthGrantType)) 2276 } 2277 2278 if v.OAuthScopes != nil { 2279 ok := object.Key("oAuthScopes") 2280 if err := awsRestjson1_serializeDocumentListOfOAuthScopesElement(v.OAuthScopes, ok); err != nil { 2281 return err 2282 } 2283 } 2284 2285 if v.RedirectSignInURIs != nil { 2286 ok := object.Key("redirectSignInURIs") 2287 if err := awsRestjson1_serializeDocumentListOf__string(v.RedirectSignInURIs, ok); err != nil { 2288 return err 2289 } 2290 } 2291 2292 if v.RedirectSignOutURIs != nil { 2293 ok := object.Key("redirectSignOutURIs") 2294 if err := awsRestjson1_serializeDocumentListOf__string(v.RedirectSignOutURIs, ok); err != nil { 2295 return err 2296 } 2297 } 2298 2299 if v.SocialProviderSettings != nil { 2300 ok := object.Key("socialProviderSettings") 2301 if err := awsRestjson1_serializeDocumentSocialProviderSettings(v.SocialProviderSettings, ok); err != nil { 2302 return err 2303 } 2304 } 2305 2306 return nil 2307} 2308 2309func awsRestjson1_serializeDocumentCreateBackendAuthPasswordPolicyConfig(v *types.CreateBackendAuthPasswordPolicyConfig, value smithyjson.Value) error { 2310 object := value.Object() 2311 defer object.Close() 2312 2313 if v.AdditionalConstraints != nil { 2314 ok := object.Key("additionalConstraints") 2315 if err := awsRestjson1_serializeDocumentListOfAdditionalConstraintsElement(v.AdditionalConstraints, ok); err != nil { 2316 return err 2317 } 2318 } 2319 2320 { 2321 ok := object.Key("minimumLength") 2322 ok.Double(v.MinimumLength) 2323 } 2324 2325 return nil 2326} 2327 2328func awsRestjson1_serializeDocumentCreateBackendAuthResourceConfig(v *types.CreateBackendAuthResourceConfig, value smithyjson.Value) error { 2329 object := value.Object() 2330 defer object.Close() 2331 2332 if len(v.AuthResources) > 0 { 2333 ok := object.Key("authResources") 2334 ok.String(string(v.AuthResources)) 2335 } 2336 2337 if v.IdentityPoolConfigs != nil { 2338 ok := object.Key("identityPoolConfigs") 2339 if err := awsRestjson1_serializeDocumentCreateBackendAuthIdentityPoolConfig(v.IdentityPoolConfigs, ok); err != nil { 2340 return err 2341 } 2342 } 2343 2344 if len(v.Service) > 0 { 2345 ok := object.Key("service") 2346 ok.String(string(v.Service)) 2347 } 2348 2349 if v.UserPoolConfigs != nil { 2350 ok := object.Key("userPoolConfigs") 2351 if err := awsRestjson1_serializeDocumentCreateBackendAuthUserPoolConfig(v.UserPoolConfigs, ok); err != nil { 2352 return err 2353 } 2354 } 2355 2356 return nil 2357} 2358 2359func awsRestjson1_serializeDocumentCreateBackendAuthUserPoolConfig(v *types.CreateBackendAuthUserPoolConfig, value smithyjson.Value) error { 2360 object := value.Object() 2361 defer object.Close() 2362 2363 if v.ForgotPassword != nil { 2364 ok := object.Key("forgotPassword") 2365 if err := awsRestjson1_serializeDocumentCreateBackendAuthForgotPasswordConfig(v.ForgotPassword, ok); err != nil { 2366 return err 2367 } 2368 } 2369 2370 if v.Mfa != nil { 2371 ok := object.Key("mfa") 2372 if err := awsRestjson1_serializeDocumentCreateBackendAuthMFAConfig(v.Mfa, ok); err != nil { 2373 return err 2374 } 2375 } 2376 2377 if v.OAuth != nil { 2378 ok := object.Key("oAuth") 2379 if err := awsRestjson1_serializeDocumentCreateBackendAuthOAuthConfig(v.OAuth, ok); err != nil { 2380 return err 2381 } 2382 } 2383 2384 if v.PasswordPolicy != nil { 2385 ok := object.Key("passwordPolicy") 2386 if err := awsRestjson1_serializeDocumentCreateBackendAuthPasswordPolicyConfig(v.PasswordPolicy, ok); err != nil { 2387 return err 2388 } 2389 } 2390 2391 if v.RequiredSignUpAttributes != nil { 2392 ok := object.Key("requiredSignUpAttributes") 2393 if err := awsRestjson1_serializeDocumentListOfRequiredSignUpAttributesElement(v.RequiredSignUpAttributes, ok); err != nil { 2394 return err 2395 } 2396 } 2397 2398 if len(v.SignInMethod) > 0 { 2399 ok := object.Key("signInMethod") 2400 ok.String(string(v.SignInMethod)) 2401 } 2402 2403 if v.UserPoolName != nil { 2404 ok := object.Key("userPoolName") 2405 ok.String(*v.UserPoolName) 2406 } 2407 2408 return nil 2409} 2410 2411func awsRestjson1_serializeDocumentEmailSettings(v *types.EmailSettings, value smithyjson.Value) error { 2412 object := value.Object() 2413 defer object.Close() 2414 2415 if v.EmailMessage != nil { 2416 ok := object.Key("emailMessage") 2417 ok.String(*v.EmailMessage) 2418 } 2419 2420 if v.EmailSubject != nil { 2421 ok := object.Key("emailSubject") 2422 ok.String(*v.EmailSubject) 2423 } 2424 2425 return nil 2426} 2427 2428func awsRestjson1_serializeDocumentListOf__string(v []string, value smithyjson.Value) error { 2429 array := value.Array() 2430 defer array.Close() 2431 2432 for i := range v { 2433 av := array.Value() 2434 av.String(v[i]) 2435 } 2436 return nil 2437} 2438 2439func awsRestjson1_serializeDocumentListOfAdditionalConstraintsElement(v []types.AdditionalConstraintsElement, value smithyjson.Value) error { 2440 array := value.Array() 2441 defer array.Close() 2442 2443 for i := range v { 2444 av := array.Value() 2445 av.String(string(v[i])) 2446 } 2447 return nil 2448} 2449 2450func awsRestjson1_serializeDocumentListOfBackendAPIAuthType(v []types.BackendAPIAuthType, value smithyjson.Value) error { 2451 array := value.Array() 2452 defer array.Close() 2453 2454 for i := range v { 2455 av := array.Value() 2456 if err := awsRestjson1_serializeDocumentBackendAPIAuthType(&v[i], av); err != nil { 2457 return err 2458 } 2459 } 2460 return nil 2461} 2462 2463func awsRestjson1_serializeDocumentListOfMfaTypesElement(v []types.MfaTypesElement, value smithyjson.Value) error { 2464 array := value.Array() 2465 defer array.Close() 2466 2467 for i := range v { 2468 av := array.Value() 2469 av.String(string(v[i])) 2470 } 2471 return nil 2472} 2473 2474func awsRestjson1_serializeDocumentListOfOAuthScopesElement(v []types.OAuthScopesElement, value smithyjson.Value) error { 2475 array := value.Array() 2476 defer array.Close() 2477 2478 for i := range v { 2479 av := array.Value() 2480 av.String(string(v[i])) 2481 } 2482 return nil 2483} 2484 2485func awsRestjson1_serializeDocumentListOfRequiredSignUpAttributesElement(v []types.RequiredSignUpAttributesElement, value smithyjson.Value) error { 2486 array := value.Array() 2487 defer array.Close() 2488 2489 for i := range v { 2490 av := array.Value() 2491 av.String(string(v[i])) 2492 } 2493 return nil 2494} 2495 2496func awsRestjson1_serializeDocumentLoginAuthConfigReqObj(v *types.LoginAuthConfigReqObj, value smithyjson.Value) error { 2497 object := value.Object() 2498 defer object.Close() 2499 2500 if v.AwsCognitoIdentityPoolId != nil { 2501 ok := object.Key("aws_cognito_identity_pool_id") 2502 ok.String(*v.AwsCognitoIdentityPoolId) 2503 } 2504 2505 if v.AwsCognitoRegion != nil { 2506 ok := object.Key("aws_cognito_region") 2507 ok.String(*v.AwsCognitoRegion) 2508 } 2509 2510 if v.AwsUserPoolsId != nil { 2511 ok := object.Key("aws_user_pools_id") 2512 ok.String(*v.AwsUserPoolsId) 2513 } 2514 2515 if v.AwsUserPoolsWebClientId != nil { 2516 ok := object.Key("aws_user_pools_web_client_id") 2517 ok.String(*v.AwsUserPoolsWebClientId) 2518 } 2519 2520 return nil 2521} 2522 2523func awsRestjson1_serializeDocumentResourceConfig(v *types.ResourceConfig, value smithyjson.Value) error { 2524 object := value.Object() 2525 defer object.Close() 2526 2527 return nil 2528} 2529 2530func awsRestjson1_serializeDocumentSettings(v *types.Settings, value smithyjson.Value) error { 2531 object := value.Object() 2532 defer object.Close() 2533 2534 if v.MfaTypes != nil { 2535 ok := object.Key("mfaTypes") 2536 if err := awsRestjson1_serializeDocumentListOfMfaTypesElement(v.MfaTypes, ok); err != nil { 2537 return err 2538 } 2539 } 2540 2541 if v.SmsMessage != nil { 2542 ok := object.Key("smsMessage") 2543 ok.String(*v.SmsMessage) 2544 } 2545 2546 return nil 2547} 2548 2549func awsRestjson1_serializeDocumentSmsSettings(v *types.SmsSettings, value smithyjson.Value) error { 2550 object := value.Object() 2551 defer object.Close() 2552 2553 if v.SmsMessage != nil { 2554 ok := object.Key("smsMessage") 2555 ok.String(*v.SmsMessage) 2556 } 2557 2558 return nil 2559} 2560 2561func awsRestjson1_serializeDocumentSocialProviderSettings(v *types.SocialProviderSettings, value smithyjson.Value) error { 2562 object := value.Object() 2563 defer object.Close() 2564 2565 if v.Facebook != nil { 2566 ok := object.Key("Facebook") 2567 if err := awsRestjson1_serializeDocumentBackendAuthSocialProviderConfig(v.Facebook, ok); err != nil { 2568 return err 2569 } 2570 } 2571 2572 if v.Google != nil { 2573 ok := object.Key("Google") 2574 if err := awsRestjson1_serializeDocumentBackendAuthSocialProviderConfig(v.Google, ok); err != nil { 2575 return err 2576 } 2577 } 2578 2579 if v.LoginWithAmazon != nil { 2580 ok := object.Key("LoginWithAmazon") 2581 if err := awsRestjson1_serializeDocumentBackendAuthSocialProviderConfig(v.LoginWithAmazon, ok); err != nil { 2582 return err 2583 } 2584 } 2585 2586 return nil 2587} 2588 2589func awsRestjson1_serializeDocumentUpdateBackendAuthForgotPasswordConfig(v *types.UpdateBackendAuthForgotPasswordConfig, value smithyjson.Value) error { 2590 object := value.Object() 2591 defer object.Close() 2592 2593 if len(v.DeliveryMethod) > 0 { 2594 ok := object.Key("deliveryMethod") 2595 ok.String(string(v.DeliveryMethod)) 2596 } 2597 2598 if v.EmailSettings != nil { 2599 ok := object.Key("emailSettings") 2600 if err := awsRestjson1_serializeDocumentEmailSettings(v.EmailSettings, ok); err != nil { 2601 return err 2602 } 2603 } 2604 2605 if v.SmsSettings != nil { 2606 ok := object.Key("smsSettings") 2607 if err := awsRestjson1_serializeDocumentSmsSettings(v.SmsSettings, ok); err != nil { 2608 return err 2609 } 2610 } 2611 2612 return nil 2613} 2614 2615func awsRestjson1_serializeDocumentUpdateBackendAuthIdentityPoolConfig(v *types.UpdateBackendAuthIdentityPoolConfig, value smithyjson.Value) error { 2616 object := value.Object() 2617 defer object.Close() 2618 2619 if v.UnauthenticatedLogin { 2620 ok := object.Key("unauthenticatedLogin") 2621 ok.Boolean(v.UnauthenticatedLogin) 2622 } 2623 2624 return nil 2625} 2626 2627func awsRestjson1_serializeDocumentUpdateBackendAuthMFAConfig(v *types.UpdateBackendAuthMFAConfig, value smithyjson.Value) error { 2628 object := value.Object() 2629 defer object.Close() 2630 2631 if len(v.MFAMode) > 0 { 2632 ok := object.Key("MFAMode") 2633 ok.String(string(v.MFAMode)) 2634 } 2635 2636 if v.Settings != nil { 2637 ok := object.Key("settings") 2638 if err := awsRestjson1_serializeDocumentSettings(v.Settings, ok); err != nil { 2639 return err 2640 } 2641 } 2642 2643 return nil 2644} 2645 2646func awsRestjson1_serializeDocumentUpdateBackendAuthOAuthConfig(v *types.UpdateBackendAuthOAuthConfig, value smithyjson.Value) error { 2647 object := value.Object() 2648 defer object.Close() 2649 2650 if v.DomainPrefix != nil { 2651 ok := object.Key("domainPrefix") 2652 ok.String(*v.DomainPrefix) 2653 } 2654 2655 if len(v.OAuthGrantType) > 0 { 2656 ok := object.Key("oAuthGrantType") 2657 ok.String(string(v.OAuthGrantType)) 2658 } 2659 2660 if v.OAuthScopes != nil { 2661 ok := object.Key("oAuthScopes") 2662 if err := awsRestjson1_serializeDocumentListOfOAuthScopesElement(v.OAuthScopes, ok); err != nil { 2663 return err 2664 } 2665 } 2666 2667 if v.RedirectSignInURIs != nil { 2668 ok := object.Key("redirectSignInURIs") 2669 if err := awsRestjson1_serializeDocumentListOf__string(v.RedirectSignInURIs, ok); err != nil { 2670 return err 2671 } 2672 } 2673 2674 if v.RedirectSignOutURIs != nil { 2675 ok := object.Key("redirectSignOutURIs") 2676 if err := awsRestjson1_serializeDocumentListOf__string(v.RedirectSignOutURIs, ok); err != nil { 2677 return err 2678 } 2679 } 2680 2681 if v.SocialProviderSettings != nil { 2682 ok := object.Key("socialProviderSettings") 2683 if err := awsRestjson1_serializeDocumentSocialProviderSettings(v.SocialProviderSettings, ok); err != nil { 2684 return err 2685 } 2686 } 2687 2688 return nil 2689} 2690 2691func awsRestjson1_serializeDocumentUpdateBackendAuthPasswordPolicyConfig(v *types.UpdateBackendAuthPasswordPolicyConfig, value smithyjson.Value) error { 2692 object := value.Object() 2693 defer object.Close() 2694 2695 if v.AdditionalConstraints != nil { 2696 ok := object.Key("additionalConstraints") 2697 if err := awsRestjson1_serializeDocumentListOfAdditionalConstraintsElement(v.AdditionalConstraints, ok); err != nil { 2698 return err 2699 } 2700 } 2701 2702 if v.MinimumLength != 0 { 2703 ok := object.Key("minimumLength") 2704 ok.Double(v.MinimumLength) 2705 } 2706 2707 return nil 2708} 2709 2710func awsRestjson1_serializeDocumentUpdateBackendAuthResourceConfig(v *types.UpdateBackendAuthResourceConfig, value smithyjson.Value) error { 2711 object := value.Object() 2712 defer object.Close() 2713 2714 if len(v.AuthResources) > 0 { 2715 ok := object.Key("authResources") 2716 ok.String(string(v.AuthResources)) 2717 } 2718 2719 if v.IdentityPoolConfigs != nil { 2720 ok := object.Key("identityPoolConfigs") 2721 if err := awsRestjson1_serializeDocumentUpdateBackendAuthIdentityPoolConfig(v.IdentityPoolConfigs, ok); err != nil { 2722 return err 2723 } 2724 } 2725 2726 if len(v.Service) > 0 { 2727 ok := object.Key("service") 2728 ok.String(string(v.Service)) 2729 } 2730 2731 if v.UserPoolConfigs != nil { 2732 ok := object.Key("userPoolConfigs") 2733 if err := awsRestjson1_serializeDocumentUpdateBackendAuthUserPoolConfig(v.UserPoolConfigs, ok); err != nil { 2734 return err 2735 } 2736 } 2737 2738 return nil 2739} 2740 2741func awsRestjson1_serializeDocumentUpdateBackendAuthUserPoolConfig(v *types.UpdateBackendAuthUserPoolConfig, value smithyjson.Value) error { 2742 object := value.Object() 2743 defer object.Close() 2744 2745 if v.ForgotPassword != nil { 2746 ok := object.Key("forgotPassword") 2747 if err := awsRestjson1_serializeDocumentUpdateBackendAuthForgotPasswordConfig(v.ForgotPassword, ok); err != nil { 2748 return err 2749 } 2750 } 2751 2752 if v.Mfa != nil { 2753 ok := object.Key("mfa") 2754 if err := awsRestjson1_serializeDocumentUpdateBackendAuthMFAConfig(v.Mfa, ok); err != nil { 2755 return err 2756 } 2757 } 2758 2759 if v.OAuth != nil { 2760 ok := object.Key("oAuth") 2761 if err := awsRestjson1_serializeDocumentUpdateBackendAuthOAuthConfig(v.OAuth, ok); err != nil { 2762 return err 2763 } 2764 } 2765 2766 if v.PasswordPolicy != nil { 2767 ok := object.Key("passwordPolicy") 2768 if err := awsRestjson1_serializeDocumentUpdateBackendAuthPasswordPolicyConfig(v.PasswordPolicy, ok); err != nil { 2769 return err 2770 } 2771 } 2772 2773 return nil 2774} 2775