1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package appmesh 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/appmesh/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_serializeOpCreateGatewayRoute struct { 18} 19 20func (*awsRestjson1_serializeOpCreateGatewayRoute) ID() string { 21 return "OperationSerializer" 22} 23 24func (m *awsRestjson1_serializeOpCreateGatewayRoute) 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.(*CreateGatewayRouteInput) 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("/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes") 39 request.URL.Path = opPath 40 if len(request.URL.RawQuery) > 0 { 41 request.URL.RawQuery = "&" + opQuery 42 } else { 43 request.URL.RawQuery = opQuery 44 } 45 46 request.Method = "PUT" 47 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 48 if err != nil { 49 return out, metadata, &smithy.SerializationError{Err: err} 50 } 51 52 if err := awsRestjson1_serializeOpHttpBindingsCreateGatewayRouteInput(input, restEncoder); err != nil { 53 return out, metadata, &smithy.SerializationError{Err: err} 54 } 55 56 restEncoder.SetHeader("Content-Type").String("application/json") 57 58 jsonEncoder := smithyjson.NewEncoder() 59 if err := awsRestjson1_serializeOpDocumentCreateGatewayRouteInput(input, jsonEncoder.Value); err != nil { 60 return out, metadata, &smithy.SerializationError{Err: err} 61 } 62 63 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 64 return out, metadata, &smithy.SerializationError{Err: err} 65 } 66 67 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 68 return out, metadata, &smithy.SerializationError{Err: err} 69 } 70 in.Request = request 71 72 return next.HandleSerialize(ctx, in) 73} 74func awsRestjson1_serializeOpHttpBindingsCreateGatewayRouteInput(v *CreateGatewayRouteInput, encoder *httpbinding.Encoder) error { 75 if v == nil { 76 return fmt.Errorf("unsupported serialization of nil %T", v) 77 } 78 79 if v.MeshName == nil || len(*v.MeshName) == 0 { 80 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 81 } 82 if v.MeshName != nil { 83 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 84 return err 85 } 86 } 87 88 if v.MeshOwner != nil { 89 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 90 } 91 92 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 93 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 94 } 95 if v.VirtualGatewayName != nil { 96 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 97 return err 98 } 99 } 100 101 return nil 102} 103 104func awsRestjson1_serializeOpDocumentCreateGatewayRouteInput(v *CreateGatewayRouteInput, value smithyjson.Value) error { 105 object := value.Object() 106 defer object.Close() 107 108 if v.ClientToken != nil { 109 ok := object.Key("clientToken") 110 ok.String(*v.ClientToken) 111 } 112 113 if v.GatewayRouteName != nil { 114 ok := object.Key("gatewayRouteName") 115 ok.String(*v.GatewayRouteName) 116 } 117 118 if v.Spec != nil { 119 ok := object.Key("spec") 120 if err := awsRestjson1_serializeDocumentGatewayRouteSpec(v.Spec, ok); err != nil { 121 return err 122 } 123 } 124 125 if v.Tags != nil { 126 ok := object.Key("tags") 127 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 128 return err 129 } 130 } 131 132 return nil 133} 134 135type awsRestjson1_serializeOpCreateMesh struct { 136} 137 138func (*awsRestjson1_serializeOpCreateMesh) ID() string { 139 return "OperationSerializer" 140} 141 142func (m *awsRestjson1_serializeOpCreateMesh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 143 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 144) { 145 request, ok := in.Request.(*smithyhttp.Request) 146 if !ok { 147 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 148 } 149 150 input, ok := in.Parameters.(*CreateMeshInput) 151 _ = input 152 if !ok { 153 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 154 } 155 156 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes") 157 request.URL.Path = opPath 158 if len(request.URL.RawQuery) > 0 { 159 request.URL.RawQuery = "&" + opQuery 160 } else { 161 request.URL.RawQuery = opQuery 162 } 163 164 request.Method = "PUT" 165 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 166 if err != nil { 167 return out, metadata, &smithy.SerializationError{Err: err} 168 } 169 170 restEncoder.SetHeader("Content-Type").String("application/json") 171 172 jsonEncoder := smithyjson.NewEncoder() 173 if err := awsRestjson1_serializeOpDocumentCreateMeshInput(input, jsonEncoder.Value); err != nil { 174 return out, metadata, &smithy.SerializationError{Err: err} 175 } 176 177 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 178 return out, metadata, &smithy.SerializationError{Err: err} 179 } 180 181 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 182 return out, metadata, &smithy.SerializationError{Err: err} 183 } 184 in.Request = request 185 186 return next.HandleSerialize(ctx, in) 187} 188func awsRestjson1_serializeOpHttpBindingsCreateMeshInput(v *CreateMeshInput, encoder *httpbinding.Encoder) error { 189 if v == nil { 190 return fmt.Errorf("unsupported serialization of nil %T", v) 191 } 192 193 return nil 194} 195 196func awsRestjson1_serializeOpDocumentCreateMeshInput(v *CreateMeshInput, value smithyjson.Value) error { 197 object := value.Object() 198 defer object.Close() 199 200 if v.ClientToken != nil { 201 ok := object.Key("clientToken") 202 ok.String(*v.ClientToken) 203 } 204 205 if v.MeshName != nil { 206 ok := object.Key("meshName") 207 ok.String(*v.MeshName) 208 } 209 210 if v.Spec != nil { 211 ok := object.Key("spec") 212 if err := awsRestjson1_serializeDocumentMeshSpec(v.Spec, ok); err != nil { 213 return err 214 } 215 } 216 217 if v.Tags != nil { 218 ok := object.Key("tags") 219 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 220 return err 221 } 222 } 223 224 return nil 225} 226 227type awsRestjson1_serializeOpCreateRoute struct { 228} 229 230func (*awsRestjson1_serializeOpCreateRoute) ID() string { 231 return "OperationSerializer" 232} 233 234func (m *awsRestjson1_serializeOpCreateRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 235 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 236) { 237 request, ok := in.Request.(*smithyhttp.Request) 238 if !ok { 239 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 240 } 241 242 input, ok := in.Parameters.(*CreateRouteInput) 243 _ = input 244 if !ok { 245 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 246 } 247 248 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes") 249 request.URL.Path = opPath 250 if len(request.URL.RawQuery) > 0 { 251 request.URL.RawQuery = "&" + opQuery 252 } else { 253 request.URL.RawQuery = opQuery 254 } 255 256 request.Method = "PUT" 257 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 258 if err != nil { 259 return out, metadata, &smithy.SerializationError{Err: err} 260 } 261 262 if err := awsRestjson1_serializeOpHttpBindingsCreateRouteInput(input, restEncoder); err != nil { 263 return out, metadata, &smithy.SerializationError{Err: err} 264 } 265 266 restEncoder.SetHeader("Content-Type").String("application/json") 267 268 jsonEncoder := smithyjson.NewEncoder() 269 if err := awsRestjson1_serializeOpDocumentCreateRouteInput(input, jsonEncoder.Value); err != nil { 270 return out, metadata, &smithy.SerializationError{Err: err} 271 } 272 273 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 274 return out, metadata, &smithy.SerializationError{Err: err} 275 } 276 277 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 278 return out, metadata, &smithy.SerializationError{Err: err} 279 } 280 in.Request = request 281 282 return next.HandleSerialize(ctx, in) 283} 284func awsRestjson1_serializeOpHttpBindingsCreateRouteInput(v *CreateRouteInput, encoder *httpbinding.Encoder) error { 285 if v == nil { 286 return fmt.Errorf("unsupported serialization of nil %T", v) 287 } 288 289 if v.MeshName == nil || len(*v.MeshName) == 0 { 290 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 291 } 292 if v.MeshName != nil { 293 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 294 return err 295 } 296 } 297 298 if v.MeshOwner != nil { 299 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 300 } 301 302 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 303 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 304 } 305 if v.VirtualRouterName != nil { 306 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 307 return err 308 } 309 } 310 311 return nil 312} 313 314func awsRestjson1_serializeOpDocumentCreateRouteInput(v *CreateRouteInput, value smithyjson.Value) error { 315 object := value.Object() 316 defer object.Close() 317 318 if v.ClientToken != nil { 319 ok := object.Key("clientToken") 320 ok.String(*v.ClientToken) 321 } 322 323 if v.RouteName != nil { 324 ok := object.Key("routeName") 325 ok.String(*v.RouteName) 326 } 327 328 if v.Spec != nil { 329 ok := object.Key("spec") 330 if err := awsRestjson1_serializeDocumentRouteSpec(v.Spec, ok); err != nil { 331 return err 332 } 333 } 334 335 if v.Tags != nil { 336 ok := object.Key("tags") 337 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 338 return err 339 } 340 } 341 342 return nil 343} 344 345type awsRestjson1_serializeOpCreateVirtualGateway struct { 346} 347 348func (*awsRestjson1_serializeOpCreateVirtualGateway) ID() string { 349 return "OperationSerializer" 350} 351 352func (m *awsRestjson1_serializeOpCreateVirtualGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 353 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 354) { 355 request, ok := in.Request.(*smithyhttp.Request) 356 if !ok { 357 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 358 } 359 360 input, ok := in.Parameters.(*CreateVirtualGatewayInput) 361 _ = input 362 if !ok { 363 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 364 } 365 366 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateways") 367 request.URL.Path = opPath 368 if len(request.URL.RawQuery) > 0 { 369 request.URL.RawQuery = "&" + opQuery 370 } else { 371 request.URL.RawQuery = opQuery 372 } 373 374 request.Method = "PUT" 375 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 376 if err != nil { 377 return out, metadata, &smithy.SerializationError{Err: err} 378 } 379 380 if err := awsRestjson1_serializeOpHttpBindingsCreateVirtualGatewayInput(input, restEncoder); err != nil { 381 return out, metadata, &smithy.SerializationError{Err: err} 382 } 383 384 restEncoder.SetHeader("Content-Type").String("application/json") 385 386 jsonEncoder := smithyjson.NewEncoder() 387 if err := awsRestjson1_serializeOpDocumentCreateVirtualGatewayInput(input, jsonEncoder.Value); err != nil { 388 return out, metadata, &smithy.SerializationError{Err: err} 389 } 390 391 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 392 return out, metadata, &smithy.SerializationError{Err: err} 393 } 394 395 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 396 return out, metadata, &smithy.SerializationError{Err: err} 397 } 398 in.Request = request 399 400 return next.HandleSerialize(ctx, in) 401} 402func awsRestjson1_serializeOpHttpBindingsCreateVirtualGatewayInput(v *CreateVirtualGatewayInput, encoder *httpbinding.Encoder) error { 403 if v == nil { 404 return fmt.Errorf("unsupported serialization of nil %T", v) 405 } 406 407 if v.MeshName == nil || len(*v.MeshName) == 0 { 408 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 409 } 410 if v.MeshName != nil { 411 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 412 return err 413 } 414 } 415 416 if v.MeshOwner != nil { 417 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 418 } 419 420 return nil 421} 422 423func awsRestjson1_serializeOpDocumentCreateVirtualGatewayInput(v *CreateVirtualGatewayInput, value smithyjson.Value) error { 424 object := value.Object() 425 defer object.Close() 426 427 if v.ClientToken != nil { 428 ok := object.Key("clientToken") 429 ok.String(*v.ClientToken) 430 } 431 432 if v.Spec != nil { 433 ok := object.Key("spec") 434 if err := awsRestjson1_serializeDocumentVirtualGatewaySpec(v.Spec, ok); err != nil { 435 return err 436 } 437 } 438 439 if v.Tags != nil { 440 ok := object.Key("tags") 441 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 442 return err 443 } 444 } 445 446 if v.VirtualGatewayName != nil { 447 ok := object.Key("virtualGatewayName") 448 ok.String(*v.VirtualGatewayName) 449 } 450 451 return nil 452} 453 454type awsRestjson1_serializeOpCreateVirtualNode struct { 455} 456 457func (*awsRestjson1_serializeOpCreateVirtualNode) ID() string { 458 return "OperationSerializer" 459} 460 461func (m *awsRestjson1_serializeOpCreateVirtualNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 462 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 463) { 464 request, ok := in.Request.(*smithyhttp.Request) 465 if !ok { 466 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 467 } 468 469 input, ok := in.Parameters.(*CreateVirtualNodeInput) 470 _ = input 471 if !ok { 472 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 473 } 474 475 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualNodes") 476 request.URL.Path = opPath 477 if len(request.URL.RawQuery) > 0 { 478 request.URL.RawQuery = "&" + opQuery 479 } else { 480 request.URL.RawQuery = opQuery 481 } 482 483 request.Method = "PUT" 484 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 485 if err != nil { 486 return out, metadata, &smithy.SerializationError{Err: err} 487 } 488 489 if err := awsRestjson1_serializeOpHttpBindingsCreateVirtualNodeInput(input, restEncoder); err != nil { 490 return out, metadata, &smithy.SerializationError{Err: err} 491 } 492 493 restEncoder.SetHeader("Content-Type").String("application/json") 494 495 jsonEncoder := smithyjson.NewEncoder() 496 if err := awsRestjson1_serializeOpDocumentCreateVirtualNodeInput(input, jsonEncoder.Value); err != nil { 497 return out, metadata, &smithy.SerializationError{Err: err} 498 } 499 500 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 501 return out, metadata, &smithy.SerializationError{Err: err} 502 } 503 504 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 505 return out, metadata, &smithy.SerializationError{Err: err} 506 } 507 in.Request = request 508 509 return next.HandleSerialize(ctx, in) 510} 511func awsRestjson1_serializeOpHttpBindingsCreateVirtualNodeInput(v *CreateVirtualNodeInput, encoder *httpbinding.Encoder) error { 512 if v == nil { 513 return fmt.Errorf("unsupported serialization of nil %T", v) 514 } 515 516 if v.MeshName == nil || len(*v.MeshName) == 0 { 517 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 518 } 519 if v.MeshName != nil { 520 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 521 return err 522 } 523 } 524 525 if v.MeshOwner != nil { 526 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 527 } 528 529 return nil 530} 531 532func awsRestjson1_serializeOpDocumentCreateVirtualNodeInput(v *CreateVirtualNodeInput, value smithyjson.Value) error { 533 object := value.Object() 534 defer object.Close() 535 536 if v.ClientToken != nil { 537 ok := object.Key("clientToken") 538 ok.String(*v.ClientToken) 539 } 540 541 if v.Spec != nil { 542 ok := object.Key("spec") 543 if err := awsRestjson1_serializeDocumentVirtualNodeSpec(v.Spec, ok); err != nil { 544 return err 545 } 546 } 547 548 if v.Tags != nil { 549 ok := object.Key("tags") 550 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 551 return err 552 } 553 } 554 555 if v.VirtualNodeName != nil { 556 ok := object.Key("virtualNodeName") 557 ok.String(*v.VirtualNodeName) 558 } 559 560 return nil 561} 562 563type awsRestjson1_serializeOpCreateVirtualRouter struct { 564} 565 566func (*awsRestjson1_serializeOpCreateVirtualRouter) ID() string { 567 return "OperationSerializer" 568} 569 570func (m *awsRestjson1_serializeOpCreateVirtualRouter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 571 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 572) { 573 request, ok := in.Request.(*smithyhttp.Request) 574 if !ok { 575 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 576 } 577 578 input, ok := in.Parameters.(*CreateVirtualRouterInput) 579 _ = input 580 if !ok { 581 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 582 } 583 584 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouters") 585 request.URL.Path = opPath 586 if len(request.URL.RawQuery) > 0 { 587 request.URL.RawQuery = "&" + opQuery 588 } else { 589 request.URL.RawQuery = opQuery 590 } 591 592 request.Method = "PUT" 593 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 594 if err != nil { 595 return out, metadata, &smithy.SerializationError{Err: err} 596 } 597 598 if err := awsRestjson1_serializeOpHttpBindingsCreateVirtualRouterInput(input, restEncoder); err != nil { 599 return out, metadata, &smithy.SerializationError{Err: err} 600 } 601 602 restEncoder.SetHeader("Content-Type").String("application/json") 603 604 jsonEncoder := smithyjson.NewEncoder() 605 if err := awsRestjson1_serializeOpDocumentCreateVirtualRouterInput(input, jsonEncoder.Value); err != nil { 606 return out, metadata, &smithy.SerializationError{Err: err} 607 } 608 609 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 610 return out, metadata, &smithy.SerializationError{Err: err} 611 } 612 613 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 614 return out, metadata, &smithy.SerializationError{Err: err} 615 } 616 in.Request = request 617 618 return next.HandleSerialize(ctx, in) 619} 620func awsRestjson1_serializeOpHttpBindingsCreateVirtualRouterInput(v *CreateVirtualRouterInput, encoder *httpbinding.Encoder) error { 621 if v == nil { 622 return fmt.Errorf("unsupported serialization of nil %T", v) 623 } 624 625 if v.MeshName == nil || len(*v.MeshName) == 0 { 626 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 627 } 628 if v.MeshName != nil { 629 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 630 return err 631 } 632 } 633 634 if v.MeshOwner != nil { 635 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 636 } 637 638 return nil 639} 640 641func awsRestjson1_serializeOpDocumentCreateVirtualRouterInput(v *CreateVirtualRouterInput, value smithyjson.Value) error { 642 object := value.Object() 643 defer object.Close() 644 645 if v.ClientToken != nil { 646 ok := object.Key("clientToken") 647 ok.String(*v.ClientToken) 648 } 649 650 if v.Spec != nil { 651 ok := object.Key("spec") 652 if err := awsRestjson1_serializeDocumentVirtualRouterSpec(v.Spec, ok); err != nil { 653 return err 654 } 655 } 656 657 if v.Tags != nil { 658 ok := object.Key("tags") 659 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 660 return err 661 } 662 } 663 664 if v.VirtualRouterName != nil { 665 ok := object.Key("virtualRouterName") 666 ok.String(*v.VirtualRouterName) 667 } 668 669 return nil 670} 671 672type awsRestjson1_serializeOpCreateVirtualService struct { 673} 674 675func (*awsRestjson1_serializeOpCreateVirtualService) ID() string { 676 return "OperationSerializer" 677} 678 679func (m *awsRestjson1_serializeOpCreateVirtualService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 680 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 681) { 682 request, ok := in.Request.(*smithyhttp.Request) 683 if !ok { 684 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 685 } 686 687 input, ok := in.Parameters.(*CreateVirtualServiceInput) 688 _ = input 689 if !ok { 690 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 691 } 692 693 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualServices") 694 request.URL.Path = opPath 695 if len(request.URL.RawQuery) > 0 { 696 request.URL.RawQuery = "&" + opQuery 697 } else { 698 request.URL.RawQuery = opQuery 699 } 700 701 request.Method = "PUT" 702 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 703 if err != nil { 704 return out, metadata, &smithy.SerializationError{Err: err} 705 } 706 707 if err := awsRestjson1_serializeOpHttpBindingsCreateVirtualServiceInput(input, restEncoder); err != nil { 708 return out, metadata, &smithy.SerializationError{Err: err} 709 } 710 711 restEncoder.SetHeader("Content-Type").String("application/json") 712 713 jsonEncoder := smithyjson.NewEncoder() 714 if err := awsRestjson1_serializeOpDocumentCreateVirtualServiceInput(input, jsonEncoder.Value); err != nil { 715 return out, metadata, &smithy.SerializationError{Err: err} 716 } 717 718 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 719 return out, metadata, &smithy.SerializationError{Err: err} 720 } 721 722 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 723 return out, metadata, &smithy.SerializationError{Err: err} 724 } 725 in.Request = request 726 727 return next.HandleSerialize(ctx, in) 728} 729func awsRestjson1_serializeOpHttpBindingsCreateVirtualServiceInput(v *CreateVirtualServiceInput, encoder *httpbinding.Encoder) error { 730 if v == nil { 731 return fmt.Errorf("unsupported serialization of nil %T", v) 732 } 733 734 if v.MeshName == nil || len(*v.MeshName) == 0 { 735 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 736 } 737 if v.MeshName != nil { 738 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 739 return err 740 } 741 } 742 743 if v.MeshOwner != nil { 744 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 745 } 746 747 return nil 748} 749 750func awsRestjson1_serializeOpDocumentCreateVirtualServiceInput(v *CreateVirtualServiceInput, value smithyjson.Value) error { 751 object := value.Object() 752 defer object.Close() 753 754 if v.ClientToken != nil { 755 ok := object.Key("clientToken") 756 ok.String(*v.ClientToken) 757 } 758 759 if v.Spec != nil { 760 ok := object.Key("spec") 761 if err := awsRestjson1_serializeDocumentVirtualServiceSpec(v.Spec, ok); err != nil { 762 return err 763 } 764 } 765 766 if v.Tags != nil { 767 ok := object.Key("tags") 768 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 769 return err 770 } 771 } 772 773 if v.VirtualServiceName != nil { 774 ok := object.Key("virtualServiceName") 775 ok.String(*v.VirtualServiceName) 776 } 777 778 return nil 779} 780 781type awsRestjson1_serializeOpDeleteGatewayRoute struct { 782} 783 784func (*awsRestjson1_serializeOpDeleteGatewayRoute) ID() string { 785 return "OperationSerializer" 786} 787 788func (m *awsRestjson1_serializeOpDeleteGatewayRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 789 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 790) { 791 request, ok := in.Request.(*smithyhttp.Request) 792 if !ok { 793 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 794 } 795 796 input, ok := in.Parameters.(*DeleteGatewayRouteInput) 797 _ = input 798 if !ok { 799 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 800 } 801 802 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}") 803 request.URL.Path = opPath 804 if len(request.URL.RawQuery) > 0 { 805 request.URL.RawQuery = "&" + opQuery 806 } else { 807 request.URL.RawQuery = opQuery 808 } 809 810 request.Method = "DELETE" 811 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 812 if err != nil { 813 return out, metadata, &smithy.SerializationError{Err: err} 814 } 815 816 if err := awsRestjson1_serializeOpHttpBindingsDeleteGatewayRouteInput(input, restEncoder); err != nil { 817 return out, metadata, &smithy.SerializationError{Err: err} 818 } 819 820 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 821 return out, metadata, &smithy.SerializationError{Err: err} 822 } 823 in.Request = request 824 825 return next.HandleSerialize(ctx, in) 826} 827func awsRestjson1_serializeOpHttpBindingsDeleteGatewayRouteInput(v *DeleteGatewayRouteInput, encoder *httpbinding.Encoder) error { 828 if v == nil { 829 return fmt.Errorf("unsupported serialization of nil %T", v) 830 } 831 832 if v.GatewayRouteName == nil || len(*v.GatewayRouteName) == 0 { 833 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayRouteName must not be empty")} 834 } 835 if v.GatewayRouteName != nil { 836 if err := encoder.SetURI("gatewayRouteName").String(*v.GatewayRouteName); err != nil { 837 return err 838 } 839 } 840 841 if v.MeshName == nil || len(*v.MeshName) == 0 { 842 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 843 } 844 if v.MeshName != nil { 845 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 846 return err 847 } 848 } 849 850 if v.MeshOwner != nil { 851 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 852 } 853 854 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 855 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 856 } 857 if v.VirtualGatewayName != nil { 858 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 859 return err 860 } 861 } 862 863 return nil 864} 865 866type awsRestjson1_serializeOpDeleteMesh struct { 867} 868 869func (*awsRestjson1_serializeOpDeleteMesh) ID() string { 870 return "OperationSerializer" 871} 872 873func (m *awsRestjson1_serializeOpDeleteMesh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 874 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 875) { 876 request, ok := in.Request.(*smithyhttp.Request) 877 if !ok { 878 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 879 } 880 881 input, ok := in.Parameters.(*DeleteMeshInput) 882 _ = input 883 if !ok { 884 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 885 } 886 887 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}") 888 request.URL.Path = opPath 889 if len(request.URL.RawQuery) > 0 { 890 request.URL.RawQuery = "&" + opQuery 891 } else { 892 request.URL.RawQuery = opQuery 893 } 894 895 request.Method = "DELETE" 896 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 897 if err != nil { 898 return out, metadata, &smithy.SerializationError{Err: err} 899 } 900 901 if err := awsRestjson1_serializeOpHttpBindingsDeleteMeshInput(input, restEncoder); err != nil { 902 return out, metadata, &smithy.SerializationError{Err: err} 903 } 904 905 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 906 return out, metadata, &smithy.SerializationError{Err: err} 907 } 908 in.Request = request 909 910 return next.HandleSerialize(ctx, in) 911} 912func awsRestjson1_serializeOpHttpBindingsDeleteMeshInput(v *DeleteMeshInput, encoder *httpbinding.Encoder) error { 913 if v == nil { 914 return fmt.Errorf("unsupported serialization of nil %T", v) 915 } 916 917 if v.MeshName == nil || len(*v.MeshName) == 0 { 918 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 919 } 920 if v.MeshName != nil { 921 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 922 return err 923 } 924 } 925 926 return nil 927} 928 929type awsRestjson1_serializeOpDeleteRoute struct { 930} 931 932func (*awsRestjson1_serializeOpDeleteRoute) ID() string { 933 return "OperationSerializer" 934} 935 936func (m *awsRestjson1_serializeOpDeleteRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 937 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 938) { 939 request, ok := in.Request.(*smithyhttp.Request) 940 if !ok { 941 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 942 } 943 944 input, ok := in.Parameters.(*DeleteRouteInput) 945 _ = input 946 if !ok { 947 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 948 } 949 950 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}") 951 request.URL.Path = opPath 952 if len(request.URL.RawQuery) > 0 { 953 request.URL.RawQuery = "&" + opQuery 954 } else { 955 request.URL.RawQuery = opQuery 956 } 957 958 request.Method = "DELETE" 959 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 960 if err != nil { 961 return out, metadata, &smithy.SerializationError{Err: err} 962 } 963 964 if err := awsRestjson1_serializeOpHttpBindingsDeleteRouteInput(input, restEncoder); err != nil { 965 return out, metadata, &smithy.SerializationError{Err: err} 966 } 967 968 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 969 return out, metadata, &smithy.SerializationError{Err: err} 970 } 971 in.Request = request 972 973 return next.HandleSerialize(ctx, in) 974} 975func awsRestjson1_serializeOpHttpBindingsDeleteRouteInput(v *DeleteRouteInput, encoder *httpbinding.Encoder) error { 976 if v == nil { 977 return fmt.Errorf("unsupported serialization of nil %T", v) 978 } 979 980 if v.MeshName == nil || len(*v.MeshName) == 0 { 981 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 982 } 983 if v.MeshName != nil { 984 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 985 return err 986 } 987 } 988 989 if v.MeshOwner != nil { 990 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 991 } 992 993 if v.RouteName == nil || len(*v.RouteName) == 0 { 994 return &smithy.SerializationError{Err: fmt.Errorf("input member routeName must not be empty")} 995 } 996 if v.RouteName != nil { 997 if err := encoder.SetURI("routeName").String(*v.RouteName); err != nil { 998 return err 999 } 1000 } 1001 1002 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 1003 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 1004 } 1005 if v.VirtualRouterName != nil { 1006 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 1007 return err 1008 } 1009 } 1010 1011 return nil 1012} 1013 1014type awsRestjson1_serializeOpDeleteVirtualGateway struct { 1015} 1016 1017func (*awsRestjson1_serializeOpDeleteVirtualGateway) ID() string { 1018 return "OperationSerializer" 1019} 1020 1021func (m *awsRestjson1_serializeOpDeleteVirtualGateway) 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.(*DeleteVirtualGatewayInput) 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("/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}") 1036 request.URL.Path = opPath 1037 if len(request.URL.RawQuery) > 0 { 1038 request.URL.RawQuery = "&" + opQuery 1039 } else { 1040 request.URL.RawQuery = opQuery 1041 } 1042 1043 request.Method = "DELETE" 1044 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1045 if err != nil { 1046 return out, metadata, &smithy.SerializationError{Err: err} 1047 } 1048 1049 if err := awsRestjson1_serializeOpHttpBindingsDeleteVirtualGatewayInput(input, restEncoder); err != nil { 1050 return out, metadata, &smithy.SerializationError{Err: err} 1051 } 1052 1053 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1054 return out, metadata, &smithy.SerializationError{Err: err} 1055 } 1056 in.Request = request 1057 1058 return next.HandleSerialize(ctx, in) 1059} 1060func awsRestjson1_serializeOpHttpBindingsDeleteVirtualGatewayInput(v *DeleteVirtualGatewayInput, encoder *httpbinding.Encoder) error { 1061 if v == nil { 1062 return fmt.Errorf("unsupported serialization of nil %T", v) 1063 } 1064 1065 if v.MeshName == nil || len(*v.MeshName) == 0 { 1066 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1067 } 1068 if v.MeshName != nil { 1069 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1070 return err 1071 } 1072 } 1073 1074 if v.MeshOwner != nil { 1075 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1076 } 1077 1078 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 1079 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 1080 } 1081 if v.VirtualGatewayName != nil { 1082 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 1083 return err 1084 } 1085 } 1086 1087 return nil 1088} 1089 1090type awsRestjson1_serializeOpDeleteVirtualNode struct { 1091} 1092 1093func (*awsRestjson1_serializeOpDeleteVirtualNode) ID() string { 1094 return "OperationSerializer" 1095} 1096 1097func (m *awsRestjson1_serializeOpDeleteVirtualNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1098 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1099) { 1100 request, ok := in.Request.(*smithyhttp.Request) 1101 if !ok { 1102 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1103 } 1104 1105 input, ok := in.Parameters.(*DeleteVirtualNodeInput) 1106 _ = input 1107 if !ok { 1108 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1109 } 1110 1111 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}") 1112 request.URL.Path = opPath 1113 if len(request.URL.RawQuery) > 0 { 1114 request.URL.RawQuery = "&" + opQuery 1115 } else { 1116 request.URL.RawQuery = opQuery 1117 } 1118 1119 request.Method = "DELETE" 1120 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1121 if err != nil { 1122 return out, metadata, &smithy.SerializationError{Err: err} 1123 } 1124 1125 if err := awsRestjson1_serializeOpHttpBindingsDeleteVirtualNodeInput(input, restEncoder); err != nil { 1126 return out, metadata, &smithy.SerializationError{Err: err} 1127 } 1128 1129 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1130 return out, metadata, &smithy.SerializationError{Err: err} 1131 } 1132 in.Request = request 1133 1134 return next.HandleSerialize(ctx, in) 1135} 1136func awsRestjson1_serializeOpHttpBindingsDeleteVirtualNodeInput(v *DeleteVirtualNodeInput, encoder *httpbinding.Encoder) error { 1137 if v == nil { 1138 return fmt.Errorf("unsupported serialization of nil %T", v) 1139 } 1140 1141 if v.MeshName == nil || len(*v.MeshName) == 0 { 1142 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1143 } 1144 if v.MeshName != nil { 1145 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1146 return err 1147 } 1148 } 1149 1150 if v.MeshOwner != nil { 1151 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1152 } 1153 1154 if v.VirtualNodeName == nil || len(*v.VirtualNodeName) == 0 { 1155 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualNodeName must not be empty")} 1156 } 1157 if v.VirtualNodeName != nil { 1158 if err := encoder.SetURI("virtualNodeName").String(*v.VirtualNodeName); err != nil { 1159 return err 1160 } 1161 } 1162 1163 return nil 1164} 1165 1166type awsRestjson1_serializeOpDeleteVirtualRouter struct { 1167} 1168 1169func (*awsRestjson1_serializeOpDeleteVirtualRouter) ID() string { 1170 return "OperationSerializer" 1171} 1172 1173func (m *awsRestjson1_serializeOpDeleteVirtualRouter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1174 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1175) { 1176 request, ok := in.Request.(*smithyhttp.Request) 1177 if !ok { 1178 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1179 } 1180 1181 input, ok := in.Parameters.(*DeleteVirtualRouterInput) 1182 _ = input 1183 if !ok { 1184 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1185 } 1186 1187 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}") 1188 request.URL.Path = opPath 1189 if len(request.URL.RawQuery) > 0 { 1190 request.URL.RawQuery = "&" + opQuery 1191 } else { 1192 request.URL.RawQuery = opQuery 1193 } 1194 1195 request.Method = "DELETE" 1196 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1197 if err != nil { 1198 return out, metadata, &smithy.SerializationError{Err: err} 1199 } 1200 1201 if err := awsRestjson1_serializeOpHttpBindingsDeleteVirtualRouterInput(input, restEncoder); err != nil { 1202 return out, metadata, &smithy.SerializationError{Err: err} 1203 } 1204 1205 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1206 return out, metadata, &smithy.SerializationError{Err: err} 1207 } 1208 in.Request = request 1209 1210 return next.HandleSerialize(ctx, in) 1211} 1212func awsRestjson1_serializeOpHttpBindingsDeleteVirtualRouterInput(v *DeleteVirtualRouterInput, encoder *httpbinding.Encoder) error { 1213 if v == nil { 1214 return fmt.Errorf("unsupported serialization of nil %T", v) 1215 } 1216 1217 if v.MeshName == nil || len(*v.MeshName) == 0 { 1218 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1219 } 1220 if v.MeshName != nil { 1221 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1222 return err 1223 } 1224 } 1225 1226 if v.MeshOwner != nil { 1227 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1228 } 1229 1230 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 1231 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 1232 } 1233 if v.VirtualRouterName != nil { 1234 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 1235 return err 1236 } 1237 } 1238 1239 return nil 1240} 1241 1242type awsRestjson1_serializeOpDeleteVirtualService struct { 1243} 1244 1245func (*awsRestjson1_serializeOpDeleteVirtualService) ID() string { 1246 return "OperationSerializer" 1247} 1248 1249func (m *awsRestjson1_serializeOpDeleteVirtualService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1250 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1251) { 1252 request, ok := in.Request.(*smithyhttp.Request) 1253 if !ok { 1254 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1255 } 1256 1257 input, ok := in.Parameters.(*DeleteVirtualServiceInput) 1258 _ = input 1259 if !ok { 1260 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1261 } 1262 1263 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}") 1264 request.URL.Path = opPath 1265 if len(request.URL.RawQuery) > 0 { 1266 request.URL.RawQuery = "&" + opQuery 1267 } else { 1268 request.URL.RawQuery = opQuery 1269 } 1270 1271 request.Method = "DELETE" 1272 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1273 if err != nil { 1274 return out, metadata, &smithy.SerializationError{Err: err} 1275 } 1276 1277 if err := awsRestjson1_serializeOpHttpBindingsDeleteVirtualServiceInput(input, restEncoder); err != nil { 1278 return out, metadata, &smithy.SerializationError{Err: err} 1279 } 1280 1281 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1282 return out, metadata, &smithy.SerializationError{Err: err} 1283 } 1284 in.Request = request 1285 1286 return next.HandleSerialize(ctx, in) 1287} 1288func awsRestjson1_serializeOpHttpBindingsDeleteVirtualServiceInput(v *DeleteVirtualServiceInput, encoder *httpbinding.Encoder) error { 1289 if v == nil { 1290 return fmt.Errorf("unsupported serialization of nil %T", v) 1291 } 1292 1293 if v.MeshName == nil || len(*v.MeshName) == 0 { 1294 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1295 } 1296 if v.MeshName != nil { 1297 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1298 return err 1299 } 1300 } 1301 1302 if v.MeshOwner != nil { 1303 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1304 } 1305 1306 if v.VirtualServiceName == nil || len(*v.VirtualServiceName) == 0 { 1307 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualServiceName must not be empty")} 1308 } 1309 if v.VirtualServiceName != nil { 1310 if err := encoder.SetURI("virtualServiceName").String(*v.VirtualServiceName); err != nil { 1311 return err 1312 } 1313 } 1314 1315 return nil 1316} 1317 1318type awsRestjson1_serializeOpDescribeGatewayRoute struct { 1319} 1320 1321func (*awsRestjson1_serializeOpDescribeGatewayRoute) ID() string { 1322 return "OperationSerializer" 1323} 1324 1325func (m *awsRestjson1_serializeOpDescribeGatewayRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1326 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1327) { 1328 request, ok := in.Request.(*smithyhttp.Request) 1329 if !ok { 1330 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1331 } 1332 1333 input, ok := in.Parameters.(*DescribeGatewayRouteInput) 1334 _ = input 1335 if !ok { 1336 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1337 } 1338 1339 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}") 1340 request.URL.Path = opPath 1341 if len(request.URL.RawQuery) > 0 { 1342 request.URL.RawQuery = "&" + opQuery 1343 } else { 1344 request.URL.RawQuery = opQuery 1345 } 1346 1347 request.Method = "GET" 1348 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1349 if err != nil { 1350 return out, metadata, &smithy.SerializationError{Err: err} 1351 } 1352 1353 if err := awsRestjson1_serializeOpHttpBindingsDescribeGatewayRouteInput(input, restEncoder); err != nil { 1354 return out, metadata, &smithy.SerializationError{Err: err} 1355 } 1356 1357 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1358 return out, metadata, &smithy.SerializationError{Err: err} 1359 } 1360 in.Request = request 1361 1362 return next.HandleSerialize(ctx, in) 1363} 1364func awsRestjson1_serializeOpHttpBindingsDescribeGatewayRouteInput(v *DescribeGatewayRouteInput, encoder *httpbinding.Encoder) error { 1365 if v == nil { 1366 return fmt.Errorf("unsupported serialization of nil %T", v) 1367 } 1368 1369 if v.GatewayRouteName == nil || len(*v.GatewayRouteName) == 0 { 1370 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayRouteName must not be empty")} 1371 } 1372 if v.GatewayRouteName != nil { 1373 if err := encoder.SetURI("gatewayRouteName").String(*v.GatewayRouteName); err != nil { 1374 return err 1375 } 1376 } 1377 1378 if v.MeshName == nil || len(*v.MeshName) == 0 { 1379 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1380 } 1381 if v.MeshName != nil { 1382 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1383 return err 1384 } 1385 } 1386 1387 if v.MeshOwner != nil { 1388 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1389 } 1390 1391 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 1392 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 1393 } 1394 if v.VirtualGatewayName != nil { 1395 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 1396 return err 1397 } 1398 } 1399 1400 return nil 1401} 1402 1403type awsRestjson1_serializeOpDescribeMesh struct { 1404} 1405 1406func (*awsRestjson1_serializeOpDescribeMesh) ID() string { 1407 return "OperationSerializer" 1408} 1409 1410func (m *awsRestjson1_serializeOpDescribeMesh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1411 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1412) { 1413 request, ok := in.Request.(*smithyhttp.Request) 1414 if !ok { 1415 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1416 } 1417 1418 input, ok := in.Parameters.(*DescribeMeshInput) 1419 _ = input 1420 if !ok { 1421 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1422 } 1423 1424 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}") 1425 request.URL.Path = opPath 1426 if len(request.URL.RawQuery) > 0 { 1427 request.URL.RawQuery = "&" + opQuery 1428 } else { 1429 request.URL.RawQuery = opQuery 1430 } 1431 1432 request.Method = "GET" 1433 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1434 if err != nil { 1435 return out, metadata, &smithy.SerializationError{Err: err} 1436 } 1437 1438 if err := awsRestjson1_serializeOpHttpBindingsDescribeMeshInput(input, restEncoder); err != nil { 1439 return out, metadata, &smithy.SerializationError{Err: err} 1440 } 1441 1442 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1443 return out, metadata, &smithy.SerializationError{Err: err} 1444 } 1445 in.Request = request 1446 1447 return next.HandleSerialize(ctx, in) 1448} 1449func awsRestjson1_serializeOpHttpBindingsDescribeMeshInput(v *DescribeMeshInput, encoder *httpbinding.Encoder) error { 1450 if v == nil { 1451 return fmt.Errorf("unsupported serialization of nil %T", v) 1452 } 1453 1454 if v.MeshName == nil || len(*v.MeshName) == 0 { 1455 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1456 } 1457 if v.MeshName != nil { 1458 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1459 return err 1460 } 1461 } 1462 1463 if v.MeshOwner != nil { 1464 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1465 } 1466 1467 return nil 1468} 1469 1470type awsRestjson1_serializeOpDescribeRoute struct { 1471} 1472 1473func (*awsRestjson1_serializeOpDescribeRoute) ID() string { 1474 return "OperationSerializer" 1475} 1476 1477func (m *awsRestjson1_serializeOpDescribeRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1478 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1479) { 1480 request, ok := in.Request.(*smithyhttp.Request) 1481 if !ok { 1482 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1483 } 1484 1485 input, ok := in.Parameters.(*DescribeRouteInput) 1486 _ = input 1487 if !ok { 1488 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1489 } 1490 1491 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}") 1492 request.URL.Path = opPath 1493 if len(request.URL.RawQuery) > 0 { 1494 request.URL.RawQuery = "&" + opQuery 1495 } else { 1496 request.URL.RawQuery = opQuery 1497 } 1498 1499 request.Method = "GET" 1500 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1501 if err != nil { 1502 return out, metadata, &smithy.SerializationError{Err: err} 1503 } 1504 1505 if err := awsRestjson1_serializeOpHttpBindingsDescribeRouteInput(input, restEncoder); err != nil { 1506 return out, metadata, &smithy.SerializationError{Err: err} 1507 } 1508 1509 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1510 return out, metadata, &smithy.SerializationError{Err: err} 1511 } 1512 in.Request = request 1513 1514 return next.HandleSerialize(ctx, in) 1515} 1516func awsRestjson1_serializeOpHttpBindingsDescribeRouteInput(v *DescribeRouteInput, encoder *httpbinding.Encoder) error { 1517 if v == nil { 1518 return fmt.Errorf("unsupported serialization of nil %T", v) 1519 } 1520 1521 if v.MeshName == nil || len(*v.MeshName) == 0 { 1522 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1523 } 1524 if v.MeshName != nil { 1525 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1526 return err 1527 } 1528 } 1529 1530 if v.MeshOwner != nil { 1531 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1532 } 1533 1534 if v.RouteName == nil || len(*v.RouteName) == 0 { 1535 return &smithy.SerializationError{Err: fmt.Errorf("input member routeName must not be empty")} 1536 } 1537 if v.RouteName != nil { 1538 if err := encoder.SetURI("routeName").String(*v.RouteName); err != nil { 1539 return err 1540 } 1541 } 1542 1543 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 1544 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 1545 } 1546 if v.VirtualRouterName != nil { 1547 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 1548 return err 1549 } 1550 } 1551 1552 return nil 1553} 1554 1555type awsRestjson1_serializeOpDescribeVirtualGateway struct { 1556} 1557 1558func (*awsRestjson1_serializeOpDescribeVirtualGateway) ID() string { 1559 return "OperationSerializer" 1560} 1561 1562func (m *awsRestjson1_serializeOpDescribeVirtualGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1563 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1564) { 1565 request, ok := in.Request.(*smithyhttp.Request) 1566 if !ok { 1567 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1568 } 1569 1570 input, ok := in.Parameters.(*DescribeVirtualGatewayInput) 1571 _ = input 1572 if !ok { 1573 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1574 } 1575 1576 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}") 1577 request.URL.Path = opPath 1578 if len(request.URL.RawQuery) > 0 { 1579 request.URL.RawQuery = "&" + opQuery 1580 } else { 1581 request.URL.RawQuery = opQuery 1582 } 1583 1584 request.Method = "GET" 1585 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1586 if err != nil { 1587 return out, metadata, &smithy.SerializationError{Err: err} 1588 } 1589 1590 if err := awsRestjson1_serializeOpHttpBindingsDescribeVirtualGatewayInput(input, restEncoder); err != nil { 1591 return out, metadata, &smithy.SerializationError{Err: err} 1592 } 1593 1594 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1595 return out, metadata, &smithy.SerializationError{Err: err} 1596 } 1597 in.Request = request 1598 1599 return next.HandleSerialize(ctx, in) 1600} 1601func awsRestjson1_serializeOpHttpBindingsDescribeVirtualGatewayInput(v *DescribeVirtualGatewayInput, encoder *httpbinding.Encoder) error { 1602 if v == nil { 1603 return fmt.Errorf("unsupported serialization of nil %T", v) 1604 } 1605 1606 if v.MeshName == nil || len(*v.MeshName) == 0 { 1607 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1608 } 1609 if v.MeshName != nil { 1610 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1611 return err 1612 } 1613 } 1614 1615 if v.MeshOwner != nil { 1616 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1617 } 1618 1619 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 1620 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 1621 } 1622 if v.VirtualGatewayName != nil { 1623 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 1624 return err 1625 } 1626 } 1627 1628 return nil 1629} 1630 1631type awsRestjson1_serializeOpDescribeVirtualNode struct { 1632} 1633 1634func (*awsRestjson1_serializeOpDescribeVirtualNode) ID() string { 1635 return "OperationSerializer" 1636} 1637 1638func (m *awsRestjson1_serializeOpDescribeVirtualNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1639 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1640) { 1641 request, ok := in.Request.(*smithyhttp.Request) 1642 if !ok { 1643 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1644 } 1645 1646 input, ok := in.Parameters.(*DescribeVirtualNodeInput) 1647 _ = input 1648 if !ok { 1649 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1650 } 1651 1652 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}") 1653 request.URL.Path = opPath 1654 if len(request.URL.RawQuery) > 0 { 1655 request.URL.RawQuery = "&" + opQuery 1656 } else { 1657 request.URL.RawQuery = opQuery 1658 } 1659 1660 request.Method = "GET" 1661 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1662 if err != nil { 1663 return out, metadata, &smithy.SerializationError{Err: err} 1664 } 1665 1666 if err := awsRestjson1_serializeOpHttpBindingsDescribeVirtualNodeInput(input, restEncoder); err != nil { 1667 return out, metadata, &smithy.SerializationError{Err: err} 1668 } 1669 1670 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1671 return out, metadata, &smithy.SerializationError{Err: err} 1672 } 1673 in.Request = request 1674 1675 return next.HandleSerialize(ctx, in) 1676} 1677func awsRestjson1_serializeOpHttpBindingsDescribeVirtualNodeInput(v *DescribeVirtualNodeInput, encoder *httpbinding.Encoder) error { 1678 if v == nil { 1679 return fmt.Errorf("unsupported serialization of nil %T", v) 1680 } 1681 1682 if v.MeshName == nil || len(*v.MeshName) == 0 { 1683 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1684 } 1685 if v.MeshName != nil { 1686 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1687 return err 1688 } 1689 } 1690 1691 if v.MeshOwner != nil { 1692 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1693 } 1694 1695 if v.VirtualNodeName == nil || len(*v.VirtualNodeName) == 0 { 1696 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualNodeName must not be empty")} 1697 } 1698 if v.VirtualNodeName != nil { 1699 if err := encoder.SetURI("virtualNodeName").String(*v.VirtualNodeName); err != nil { 1700 return err 1701 } 1702 } 1703 1704 return nil 1705} 1706 1707type awsRestjson1_serializeOpDescribeVirtualRouter struct { 1708} 1709 1710func (*awsRestjson1_serializeOpDescribeVirtualRouter) ID() string { 1711 return "OperationSerializer" 1712} 1713 1714func (m *awsRestjson1_serializeOpDescribeVirtualRouter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1715 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1716) { 1717 request, ok := in.Request.(*smithyhttp.Request) 1718 if !ok { 1719 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1720 } 1721 1722 input, ok := in.Parameters.(*DescribeVirtualRouterInput) 1723 _ = input 1724 if !ok { 1725 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1726 } 1727 1728 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}") 1729 request.URL.Path = opPath 1730 if len(request.URL.RawQuery) > 0 { 1731 request.URL.RawQuery = "&" + opQuery 1732 } else { 1733 request.URL.RawQuery = opQuery 1734 } 1735 1736 request.Method = "GET" 1737 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1738 if err != nil { 1739 return out, metadata, &smithy.SerializationError{Err: err} 1740 } 1741 1742 if err := awsRestjson1_serializeOpHttpBindingsDescribeVirtualRouterInput(input, restEncoder); err != nil { 1743 return out, metadata, &smithy.SerializationError{Err: err} 1744 } 1745 1746 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1747 return out, metadata, &smithy.SerializationError{Err: err} 1748 } 1749 in.Request = request 1750 1751 return next.HandleSerialize(ctx, in) 1752} 1753func awsRestjson1_serializeOpHttpBindingsDescribeVirtualRouterInput(v *DescribeVirtualRouterInput, encoder *httpbinding.Encoder) error { 1754 if v == nil { 1755 return fmt.Errorf("unsupported serialization of nil %T", v) 1756 } 1757 1758 if v.MeshName == nil || len(*v.MeshName) == 0 { 1759 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1760 } 1761 if v.MeshName != nil { 1762 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1763 return err 1764 } 1765 } 1766 1767 if v.MeshOwner != nil { 1768 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1769 } 1770 1771 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 1772 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 1773 } 1774 if v.VirtualRouterName != nil { 1775 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 1776 return err 1777 } 1778 } 1779 1780 return nil 1781} 1782 1783type awsRestjson1_serializeOpDescribeVirtualService struct { 1784} 1785 1786func (*awsRestjson1_serializeOpDescribeVirtualService) ID() string { 1787 return "OperationSerializer" 1788} 1789 1790func (m *awsRestjson1_serializeOpDescribeVirtualService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1791 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1792) { 1793 request, ok := in.Request.(*smithyhttp.Request) 1794 if !ok { 1795 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1796 } 1797 1798 input, ok := in.Parameters.(*DescribeVirtualServiceInput) 1799 _ = input 1800 if !ok { 1801 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1802 } 1803 1804 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}") 1805 request.URL.Path = opPath 1806 if len(request.URL.RawQuery) > 0 { 1807 request.URL.RawQuery = "&" + opQuery 1808 } else { 1809 request.URL.RawQuery = opQuery 1810 } 1811 1812 request.Method = "GET" 1813 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1814 if err != nil { 1815 return out, metadata, &smithy.SerializationError{Err: err} 1816 } 1817 1818 if err := awsRestjson1_serializeOpHttpBindingsDescribeVirtualServiceInput(input, restEncoder); err != nil { 1819 return out, metadata, &smithy.SerializationError{Err: err} 1820 } 1821 1822 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1823 return out, metadata, &smithy.SerializationError{Err: err} 1824 } 1825 in.Request = request 1826 1827 return next.HandleSerialize(ctx, in) 1828} 1829func awsRestjson1_serializeOpHttpBindingsDescribeVirtualServiceInput(v *DescribeVirtualServiceInput, encoder *httpbinding.Encoder) error { 1830 if v == nil { 1831 return fmt.Errorf("unsupported serialization of nil %T", v) 1832 } 1833 1834 if v.MeshName == nil || len(*v.MeshName) == 0 { 1835 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1836 } 1837 if v.MeshName != nil { 1838 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1839 return err 1840 } 1841 } 1842 1843 if v.MeshOwner != nil { 1844 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1845 } 1846 1847 if v.VirtualServiceName == nil || len(*v.VirtualServiceName) == 0 { 1848 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualServiceName must not be empty")} 1849 } 1850 if v.VirtualServiceName != nil { 1851 if err := encoder.SetURI("virtualServiceName").String(*v.VirtualServiceName); err != nil { 1852 return err 1853 } 1854 } 1855 1856 return nil 1857} 1858 1859type awsRestjson1_serializeOpListGatewayRoutes struct { 1860} 1861 1862func (*awsRestjson1_serializeOpListGatewayRoutes) ID() string { 1863 return "OperationSerializer" 1864} 1865 1866func (m *awsRestjson1_serializeOpListGatewayRoutes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1867 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1868) { 1869 request, ok := in.Request.(*smithyhttp.Request) 1870 if !ok { 1871 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1872 } 1873 1874 input, ok := in.Parameters.(*ListGatewayRoutesInput) 1875 _ = input 1876 if !ok { 1877 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1878 } 1879 1880 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes") 1881 request.URL.Path = opPath 1882 if len(request.URL.RawQuery) > 0 { 1883 request.URL.RawQuery = "&" + opQuery 1884 } else { 1885 request.URL.RawQuery = opQuery 1886 } 1887 1888 request.Method = "GET" 1889 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1890 if err != nil { 1891 return out, metadata, &smithy.SerializationError{Err: err} 1892 } 1893 1894 if err := awsRestjson1_serializeOpHttpBindingsListGatewayRoutesInput(input, restEncoder); err != nil { 1895 return out, metadata, &smithy.SerializationError{Err: err} 1896 } 1897 1898 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1899 return out, metadata, &smithy.SerializationError{Err: err} 1900 } 1901 in.Request = request 1902 1903 return next.HandleSerialize(ctx, in) 1904} 1905func awsRestjson1_serializeOpHttpBindingsListGatewayRoutesInput(v *ListGatewayRoutesInput, encoder *httpbinding.Encoder) error { 1906 if v == nil { 1907 return fmt.Errorf("unsupported serialization of nil %T", v) 1908 } 1909 1910 if v.Limit != nil { 1911 encoder.SetQuery("limit").Integer(*v.Limit) 1912 } 1913 1914 if v.MeshName == nil || len(*v.MeshName) == 0 { 1915 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 1916 } 1917 if v.MeshName != nil { 1918 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 1919 return err 1920 } 1921 } 1922 1923 if v.MeshOwner != nil { 1924 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 1925 } 1926 1927 if v.NextToken != nil { 1928 encoder.SetQuery("nextToken").String(*v.NextToken) 1929 } 1930 1931 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 1932 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 1933 } 1934 if v.VirtualGatewayName != nil { 1935 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 1936 return err 1937 } 1938 } 1939 1940 return nil 1941} 1942 1943type awsRestjson1_serializeOpListMeshes struct { 1944} 1945 1946func (*awsRestjson1_serializeOpListMeshes) ID() string { 1947 return "OperationSerializer" 1948} 1949 1950func (m *awsRestjson1_serializeOpListMeshes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1951 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1952) { 1953 request, ok := in.Request.(*smithyhttp.Request) 1954 if !ok { 1955 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1956 } 1957 1958 input, ok := in.Parameters.(*ListMeshesInput) 1959 _ = input 1960 if !ok { 1961 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1962 } 1963 1964 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes") 1965 request.URL.Path = opPath 1966 if len(request.URL.RawQuery) > 0 { 1967 request.URL.RawQuery = "&" + opQuery 1968 } else { 1969 request.URL.RawQuery = opQuery 1970 } 1971 1972 request.Method = "GET" 1973 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1974 if err != nil { 1975 return out, metadata, &smithy.SerializationError{Err: err} 1976 } 1977 1978 if err := awsRestjson1_serializeOpHttpBindingsListMeshesInput(input, restEncoder); err != nil { 1979 return out, metadata, &smithy.SerializationError{Err: err} 1980 } 1981 1982 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1983 return out, metadata, &smithy.SerializationError{Err: err} 1984 } 1985 in.Request = request 1986 1987 return next.HandleSerialize(ctx, in) 1988} 1989func awsRestjson1_serializeOpHttpBindingsListMeshesInput(v *ListMeshesInput, encoder *httpbinding.Encoder) error { 1990 if v == nil { 1991 return fmt.Errorf("unsupported serialization of nil %T", v) 1992 } 1993 1994 if v.Limit != nil { 1995 encoder.SetQuery("limit").Integer(*v.Limit) 1996 } 1997 1998 if v.NextToken != nil { 1999 encoder.SetQuery("nextToken").String(*v.NextToken) 2000 } 2001 2002 return nil 2003} 2004 2005type awsRestjson1_serializeOpListRoutes struct { 2006} 2007 2008func (*awsRestjson1_serializeOpListRoutes) ID() string { 2009 return "OperationSerializer" 2010} 2011 2012func (m *awsRestjson1_serializeOpListRoutes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2013 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2014) { 2015 request, ok := in.Request.(*smithyhttp.Request) 2016 if !ok { 2017 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2018 } 2019 2020 input, ok := in.Parameters.(*ListRoutesInput) 2021 _ = input 2022 if !ok { 2023 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2024 } 2025 2026 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes") 2027 request.URL.Path = opPath 2028 if len(request.URL.RawQuery) > 0 { 2029 request.URL.RawQuery = "&" + opQuery 2030 } else { 2031 request.URL.RawQuery = opQuery 2032 } 2033 2034 request.Method = "GET" 2035 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2036 if err != nil { 2037 return out, metadata, &smithy.SerializationError{Err: err} 2038 } 2039 2040 if err := awsRestjson1_serializeOpHttpBindingsListRoutesInput(input, restEncoder); err != nil { 2041 return out, metadata, &smithy.SerializationError{Err: err} 2042 } 2043 2044 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2045 return out, metadata, &smithy.SerializationError{Err: err} 2046 } 2047 in.Request = request 2048 2049 return next.HandleSerialize(ctx, in) 2050} 2051func awsRestjson1_serializeOpHttpBindingsListRoutesInput(v *ListRoutesInput, encoder *httpbinding.Encoder) error { 2052 if v == nil { 2053 return fmt.Errorf("unsupported serialization of nil %T", v) 2054 } 2055 2056 if v.Limit != nil { 2057 encoder.SetQuery("limit").Integer(*v.Limit) 2058 } 2059 2060 if v.MeshName == nil || len(*v.MeshName) == 0 { 2061 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2062 } 2063 if v.MeshName != nil { 2064 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2065 return err 2066 } 2067 } 2068 2069 if v.MeshOwner != nil { 2070 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2071 } 2072 2073 if v.NextToken != nil { 2074 encoder.SetQuery("nextToken").String(*v.NextToken) 2075 } 2076 2077 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 2078 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 2079 } 2080 if v.VirtualRouterName != nil { 2081 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 2082 return err 2083 } 2084 } 2085 2086 return nil 2087} 2088 2089type awsRestjson1_serializeOpListTagsForResource struct { 2090} 2091 2092func (*awsRestjson1_serializeOpListTagsForResource) ID() string { 2093 return "OperationSerializer" 2094} 2095 2096func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2097 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2098) { 2099 request, ok := in.Request.(*smithyhttp.Request) 2100 if !ok { 2101 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2102 } 2103 2104 input, ok := in.Parameters.(*ListTagsForResourceInput) 2105 _ = input 2106 if !ok { 2107 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2108 } 2109 2110 opPath, opQuery := httpbinding.SplitURI("/v20190125/tags") 2111 request.URL.Path = opPath 2112 if len(request.URL.RawQuery) > 0 { 2113 request.URL.RawQuery = "&" + opQuery 2114 } else { 2115 request.URL.RawQuery = opQuery 2116 } 2117 2118 request.Method = "GET" 2119 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2120 if err != nil { 2121 return out, metadata, &smithy.SerializationError{Err: err} 2122 } 2123 2124 if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { 2125 return out, metadata, &smithy.SerializationError{Err: err} 2126 } 2127 2128 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2129 return out, metadata, &smithy.SerializationError{Err: err} 2130 } 2131 in.Request = request 2132 2133 return next.HandleSerialize(ctx, in) 2134} 2135func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { 2136 if v == nil { 2137 return fmt.Errorf("unsupported serialization of nil %T", v) 2138 } 2139 2140 if v.Limit != nil { 2141 encoder.SetQuery("limit").Integer(*v.Limit) 2142 } 2143 2144 if v.NextToken != nil { 2145 encoder.SetQuery("nextToken").String(*v.NextToken) 2146 } 2147 2148 if v.ResourceArn != nil { 2149 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 2150 } 2151 2152 return nil 2153} 2154 2155type awsRestjson1_serializeOpListVirtualGateways struct { 2156} 2157 2158func (*awsRestjson1_serializeOpListVirtualGateways) ID() string { 2159 return "OperationSerializer" 2160} 2161 2162func (m *awsRestjson1_serializeOpListVirtualGateways) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2163 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2164) { 2165 request, ok := in.Request.(*smithyhttp.Request) 2166 if !ok { 2167 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2168 } 2169 2170 input, ok := in.Parameters.(*ListVirtualGatewaysInput) 2171 _ = input 2172 if !ok { 2173 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2174 } 2175 2176 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateways") 2177 request.URL.Path = opPath 2178 if len(request.URL.RawQuery) > 0 { 2179 request.URL.RawQuery = "&" + opQuery 2180 } else { 2181 request.URL.RawQuery = opQuery 2182 } 2183 2184 request.Method = "GET" 2185 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2186 if err != nil { 2187 return out, metadata, &smithy.SerializationError{Err: err} 2188 } 2189 2190 if err := awsRestjson1_serializeOpHttpBindingsListVirtualGatewaysInput(input, restEncoder); err != nil { 2191 return out, metadata, &smithy.SerializationError{Err: err} 2192 } 2193 2194 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2195 return out, metadata, &smithy.SerializationError{Err: err} 2196 } 2197 in.Request = request 2198 2199 return next.HandleSerialize(ctx, in) 2200} 2201func awsRestjson1_serializeOpHttpBindingsListVirtualGatewaysInput(v *ListVirtualGatewaysInput, encoder *httpbinding.Encoder) error { 2202 if v == nil { 2203 return fmt.Errorf("unsupported serialization of nil %T", v) 2204 } 2205 2206 if v.Limit != nil { 2207 encoder.SetQuery("limit").Integer(*v.Limit) 2208 } 2209 2210 if v.MeshName == nil || len(*v.MeshName) == 0 { 2211 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2212 } 2213 if v.MeshName != nil { 2214 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2215 return err 2216 } 2217 } 2218 2219 if v.MeshOwner != nil { 2220 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2221 } 2222 2223 if v.NextToken != nil { 2224 encoder.SetQuery("nextToken").String(*v.NextToken) 2225 } 2226 2227 return nil 2228} 2229 2230type awsRestjson1_serializeOpListVirtualNodes struct { 2231} 2232 2233func (*awsRestjson1_serializeOpListVirtualNodes) ID() string { 2234 return "OperationSerializer" 2235} 2236 2237func (m *awsRestjson1_serializeOpListVirtualNodes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2238 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2239) { 2240 request, ok := in.Request.(*smithyhttp.Request) 2241 if !ok { 2242 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2243 } 2244 2245 input, ok := in.Parameters.(*ListVirtualNodesInput) 2246 _ = input 2247 if !ok { 2248 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2249 } 2250 2251 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualNodes") 2252 request.URL.Path = opPath 2253 if len(request.URL.RawQuery) > 0 { 2254 request.URL.RawQuery = "&" + opQuery 2255 } else { 2256 request.URL.RawQuery = opQuery 2257 } 2258 2259 request.Method = "GET" 2260 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2261 if err != nil { 2262 return out, metadata, &smithy.SerializationError{Err: err} 2263 } 2264 2265 if err := awsRestjson1_serializeOpHttpBindingsListVirtualNodesInput(input, restEncoder); err != nil { 2266 return out, metadata, &smithy.SerializationError{Err: err} 2267 } 2268 2269 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2270 return out, metadata, &smithy.SerializationError{Err: err} 2271 } 2272 in.Request = request 2273 2274 return next.HandleSerialize(ctx, in) 2275} 2276func awsRestjson1_serializeOpHttpBindingsListVirtualNodesInput(v *ListVirtualNodesInput, encoder *httpbinding.Encoder) error { 2277 if v == nil { 2278 return fmt.Errorf("unsupported serialization of nil %T", v) 2279 } 2280 2281 if v.Limit != nil { 2282 encoder.SetQuery("limit").Integer(*v.Limit) 2283 } 2284 2285 if v.MeshName == nil || len(*v.MeshName) == 0 { 2286 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2287 } 2288 if v.MeshName != nil { 2289 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2290 return err 2291 } 2292 } 2293 2294 if v.MeshOwner != nil { 2295 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2296 } 2297 2298 if v.NextToken != nil { 2299 encoder.SetQuery("nextToken").String(*v.NextToken) 2300 } 2301 2302 return nil 2303} 2304 2305type awsRestjson1_serializeOpListVirtualRouters struct { 2306} 2307 2308func (*awsRestjson1_serializeOpListVirtualRouters) ID() string { 2309 return "OperationSerializer" 2310} 2311 2312func (m *awsRestjson1_serializeOpListVirtualRouters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2313 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2314) { 2315 request, ok := in.Request.(*smithyhttp.Request) 2316 if !ok { 2317 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2318 } 2319 2320 input, ok := in.Parameters.(*ListVirtualRoutersInput) 2321 _ = input 2322 if !ok { 2323 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2324 } 2325 2326 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouters") 2327 request.URL.Path = opPath 2328 if len(request.URL.RawQuery) > 0 { 2329 request.URL.RawQuery = "&" + opQuery 2330 } else { 2331 request.URL.RawQuery = opQuery 2332 } 2333 2334 request.Method = "GET" 2335 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2336 if err != nil { 2337 return out, metadata, &smithy.SerializationError{Err: err} 2338 } 2339 2340 if err := awsRestjson1_serializeOpHttpBindingsListVirtualRoutersInput(input, restEncoder); err != nil { 2341 return out, metadata, &smithy.SerializationError{Err: err} 2342 } 2343 2344 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2345 return out, metadata, &smithy.SerializationError{Err: err} 2346 } 2347 in.Request = request 2348 2349 return next.HandleSerialize(ctx, in) 2350} 2351func awsRestjson1_serializeOpHttpBindingsListVirtualRoutersInput(v *ListVirtualRoutersInput, encoder *httpbinding.Encoder) error { 2352 if v == nil { 2353 return fmt.Errorf("unsupported serialization of nil %T", v) 2354 } 2355 2356 if v.Limit != nil { 2357 encoder.SetQuery("limit").Integer(*v.Limit) 2358 } 2359 2360 if v.MeshName == nil || len(*v.MeshName) == 0 { 2361 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2362 } 2363 if v.MeshName != nil { 2364 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2365 return err 2366 } 2367 } 2368 2369 if v.MeshOwner != nil { 2370 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2371 } 2372 2373 if v.NextToken != nil { 2374 encoder.SetQuery("nextToken").String(*v.NextToken) 2375 } 2376 2377 return nil 2378} 2379 2380type awsRestjson1_serializeOpListVirtualServices struct { 2381} 2382 2383func (*awsRestjson1_serializeOpListVirtualServices) ID() string { 2384 return "OperationSerializer" 2385} 2386 2387func (m *awsRestjson1_serializeOpListVirtualServices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2388 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2389) { 2390 request, ok := in.Request.(*smithyhttp.Request) 2391 if !ok { 2392 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2393 } 2394 2395 input, ok := in.Parameters.(*ListVirtualServicesInput) 2396 _ = input 2397 if !ok { 2398 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2399 } 2400 2401 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualServices") 2402 request.URL.Path = opPath 2403 if len(request.URL.RawQuery) > 0 { 2404 request.URL.RawQuery = "&" + opQuery 2405 } else { 2406 request.URL.RawQuery = opQuery 2407 } 2408 2409 request.Method = "GET" 2410 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2411 if err != nil { 2412 return out, metadata, &smithy.SerializationError{Err: err} 2413 } 2414 2415 if err := awsRestjson1_serializeOpHttpBindingsListVirtualServicesInput(input, restEncoder); err != nil { 2416 return out, metadata, &smithy.SerializationError{Err: err} 2417 } 2418 2419 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2420 return out, metadata, &smithy.SerializationError{Err: err} 2421 } 2422 in.Request = request 2423 2424 return next.HandleSerialize(ctx, in) 2425} 2426func awsRestjson1_serializeOpHttpBindingsListVirtualServicesInput(v *ListVirtualServicesInput, encoder *httpbinding.Encoder) error { 2427 if v == nil { 2428 return fmt.Errorf("unsupported serialization of nil %T", v) 2429 } 2430 2431 if v.Limit != nil { 2432 encoder.SetQuery("limit").Integer(*v.Limit) 2433 } 2434 2435 if v.MeshName == nil || len(*v.MeshName) == 0 { 2436 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2437 } 2438 if v.MeshName != nil { 2439 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2440 return err 2441 } 2442 } 2443 2444 if v.MeshOwner != nil { 2445 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2446 } 2447 2448 if v.NextToken != nil { 2449 encoder.SetQuery("nextToken").String(*v.NextToken) 2450 } 2451 2452 return nil 2453} 2454 2455type awsRestjson1_serializeOpTagResource struct { 2456} 2457 2458func (*awsRestjson1_serializeOpTagResource) ID() string { 2459 return "OperationSerializer" 2460} 2461 2462func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2463 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2464) { 2465 request, ok := in.Request.(*smithyhttp.Request) 2466 if !ok { 2467 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2468 } 2469 2470 input, ok := in.Parameters.(*TagResourceInput) 2471 _ = input 2472 if !ok { 2473 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2474 } 2475 2476 opPath, opQuery := httpbinding.SplitURI("/v20190125/tag") 2477 request.URL.Path = opPath 2478 if len(request.URL.RawQuery) > 0 { 2479 request.URL.RawQuery = "&" + opQuery 2480 } else { 2481 request.URL.RawQuery = opQuery 2482 } 2483 2484 request.Method = "PUT" 2485 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2486 if err != nil { 2487 return out, metadata, &smithy.SerializationError{Err: err} 2488 } 2489 2490 if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { 2491 return out, metadata, &smithy.SerializationError{Err: err} 2492 } 2493 2494 restEncoder.SetHeader("Content-Type").String("application/json") 2495 2496 jsonEncoder := smithyjson.NewEncoder() 2497 if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { 2498 return out, metadata, &smithy.SerializationError{Err: err} 2499 } 2500 2501 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2502 return out, metadata, &smithy.SerializationError{Err: err} 2503 } 2504 2505 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2506 return out, metadata, &smithy.SerializationError{Err: err} 2507 } 2508 in.Request = request 2509 2510 return next.HandleSerialize(ctx, in) 2511} 2512func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { 2513 if v == nil { 2514 return fmt.Errorf("unsupported serialization of nil %T", v) 2515 } 2516 2517 if v.ResourceArn != nil { 2518 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 2519 } 2520 2521 return nil 2522} 2523 2524func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { 2525 object := value.Object() 2526 defer object.Close() 2527 2528 if v.Tags != nil { 2529 ok := object.Key("tags") 2530 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 2531 return err 2532 } 2533 } 2534 2535 return nil 2536} 2537 2538type awsRestjson1_serializeOpUntagResource struct { 2539} 2540 2541func (*awsRestjson1_serializeOpUntagResource) ID() string { 2542 return "OperationSerializer" 2543} 2544 2545func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2546 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2547) { 2548 request, ok := in.Request.(*smithyhttp.Request) 2549 if !ok { 2550 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2551 } 2552 2553 input, ok := in.Parameters.(*UntagResourceInput) 2554 _ = input 2555 if !ok { 2556 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2557 } 2558 2559 opPath, opQuery := httpbinding.SplitURI("/v20190125/untag") 2560 request.URL.Path = opPath 2561 if len(request.URL.RawQuery) > 0 { 2562 request.URL.RawQuery = "&" + opQuery 2563 } else { 2564 request.URL.RawQuery = opQuery 2565 } 2566 2567 request.Method = "PUT" 2568 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2569 if err != nil { 2570 return out, metadata, &smithy.SerializationError{Err: err} 2571 } 2572 2573 if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { 2574 return out, metadata, &smithy.SerializationError{Err: err} 2575 } 2576 2577 restEncoder.SetHeader("Content-Type").String("application/json") 2578 2579 jsonEncoder := smithyjson.NewEncoder() 2580 if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { 2581 return out, metadata, &smithy.SerializationError{Err: err} 2582 } 2583 2584 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2585 return out, metadata, &smithy.SerializationError{Err: err} 2586 } 2587 2588 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2589 return out, metadata, &smithy.SerializationError{Err: err} 2590 } 2591 in.Request = request 2592 2593 return next.HandleSerialize(ctx, in) 2594} 2595func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { 2596 if v == nil { 2597 return fmt.Errorf("unsupported serialization of nil %T", v) 2598 } 2599 2600 if v.ResourceArn != nil { 2601 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 2602 } 2603 2604 return nil 2605} 2606 2607func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { 2608 object := value.Object() 2609 defer object.Close() 2610 2611 if v.TagKeys != nil { 2612 ok := object.Key("tagKeys") 2613 if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { 2614 return err 2615 } 2616 } 2617 2618 return nil 2619} 2620 2621type awsRestjson1_serializeOpUpdateGatewayRoute struct { 2622} 2623 2624func (*awsRestjson1_serializeOpUpdateGatewayRoute) ID() string { 2625 return "OperationSerializer" 2626} 2627 2628func (m *awsRestjson1_serializeOpUpdateGatewayRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2629 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2630) { 2631 request, ok := in.Request.(*smithyhttp.Request) 2632 if !ok { 2633 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2634 } 2635 2636 input, ok := in.Parameters.(*UpdateGatewayRouteInput) 2637 _ = input 2638 if !ok { 2639 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2640 } 2641 2642 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}") 2643 request.URL.Path = opPath 2644 if len(request.URL.RawQuery) > 0 { 2645 request.URL.RawQuery = "&" + opQuery 2646 } else { 2647 request.URL.RawQuery = opQuery 2648 } 2649 2650 request.Method = "PUT" 2651 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2652 if err != nil { 2653 return out, metadata, &smithy.SerializationError{Err: err} 2654 } 2655 2656 if err := awsRestjson1_serializeOpHttpBindingsUpdateGatewayRouteInput(input, restEncoder); err != nil { 2657 return out, metadata, &smithy.SerializationError{Err: err} 2658 } 2659 2660 restEncoder.SetHeader("Content-Type").String("application/json") 2661 2662 jsonEncoder := smithyjson.NewEncoder() 2663 if err := awsRestjson1_serializeOpDocumentUpdateGatewayRouteInput(input, jsonEncoder.Value); err != nil { 2664 return out, metadata, &smithy.SerializationError{Err: err} 2665 } 2666 2667 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2668 return out, metadata, &smithy.SerializationError{Err: err} 2669 } 2670 2671 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2672 return out, metadata, &smithy.SerializationError{Err: err} 2673 } 2674 in.Request = request 2675 2676 return next.HandleSerialize(ctx, in) 2677} 2678func awsRestjson1_serializeOpHttpBindingsUpdateGatewayRouteInput(v *UpdateGatewayRouteInput, encoder *httpbinding.Encoder) error { 2679 if v == nil { 2680 return fmt.Errorf("unsupported serialization of nil %T", v) 2681 } 2682 2683 if v.GatewayRouteName == nil || len(*v.GatewayRouteName) == 0 { 2684 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayRouteName must not be empty")} 2685 } 2686 if v.GatewayRouteName != nil { 2687 if err := encoder.SetURI("gatewayRouteName").String(*v.GatewayRouteName); err != nil { 2688 return err 2689 } 2690 } 2691 2692 if v.MeshName == nil || len(*v.MeshName) == 0 { 2693 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2694 } 2695 if v.MeshName != nil { 2696 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2697 return err 2698 } 2699 } 2700 2701 if v.MeshOwner != nil { 2702 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2703 } 2704 2705 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 2706 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 2707 } 2708 if v.VirtualGatewayName != nil { 2709 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 2710 return err 2711 } 2712 } 2713 2714 return nil 2715} 2716 2717func awsRestjson1_serializeOpDocumentUpdateGatewayRouteInput(v *UpdateGatewayRouteInput, value smithyjson.Value) error { 2718 object := value.Object() 2719 defer object.Close() 2720 2721 if v.ClientToken != nil { 2722 ok := object.Key("clientToken") 2723 ok.String(*v.ClientToken) 2724 } 2725 2726 if v.Spec != nil { 2727 ok := object.Key("spec") 2728 if err := awsRestjson1_serializeDocumentGatewayRouteSpec(v.Spec, ok); err != nil { 2729 return err 2730 } 2731 } 2732 2733 return nil 2734} 2735 2736type awsRestjson1_serializeOpUpdateMesh struct { 2737} 2738 2739func (*awsRestjson1_serializeOpUpdateMesh) ID() string { 2740 return "OperationSerializer" 2741} 2742 2743func (m *awsRestjson1_serializeOpUpdateMesh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2744 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2745) { 2746 request, ok := in.Request.(*smithyhttp.Request) 2747 if !ok { 2748 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2749 } 2750 2751 input, ok := in.Parameters.(*UpdateMeshInput) 2752 _ = input 2753 if !ok { 2754 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2755 } 2756 2757 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}") 2758 request.URL.Path = opPath 2759 if len(request.URL.RawQuery) > 0 { 2760 request.URL.RawQuery = "&" + opQuery 2761 } else { 2762 request.URL.RawQuery = opQuery 2763 } 2764 2765 request.Method = "PUT" 2766 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2767 if err != nil { 2768 return out, metadata, &smithy.SerializationError{Err: err} 2769 } 2770 2771 if err := awsRestjson1_serializeOpHttpBindingsUpdateMeshInput(input, restEncoder); err != nil { 2772 return out, metadata, &smithy.SerializationError{Err: err} 2773 } 2774 2775 restEncoder.SetHeader("Content-Type").String("application/json") 2776 2777 jsonEncoder := smithyjson.NewEncoder() 2778 if err := awsRestjson1_serializeOpDocumentUpdateMeshInput(input, jsonEncoder.Value); err != nil { 2779 return out, metadata, &smithy.SerializationError{Err: err} 2780 } 2781 2782 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2783 return out, metadata, &smithy.SerializationError{Err: err} 2784 } 2785 2786 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2787 return out, metadata, &smithy.SerializationError{Err: err} 2788 } 2789 in.Request = request 2790 2791 return next.HandleSerialize(ctx, in) 2792} 2793func awsRestjson1_serializeOpHttpBindingsUpdateMeshInput(v *UpdateMeshInput, encoder *httpbinding.Encoder) error { 2794 if v == nil { 2795 return fmt.Errorf("unsupported serialization of nil %T", v) 2796 } 2797 2798 if v.MeshName == nil || len(*v.MeshName) == 0 { 2799 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2800 } 2801 if v.MeshName != nil { 2802 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2803 return err 2804 } 2805 } 2806 2807 return nil 2808} 2809 2810func awsRestjson1_serializeOpDocumentUpdateMeshInput(v *UpdateMeshInput, value smithyjson.Value) error { 2811 object := value.Object() 2812 defer object.Close() 2813 2814 if v.ClientToken != nil { 2815 ok := object.Key("clientToken") 2816 ok.String(*v.ClientToken) 2817 } 2818 2819 if v.Spec != nil { 2820 ok := object.Key("spec") 2821 if err := awsRestjson1_serializeDocumentMeshSpec(v.Spec, ok); err != nil { 2822 return err 2823 } 2824 } 2825 2826 return nil 2827} 2828 2829type awsRestjson1_serializeOpUpdateRoute struct { 2830} 2831 2832func (*awsRestjson1_serializeOpUpdateRoute) ID() string { 2833 return "OperationSerializer" 2834} 2835 2836func (m *awsRestjson1_serializeOpUpdateRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2837 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2838) { 2839 request, ok := in.Request.(*smithyhttp.Request) 2840 if !ok { 2841 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2842 } 2843 2844 input, ok := in.Parameters.(*UpdateRouteInput) 2845 _ = input 2846 if !ok { 2847 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2848 } 2849 2850 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}") 2851 request.URL.Path = opPath 2852 if len(request.URL.RawQuery) > 0 { 2853 request.URL.RawQuery = "&" + opQuery 2854 } else { 2855 request.URL.RawQuery = opQuery 2856 } 2857 2858 request.Method = "PUT" 2859 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2860 if err != nil { 2861 return out, metadata, &smithy.SerializationError{Err: err} 2862 } 2863 2864 if err := awsRestjson1_serializeOpHttpBindingsUpdateRouteInput(input, restEncoder); err != nil { 2865 return out, metadata, &smithy.SerializationError{Err: err} 2866 } 2867 2868 restEncoder.SetHeader("Content-Type").String("application/json") 2869 2870 jsonEncoder := smithyjson.NewEncoder() 2871 if err := awsRestjson1_serializeOpDocumentUpdateRouteInput(input, jsonEncoder.Value); err != nil { 2872 return out, metadata, &smithy.SerializationError{Err: err} 2873 } 2874 2875 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2876 return out, metadata, &smithy.SerializationError{Err: err} 2877 } 2878 2879 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2880 return out, metadata, &smithy.SerializationError{Err: err} 2881 } 2882 in.Request = request 2883 2884 return next.HandleSerialize(ctx, in) 2885} 2886func awsRestjson1_serializeOpHttpBindingsUpdateRouteInput(v *UpdateRouteInput, encoder *httpbinding.Encoder) error { 2887 if v == nil { 2888 return fmt.Errorf("unsupported serialization of nil %T", v) 2889 } 2890 2891 if v.MeshName == nil || len(*v.MeshName) == 0 { 2892 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 2893 } 2894 if v.MeshName != nil { 2895 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 2896 return err 2897 } 2898 } 2899 2900 if v.MeshOwner != nil { 2901 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 2902 } 2903 2904 if v.RouteName == nil || len(*v.RouteName) == 0 { 2905 return &smithy.SerializationError{Err: fmt.Errorf("input member routeName must not be empty")} 2906 } 2907 if v.RouteName != nil { 2908 if err := encoder.SetURI("routeName").String(*v.RouteName); err != nil { 2909 return err 2910 } 2911 } 2912 2913 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 2914 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 2915 } 2916 if v.VirtualRouterName != nil { 2917 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 2918 return err 2919 } 2920 } 2921 2922 return nil 2923} 2924 2925func awsRestjson1_serializeOpDocumentUpdateRouteInput(v *UpdateRouteInput, value smithyjson.Value) error { 2926 object := value.Object() 2927 defer object.Close() 2928 2929 if v.ClientToken != nil { 2930 ok := object.Key("clientToken") 2931 ok.String(*v.ClientToken) 2932 } 2933 2934 if v.Spec != nil { 2935 ok := object.Key("spec") 2936 if err := awsRestjson1_serializeDocumentRouteSpec(v.Spec, ok); err != nil { 2937 return err 2938 } 2939 } 2940 2941 return nil 2942} 2943 2944type awsRestjson1_serializeOpUpdateVirtualGateway struct { 2945} 2946 2947func (*awsRestjson1_serializeOpUpdateVirtualGateway) ID() string { 2948 return "OperationSerializer" 2949} 2950 2951func (m *awsRestjson1_serializeOpUpdateVirtualGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2952 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2953) { 2954 request, ok := in.Request.(*smithyhttp.Request) 2955 if !ok { 2956 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2957 } 2958 2959 input, ok := in.Parameters.(*UpdateVirtualGatewayInput) 2960 _ = input 2961 if !ok { 2962 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2963 } 2964 2965 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}") 2966 request.URL.Path = opPath 2967 if len(request.URL.RawQuery) > 0 { 2968 request.URL.RawQuery = "&" + opQuery 2969 } else { 2970 request.URL.RawQuery = opQuery 2971 } 2972 2973 request.Method = "PUT" 2974 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2975 if err != nil { 2976 return out, metadata, &smithy.SerializationError{Err: err} 2977 } 2978 2979 if err := awsRestjson1_serializeOpHttpBindingsUpdateVirtualGatewayInput(input, restEncoder); err != nil { 2980 return out, metadata, &smithy.SerializationError{Err: err} 2981 } 2982 2983 restEncoder.SetHeader("Content-Type").String("application/json") 2984 2985 jsonEncoder := smithyjson.NewEncoder() 2986 if err := awsRestjson1_serializeOpDocumentUpdateVirtualGatewayInput(input, jsonEncoder.Value); err != nil { 2987 return out, metadata, &smithy.SerializationError{Err: err} 2988 } 2989 2990 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2991 return out, metadata, &smithy.SerializationError{Err: err} 2992 } 2993 2994 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2995 return out, metadata, &smithy.SerializationError{Err: err} 2996 } 2997 in.Request = request 2998 2999 return next.HandleSerialize(ctx, in) 3000} 3001func awsRestjson1_serializeOpHttpBindingsUpdateVirtualGatewayInput(v *UpdateVirtualGatewayInput, encoder *httpbinding.Encoder) error { 3002 if v == nil { 3003 return fmt.Errorf("unsupported serialization of nil %T", v) 3004 } 3005 3006 if v.MeshName == nil || len(*v.MeshName) == 0 { 3007 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 3008 } 3009 if v.MeshName != nil { 3010 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 3011 return err 3012 } 3013 } 3014 3015 if v.MeshOwner != nil { 3016 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 3017 } 3018 3019 if v.VirtualGatewayName == nil || len(*v.VirtualGatewayName) == 0 { 3020 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualGatewayName must not be empty")} 3021 } 3022 if v.VirtualGatewayName != nil { 3023 if err := encoder.SetURI("virtualGatewayName").String(*v.VirtualGatewayName); err != nil { 3024 return err 3025 } 3026 } 3027 3028 return nil 3029} 3030 3031func awsRestjson1_serializeOpDocumentUpdateVirtualGatewayInput(v *UpdateVirtualGatewayInput, value smithyjson.Value) error { 3032 object := value.Object() 3033 defer object.Close() 3034 3035 if v.ClientToken != nil { 3036 ok := object.Key("clientToken") 3037 ok.String(*v.ClientToken) 3038 } 3039 3040 if v.Spec != nil { 3041 ok := object.Key("spec") 3042 if err := awsRestjson1_serializeDocumentVirtualGatewaySpec(v.Spec, ok); err != nil { 3043 return err 3044 } 3045 } 3046 3047 return nil 3048} 3049 3050type awsRestjson1_serializeOpUpdateVirtualNode struct { 3051} 3052 3053func (*awsRestjson1_serializeOpUpdateVirtualNode) ID() string { 3054 return "OperationSerializer" 3055} 3056 3057func (m *awsRestjson1_serializeOpUpdateVirtualNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3058 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3059) { 3060 request, ok := in.Request.(*smithyhttp.Request) 3061 if !ok { 3062 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3063 } 3064 3065 input, ok := in.Parameters.(*UpdateVirtualNodeInput) 3066 _ = input 3067 if !ok { 3068 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3069 } 3070 3071 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}") 3072 request.URL.Path = opPath 3073 if len(request.URL.RawQuery) > 0 { 3074 request.URL.RawQuery = "&" + opQuery 3075 } else { 3076 request.URL.RawQuery = opQuery 3077 } 3078 3079 request.Method = "PUT" 3080 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3081 if err != nil { 3082 return out, metadata, &smithy.SerializationError{Err: err} 3083 } 3084 3085 if err := awsRestjson1_serializeOpHttpBindingsUpdateVirtualNodeInput(input, restEncoder); err != nil { 3086 return out, metadata, &smithy.SerializationError{Err: err} 3087 } 3088 3089 restEncoder.SetHeader("Content-Type").String("application/json") 3090 3091 jsonEncoder := smithyjson.NewEncoder() 3092 if err := awsRestjson1_serializeOpDocumentUpdateVirtualNodeInput(input, jsonEncoder.Value); err != nil { 3093 return out, metadata, &smithy.SerializationError{Err: err} 3094 } 3095 3096 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3097 return out, metadata, &smithy.SerializationError{Err: err} 3098 } 3099 3100 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3101 return out, metadata, &smithy.SerializationError{Err: err} 3102 } 3103 in.Request = request 3104 3105 return next.HandleSerialize(ctx, in) 3106} 3107func awsRestjson1_serializeOpHttpBindingsUpdateVirtualNodeInput(v *UpdateVirtualNodeInput, encoder *httpbinding.Encoder) error { 3108 if v == nil { 3109 return fmt.Errorf("unsupported serialization of nil %T", v) 3110 } 3111 3112 if v.MeshName == nil || len(*v.MeshName) == 0 { 3113 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 3114 } 3115 if v.MeshName != nil { 3116 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 3117 return err 3118 } 3119 } 3120 3121 if v.MeshOwner != nil { 3122 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 3123 } 3124 3125 if v.VirtualNodeName == nil || len(*v.VirtualNodeName) == 0 { 3126 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualNodeName must not be empty")} 3127 } 3128 if v.VirtualNodeName != nil { 3129 if err := encoder.SetURI("virtualNodeName").String(*v.VirtualNodeName); err != nil { 3130 return err 3131 } 3132 } 3133 3134 return nil 3135} 3136 3137func awsRestjson1_serializeOpDocumentUpdateVirtualNodeInput(v *UpdateVirtualNodeInput, value smithyjson.Value) error { 3138 object := value.Object() 3139 defer object.Close() 3140 3141 if v.ClientToken != nil { 3142 ok := object.Key("clientToken") 3143 ok.String(*v.ClientToken) 3144 } 3145 3146 if v.Spec != nil { 3147 ok := object.Key("spec") 3148 if err := awsRestjson1_serializeDocumentVirtualNodeSpec(v.Spec, ok); err != nil { 3149 return err 3150 } 3151 } 3152 3153 return nil 3154} 3155 3156type awsRestjson1_serializeOpUpdateVirtualRouter struct { 3157} 3158 3159func (*awsRestjson1_serializeOpUpdateVirtualRouter) ID() string { 3160 return "OperationSerializer" 3161} 3162 3163func (m *awsRestjson1_serializeOpUpdateVirtualRouter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3164 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3165) { 3166 request, ok := in.Request.(*smithyhttp.Request) 3167 if !ok { 3168 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3169 } 3170 3171 input, ok := in.Parameters.(*UpdateVirtualRouterInput) 3172 _ = input 3173 if !ok { 3174 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3175 } 3176 3177 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}") 3178 request.URL.Path = opPath 3179 if len(request.URL.RawQuery) > 0 { 3180 request.URL.RawQuery = "&" + opQuery 3181 } else { 3182 request.URL.RawQuery = opQuery 3183 } 3184 3185 request.Method = "PUT" 3186 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3187 if err != nil { 3188 return out, metadata, &smithy.SerializationError{Err: err} 3189 } 3190 3191 if err := awsRestjson1_serializeOpHttpBindingsUpdateVirtualRouterInput(input, restEncoder); err != nil { 3192 return out, metadata, &smithy.SerializationError{Err: err} 3193 } 3194 3195 restEncoder.SetHeader("Content-Type").String("application/json") 3196 3197 jsonEncoder := smithyjson.NewEncoder() 3198 if err := awsRestjson1_serializeOpDocumentUpdateVirtualRouterInput(input, jsonEncoder.Value); err != nil { 3199 return out, metadata, &smithy.SerializationError{Err: err} 3200 } 3201 3202 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3203 return out, metadata, &smithy.SerializationError{Err: err} 3204 } 3205 3206 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3207 return out, metadata, &smithy.SerializationError{Err: err} 3208 } 3209 in.Request = request 3210 3211 return next.HandleSerialize(ctx, in) 3212} 3213func awsRestjson1_serializeOpHttpBindingsUpdateVirtualRouterInput(v *UpdateVirtualRouterInput, encoder *httpbinding.Encoder) error { 3214 if v == nil { 3215 return fmt.Errorf("unsupported serialization of nil %T", v) 3216 } 3217 3218 if v.MeshName == nil || len(*v.MeshName) == 0 { 3219 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 3220 } 3221 if v.MeshName != nil { 3222 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 3223 return err 3224 } 3225 } 3226 3227 if v.MeshOwner != nil { 3228 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 3229 } 3230 3231 if v.VirtualRouterName == nil || len(*v.VirtualRouterName) == 0 { 3232 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualRouterName must not be empty")} 3233 } 3234 if v.VirtualRouterName != nil { 3235 if err := encoder.SetURI("virtualRouterName").String(*v.VirtualRouterName); err != nil { 3236 return err 3237 } 3238 } 3239 3240 return nil 3241} 3242 3243func awsRestjson1_serializeOpDocumentUpdateVirtualRouterInput(v *UpdateVirtualRouterInput, value smithyjson.Value) error { 3244 object := value.Object() 3245 defer object.Close() 3246 3247 if v.ClientToken != nil { 3248 ok := object.Key("clientToken") 3249 ok.String(*v.ClientToken) 3250 } 3251 3252 if v.Spec != nil { 3253 ok := object.Key("spec") 3254 if err := awsRestjson1_serializeDocumentVirtualRouterSpec(v.Spec, ok); err != nil { 3255 return err 3256 } 3257 } 3258 3259 return nil 3260} 3261 3262type awsRestjson1_serializeOpUpdateVirtualService struct { 3263} 3264 3265func (*awsRestjson1_serializeOpUpdateVirtualService) ID() string { 3266 return "OperationSerializer" 3267} 3268 3269func (m *awsRestjson1_serializeOpUpdateVirtualService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3270 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3271) { 3272 request, ok := in.Request.(*smithyhttp.Request) 3273 if !ok { 3274 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3275 } 3276 3277 input, ok := in.Parameters.(*UpdateVirtualServiceInput) 3278 _ = input 3279 if !ok { 3280 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3281 } 3282 3283 opPath, opQuery := httpbinding.SplitURI("/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}") 3284 request.URL.Path = opPath 3285 if len(request.URL.RawQuery) > 0 { 3286 request.URL.RawQuery = "&" + opQuery 3287 } else { 3288 request.URL.RawQuery = opQuery 3289 } 3290 3291 request.Method = "PUT" 3292 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3293 if err != nil { 3294 return out, metadata, &smithy.SerializationError{Err: err} 3295 } 3296 3297 if err := awsRestjson1_serializeOpHttpBindingsUpdateVirtualServiceInput(input, restEncoder); err != nil { 3298 return out, metadata, &smithy.SerializationError{Err: err} 3299 } 3300 3301 restEncoder.SetHeader("Content-Type").String("application/json") 3302 3303 jsonEncoder := smithyjson.NewEncoder() 3304 if err := awsRestjson1_serializeOpDocumentUpdateVirtualServiceInput(input, jsonEncoder.Value); err != nil { 3305 return out, metadata, &smithy.SerializationError{Err: err} 3306 } 3307 3308 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3309 return out, metadata, &smithy.SerializationError{Err: err} 3310 } 3311 3312 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3313 return out, metadata, &smithy.SerializationError{Err: err} 3314 } 3315 in.Request = request 3316 3317 return next.HandleSerialize(ctx, in) 3318} 3319func awsRestjson1_serializeOpHttpBindingsUpdateVirtualServiceInput(v *UpdateVirtualServiceInput, encoder *httpbinding.Encoder) error { 3320 if v == nil { 3321 return fmt.Errorf("unsupported serialization of nil %T", v) 3322 } 3323 3324 if v.MeshName == nil || len(*v.MeshName) == 0 { 3325 return &smithy.SerializationError{Err: fmt.Errorf("input member meshName must not be empty")} 3326 } 3327 if v.MeshName != nil { 3328 if err := encoder.SetURI("meshName").String(*v.MeshName); err != nil { 3329 return err 3330 } 3331 } 3332 3333 if v.MeshOwner != nil { 3334 encoder.SetQuery("meshOwner").String(*v.MeshOwner) 3335 } 3336 3337 if v.VirtualServiceName == nil || len(*v.VirtualServiceName) == 0 { 3338 return &smithy.SerializationError{Err: fmt.Errorf("input member virtualServiceName must not be empty")} 3339 } 3340 if v.VirtualServiceName != nil { 3341 if err := encoder.SetURI("virtualServiceName").String(*v.VirtualServiceName); err != nil { 3342 return err 3343 } 3344 } 3345 3346 return nil 3347} 3348 3349func awsRestjson1_serializeOpDocumentUpdateVirtualServiceInput(v *UpdateVirtualServiceInput, value smithyjson.Value) error { 3350 object := value.Object() 3351 defer object.Close() 3352 3353 if v.ClientToken != nil { 3354 ok := object.Key("clientToken") 3355 ok.String(*v.ClientToken) 3356 } 3357 3358 if v.Spec != nil { 3359 ok := object.Key("spec") 3360 if err := awsRestjson1_serializeDocumentVirtualServiceSpec(v.Spec, ok); err != nil { 3361 return err 3362 } 3363 } 3364 3365 return nil 3366} 3367 3368func awsRestjson1_serializeDocumentAccessLog(v types.AccessLog, value smithyjson.Value) error { 3369 object := value.Object() 3370 defer object.Close() 3371 3372 switch uv := v.(type) { 3373 case *types.AccessLogMemberFile: 3374 av := object.Key("file") 3375 if err := awsRestjson1_serializeDocumentFileAccessLog(&uv.Value, av); err != nil { 3376 return err 3377 } 3378 3379 default: 3380 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 3381 3382 } 3383 return nil 3384} 3385 3386func awsRestjson1_serializeDocumentAwsCloudMapInstanceAttribute(v *types.AwsCloudMapInstanceAttribute, value smithyjson.Value) error { 3387 object := value.Object() 3388 defer object.Close() 3389 3390 if v.Key != nil { 3391 ok := object.Key("key") 3392 ok.String(*v.Key) 3393 } 3394 3395 if v.Value != nil { 3396 ok := object.Key("value") 3397 ok.String(*v.Value) 3398 } 3399 3400 return nil 3401} 3402 3403func awsRestjson1_serializeDocumentAwsCloudMapInstanceAttributes(v []types.AwsCloudMapInstanceAttribute, value smithyjson.Value) error { 3404 array := value.Array() 3405 defer array.Close() 3406 3407 for i := range v { 3408 av := array.Value() 3409 if err := awsRestjson1_serializeDocumentAwsCloudMapInstanceAttribute(&v[i], av); err != nil { 3410 return err 3411 } 3412 } 3413 return nil 3414} 3415 3416func awsRestjson1_serializeDocumentAwsCloudMapServiceDiscovery(v *types.AwsCloudMapServiceDiscovery, value smithyjson.Value) error { 3417 object := value.Object() 3418 defer object.Close() 3419 3420 if v.Attributes != nil { 3421 ok := object.Key("attributes") 3422 if err := awsRestjson1_serializeDocumentAwsCloudMapInstanceAttributes(v.Attributes, ok); err != nil { 3423 return err 3424 } 3425 } 3426 3427 if v.NamespaceName != nil { 3428 ok := object.Key("namespaceName") 3429 ok.String(*v.NamespaceName) 3430 } 3431 3432 if v.ServiceName != nil { 3433 ok := object.Key("serviceName") 3434 ok.String(*v.ServiceName) 3435 } 3436 3437 return nil 3438} 3439 3440func awsRestjson1_serializeDocumentBackend(v types.Backend, value smithyjson.Value) error { 3441 object := value.Object() 3442 defer object.Close() 3443 3444 switch uv := v.(type) { 3445 case *types.BackendMemberVirtualService: 3446 av := object.Key("virtualService") 3447 if err := awsRestjson1_serializeDocumentVirtualServiceBackend(&uv.Value, av); err != nil { 3448 return err 3449 } 3450 3451 default: 3452 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 3453 3454 } 3455 return nil 3456} 3457 3458func awsRestjson1_serializeDocumentBackendDefaults(v *types.BackendDefaults, value smithyjson.Value) error { 3459 object := value.Object() 3460 defer object.Close() 3461 3462 if v.ClientPolicy != nil { 3463 ok := object.Key("clientPolicy") 3464 if err := awsRestjson1_serializeDocumentClientPolicy(v.ClientPolicy, ok); err != nil { 3465 return err 3466 } 3467 } 3468 3469 return nil 3470} 3471 3472func awsRestjson1_serializeDocumentBackends(v []types.Backend, value smithyjson.Value) error { 3473 array := value.Array() 3474 defer array.Close() 3475 3476 for i := range v { 3477 av := array.Value() 3478 if vv := v[i]; vv == nil { 3479 continue 3480 } 3481 if err := awsRestjson1_serializeDocumentBackend(v[i], av); err != nil { 3482 return err 3483 } 3484 } 3485 return nil 3486} 3487 3488func awsRestjson1_serializeDocumentCertificateAuthorityArns(v []string, value smithyjson.Value) error { 3489 array := value.Array() 3490 defer array.Close() 3491 3492 for i := range v { 3493 av := array.Value() 3494 av.String(v[i]) 3495 } 3496 return nil 3497} 3498 3499func awsRestjson1_serializeDocumentClientPolicy(v *types.ClientPolicy, value smithyjson.Value) error { 3500 object := value.Object() 3501 defer object.Close() 3502 3503 if v.Tls != nil { 3504 ok := object.Key("tls") 3505 if err := awsRestjson1_serializeDocumentClientPolicyTls(v.Tls, ok); err != nil { 3506 return err 3507 } 3508 } 3509 3510 return nil 3511} 3512 3513func awsRestjson1_serializeDocumentClientPolicyTls(v *types.ClientPolicyTls, value smithyjson.Value) error { 3514 object := value.Object() 3515 defer object.Close() 3516 3517 if v.Enforce != nil { 3518 ok := object.Key("enforce") 3519 ok.Boolean(*v.Enforce) 3520 } 3521 3522 if v.Ports != nil { 3523 ok := object.Key("ports") 3524 if err := awsRestjson1_serializeDocumentPortSet(v.Ports, ok); err != nil { 3525 return err 3526 } 3527 } 3528 3529 if v.Validation != nil { 3530 ok := object.Key("validation") 3531 if err := awsRestjson1_serializeDocumentTlsValidationContext(v.Validation, ok); err != nil { 3532 return err 3533 } 3534 } 3535 3536 return nil 3537} 3538 3539func awsRestjson1_serializeDocumentDnsServiceDiscovery(v *types.DnsServiceDiscovery, value smithyjson.Value) error { 3540 object := value.Object() 3541 defer object.Close() 3542 3543 if v.Hostname != nil { 3544 ok := object.Key("hostname") 3545 ok.String(*v.Hostname) 3546 } 3547 3548 return nil 3549} 3550 3551func awsRestjson1_serializeDocumentDuration(v *types.Duration, value smithyjson.Value) error { 3552 object := value.Object() 3553 defer object.Close() 3554 3555 if len(v.Unit) > 0 { 3556 ok := object.Key("unit") 3557 ok.String(string(v.Unit)) 3558 } 3559 3560 if v.Value != nil { 3561 ok := object.Key("value") 3562 ok.Long(*v.Value) 3563 } 3564 3565 return nil 3566} 3567 3568func awsRestjson1_serializeDocumentEgressFilter(v *types.EgressFilter, value smithyjson.Value) error { 3569 object := value.Object() 3570 defer object.Close() 3571 3572 if len(v.Type) > 0 { 3573 ok := object.Key("type") 3574 ok.String(string(v.Type)) 3575 } 3576 3577 return nil 3578} 3579 3580func awsRestjson1_serializeDocumentFileAccessLog(v *types.FileAccessLog, value smithyjson.Value) error { 3581 object := value.Object() 3582 defer object.Close() 3583 3584 if v.Path != nil { 3585 ok := object.Key("path") 3586 ok.String(*v.Path) 3587 } 3588 3589 return nil 3590} 3591 3592func awsRestjson1_serializeDocumentGatewayRouteSpec(v *types.GatewayRouteSpec, value smithyjson.Value) error { 3593 object := value.Object() 3594 defer object.Close() 3595 3596 if v.GrpcRoute != nil { 3597 ok := object.Key("grpcRoute") 3598 if err := awsRestjson1_serializeDocumentGrpcGatewayRoute(v.GrpcRoute, ok); err != nil { 3599 return err 3600 } 3601 } 3602 3603 if v.Http2Route != nil { 3604 ok := object.Key("http2Route") 3605 if err := awsRestjson1_serializeDocumentHttpGatewayRoute(v.Http2Route, ok); err != nil { 3606 return err 3607 } 3608 } 3609 3610 if v.HttpRoute != nil { 3611 ok := object.Key("httpRoute") 3612 if err := awsRestjson1_serializeDocumentHttpGatewayRoute(v.HttpRoute, ok); err != nil { 3613 return err 3614 } 3615 } 3616 3617 return nil 3618} 3619 3620func awsRestjson1_serializeDocumentGatewayRouteTarget(v *types.GatewayRouteTarget, value smithyjson.Value) error { 3621 object := value.Object() 3622 defer object.Close() 3623 3624 if v.VirtualService != nil { 3625 ok := object.Key("virtualService") 3626 if err := awsRestjson1_serializeDocumentGatewayRouteVirtualService(v.VirtualService, ok); err != nil { 3627 return err 3628 } 3629 } 3630 3631 return nil 3632} 3633 3634func awsRestjson1_serializeDocumentGatewayRouteVirtualService(v *types.GatewayRouteVirtualService, value smithyjson.Value) error { 3635 object := value.Object() 3636 defer object.Close() 3637 3638 if v.VirtualServiceName != nil { 3639 ok := object.Key("virtualServiceName") 3640 ok.String(*v.VirtualServiceName) 3641 } 3642 3643 return nil 3644} 3645 3646func awsRestjson1_serializeDocumentGrpcGatewayRoute(v *types.GrpcGatewayRoute, value smithyjson.Value) error { 3647 object := value.Object() 3648 defer object.Close() 3649 3650 if v.Action != nil { 3651 ok := object.Key("action") 3652 if err := awsRestjson1_serializeDocumentGrpcGatewayRouteAction(v.Action, ok); err != nil { 3653 return err 3654 } 3655 } 3656 3657 if v.Match != nil { 3658 ok := object.Key("match") 3659 if err := awsRestjson1_serializeDocumentGrpcGatewayRouteMatch(v.Match, ok); err != nil { 3660 return err 3661 } 3662 } 3663 3664 return nil 3665} 3666 3667func awsRestjson1_serializeDocumentGrpcGatewayRouteAction(v *types.GrpcGatewayRouteAction, value smithyjson.Value) error { 3668 object := value.Object() 3669 defer object.Close() 3670 3671 if v.Target != nil { 3672 ok := object.Key("target") 3673 if err := awsRestjson1_serializeDocumentGatewayRouteTarget(v.Target, ok); err != nil { 3674 return err 3675 } 3676 } 3677 3678 return nil 3679} 3680 3681func awsRestjson1_serializeDocumentGrpcGatewayRouteMatch(v *types.GrpcGatewayRouteMatch, value smithyjson.Value) error { 3682 object := value.Object() 3683 defer object.Close() 3684 3685 if v.ServiceName != nil { 3686 ok := object.Key("serviceName") 3687 ok.String(*v.ServiceName) 3688 } 3689 3690 return nil 3691} 3692 3693func awsRestjson1_serializeDocumentGrpcRetryPolicy(v *types.GrpcRetryPolicy, value smithyjson.Value) error { 3694 object := value.Object() 3695 defer object.Close() 3696 3697 if v.GrpcRetryEvents != nil { 3698 ok := object.Key("grpcRetryEvents") 3699 if err := awsRestjson1_serializeDocumentGrpcRetryPolicyEvents(v.GrpcRetryEvents, ok); err != nil { 3700 return err 3701 } 3702 } 3703 3704 if v.HttpRetryEvents != nil { 3705 ok := object.Key("httpRetryEvents") 3706 if err := awsRestjson1_serializeDocumentHttpRetryPolicyEvents(v.HttpRetryEvents, ok); err != nil { 3707 return err 3708 } 3709 } 3710 3711 if v.MaxRetries != nil { 3712 ok := object.Key("maxRetries") 3713 ok.Long(*v.MaxRetries) 3714 } 3715 3716 if v.PerRetryTimeout != nil { 3717 ok := object.Key("perRetryTimeout") 3718 if err := awsRestjson1_serializeDocumentDuration(v.PerRetryTimeout, ok); err != nil { 3719 return err 3720 } 3721 } 3722 3723 if v.TcpRetryEvents != nil { 3724 ok := object.Key("tcpRetryEvents") 3725 if err := awsRestjson1_serializeDocumentTcpRetryPolicyEvents(v.TcpRetryEvents, ok); err != nil { 3726 return err 3727 } 3728 } 3729 3730 return nil 3731} 3732 3733func awsRestjson1_serializeDocumentGrpcRetryPolicyEvents(v []types.GrpcRetryPolicyEvent, value smithyjson.Value) error { 3734 array := value.Array() 3735 defer array.Close() 3736 3737 for i := range v { 3738 av := array.Value() 3739 av.String(string(v[i])) 3740 } 3741 return nil 3742} 3743 3744func awsRestjson1_serializeDocumentGrpcRoute(v *types.GrpcRoute, value smithyjson.Value) error { 3745 object := value.Object() 3746 defer object.Close() 3747 3748 if v.Action != nil { 3749 ok := object.Key("action") 3750 if err := awsRestjson1_serializeDocumentGrpcRouteAction(v.Action, ok); err != nil { 3751 return err 3752 } 3753 } 3754 3755 if v.Match != nil { 3756 ok := object.Key("match") 3757 if err := awsRestjson1_serializeDocumentGrpcRouteMatch(v.Match, ok); err != nil { 3758 return err 3759 } 3760 } 3761 3762 if v.RetryPolicy != nil { 3763 ok := object.Key("retryPolicy") 3764 if err := awsRestjson1_serializeDocumentGrpcRetryPolicy(v.RetryPolicy, ok); err != nil { 3765 return err 3766 } 3767 } 3768 3769 if v.Timeout != nil { 3770 ok := object.Key("timeout") 3771 if err := awsRestjson1_serializeDocumentGrpcTimeout(v.Timeout, ok); err != nil { 3772 return err 3773 } 3774 } 3775 3776 return nil 3777} 3778 3779func awsRestjson1_serializeDocumentGrpcRouteAction(v *types.GrpcRouteAction, value smithyjson.Value) error { 3780 object := value.Object() 3781 defer object.Close() 3782 3783 if v.WeightedTargets != nil { 3784 ok := object.Key("weightedTargets") 3785 if err := awsRestjson1_serializeDocumentWeightedTargets(v.WeightedTargets, ok); err != nil { 3786 return err 3787 } 3788 } 3789 3790 return nil 3791} 3792 3793func awsRestjson1_serializeDocumentGrpcRouteMatch(v *types.GrpcRouteMatch, value smithyjson.Value) error { 3794 object := value.Object() 3795 defer object.Close() 3796 3797 if v.Metadata != nil { 3798 ok := object.Key("metadata") 3799 if err := awsRestjson1_serializeDocumentGrpcRouteMetadataList(v.Metadata, ok); err != nil { 3800 return err 3801 } 3802 } 3803 3804 if v.MethodName != nil { 3805 ok := object.Key("methodName") 3806 ok.String(*v.MethodName) 3807 } 3808 3809 if v.ServiceName != nil { 3810 ok := object.Key("serviceName") 3811 ok.String(*v.ServiceName) 3812 } 3813 3814 return nil 3815} 3816 3817func awsRestjson1_serializeDocumentGrpcRouteMetadata(v *types.GrpcRouteMetadata, value smithyjson.Value) error { 3818 object := value.Object() 3819 defer object.Close() 3820 3821 if v.Invert != nil { 3822 ok := object.Key("invert") 3823 ok.Boolean(*v.Invert) 3824 } 3825 3826 if v.Match != nil { 3827 ok := object.Key("match") 3828 if err := awsRestjson1_serializeDocumentGrpcRouteMetadataMatchMethod(v.Match, ok); err != nil { 3829 return err 3830 } 3831 } 3832 3833 if v.Name != nil { 3834 ok := object.Key("name") 3835 ok.String(*v.Name) 3836 } 3837 3838 return nil 3839} 3840 3841func awsRestjson1_serializeDocumentGrpcRouteMetadataList(v []types.GrpcRouteMetadata, value smithyjson.Value) error { 3842 array := value.Array() 3843 defer array.Close() 3844 3845 for i := range v { 3846 av := array.Value() 3847 if err := awsRestjson1_serializeDocumentGrpcRouteMetadata(&v[i], av); err != nil { 3848 return err 3849 } 3850 } 3851 return nil 3852} 3853 3854func awsRestjson1_serializeDocumentGrpcRouteMetadataMatchMethod(v types.GrpcRouteMetadataMatchMethod, value smithyjson.Value) error { 3855 object := value.Object() 3856 defer object.Close() 3857 3858 switch uv := v.(type) { 3859 case *types.GrpcRouteMetadataMatchMethodMemberExact: 3860 av := object.Key("exact") 3861 av.String(uv.Value) 3862 3863 case *types.GrpcRouteMetadataMatchMethodMemberPrefix: 3864 av := object.Key("prefix") 3865 av.String(uv.Value) 3866 3867 case *types.GrpcRouteMetadataMatchMethodMemberRange: 3868 av := object.Key("range") 3869 if err := awsRestjson1_serializeDocumentMatchRange(&uv.Value, av); err != nil { 3870 return err 3871 } 3872 3873 case *types.GrpcRouteMetadataMatchMethodMemberRegex: 3874 av := object.Key("regex") 3875 av.String(uv.Value) 3876 3877 case *types.GrpcRouteMetadataMatchMethodMemberSuffix: 3878 av := object.Key("suffix") 3879 av.String(uv.Value) 3880 3881 default: 3882 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 3883 3884 } 3885 return nil 3886} 3887 3888func awsRestjson1_serializeDocumentGrpcTimeout(v *types.GrpcTimeout, value smithyjson.Value) error { 3889 object := value.Object() 3890 defer object.Close() 3891 3892 if v.Idle != nil { 3893 ok := object.Key("idle") 3894 if err := awsRestjson1_serializeDocumentDuration(v.Idle, ok); err != nil { 3895 return err 3896 } 3897 } 3898 3899 if v.PerRequest != nil { 3900 ok := object.Key("perRequest") 3901 if err := awsRestjson1_serializeDocumentDuration(v.PerRequest, ok); err != nil { 3902 return err 3903 } 3904 } 3905 3906 return nil 3907} 3908 3909func awsRestjson1_serializeDocumentHeaderMatchMethod(v types.HeaderMatchMethod, value smithyjson.Value) error { 3910 object := value.Object() 3911 defer object.Close() 3912 3913 switch uv := v.(type) { 3914 case *types.HeaderMatchMethodMemberExact: 3915 av := object.Key("exact") 3916 av.String(uv.Value) 3917 3918 case *types.HeaderMatchMethodMemberPrefix: 3919 av := object.Key("prefix") 3920 av.String(uv.Value) 3921 3922 case *types.HeaderMatchMethodMemberRange: 3923 av := object.Key("range") 3924 if err := awsRestjson1_serializeDocumentMatchRange(&uv.Value, av); err != nil { 3925 return err 3926 } 3927 3928 case *types.HeaderMatchMethodMemberRegex: 3929 av := object.Key("regex") 3930 av.String(uv.Value) 3931 3932 case *types.HeaderMatchMethodMemberSuffix: 3933 av := object.Key("suffix") 3934 av.String(uv.Value) 3935 3936 default: 3937 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 3938 3939 } 3940 return nil 3941} 3942 3943func awsRestjson1_serializeDocumentHealthCheckPolicy(v *types.HealthCheckPolicy, value smithyjson.Value) error { 3944 object := value.Object() 3945 defer object.Close() 3946 3947 if v.HealthyThreshold != 0 { 3948 ok := object.Key("healthyThreshold") 3949 ok.Integer(v.HealthyThreshold) 3950 } 3951 3952 if v.IntervalMillis != nil { 3953 ok := object.Key("intervalMillis") 3954 ok.Long(*v.IntervalMillis) 3955 } 3956 3957 if v.Path != nil { 3958 ok := object.Key("path") 3959 ok.String(*v.Path) 3960 } 3961 3962 if v.Port != 0 { 3963 ok := object.Key("port") 3964 ok.Integer(v.Port) 3965 } 3966 3967 if len(v.Protocol) > 0 { 3968 ok := object.Key("protocol") 3969 ok.String(string(v.Protocol)) 3970 } 3971 3972 if v.TimeoutMillis != nil { 3973 ok := object.Key("timeoutMillis") 3974 ok.Long(*v.TimeoutMillis) 3975 } 3976 3977 if v.UnhealthyThreshold != 0 { 3978 ok := object.Key("unhealthyThreshold") 3979 ok.Integer(v.UnhealthyThreshold) 3980 } 3981 3982 return nil 3983} 3984 3985func awsRestjson1_serializeDocumentHttpGatewayRoute(v *types.HttpGatewayRoute, value smithyjson.Value) error { 3986 object := value.Object() 3987 defer object.Close() 3988 3989 if v.Action != nil { 3990 ok := object.Key("action") 3991 if err := awsRestjson1_serializeDocumentHttpGatewayRouteAction(v.Action, ok); err != nil { 3992 return err 3993 } 3994 } 3995 3996 if v.Match != nil { 3997 ok := object.Key("match") 3998 if err := awsRestjson1_serializeDocumentHttpGatewayRouteMatch(v.Match, ok); err != nil { 3999 return err 4000 } 4001 } 4002 4003 return nil 4004} 4005 4006func awsRestjson1_serializeDocumentHttpGatewayRouteAction(v *types.HttpGatewayRouteAction, value smithyjson.Value) error { 4007 object := value.Object() 4008 defer object.Close() 4009 4010 if v.Target != nil { 4011 ok := object.Key("target") 4012 if err := awsRestjson1_serializeDocumentGatewayRouteTarget(v.Target, ok); err != nil { 4013 return err 4014 } 4015 } 4016 4017 return nil 4018} 4019 4020func awsRestjson1_serializeDocumentHttpGatewayRouteMatch(v *types.HttpGatewayRouteMatch, value smithyjson.Value) error { 4021 object := value.Object() 4022 defer object.Close() 4023 4024 if v.Prefix != nil { 4025 ok := object.Key("prefix") 4026 ok.String(*v.Prefix) 4027 } 4028 4029 return nil 4030} 4031 4032func awsRestjson1_serializeDocumentHttpRetryPolicy(v *types.HttpRetryPolicy, value smithyjson.Value) error { 4033 object := value.Object() 4034 defer object.Close() 4035 4036 if v.HttpRetryEvents != nil { 4037 ok := object.Key("httpRetryEvents") 4038 if err := awsRestjson1_serializeDocumentHttpRetryPolicyEvents(v.HttpRetryEvents, ok); err != nil { 4039 return err 4040 } 4041 } 4042 4043 if v.MaxRetries != nil { 4044 ok := object.Key("maxRetries") 4045 ok.Long(*v.MaxRetries) 4046 } 4047 4048 if v.PerRetryTimeout != nil { 4049 ok := object.Key("perRetryTimeout") 4050 if err := awsRestjson1_serializeDocumentDuration(v.PerRetryTimeout, ok); err != nil { 4051 return err 4052 } 4053 } 4054 4055 if v.TcpRetryEvents != nil { 4056 ok := object.Key("tcpRetryEvents") 4057 if err := awsRestjson1_serializeDocumentTcpRetryPolicyEvents(v.TcpRetryEvents, ok); err != nil { 4058 return err 4059 } 4060 } 4061 4062 return nil 4063} 4064 4065func awsRestjson1_serializeDocumentHttpRetryPolicyEvents(v []string, value smithyjson.Value) error { 4066 array := value.Array() 4067 defer array.Close() 4068 4069 for i := range v { 4070 av := array.Value() 4071 av.String(v[i]) 4072 } 4073 return nil 4074} 4075 4076func awsRestjson1_serializeDocumentHttpRoute(v *types.HttpRoute, value smithyjson.Value) error { 4077 object := value.Object() 4078 defer object.Close() 4079 4080 if v.Action != nil { 4081 ok := object.Key("action") 4082 if err := awsRestjson1_serializeDocumentHttpRouteAction(v.Action, ok); err != nil { 4083 return err 4084 } 4085 } 4086 4087 if v.Match != nil { 4088 ok := object.Key("match") 4089 if err := awsRestjson1_serializeDocumentHttpRouteMatch(v.Match, ok); err != nil { 4090 return err 4091 } 4092 } 4093 4094 if v.RetryPolicy != nil { 4095 ok := object.Key("retryPolicy") 4096 if err := awsRestjson1_serializeDocumentHttpRetryPolicy(v.RetryPolicy, ok); err != nil { 4097 return err 4098 } 4099 } 4100 4101 if v.Timeout != nil { 4102 ok := object.Key("timeout") 4103 if err := awsRestjson1_serializeDocumentHttpTimeout(v.Timeout, ok); err != nil { 4104 return err 4105 } 4106 } 4107 4108 return nil 4109} 4110 4111func awsRestjson1_serializeDocumentHttpRouteAction(v *types.HttpRouteAction, value smithyjson.Value) error { 4112 object := value.Object() 4113 defer object.Close() 4114 4115 if v.WeightedTargets != nil { 4116 ok := object.Key("weightedTargets") 4117 if err := awsRestjson1_serializeDocumentWeightedTargets(v.WeightedTargets, ok); err != nil { 4118 return err 4119 } 4120 } 4121 4122 return nil 4123} 4124 4125func awsRestjson1_serializeDocumentHttpRouteHeader(v *types.HttpRouteHeader, value smithyjson.Value) error { 4126 object := value.Object() 4127 defer object.Close() 4128 4129 if v.Invert != nil { 4130 ok := object.Key("invert") 4131 ok.Boolean(*v.Invert) 4132 } 4133 4134 if v.Match != nil { 4135 ok := object.Key("match") 4136 if err := awsRestjson1_serializeDocumentHeaderMatchMethod(v.Match, ok); err != nil { 4137 return err 4138 } 4139 } 4140 4141 if v.Name != nil { 4142 ok := object.Key("name") 4143 ok.String(*v.Name) 4144 } 4145 4146 return nil 4147} 4148 4149func awsRestjson1_serializeDocumentHttpRouteHeaders(v []types.HttpRouteHeader, value smithyjson.Value) error { 4150 array := value.Array() 4151 defer array.Close() 4152 4153 for i := range v { 4154 av := array.Value() 4155 if err := awsRestjson1_serializeDocumentHttpRouteHeader(&v[i], av); err != nil { 4156 return err 4157 } 4158 } 4159 return nil 4160} 4161 4162func awsRestjson1_serializeDocumentHttpRouteMatch(v *types.HttpRouteMatch, value smithyjson.Value) error { 4163 object := value.Object() 4164 defer object.Close() 4165 4166 if v.Headers != nil { 4167 ok := object.Key("headers") 4168 if err := awsRestjson1_serializeDocumentHttpRouteHeaders(v.Headers, ok); err != nil { 4169 return err 4170 } 4171 } 4172 4173 if len(v.Method) > 0 { 4174 ok := object.Key("method") 4175 ok.String(string(v.Method)) 4176 } 4177 4178 if v.Prefix != nil { 4179 ok := object.Key("prefix") 4180 ok.String(*v.Prefix) 4181 } 4182 4183 if len(v.Scheme) > 0 { 4184 ok := object.Key("scheme") 4185 ok.String(string(v.Scheme)) 4186 } 4187 4188 return nil 4189} 4190 4191func awsRestjson1_serializeDocumentHttpTimeout(v *types.HttpTimeout, value smithyjson.Value) error { 4192 object := value.Object() 4193 defer object.Close() 4194 4195 if v.Idle != nil { 4196 ok := object.Key("idle") 4197 if err := awsRestjson1_serializeDocumentDuration(v.Idle, ok); err != nil { 4198 return err 4199 } 4200 } 4201 4202 if v.PerRequest != nil { 4203 ok := object.Key("perRequest") 4204 if err := awsRestjson1_serializeDocumentDuration(v.PerRequest, ok); err != nil { 4205 return err 4206 } 4207 } 4208 4209 return nil 4210} 4211 4212func awsRestjson1_serializeDocumentListener(v *types.Listener, value smithyjson.Value) error { 4213 object := value.Object() 4214 defer object.Close() 4215 4216 if v.HealthCheck != nil { 4217 ok := object.Key("healthCheck") 4218 if err := awsRestjson1_serializeDocumentHealthCheckPolicy(v.HealthCheck, ok); err != nil { 4219 return err 4220 } 4221 } 4222 4223 if v.PortMapping != nil { 4224 ok := object.Key("portMapping") 4225 if err := awsRestjson1_serializeDocumentPortMapping(v.PortMapping, ok); err != nil { 4226 return err 4227 } 4228 } 4229 4230 if v.Timeout != nil { 4231 ok := object.Key("timeout") 4232 if err := awsRestjson1_serializeDocumentListenerTimeout(v.Timeout, ok); err != nil { 4233 return err 4234 } 4235 } 4236 4237 if v.Tls != nil { 4238 ok := object.Key("tls") 4239 if err := awsRestjson1_serializeDocumentListenerTls(v.Tls, ok); err != nil { 4240 return err 4241 } 4242 } 4243 4244 return nil 4245} 4246 4247func awsRestjson1_serializeDocumentListeners(v []types.Listener, value smithyjson.Value) error { 4248 array := value.Array() 4249 defer array.Close() 4250 4251 for i := range v { 4252 av := array.Value() 4253 if err := awsRestjson1_serializeDocumentListener(&v[i], av); err != nil { 4254 return err 4255 } 4256 } 4257 return nil 4258} 4259 4260func awsRestjson1_serializeDocumentListenerTimeout(v types.ListenerTimeout, value smithyjson.Value) error { 4261 object := value.Object() 4262 defer object.Close() 4263 4264 switch uv := v.(type) { 4265 case *types.ListenerTimeoutMemberGrpc: 4266 av := object.Key("grpc") 4267 if err := awsRestjson1_serializeDocumentGrpcTimeout(&uv.Value, av); err != nil { 4268 return err 4269 } 4270 4271 case *types.ListenerTimeoutMemberHttp: 4272 av := object.Key("http") 4273 if err := awsRestjson1_serializeDocumentHttpTimeout(&uv.Value, av); err != nil { 4274 return err 4275 } 4276 4277 case *types.ListenerTimeoutMemberHttp2: 4278 av := object.Key("http2") 4279 if err := awsRestjson1_serializeDocumentHttpTimeout(&uv.Value, av); err != nil { 4280 return err 4281 } 4282 4283 case *types.ListenerTimeoutMemberTcp: 4284 av := object.Key("tcp") 4285 if err := awsRestjson1_serializeDocumentTcpTimeout(&uv.Value, av); err != nil { 4286 return err 4287 } 4288 4289 default: 4290 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4291 4292 } 4293 return nil 4294} 4295 4296func awsRestjson1_serializeDocumentListenerTls(v *types.ListenerTls, value smithyjson.Value) error { 4297 object := value.Object() 4298 defer object.Close() 4299 4300 if v.Certificate != nil { 4301 ok := object.Key("certificate") 4302 if err := awsRestjson1_serializeDocumentListenerTlsCertificate(v.Certificate, ok); err != nil { 4303 return err 4304 } 4305 } 4306 4307 if len(v.Mode) > 0 { 4308 ok := object.Key("mode") 4309 ok.String(string(v.Mode)) 4310 } 4311 4312 return nil 4313} 4314 4315func awsRestjson1_serializeDocumentListenerTlsAcmCertificate(v *types.ListenerTlsAcmCertificate, value smithyjson.Value) error { 4316 object := value.Object() 4317 defer object.Close() 4318 4319 if v.CertificateArn != nil { 4320 ok := object.Key("certificateArn") 4321 ok.String(*v.CertificateArn) 4322 } 4323 4324 return nil 4325} 4326 4327func awsRestjson1_serializeDocumentListenerTlsCertificate(v types.ListenerTlsCertificate, value smithyjson.Value) error { 4328 object := value.Object() 4329 defer object.Close() 4330 4331 switch uv := v.(type) { 4332 case *types.ListenerTlsCertificateMemberAcm: 4333 av := object.Key("acm") 4334 if err := awsRestjson1_serializeDocumentListenerTlsAcmCertificate(&uv.Value, av); err != nil { 4335 return err 4336 } 4337 4338 case *types.ListenerTlsCertificateMemberFile: 4339 av := object.Key("file") 4340 if err := awsRestjson1_serializeDocumentListenerTlsFileCertificate(&uv.Value, av); err != nil { 4341 return err 4342 } 4343 4344 default: 4345 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4346 4347 } 4348 return nil 4349} 4350 4351func awsRestjson1_serializeDocumentListenerTlsFileCertificate(v *types.ListenerTlsFileCertificate, value smithyjson.Value) error { 4352 object := value.Object() 4353 defer object.Close() 4354 4355 if v.CertificateChain != nil { 4356 ok := object.Key("certificateChain") 4357 ok.String(*v.CertificateChain) 4358 } 4359 4360 if v.PrivateKey != nil { 4361 ok := object.Key("privateKey") 4362 ok.String(*v.PrivateKey) 4363 } 4364 4365 return nil 4366} 4367 4368func awsRestjson1_serializeDocumentLogging(v *types.Logging, value smithyjson.Value) error { 4369 object := value.Object() 4370 defer object.Close() 4371 4372 if v.AccessLog != nil { 4373 ok := object.Key("accessLog") 4374 if err := awsRestjson1_serializeDocumentAccessLog(v.AccessLog, ok); err != nil { 4375 return err 4376 } 4377 } 4378 4379 return nil 4380} 4381 4382func awsRestjson1_serializeDocumentMatchRange(v *types.MatchRange, value smithyjson.Value) error { 4383 object := value.Object() 4384 defer object.Close() 4385 4386 if v.End != nil { 4387 ok := object.Key("end") 4388 ok.Long(*v.End) 4389 } 4390 4391 if v.Start != nil { 4392 ok := object.Key("start") 4393 ok.Long(*v.Start) 4394 } 4395 4396 return nil 4397} 4398 4399func awsRestjson1_serializeDocumentMeshSpec(v *types.MeshSpec, value smithyjson.Value) error { 4400 object := value.Object() 4401 defer object.Close() 4402 4403 if v.EgressFilter != nil { 4404 ok := object.Key("egressFilter") 4405 if err := awsRestjson1_serializeDocumentEgressFilter(v.EgressFilter, ok); err != nil { 4406 return err 4407 } 4408 } 4409 4410 return nil 4411} 4412 4413func awsRestjson1_serializeDocumentPortMapping(v *types.PortMapping, value smithyjson.Value) error { 4414 object := value.Object() 4415 defer object.Close() 4416 4417 if v.Port != 0 { 4418 ok := object.Key("port") 4419 ok.Integer(v.Port) 4420 } 4421 4422 if len(v.Protocol) > 0 { 4423 ok := object.Key("protocol") 4424 ok.String(string(v.Protocol)) 4425 } 4426 4427 return nil 4428} 4429 4430func awsRestjson1_serializeDocumentPortSet(v []int32, value smithyjson.Value) error { 4431 array := value.Array() 4432 defer array.Close() 4433 4434 for i := range v { 4435 av := array.Value() 4436 av.Integer(v[i]) 4437 } 4438 return nil 4439} 4440 4441func awsRestjson1_serializeDocumentRouteSpec(v *types.RouteSpec, value smithyjson.Value) error { 4442 object := value.Object() 4443 defer object.Close() 4444 4445 if v.GrpcRoute != nil { 4446 ok := object.Key("grpcRoute") 4447 if err := awsRestjson1_serializeDocumentGrpcRoute(v.GrpcRoute, ok); err != nil { 4448 return err 4449 } 4450 } 4451 4452 if v.Http2Route != nil { 4453 ok := object.Key("http2Route") 4454 if err := awsRestjson1_serializeDocumentHttpRoute(v.Http2Route, ok); err != nil { 4455 return err 4456 } 4457 } 4458 4459 if v.HttpRoute != nil { 4460 ok := object.Key("httpRoute") 4461 if err := awsRestjson1_serializeDocumentHttpRoute(v.HttpRoute, ok); err != nil { 4462 return err 4463 } 4464 } 4465 4466 if v.Priority != nil { 4467 ok := object.Key("priority") 4468 ok.Integer(*v.Priority) 4469 } 4470 4471 if v.TcpRoute != nil { 4472 ok := object.Key("tcpRoute") 4473 if err := awsRestjson1_serializeDocumentTcpRoute(v.TcpRoute, ok); err != nil { 4474 return err 4475 } 4476 } 4477 4478 return nil 4479} 4480 4481func awsRestjson1_serializeDocumentServiceDiscovery(v types.ServiceDiscovery, value smithyjson.Value) error { 4482 object := value.Object() 4483 defer object.Close() 4484 4485 switch uv := v.(type) { 4486 case *types.ServiceDiscoveryMemberAwsCloudMap: 4487 av := object.Key("awsCloudMap") 4488 if err := awsRestjson1_serializeDocumentAwsCloudMapServiceDiscovery(&uv.Value, av); err != nil { 4489 return err 4490 } 4491 4492 case *types.ServiceDiscoveryMemberDns: 4493 av := object.Key("dns") 4494 if err := awsRestjson1_serializeDocumentDnsServiceDiscovery(&uv.Value, av); err != nil { 4495 return err 4496 } 4497 4498 default: 4499 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4500 4501 } 4502 return nil 4503} 4504 4505func awsRestjson1_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { 4506 array := value.Array() 4507 defer array.Close() 4508 4509 for i := range v { 4510 av := array.Value() 4511 av.String(v[i]) 4512 } 4513 return nil 4514} 4515 4516func awsRestjson1_serializeDocumentTagList(v []types.TagRef, value smithyjson.Value) error { 4517 array := value.Array() 4518 defer array.Close() 4519 4520 for i := range v { 4521 av := array.Value() 4522 if err := awsRestjson1_serializeDocumentTagRef(&v[i], av); err != nil { 4523 return err 4524 } 4525 } 4526 return nil 4527} 4528 4529func awsRestjson1_serializeDocumentTagRef(v *types.TagRef, value smithyjson.Value) error { 4530 object := value.Object() 4531 defer object.Close() 4532 4533 if v.Key != nil { 4534 ok := object.Key("key") 4535 ok.String(*v.Key) 4536 } 4537 4538 if v.Value != nil { 4539 ok := object.Key("value") 4540 ok.String(*v.Value) 4541 } 4542 4543 return nil 4544} 4545 4546func awsRestjson1_serializeDocumentTcpRetryPolicyEvents(v []types.TcpRetryPolicyEvent, value smithyjson.Value) error { 4547 array := value.Array() 4548 defer array.Close() 4549 4550 for i := range v { 4551 av := array.Value() 4552 av.String(string(v[i])) 4553 } 4554 return nil 4555} 4556 4557func awsRestjson1_serializeDocumentTcpRoute(v *types.TcpRoute, value smithyjson.Value) error { 4558 object := value.Object() 4559 defer object.Close() 4560 4561 if v.Action != nil { 4562 ok := object.Key("action") 4563 if err := awsRestjson1_serializeDocumentTcpRouteAction(v.Action, ok); err != nil { 4564 return err 4565 } 4566 } 4567 4568 if v.Timeout != nil { 4569 ok := object.Key("timeout") 4570 if err := awsRestjson1_serializeDocumentTcpTimeout(v.Timeout, ok); err != nil { 4571 return err 4572 } 4573 } 4574 4575 return nil 4576} 4577 4578func awsRestjson1_serializeDocumentTcpRouteAction(v *types.TcpRouteAction, value smithyjson.Value) error { 4579 object := value.Object() 4580 defer object.Close() 4581 4582 if v.WeightedTargets != nil { 4583 ok := object.Key("weightedTargets") 4584 if err := awsRestjson1_serializeDocumentWeightedTargets(v.WeightedTargets, ok); err != nil { 4585 return err 4586 } 4587 } 4588 4589 return nil 4590} 4591 4592func awsRestjson1_serializeDocumentTcpTimeout(v *types.TcpTimeout, value smithyjson.Value) error { 4593 object := value.Object() 4594 defer object.Close() 4595 4596 if v.Idle != nil { 4597 ok := object.Key("idle") 4598 if err := awsRestjson1_serializeDocumentDuration(v.Idle, ok); err != nil { 4599 return err 4600 } 4601 } 4602 4603 return nil 4604} 4605 4606func awsRestjson1_serializeDocumentTlsValidationContext(v *types.TlsValidationContext, value smithyjson.Value) error { 4607 object := value.Object() 4608 defer object.Close() 4609 4610 if v.Trust != nil { 4611 ok := object.Key("trust") 4612 if err := awsRestjson1_serializeDocumentTlsValidationContextTrust(v.Trust, ok); err != nil { 4613 return err 4614 } 4615 } 4616 4617 return nil 4618} 4619 4620func awsRestjson1_serializeDocumentTlsValidationContextAcmTrust(v *types.TlsValidationContextAcmTrust, value smithyjson.Value) error { 4621 object := value.Object() 4622 defer object.Close() 4623 4624 if v.CertificateAuthorityArns != nil { 4625 ok := object.Key("certificateAuthorityArns") 4626 if err := awsRestjson1_serializeDocumentCertificateAuthorityArns(v.CertificateAuthorityArns, ok); err != nil { 4627 return err 4628 } 4629 } 4630 4631 return nil 4632} 4633 4634func awsRestjson1_serializeDocumentTlsValidationContextFileTrust(v *types.TlsValidationContextFileTrust, value smithyjson.Value) error { 4635 object := value.Object() 4636 defer object.Close() 4637 4638 if v.CertificateChain != nil { 4639 ok := object.Key("certificateChain") 4640 ok.String(*v.CertificateChain) 4641 } 4642 4643 return nil 4644} 4645 4646func awsRestjson1_serializeDocumentTlsValidationContextTrust(v types.TlsValidationContextTrust, value smithyjson.Value) error { 4647 object := value.Object() 4648 defer object.Close() 4649 4650 switch uv := v.(type) { 4651 case *types.TlsValidationContextTrustMemberAcm: 4652 av := object.Key("acm") 4653 if err := awsRestjson1_serializeDocumentTlsValidationContextAcmTrust(&uv.Value, av); err != nil { 4654 return err 4655 } 4656 4657 case *types.TlsValidationContextTrustMemberFile: 4658 av := object.Key("file") 4659 if err := awsRestjson1_serializeDocumentTlsValidationContextFileTrust(&uv.Value, av); err != nil { 4660 return err 4661 } 4662 4663 default: 4664 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4665 4666 } 4667 return nil 4668} 4669 4670func awsRestjson1_serializeDocumentVirtualGatewayAccessLog(v types.VirtualGatewayAccessLog, value smithyjson.Value) error { 4671 object := value.Object() 4672 defer object.Close() 4673 4674 switch uv := v.(type) { 4675 case *types.VirtualGatewayAccessLogMemberFile: 4676 av := object.Key("file") 4677 if err := awsRestjson1_serializeDocumentVirtualGatewayFileAccessLog(&uv.Value, av); err != nil { 4678 return err 4679 } 4680 4681 default: 4682 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4683 4684 } 4685 return nil 4686} 4687 4688func awsRestjson1_serializeDocumentVirtualGatewayBackendDefaults(v *types.VirtualGatewayBackendDefaults, value smithyjson.Value) error { 4689 object := value.Object() 4690 defer object.Close() 4691 4692 if v.ClientPolicy != nil { 4693 ok := object.Key("clientPolicy") 4694 if err := awsRestjson1_serializeDocumentVirtualGatewayClientPolicy(v.ClientPolicy, ok); err != nil { 4695 return err 4696 } 4697 } 4698 4699 return nil 4700} 4701 4702func awsRestjson1_serializeDocumentVirtualGatewayCertificateAuthorityArns(v []string, value smithyjson.Value) error { 4703 array := value.Array() 4704 defer array.Close() 4705 4706 for i := range v { 4707 av := array.Value() 4708 av.String(v[i]) 4709 } 4710 return nil 4711} 4712 4713func awsRestjson1_serializeDocumentVirtualGatewayClientPolicy(v *types.VirtualGatewayClientPolicy, value smithyjson.Value) error { 4714 object := value.Object() 4715 defer object.Close() 4716 4717 if v.Tls != nil { 4718 ok := object.Key("tls") 4719 if err := awsRestjson1_serializeDocumentVirtualGatewayClientPolicyTls(v.Tls, ok); err != nil { 4720 return err 4721 } 4722 } 4723 4724 return nil 4725} 4726 4727func awsRestjson1_serializeDocumentVirtualGatewayClientPolicyTls(v *types.VirtualGatewayClientPolicyTls, value smithyjson.Value) error { 4728 object := value.Object() 4729 defer object.Close() 4730 4731 if v.Enforce != nil { 4732 ok := object.Key("enforce") 4733 ok.Boolean(*v.Enforce) 4734 } 4735 4736 if v.Ports != nil { 4737 ok := object.Key("ports") 4738 if err := awsRestjson1_serializeDocumentPortSet(v.Ports, ok); err != nil { 4739 return err 4740 } 4741 } 4742 4743 if v.Validation != nil { 4744 ok := object.Key("validation") 4745 if err := awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContext(v.Validation, ok); err != nil { 4746 return err 4747 } 4748 } 4749 4750 return nil 4751} 4752 4753func awsRestjson1_serializeDocumentVirtualGatewayFileAccessLog(v *types.VirtualGatewayFileAccessLog, value smithyjson.Value) error { 4754 object := value.Object() 4755 defer object.Close() 4756 4757 if v.Path != nil { 4758 ok := object.Key("path") 4759 ok.String(*v.Path) 4760 } 4761 4762 return nil 4763} 4764 4765func awsRestjson1_serializeDocumentVirtualGatewayHealthCheckPolicy(v *types.VirtualGatewayHealthCheckPolicy, value smithyjson.Value) error { 4766 object := value.Object() 4767 defer object.Close() 4768 4769 if v.HealthyThreshold != 0 { 4770 ok := object.Key("healthyThreshold") 4771 ok.Integer(v.HealthyThreshold) 4772 } 4773 4774 if v.IntervalMillis != nil { 4775 ok := object.Key("intervalMillis") 4776 ok.Long(*v.IntervalMillis) 4777 } 4778 4779 if v.Path != nil { 4780 ok := object.Key("path") 4781 ok.String(*v.Path) 4782 } 4783 4784 if v.Port != 0 { 4785 ok := object.Key("port") 4786 ok.Integer(v.Port) 4787 } 4788 4789 if len(v.Protocol) > 0 { 4790 ok := object.Key("protocol") 4791 ok.String(string(v.Protocol)) 4792 } 4793 4794 if v.TimeoutMillis != nil { 4795 ok := object.Key("timeoutMillis") 4796 ok.Long(*v.TimeoutMillis) 4797 } 4798 4799 if v.UnhealthyThreshold != 0 { 4800 ok := object.Key("unhealthyThreshold") 4801 ok.Integer(v.UnhealthyThreshold) 4802 } 4803 4804 return nil 4805} 4806 4807func awsRestjson1_serializeDocumentVirtualGatewayListener(v *types.VirtualGatewayListener, value smithyjson.Value) error { 4808 object := value.Object() 4809 defer object.Close() 4810 4811 if v.HealthCheck != nil { 4812 ok := object.Key("healthCheck") 4813 if err := awsRestjson1_serializeDocumentVirtualGatewayHealthCheckPolicy(v.HealthCheck, ok); err != nil { 4814 return err 4815 } 4816 } 4817 4818 if v.PortMapping != nil { 4819 ok := object.Key("portMapping") 4820 if err := awsRestjson1_serializeDocumentVirtualGatewayPortMapping(v.PortMapping, ok); err != nil { 4821 return err 4822 } 4823 } 4824 4825 if v.Tls != nil { 4826 ok := object.Key("tls") 4827 if err := awsRestjson1_serializeDocumentVirtualGatewayListenerTls(v.Tls, ok); err != nil { 4828 return err 4829 } 4830 } 4831 4832 return nil 4833} 4834 4835func awsRestjson1_serializeDocumentVirtualGatewayListeners(v []types.VirtualGatewayListener, value smithyjson.Value) error { 4836 array := value.Array() 4837 defer array.Close() 4838 4839 for i := range v { 4840 av := array.Value() 4841 if err := awsRestjson1_serializeDocumentVirtualGatewayListener(&v[i], av); err != nil { 4842 return err 4843 } 4844 } 4845 return nil 4846} 4847 4848func awsRestjson1_serializeDocumentVirtualGatewayListenerTls(v *types.VirtualGatewayListenerTls, value smithyjson.Value) error { 4849 object := value.Object() 4850 defer object.Close() 4851 4852 if v.Certificate != nil { 4853 ok := object.Key("certificate") 4854 if err := awsRestjson1_serializeDocumentVirtualGatewayListenerTlsCertificate(v.Certificate, ok); err != nil { 4855 return err 4856 } 4857 } 4858 4859 if len(v.Mode) > 0 { 4860 ok := object.Key("mode") 4861 ok.String(string(v.Mode)) 4862 } 4863 4864 return nil 4865} 4866 4867func awsRestjson1_serializeDocumentVirtualGatewayListenerTlsAcmCertificate(v *types.VirtualGatewayListenerTlsAcmCertificate, value smithyjson.Value) error { 4868 object := value.Object() 4869 defer object.Close() 4870 4871 if v.CertificateArn != nil { 4872 ok := object.Key("certificateArn") 4873 ok.String(*v.CertificateArn) 4874 } 4875 4876 return nil 4877} 4878 4879func awsRestjson1_serializeDocumentVirtualGatewayListenerTlsCertificate(v types.VirtualGatewayListenerTlsCertificate, value smithyjson.Value) error { 4880 object := value.Object() 4881 defer object.Close() 4882 4883 switch uv := v.(type) { 4884 case *types.VirtualGatewayListenerTlsCertificateMemberAcm: 4885 av := object.Key("acm") 4886 if err := awsRestjson1_serializeDocumentVirtualGatewayListenerTlsAcmCertificate(&uv.Value, av); err != nil { 4887 return err 4888 } 4889 4890 case *types.VirtualGatewayListenerTlsCertificateMemberFile: 4891 av := object.Key("file") 4892 if err := awsRestjson1_serializeDocumentVirtualGatewayListenerTlsFileCertificate(&uv.Value, av); err != nil { 4893 return err 4894 } 4895 4896 default: 4897 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 4898 4899 } 4900 return nil 4901} 4902 4903func awsRestjson1_serializeDocumentVirtualGatewayListenerTlsFileCertificate(v *types.VirtualGatewayListenerTlsFileCertificate, value smithyjson.Value) error { 4904 object := value.Object() 4905 defer object.Close() 4906 4907 if v.CertificateChain != nil { 4908 ok := object.Key("certificateChain") 4909 ok.String(*v.CertificateChain) 4910 } 4911 4912 if v.PrivateKey != nil { 4913 ok := object.Key("privateKey") 4914 ok.String(*v.PrivateKey) 4915 } 4916 4917 return nil 4918} 4919 4920func awsRestjson1_serializeDocumentVirtualGatewayLogging(v *types.VirtualGatewayLogging, value smithyjson.Value) error { 4921 object := value.Object() 4922 defer object.Close() 4923 4924 if v.AccessLog != nil { 4925 ok := object.Key("accessLog") 4926 if err := awsRestjson1_serializeDocumentVirtualGatewayAccessLog(v.AccessLog, ok); err != nil { 4927 return err 4928 } 4929 } 4930 4931 return nil 4932} 4933 4934func awsRestjson1_serializeDocumentVirtualGatewayPortMapping(v *types.VirtualGatewayPortMapping, value smithyjson.Value) error { 4935 object := value.Object() 4936 defer object.Close() 4937 4938 if v.Port != 0 { 4939 ok := object.Key("port") 4940 ok.Integer(v.Port) 4941 } 4942 4943 if len(v.Protocol) > 0 { 4944 ok := object.Key("protocol") 4945 ok.String(string(v.Protocol)) 4946 } 4947 4948 return nil 4949} 4950 4951func awsRestjson1_serializeDocumentVirtualGatewaySpec(v *types.VirtualGatewaySpec, value smithyjson.Value) error { 4952 object := value.Object() 4953 defer object.Close() 4954 4955 if v.BackendDefaults != nil { 4956 ok := object.Key("backendDefaults") 4957 if err := awsRestjson1_serializeDocumentVirtualGatewayBackendDefaults(v.BackendDefaults, ok); err != nil { 4958 return err 4959 } 4960 } 4961 4962 if v.Listeners != nil { 4963 ok := object.Key("listeners") 4964 if err := awsRestjson1_serializeDocumentVirtualGatewayListeners(v.Listeners, ok); err != nil { 4965 return err 4966 } 4967 } 4968 4969 if v.Logging != nil { 4970 ok := object.Key("logging") 4971 if err := awsRestjson1_serializeDocumentVirtualGatewayLogging(v.Logging, ok); err != nil { 4972 return err 4973 } 4974 } 4975 4976 return nil 4977} 4978 4979func awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContext(v *types.VirtualGatewayTlsValidationContext, value smithyjson.Value) error { 4980 object := value.Object() 4981 defer object.Close() 4982 4983 if v.Trust != nil { 4984 ok := object.Key("trust") 4985 if err := awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextTrust(v.Trust, ok); err != nil { 4986 return err 4987 } 4988 } 4989 4990 return nil 4991} 4992 4993func awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextAcmTrust(v *types.VirtualGatewayTlsValidationContextAcmTrust, value smithyjson.Value) error { 4994 object := value.Object() 4995 defer object.Close() 4996 4997 if v.CertificateAuthorityArns != nil { 4998 ok := object.Key("certificateAuthorityArns") 4999 if err := awsRestjson1_serializeDocumentVirtualGatewayCertificateAuthorityArns(v.CertificateAuthorityArns, ok); err != nil { 5000 return err 5001 } 5002 } 5003 5004 return nil 5005} 5006 5007func awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextFileTrust(v *types.VirtualGatewayTlsValidationContextFileTrust, value smithyjson.Value) error { 5008 object := value.Object() 5009 defer object.Close() 5010 5011 if v.CertificateChain != nil { 5012 ok := object.Key("certificateChain") 5013 ok.String(*v.CertificateChain) 5014 } 5015 5016 return nil 5017} 5018 5019func awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextTrust(v types.VirtualGatewayTlsValidationContextTrust, value smithyjson.Value) error { 5020 object := value.Object() 5021 defer object.Close() 5022 5023 switch uv := v.(type) { 5024 case *types.VirtualGatewayTlsValidationContextTrustMemberAcm: 5025 av := object.Key("acm") 5026 if err := awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextAcmTrust(&uv.Value, av); err != nil { 5027 return err 5028 } 5029 5030 case *types.VirtualGatewayTlsValidationContextTrustMemberFile: 5031 av := object.Key("file") 5032 if err := awsRestjson1_serializeDocumentVirtualGatewayTlsValidationContextFileTrust(&uv.Value, av); err != nil { 5033 return err 5034 } 5035 5036 default: 5037 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 5038 5039 } 5040 return nil 5041} 5042 5043func awsRestjson1_serializeDocumentVirtualNodeServiceProvider(v *types.VirtualNodeServiceProvider, value smithyjson.Value) error { 5044 object := value.Object() 5045 defer object.Close() 5046 5047 if v.VirtualNodeName != nil { 5048 ok := object.Key("virtualNodeName") 5049 ok.String(*v.VirtualNodeName) 5050 } 5051 5052 return nil 5053} 5054 5055func awsRestjson1_serializeDocumentVirtualNodeSpec(v *types.VirtualNodeSpec, value smithyjson.Value) error { 5056 object := value.Object() 5057 defer object.Close() 5058 5059 if v.BackendDefaults != nil { 5060 ok := object.Key("backendDefaults") 5061 if err := awsRestjson1_serializeDocumentBackendDefaults(v.BackendDefaults, ok); err != nil { 5062 return err 5063 } 5064 } 5065 5066 if v.Backends != nil { 5067 ok := object.Key("backends") 5068 if err := awsRestjson1_serializeDocumentBackends(v.Backends, ok); err != nil { 5069 return err 5070 } 5071 } 5072 5073 if v.Listeners != nil { 5074 ok := object.Key("listeners") 5075 if err := awsRestjson1_serializeDocumentListeners(v.Listeners, ok); err != nil { 5076 return err 5077 } 5078 } 5079 5080 if v.Logging != nil { 5081 ok := object.Key("logging") 5082 if err := awsRestjson1_serializeDocumentLogging(v.Logging, ok); err != nil { 5083 return err 5084 } 5085 } 5086 5087 if v.ServiceDiscovery != nil { 5088 ok := object.Key("serviceDiscovery") 5089 if err := awsRestjson1_serializeDocumentServiceDiscovery(v.ServiceDiscovery, ok); err != nil { 5090 return err 5091 } 5092 } 5093 5094 return nil 5095} 5096 5097func awsRestjson1_serializeDocumentVirtualRouterListener(v *types.VirtualRouterListener, value smithyjson.Value) error { 5098 object := value.Object() 5099 defer object.Close() 5100 5101 if v.PortMapping != nil { 5102 ok := object.Key("portMapping") 5103 if err := awsRestjson1_serializeDocumentPortMapping(v.PortMapping, ok); err != nil { 5104 return err 5105 } 5106 } 5107 5108 return nil 5109} 5110 5111func awsRestjson1_serializeDocumentVirtualRouterListeners(v []types.VirtualRouterListener, value smithyjson.Value) error { 5112 array := value.Array() 5113 defer array.Close() 5114 5115 for i := range v { 5116 av := array.Value() 5117 if err := awsRestjson1_serializeDocumentVirtualRouterListener(&v[i], av); err != nil { 5118 return err 5119 } 5120 } 5121 return nil 5122} 5123 5124func awsRestjson1_serializeDocumentVirtualRouterServiceProvider(v *types.VirtualRouterServiceProvider, value smithyjson.Value) error { 5125 object := value.Object() 5126 defer object.Close() 5127 5128 if v.VirtualRouterName != nil { 5129 ok := object.Key("virtualRouterName") 5130 ok.String(*v.VirtualRouterName) 5131 } 5132 5133 return nil 5134} 5135 5136func awsRestjson1_serializeDocumentVirtualRouterSpec(v *types.VirtualRouterSpec, value smithyjson.Value) error { 5137 object := value.Object() 5138 defer object.Close() 5139 5140 if v.Listeners != nil { 5141 ok := object.Key("listeners") 5142 if err := awsRestjson1_serializeDocumentVirtualRouterListeners(v.Listeners, ok); err != nil { 5143 return err 5144 } 5145 } 5146 5147 return nil 5148} 5149 5150func awsRestjson1_serializeDocumentVirtualServiceBackend(v *types.VirtualServiceBackend, value smithyjson.Value) error { 5151 object := value.Object() 5152 defer object.Close() 5153 5154 if v.ClientPolicy != nil { 5155 ok := object.Key("clientPolicy") 5156 if err := awsRestjson1_serializeDocumentClientPolicy(v.ClientPolicy, ok); err != nil { 5157 return err 5158 } 5159 } 5160 5161 if v.VirtualServiceName != nil { 5162 ok := object.Key("virtualServiceName") 5163 ok.String(*v.VirtualServiceName) 5164 } 5165 5166 return nil 5167} 5168 5169func awsRestjson1_serializeDocumentVirtualServiceProvider(v types.VirtualServiceProvider, value smithyjson.Value) error { 5170 object := value.Object() 5171 defer object.Close() 5172 5173 switch uv := v.(type) { 5174 case *types.VirtualServiceProviderMemberVirtualNode: 5175 av := object.Key("virtualNode") 5176 if err := awsRestjson1_serializeDocumentVirtualNodeServiceProvider(&uv.Value, av); err != nil { 5177 return err 5178 } 5179 5180 case *types.VirtualServiceProviderMemberVirtualRouter: 5181 av := object.Key("virtualRouter") 5182 if err := awsRestjson1_serializeDocumentVirtualRouterServiceProvider(&uv.Value, av); err != nil { 5183 return err 5184 } 5185 5186 default: 5187 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 5188 5189 } 5190 return nil 5191} 5192 5193func awsRestjson1_serializeDocumentVirtualServiceSpec(v *types.VirtualServiceSpec, value smithyjson.Value) error { 5194 object := value.Object() 5195 defer object.Close() 5196 5197 if v.Provider != nil { 5198 ok := object.Key("provider") 5199 if err := awsRestjson1_serializeDocumentVirtualServiceProvider(v.Provider, ok); err != nil { 5200 return err 5201 } 5202 } 5203 5204 return nil 5205} 5206 5207func awsRestjson1_serializeDocumentWeightedTarget(v *types.WeightedTarget, value smithyjson.Value) error { 5208 object := value.Object() 5209 defer object.Close() 5210 5211 if v.VirtualNode != nil { 5212 ok := object.Key("virtualNode") 5213 ok.String(*v.VirtualNode) 5214 } 5215 5216 if v.Weight != 0 { 5217 ok := object.Key("weight") 5218 ok.Integer(v.Weight) 5219 } 5220 5221 return nil 5222} 5223 5224func awsRestjson1_serializeDocumentWeightedTargets(v []types.WeightedTarget, value smithyjson.Value) error { 5225 array := value.Array() 5226 defer array.Close() 5227 5228 for i := range v { 5229 av := array.Value() 5230 if err := awsRestjson1_serializeDocumentWeightedTarget(&v[i], av); err != nil { 5231 return err 5232 } 5233 } 5234 return nil 5235} 5236