1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package servicecatalogappregistry 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 smithy "github.com/aws/smithy-go" 10 "github.com/aws/smithy-go/encoding/httpbinding" 11 smithyjson "github.com/aws/smithy-go/encoding/json" 12 "github.com/aws/smithy-go/middleware" 13 smithyhttp "github.com/aws/smithy-go/transport/http" 14) 15 16type awsRestjson1_serializeOpAssociateAttributeGroup struct { 17} 18 19func (*awsRestjson1_serializeOpAssociateAttributeGroup) ID() string { 20 return "OperationSerializer" 21} 22 23func (m *awsRestjson1_serializeOpAssociateAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 24 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 25) { 26 request, ok := in.Request.(*smithyhttp.Request) 27 if !ok { 28 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 29 } 30 31 input, ok := in.Parameters.(*AssociateAttributeGroupInput) 32 _ = input 33 if !ok { 34 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 35 } 36 37 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/attribute-groups/{attributeGroup}") 38 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 39 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 40 request.Method = "PUT" 41 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 42 if err != nil { 43 return out, metadata, &smithy.SerializationError{Err: err} 44 } 45 46 if err := awsRestjson1_serializeOpHttpBindingsAssociateAttributeGroupInput(input, restEncoder); err != nil { 47 return out, metadata, &smithy.SerializationError{Err: err} 48 } 49 50 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 51 return out, metadata, &smithy.SerializationError{Err: err} 52 } 53 in.Request = request 54 55 return next.HandleSerialize(ctx, in) 56} 57func awsRestjson1_serializeOpHttpBindingsAssociateAttributeGroupInput(v *AssociateAttributeGroupInput, encoder *httpbinding.Encoder) error { 58 if v == nil { 59 return fmt.Errorf("unsupported serialization of nil %T", v) 60 } 61 62 if v.Application == nil || len(*v.Application) == 0 { 63 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 64 } 65 if v.Application != nil { 66 if err := encoder.SetURI("application").String(*v.Application); err != nil { 67 return err 68 } 69 } 70 71 if v.AttributeGroup == nil || len(*v.AttributeGroup) == 0 { 72 return &smithy.SerializationError{Err: fmt.Errorf("input member attributeGroup must not be empty")} 73 } 74 if v.AttributeGroup != nil { 75 if err := encoder.SetURI("attributeGroup").String(*v.AttributeGroup); err != nil { 76 return err 77 } 78 } 79 80 return nil 81} 82 83type awsRestjson1_serializeOpAssociateResource struct { 84} 85 86func (*awsRestjson1_serializeOpAssociateResource) ID() string { 87 return "OperationSerializer" 88} 89 90func (m *awsRestjson1_serializeOpAssociateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 91 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 92) { 93 request, ok := in.Request.(*smithyhttp.Request) 94 if !ok { 95 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 96 } 97 98 input, ok := in.Parameters.(*AssociateResourceInput) 99 _ = input 100 if !ok { 101 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 102 } 103 104 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/resources/{resourceType}/{resource}") 105 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 106 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 107 request.Method = "PUT" 108 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 109 if err != nil { 110 return out, metadata, &smithy.SerializationError{Err: err} 111 } 112 113 if err := awsRestjson1_serializeOpHttpBindingsAssociateResourceInput(input, restEncoder); err != nil { 114 return out, metadata, &smithy.SerializationError{Err: err} 115 } 116 117 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 118 return out, metadata, &smithy.SerializationError{Err: err} 119 } 120 in.Request = request 121 122 return next.HandleSerialize(ctx, in) 123} 124func awsRestjson1_serializeOpHttpBindingsAssociateResourceInput(v *AssociateResourceInput, encoder *httpbinding.Encoder) error { 125 if v == nil { 126 return fmt.Errorf("unsupported serialization of nil %T", v) 127 } 128 129 if v.Application == nil || len(*v.Application) == 0 { 130 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 131 } 132 if v.Application != nil { 133 if err := encoder.SetURI("application").String(*v.Application); err != nil { 134 return err 135 } 136 } 137 138 if v.Resource == nil || len(*v.Resource) == 0 { 139 return &smithy.SerializationError{Err: fmt.Errorf("input member resource must not be empty")} 140 } 141 if v.Resource != nil { 142 if err := encoder.SetURI("resource").String(*v.Resource); err != nil { 143 return err 144 } 145 } 146 147 if len(v.ResourceType) == 0 { 148 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceType must not be empty")} 149 } 150 if len(v.ResourceType) > 0 { 151 if err := encoder.SetURI("resourceType").String(string(v.ResourceType)); err != nil { 152 return err 153 } 154 } 155 156 return nil 157} 158 159type awsRestjson1_serializeOpCreateApplication struct { 160} 161 162func (*awsRestjson1_serializeOpCreateApplication) ID() string { 163 return "OperationSerializer" 164} 165 166func (m *awsRestjson1_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 167 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 168) { 169 request, ok := in.Request.(*smithyhttp.Request) 170 if !ok { 171 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 172 } 173 174 input, ok := in.Parameters.(*CreateApplicationInput) 175 _ = input 176 if !ok { 177 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 178 } 179 180 opPath, opQuery := httpbinding.SplitURI("/applications") 181 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 182 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 183 request.Method = "POST" 184 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 185 if err != nil { 186 return out, metadata, &smithy.SerializationError{Err: err} 187 } 188 189 restEncoder.SetHeader("Content-Type").String("application/json") 190 191 jsonEncoder := smithyjson.NewEncoder() 192 if err := awsRestjson1_serializeOpDocumentCreateApplicationInput(input, jsonEncoder.Value); err != nil { 193 return out, metadata, &smithy.SerializationError{Err: err} 194 } 195 196 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 197 return out, metadata, &smithy.SerializationError{Err: err} 198 } 199 200 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 201 return out, metadata, &smithy.SerializationError{Err: err} 202 } 203 in.Request = request 204 205 return next.HandleSerialize(ctx, in) 206} 207func awsRestjson1_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { 208 if v == nil { 209 return fmt.Errorf("unsupported serialization of nil %T", v) 210 } 211 212 return nil 213} 214 215func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { 216 object := value.Object() 217 defer object.Close() 218 219 if v.ClientToken != nil { 220 ok := object.Key("clientToken") 221 ok.String(*v.ClientToken) 222 } 223 224 if v.Description != nil { 225 ok := object.Key("description") 226 ok.String(*v.Description) 227 } 228 229 if v.Name != nil { 230 ok := object.Key("name") 231 ok.String(*v.Name) 232 } 233 234 if v.Tags != nil { 235 ok := object.Key("tags") 236 if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { 237 return err 238 } 239 } 240 241 return nil 242} 243 244type awsRestjson1_serializeOpCreateAttributeGroup struct { 245} 246 247func (*awsRestjson1_serializeOpCreateAttributeGroup) ID() string { 248 return "OperationSerializer" 249} 250 251func (m *awsRestjson1_serializeOpCreateAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 252 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 253) { 254 request, ok := in.Request.(*smithyhttp.Request) 255 if !ok { 256 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 257 } 258 259 input, ok := in.Parameters.(*CreateAttributeGroupInput) 260 _ = input 261 if !ok { 262 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 263 } 264 265 opPath, opQuery := httpbinding.SplitURI("/attribute-groups") 266 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 267 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 268 request.Method = "POST" 269 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 270 if err != nil { 271 return out, metadata, &smithy.SerializationError{Err: err} 272 } 273 274 restEncoder.SetHeader("Content-Type").String("application/json") 275 276 jsonEncoder := smithyjson.NewEncoder() 277 if err := awsRestjson1_serializeOpDocumentCreateAttributeGroupInput(input, jsonEncoder.Value); err != nil { 278 return out, metadata, &smithy.SerializationError{Err: err} 279 } 280 281 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 282 return out, metadata, &smithy.SerializationError{Err: err} 283 } 284 285 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 286 return out, metadata, &smithy.SerializationError{Err: err} 287 } 288 in.Request = request 289 290 return next.HandleSerialize(ctx, in) 291} 292func awsRestjson1_serializeOpHttpBindingsCreateAttributeGroupInput(v *CreateAttributeGroupInput, encoder *httpbinding.Encoder) error { 293 if v == nil { 294 return fmt.Errorf("unsupported serialization of nil %T", v) 295 } 296 297 return nil 298} 299 300func awsRestjson1_serializeOpDocumentCreateAttributeGroupInput(v *CreateAttributeGroupInput, value smithyjson.Value) error { 301 object := value.Object() 302 defer object.Close() 303 304 if v.Attributes != nil { 305 ok := object.Key("attributes") 306 ok.String(*v.Attributes) 307 } 308 309 if v.ClientToken != nil { 310 ok := object.Key("clientToken") 311 ok.String(*v.ClientToken) 312 } 313 314 if v.Description != nil { 315 ok := object.Key("description") 316 ok.String(*v.Description) 317 } 318 319 if v.Name != nil { 320 ok := object.Key("name") 321 ok.String(*v.Name) 322 } 323 324 if v.Tags != nil { 325 ok := object.Key("tags") 326 if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { 327 return err 328 } 329 } 330 331 return nil 332} 333 334type awsRestjson1_serializeOpDeleteApplication struct { 335} 336 337func (*awsRestjson1_serializeOpDeleteApplication) ID() string { 338 return "OperationSerializer" 339} 340 341func (m *awsRestjson1_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 342 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 343) { 344 request, ok := in.Request.(*smithyhttp.Request) 345 if !ok { 346 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 347 } 348 349 input, ok := in.Parameters.(*DeleteApplicationInput) 350 _ = input 351 if !ok { 352 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 353 } 354 355 opPath, opQuery := httpbinding.SplitURI("/applications/{application}") 356 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 357 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 358 request.Method = "DELETE" 359 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 360 if err != nil { 361 return out, metadata, &smithy.SerializationError{Err: err} 362 } 363 364 if err := awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(input, restEncoder); err != nil { 365 return out, metadata, &smithy.SerializationError{Err: err} 366 } 367 368 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 369 return out, metadata, &smithy.SerializationError{Err: err} 370 } 371 in.Request = request 372 373 return next.HandleSerialize(ctx, in) 374} 375func awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { 376 if v == nil { 377 return fmt.Errorf("unsupported serialization of nil %T", v) 378 } 379 380 if v.Application == nil || len(*v.Application) == 0 { 381 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 382 } 383 if v.Application != nil { 384 if err := encoder.SetURI("application").String(*v.Application); err != nil { 385 return err 386 } 387 } 388 389 return nil 390} 391 392type awsRestjson1_serializeOpDeleteAttributeGroup struct { 393} 394 395func (*awsRestjson1_serializeOpDeleteAttributeGroup) ID() string { 396 return "OperationSerializer" 397} 398 399func (m *awsRestjson1_serializeOpDeleteAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 400 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 401) { 402 request, ok := in.Request.(*smithyhttp.Request) 403 if !ok { 404 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 405 } 406 407 input, ok := in.Parameters.(*DeleteAttributeGroupInput) 408 _ = input 409 if !ok { 410 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 411 } 412 413 opPath, opQuery := httpbinding.SplitURI("/attribute-groups/{attributeGroup}") 414 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 415 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 416 request.Method = "DELETE" 417 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 418 if err != nil { 419 return out, metadata, &smithy.SerializationError{Err: err} 420 } 421 422 if err := awsRestjson1_serializeOpHttpBindingsDeleteAttributeGroupInput(input, restEncoder); err != nil { 423 return out, metadata, &smithy.SerializationError{Err: err} 424 } 425 426 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 427 return out, metadata, &smithy.SerializationError{Err: err} 428 } 429 in.Request = request 430 431 return next.HandleSerialize(ctx, in) 432} 433func awsRestjson1_serializeOpHttpBindingsDeleteAttributeGroupInput(v *DeleteAttributeGroupInput, encoder *httpbinding.Encoder) error { 434 if v == nil { 435 return fmt.Errorf("unsupported serialization of nil %T", v) 436 } 437 438 if v.AttributeGroup == nil || len(*v.AttributeGroup) == 0 { 439 return &smithy.SerializationError{Err: fmt.Errorf("input member attributeGroup must not be empty")} 440 } 441 if v.AttributeGroup != nil { 442 if err := encoder.SetURI("attributeGroup").String(*v.AttributeGroup); err != nil { 443 return err 444 } 445 } 446 447 return nil 448} 449 450type awsRestjson1_serializeOpDisassociateAttributeGroup struct { 451} 452 453func (*awsRestjson1_serializeOpDisassociateAttributeGroup) ID() string { 454 return "OperationSerializer" 455} 456 457func (m *awsRestjson1_serializeOpDisassociateAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 458 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 459) { 460 request, ok := in.Request.(*smithyhttp.Request) 461 if !ok { 462 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 463 } 464 465 input, ok := in.Parameters.(*DisassociateAttributeGroupInput) 466 _ = input 467 if !ok { 468 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 469 } 470 471 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/attribute-groups/{attributeGroup}") 472 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 473 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 474 request.Method = "DELETE" 475 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 476 if err != nil { 477 return out, metadata, &smithy.SerializationError{Err: err} 478 } 479 480 if err := awsRestjson1_serializeOpHttpBindingsDisassociateAttributeGroupInput(input, restEncoder); err != nil { 481 return out, metadata, &smithy.SerializationError{Err: err} 482 } 483 484 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 485 return out, metadata, &smithy.SerializationError{Err: err} 486 } 487 in.Request = request 488 489 return next.HandleSerialize(ctx, in) 490} 491func awsRestjson1_serializeOpHttpBindingsDisassociateAttributeGroupInput(v *DisassociateAttributeGroupInput, encoder *httpbinding.Encoder) error { 492 if v == nil { 493 return fmt.Errorf("unsupported serialization of nil %T", v) 494 } 495 496 if v.Application == nil || len(*v.Application) == 0 { 497 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 498 } 499 if v.Application != nil { 500 if err := encoder.SetURI("application").String(*v.Application); err != nil { 501 return err 502 } 503 } 504 505 if v.AttributeGroup == nil || len(*v.AttributeGroup) == 0 { 506 return &smithy.SerializationError{Err: fmt.Errorf("input member attributeGroup must not be empty")} 507 } 508 if v.AttributeGroup != nil { 509 if err := encoder.SetURI("attributeGroup").String(*v.AttributeGroup); err != nil { 510 return err 511 } 512 } 513 514 return nil 515} 516 517type awsRestjson1_serializeOpDisassociateResource struct { 518} 519 520func (*awsRestjson1_serializeOpDisassociateResource) ID() string { 521 return "OperationSerializer" 522} 523 524func (m *awsRestjson1_serializeOpDisassociateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 525 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 526) { 527 request, ok := in.Request.(*smithyhttp.Request) 528 if !ok { 529 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 530 } 531 532 input, ok := in.Parameters.(*DisassociateResourceInput) 533 _ = input 534 if !ok { 535 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 536 } 537 538 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/resources/{resourceType}/{resource}") 539 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 540 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 541 request.Method = "DELETE" 542 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 543 if err != nil { 544 return out, metadata, &smithy.SerializationError{Err: err} 545 } 546 547 if err := awsRestjson1_serializeOpHttpBindingsDisassociateResourceInput(input, restEncoder); err != nil { 548 return out, metadata, &smithy.SerializationError{Err: err} 549 } 550 551 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 552 return out, metadata, &smithy.SerializationError{Err: err} 553 } 554 in.Request = request 555 556 return next.HandleSerialize(ctx, in) 557} 558func awsRestjson1_serializeOpHttpBindingsDisassociateResourceInput(v *DisassociateResourceInput, encoder *httpbinding.Encoder) error { 559 if v == nil { 560 return fmt.Errorf("unsupported serialization of nil %T", v) 561 } 562 563 if v.Application == nil || len(*v.Application) == 0 { 564 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 565 } 566 if v.Application != nil { 567 if err := encoder.SetURI("application").String(*v.Application); err != nil { 568 return err 569 } 570 } 571 572 if v.Resource == nil || len(*v.Resource) == 0 { 573 return &smithy.SerializationError{Err: fmt.Errorf("input member resource must not be empty")} 574 } 575 if v.Resource != nil { 576 if err := encoder.SetURI("resource").String(*v.Resource); err != nil { 577 return err 578 } 579 } 580 581 if len(v.ResourceType) == 0 { 582 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceType must not be empty")} 583 } 584 if len(v.ResourceType) > 0 { 585 if err := encoder.SetURI("resourceType").String(string(v.ResourceType)); err != nil { 586 return err 587 } 588 } 589 590 return nil 591} 592 593type awsRestjson1_serializeOpGetApplication struct { 594} 595 596func (*awsRestjson1_serializeOpGetApplication) ID() string { 597 return "OperationSerializer" 598} 599 600func (m *awsRestjson1_serializeOpGetApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 601 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 602) { 603 request, ok := in.Request.(*smithyhttp.Request) 604 if !ok { 605 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 606 } 607 608 input, ok := in.Parameters.(*GetApplicationInput) 609 _ = input 610 if !ok { 611 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 612 } 613 614 opPath, opQuery := httpbinding.SplitURI("/applications/{application}") 615 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 616 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 617 request.Method = "GET" 618 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 619 if err != nil { 620 return out, metadata, &smithy.SerializationError{Err: err} 621 } 622 623 if err := awsRestjson1_serializeOpHttpBindingsGetApplicationInput(input, restEncoder); err != nil { 624 return out, metadata, &smithy.SerializationError{Err: err} 625 } 626 627 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 628 return out, metadata, &smithy.SerializationError{Err: err} 629 } 630 in.Request = request 631 632 return next.HandleSerialize(ctx, in) 633} 634func awsRestjson1_serializeOpHttpBindingsGetApplicationInput(v *GetApplicationInput, encoder *httpbinding.Encoder) error { 635 if v == nil { 636 return fmt.Errorf("unsupported serialization of nil %T", v) 637 } 638 639 if v.Application == nil || len(*v.Application) == 0 { 640 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 641 } 642 if v.Application != nil { 643 if err := encoder.SetURI("application").String(*v.Application); err != nil { 644 return err 645 } 646 } 647 648 return nil 649} 650 651type awsRestjson1_serializeOpGetAttributeGroup struct { 652} 653 654func (*awsRestjson1_serializeOpGetAttributeGroup) ID() string { 655 return "OperationSerializer" 656} 657 658func (m *awsRestjson1_serializeOpGetAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 659 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 660) { 661 request, ok := in.Request.(*smithyhttp.Request) 662 if !ok { 663 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 664 } 665 666 input, ok := in.Parameters.(*GetAttributeGroupInput) 667 _ = input 668 if !ok { 669 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 670 } 671 672 opPath, opQuery := httpbinding.SplitURI("/attribute-groups/{attributeGroup}") 673 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 674 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 675 request.Method = "GET" 676 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 677 if err != nil { 678 return out, metadata, &smithy.SerializationError{Err: err} 679 } 680 681 if err := awsRestjson1_serializeOpHttpBindingsGetAttributeGroupInput(input, restEncoder); err != nil { 682 return out, metadata, &smithy.SerializationError{Err: err} 683 } 684 685 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 686 return out, metadata, &smithy.SerializationError{Err: err} 687 } 688 in.Request = request 689 690 return next.HandleSerialize(ctx, in) 691} 692func awsRestjson1_serializeOpHttpBindingsGetAttributeGroupInput(v *GetAttributeGroupInput, encoder *httpbinding.Encoder) error { 693 if v == nil { 694 return fmt.Errorf("unsupported serialization of nil %T", v) 695 } 696 697 if v.AttributeGroup == nil || len(*v.AttributeGroup) == 0 { 698 return &smithy.SerializationError{Err: fmt.Errorf("input member attributeGroup must not be empty")} 699 } 700 if v.AttributeGroup != nil { 701 if err := encoder.SetURI("attributeGroup").String(*v.AttributeGroup); err != nil { 702 return err 703 } 704 } 705 706 return nil 707} 708 709type awsRestjson1_serializeOpListApplications struct { 710} 711 712func (*awsRestjson1_serializeOpListApplications) ID() string { 713 return "OperationSerializer" 714} 715 716func (m *awsRestjson1_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 717 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 718) { 719 request, ok := in.Request.(*smithyhttp.Request) 720 if !ok { 721 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 722 } 723 724 input, ok := in.Parameters.(*ListApplicationsInput) 725 _ = input 726 if !ok { 727 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 728 } 729 730 opPath, opQuery := httpbinding.SplitURI("/applications") 731 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 732 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 733 request.Method = "GET" 734 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 735 if err != nil { 736 return out, metadata, &smithy.SerializationError{Err: err} 737 } 738 739 if err := awsRestjson1_serializeOpHttpBindingsListApplicationsInput(input, restEncoder); err != nil { 740 return out, metadata, &smithy.SerializationError{Err: err} 741 } 742 743 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 744 return out, metadata, &smithy.SerializationError{Err: err} 745 } 746 in.Request = request 747 748 return next.HandleSerialize(ctx, in) 749} 750func awsRestjson1_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error { 751 if v == nil { 752 return fmt.Errorf("unsupported serialization of nil %T", v) 753 } 754 755 if v.MaxResults != 0 { 756 encoder.SetQuery("maxResults").Integer(v.MaxResults) 757 } 758 759 if v.NextToken != nil { 760 encoder.SetQuery("nextToken").String(*v.NextToken) 761 } 762 763 return nil 764} 765 766type awsRestjson1_serializeOpListAssociatedAttributeGroups struct { 767} 768 769func (*awsRestjson1_serializeOpListAssociatedAttributeGroups) ID() string { 770 return "OperationSerializer" 771} 772 773func (m *awsRestjson1_serializeOpListAssociatedAttributeGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 774 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 775) { 776 request, ok := in.Request.(*smithyhttp.Request) 777 if !ok { 778 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 779 } 780 781 input, ok := in.Parameters.(*ListAssociatedAttributeGroupsInput) 782 _ = input 783 if !ok { 784 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 785 } 786 787 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/attribute-groups") 788 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 789 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 790 request.Method = "GET" 791 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 792 if err != nil { 793 return out, metadata, &smithy.SerializationError{Err: err} 794 } 795 796 if err := awsRestjson1_serializeOpHttpBindingsListAssociatedAttributeGroupsInput(input, restEncoder); err != nil { 797 return out, metadata, &smithy.SerializationError{Err: err} 798 } 799 800 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 801 return out, metadata, &smithy.SerializationError{Err: err} 802 } 803 in.Request = request 804 805 return next.HandleSerialize(ctx, in) 806} 807func awsRestjson1_serializeOpHttpBindingsListAssociatedAttributeGroupsInput(v *ListAssociatedAttributeGroupsInput, encoder *httpbinding.Encoder) error { 808 if v == nil { 809 return fmt.Errorf("unsupported serialization of nil %T", v) 810 } 811 812 if v.Application == nil || len(*v.Application) == 0 { 813 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 814 } 815 if v.Application != nil { 816 if err := encoder.SetURI("application").String(*v.Application); err != nil { 817 return err 818 } 819 } 820 821 if v.MaxResults != 0 { 822 encoder.SetQuery("maxResults").Integer(v.MaxResults) 823 } 824 825 if v.NextToken != nil { 826 encoder.SetQuery("nextToken").String(*v.NextToken) 827 } 828 829 return nil 830} 831 832type awsRestjson1_serializeOpListAssociatedResources struct { 833} 834 835func (*awsRestjson1_serializeOpListAssociatedResources) ID() string { 836 return "OperationSerializer" 837} 838 839func (m *awsRestjson1_serializeOpListAssociatedResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 840 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 841) { 842 request, ok := in.Request.(*smithyhttp.Request) 843 if !ok { 844 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 845 } 846 847 input, ok := in.Parameters.(*ListAssociatedResourcesInput) 848 _ = input 849 if !ok { 850 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 851 } 852 853 opPath, opQuery := httpbinding.SplitURI("/applications/{application}/resources") 854 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 855 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 856 request.Method = "GET" 857 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 858 if err != nil { 859 return out, metadata, &smithy.SerializationError{Err: err} 860 } 861 862 if err := awsRestjson1_serializeOpHttpBindingsListAssociatedResourcesInput(input, restEncoder); err != nil { 863 return out, metadata, &smithy.SerializationError{Err: err} 864 } 865 866 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 867 return out, metadata, &smithy.SerializationError{Err: err} 868 } 869 in.Request = request 870 871 return next.HandleSerialize(ctx, in) 872} 873func awsRestjson1_serializeOpHttpBindingsListAssociatedResourcesInput(v *ListAssociatedResourcesInput, encoder *httpbinding.Encoder) error { 874 if v == nil { 875 return fmt.Errorf("unsupported serialization of nil %T", v) 876 } 877 878 if v.Application == nil || len(*v.Application) == 0 { 879 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 880 } 881 if v.Application != nil { 882 if err := encoder.SetURI("application").String(*v.Application); err != nil { 883 return err 884 } 885 } 886 887 if v.MaxResults != 0 { 888 encoder.SetQuery("maxResults").Integer(v.MaxResults) 889 } 890 891 if v.NextToken != nil { 892 encoder.SetQuery("nextToken").String(*v.NextToken) 893 } 894 895 return nil 896} 897 898type awsRestjson1_serializeOpListAttributeGroups struct { 899} 900 901func (*awsRestjson1_serializeOpListAttributeGroups) ID() string { 902 return "OperationSerializer" 903} 904 905func (m *awsRestjson1_serializeOpListAttributeGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 906 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 907) { 908 request, ok := in.Request.(*smithyhttp.Request) 909 if !ok { 910 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 911 } 912 913 input, ok := in.Parameters.(*ListAttributeGroupsInput) 914 _ = input 915 if !ok { 916 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 917 } 918 919 opPath, opQuery := httpbinding.SplitURI("/attribute-groups") 920 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 921 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 922 request.Method = "GET" 923 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 924 if err != nil { 925 return out, metadata, &smithy.SerializationError{Err: err} 926 } 927 928 if err := awsRestjson1_serializeOpHttpBindingsListAttributeGroupsInput(input, restEncoder); err != nil { 929 return out, metadata, &smithy.SerializationError{Err: err} 930 } 931 932 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 933 return out, metadata, &smithy.SerializationError{Err: err} 934 } 935 in.Request = request 936 937 return next.HandleSerialize(ctx, in) 938} 939func awsRestjson1_serializeOpHttpBindingsListAttributeGroupsInput(v *ListAttributeGroupsInput, encoder *httpbinding.Encoder) error { 940 if v == nil { 941 return fmt.Errorf("unsupported serialization of nil %T", v) 942 } 943 944 if v.MaxResults != 0 { 945 encoder.SetQuery("maxResults").Integer(v.MaxResults) 946 } 947 948 if v.NextToken != nil { 949 encoder.SetQuery("nextToken").String(*v.NextToken) 950 } 951 952 return nil 953} 954 955type awsRestjson1_serializeOpListTagsForResource struct { 956} 957 958func (*awsRestjson1_serializeOpListTagsForResource) ID() string { 959 return "OperationSerializer" 960} 961 962func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 963 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 964) { 965 request, ok := in.Request.(*smithyhttp.Request) 966 if !ok { 967 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 968 } 969 970 input, ok := in.Parameters.(*ListTagsForResourceInput) 971 _ = input 972 if !ok { 973 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 974 } 975 976 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 977 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 978 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 979 request.Method = "GET" 980 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 981 if err != nil { 982 return out, metadata, &smithy.SerializationError{Err: err} 983 } 984 985 if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { 986 return out, metadata, &smithy.SerializationError{Err: err} 987 } 988 989 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 990 return out, metadata, &smithy.SerializationError{Err: err} 991 } 992 in.Request = request 993 994 return next.HandleSerialize(ctx, in) 995} 996func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { 997 if v == nil { 998 return fmt.Errorf("unsupported serialization of nil %T", v) 999 } 1000 1001 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 1002 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 1003 } 1004 if v.ResourceArn != nil { 1005 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 1006 return err 1007 } 1008 } 1009 1010 return nil 1011} 1012 1013type awsRestjson1_serializeOpSyncResource struct { 1014} 1015 1016func (*awsRestjson1_serializeOpSyncResource) ID() string { 1017 return "OperationSerializer" 1018} 1019 1020func (m *awsRestjson1_serializeOpSyncResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1021 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1022) { 1023 request, ok := in.Request.(*smithyhttp.Request) 1024 if !ok { 1025 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1026 } 1027 1028 input, ok := in.Parameters.(*SyncResourceInput) 1029 _ = input 1030 if !ok { 1031 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1032 } 1033 1034 opPath, opQuery := httpbinding.SplitURI("/sync/{resourceType}/{resource}") 1035 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1036 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1037 request.Method = "POST" 1038 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1039 if err != nil { 1040 return out, metadata, &smithy.SerializationError{Err: err} 1041 } 1042 1043 if err := awsRestjson1_serializeOpHttpBindingsSyncResourceInput(input, restEncoder); err != nil { 1044 return out, metadata, &smithy.SerializationError{Err: err} 1045 } 1046 1047 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1048 return out, metadata, &smithy.SerializationError{Err: err} 1049 } 1050 in.Request = request 1051 1052 return next.HandleSerialize(ctx, in) 1053} 1054func awsRestjson1_serializeOpHttpBindingsSyncResourceInput(v *SyncResourceInput, encoder *httpbinding.Encoder) error { 1055 if v == nil { 1056 return fmt.Errorf("unsupported serialization of nil %T", v) 1057 } 1058 1059 if v.Resource == nil || len(*v.Resource) == 0 { 1060 return &smithy.SerializationError{Err: fmt.Errorf("input member resource must not be empty")} 1061 } 1062 if v.Resource != nil { 1063 if err := encoder.SetURI("resource").String(*v.Resource); err != nil { 1064 return err 1065 } 1066 } 1067 1068 if len(v.ResourceType) == 0 { 1069 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceType must not be empty")} 1070 } 1071 if len(v.ResourceType) > 0 { 1072 if err := encoder.SetURI("resourceType").String(string(v.ResourceType)); err != nil { 1073 return err 1074 } 1075 } 1076 1077 return nil 1078} 1079 1080type awsRestjson1_serializeOpTagResource struct { 1081} 1082 1083func (*awsRestjson1_serializeOpTagResource) ID() string { 1084 return "OperationSerializer" 1085} 1086 1087func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1088 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1089) { 1090 request, ok := in.Request.(*smithyhttp.Request) 1091 if !ok { 1092 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1093 } 1094 1095 input, ok := in.Parameters.(*TagResourceInput) 1096 _ = input 1097 if !ok { 1098 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1099 } 1100 1101 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 1102 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1103 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1104 request.Method = "POST" 1105 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1106 if err != nil { 1107 return out, metadata, &smithy.SerializationError{Err: err} 1108 } 1109 1110 if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { 1111 return out, metadata, &smithy.SerializationError{Err: err} 1112 } 1113 1114 restEncoder.SetHeader("Content-Type").String("application/json") 1115 1116 jsonEncoder := smithyjson.NewEncoder() 1117 if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { 1118 return out, metadata, &smithy.SerializationError{Err: err} 1119 } 1120 1121 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1122 return out, metadata, &smithy.SerializationError{Err: err} 1123 } 1124 1125 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1126 return out, metadata, &smithy.SerializationError{Err: err} 1127 } 1128 in.Request = request 1129 1130 return next.HandleSerialize(ctx, in) 1131} 1132func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { 1133 if v == nil { 1134 return fmt.Errorf("unsupported serialization of nil %T", v) 1135 } 1136 1137 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 1138 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 1139 } 1140 if v.ResourceArn != nil { 1141 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 1142 return err 1143 } 1144 } 1145 1146 return nil 1147} 1148 1149func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { 1150 object := value.Object() 1151 defer object.Close() 1152 1153 if v.Tags != nil { 1154 ok := object.Key("tags") 1155 if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { 1156 return err 1157 } 1158 } 1159 1160 return nil 1161} 1162 1163type awsRestjson1_serializeOpUntagResource struct { 1164} 1165 1166func (*awsRestjson1_serializeOpUntagResource) ID() string { 1167 return "OperationSerializer" 1168} 1169 1170func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1171 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1172) { 1173 request, ok := in.Request.(*smithyhttp.Request) 1174 if !ok { 1175 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1176 } 1177 1178 input, ok := in.Parameters.(*UntagResourceInput) 1179 _ = input 1180 if !ok { 1181 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1182 } 1183 1184 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 1185 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1186 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1187 request.Method = "DELETE" 1188 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1189 if err != nil { 1190 return out, metadata, &smithy.SerializationError{Err: err} 1191 } 1192 1193 if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { 1194 return out, metadata, &smithy.SerializationError{Err: err} 1195 } 1196 1197 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1198 return out, metadata, &smithy.SerializationError{Err: err} 1199 } 1200 in.Request = request 1201 1202 return next.HandleSerialize(ctx, in) 1203} 1204func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { 1205 if v == nil { 1206 return fmt.Errorf("unsupported serialization of nil %T", v) 1207 } 1208 1209 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 1210 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 1211 } 1212 if v.ResourceArn != nil { 1213 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 1214 return err 1215 } 1216 } 1217 1218 if v.TagKeys != nil { 1219 for i := range v.TagKeys { 1220 encoder.AddQuery("tagKeys").String(v.TagKeys[i]) 1221 } 1222 } 1223 1224 return nil 1225} 1226 1227type awsRestjson1_serializeOpUpdateApplication struct { 1228} 1229 1230func (*awsRestjson1_serializeOpUpdateApplication) ID() string { 1231 return "OperationSerializer" 1232} 1233 1234func (m *awsRestjson1_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1235 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1236) { 1237 request, ok := in.Request.(*smithyhttp.Request) 1238 if !ok { 1239 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1240 } 1241 1242 input, ok := in.Parameters.(*UpdateApplicationInput) 1243 _ = input 1244 if !ok { 1245 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1246 } 1247 1248 opPath, opQuery := httpbinding.SplitURI("/applications/{application}") 1249 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1250 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1251 request.Method = "PATCH" 1252 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1253 if err != nil { 1254 return out, metadata, &smithy.SerializationError{Err: err} 1255 } 1256 1257 if err := awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil { 1258 return out, metadata, &smithy.SerializationError{Err: err} 1259 } 1260 1261 restEncoder.SetHeader("Content-Type").String("application/json") 1262 1263 jsonEncoder := smithyjson.NewEncoder() 1264 if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(input, jsonEncoder.Value); err != nil { 1265 return out, metadata, &smithy.SerializationError{Err: err} 1266 } 1267 1268 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1269 return out, metadata, &smithy.SerializationError{Err: err} 1270 } 1271 1272 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1273 return out, metadata, &smithy.SerializationError{Err: err} 1274 } 1275 in.Request = request 1276 1277 return next.HandleSerialize(ctx, in) 1278} 1279func awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { 1280 if v == nil { 1281 return fmt.Errorf("unsupported serialization of nil %T", v) 1282 } 1283 1284 if v.Application == nil || len(*v.Application) == 0 { 1285 return &smithy.SerializationError{Err: fmt.Errorf("input member application must not be empty")} 1286 } 1287 if v.Application != nil { 1288 if err := encoder.SetURI("application").String(*v.Application); err != nil { 1289 return err 1290 } 1291 } 1292 1293 return nil 1294} 1295 1296func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { 1297 object := value.Object() 1298 defer object.Close() 1299 1300 if v.Description != nil { 1301 ok := object.Key("description") 1302 ok.String(*v.Description) 1303 } 1304 1305 if v.Name != nil { 1306 ok := object.Key("name") 1307 ok.String(*v.Name) 1308 } 1309 1310 return nil 1311} 1312 1313type awsRestjson1_serializeOpUpdateAttributeGroup struct { 1314} 1315 1316func (*awsRestjson1_serializeOpUpdateAttributeGroup) ID() string { 1317 return "OperationSerializer" 1318} 1319 1320func (m *awsRestjson1_serializeOpUpdateAttributeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1321 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1322) { 1323 request, ok := in.Request.(*smithyhttp.Request) 1324 if !ok { 1325 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1326 } 1327 1328 input, ok := in.Parameters.(*UpdateAttributeGroupInput) 1329 _ = input 1330 if !ok { 1331 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1332 } 1333 1334 opPath, opQuery := httpbinding.SplitURI("/attribute-groups/{attributeGroup}") 1335 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1336 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1337 request.Method = "PATCH" 1338 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1339 if err != nil { 1340 return out, metadata, &smithy.SerializationError{Err: err} 1341 } 1342 1343 if err := awsRestjson1_serializeOpHttpBindingsUpdateAttributeGroupInput(input, restEncoder); err != nil { 1344 return out, metadata, &smithy.SerializationError{Err: err} 1345 } 1346 1347 restEncoder.SetHeader("Content-Type").String("application/json") 1348 1349 jsonEncoder := smithyjson.NewEncoder() 1350 if err := awsRestjson1_serializeOpDocumentUpdateAttributeGroupInput(input, jsonEncoder.Value); err != nil { 1351 return out, metadata, &smithy.SerializationError{Err: err} 1352 } 1353 1354 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1355 return out, metadata, &smithy.SerializationError{Err: err} 1356 } 1357 1358 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1359 return out, metadata, &smithy.SerializationError{Err: err} 1360 } 1361 in.Request = request 1362 1363 return next.HandleSerialize(ctx, in) 1364} 1365func awsRestjson1_serializeOpHttpBindingsUpdateAttributeGroupInput(v *UpdateAttributeGroupInput, encoder *httpbinding.Encoder) error { 1366 if v == nil { 1367 return fmt.Errorf("unsupported serialization of nil %T", v) 1368 } 1369 1370 if v.AttributeGroup == nil || len(*v.AttributeGroup) == 0 { 1371 return &smithy.SerializationError{Err: fmt.Errorf("input member attributeGroup must not be empty")} 1372 } 1373 if v.AttributeGroup != nil { 1374 if err := encoder.SetURI("attributeGroup").String(*v.AttributeGroup); err != nil { 1375 return err 1376 } 1377 } 1378 1379 return nil 1380} 1381 1382func awsRestjson1_serializeOpDocumentUpdateAttributeGroupInput(v *UpdateAttributeGroupInput, value smithyjson.Value) error { 1383 object := value.Object() 1384 defer object.Close() 1385 1386 if v.Attributes != nil { 1387 ok := object.Key("attributes") 1388 ok.String(*v.Attributes) 1389 } 1390 1391 if v.Description != nil { 1392 ok := object.Key("description") 1393 ok.String(*v.Description) 1394 } 1395 1396 if v.Name != nil { 1397 ok := object.Key("name") 1398 ok.String(*v.Name) 1399 } 1400 1401 return nil 1402} 1403 1404func awsRestjson1_serializeDocumentTags(v map[string]string, value smithyjson.Value) error { 1405 object := value.Object() 1406 defer object.Close() 1407 1408 for key := range v { 1409 om := object.Key(key) 1410 om.String(v[key]) 1411 } 1412 return nil 1413} 1414