1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package globalaccelerator 4 5import ( 6 "bytes" 7 "context" 8 "encoding/json" 9 "fmt" 10 "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" 11 "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" 12 smithy "github.com/aws/smithy-go" 13 smithyio "github.com/aws/smithy-go/io" 14 "github.com/aws/smithy-go/middleware" 15 "github.com/aws/smithy-go/ptr" 16 smithytime "github.com/aws/smithy-go/time" 17 smithyhttp "github.com/aws/smithy-go/transport/http" 18 "io" 19 "io/ioutil" 20 "math" 21 "strings" 22) 23 24type awsAwsjson11_deserializeOpAddCustomRoutingEndpoints struct { 25} 26 27func (*awsAwsjson11_deserializeOpAddCustomRoutingEndpoints) ID() string { 28 return "OperationDeserializer" 29} 30 31func (m *awsAwsjson11_deserializeOpAddCustomRoutingEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 32 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 33) { 34 out, metadata, err = next.HandleDeserialize(ctx, in) 35 if err != nil { 36 return out, metadata, err 37 } 38 39 response, ok := out.RawResponse.(*smithyhttp.Response) 40 if !ok { 41 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 42 } 43 44 if response.StatusCode < 200 || response.StatusCode >= 300 { 45 return out, metadata, awsAwsjson11_deserializeOpErrorAddCustomRoutingEndpoints(response, &metadata) 46 } 47 output := &AddCustomRoutingEndpointsOutput{} 48 out.Result = output 49 50 var buff [1024]byte 51 ringBuffer := smithyio.NewRingBuffer(buff[:]) 52 53 body := io.TeeReader(response.Body, ringBuffer) 54 decoder := json.NewDecoder(body) 55 decoder.UseNumber() 56 var shape interface{} 57 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 58 var snapshot bytes.Buffer 59 io.Copy(&snapshot, ringBuffer) 60 err = &smithy.DeserializationError{ 61 Err: fmt.Errorf("failed to decode response body, %w", err), 62 Snapshot: snapshot.Bytes(), 63 } 64 return out, metadata, err 65 } 66 67 err = awsAwsjson11_deserializeOpDocumentAddCustomRoutingEndpointsOutput(&output, shape) 68 if err != nil { 69 var snapshot bytes.Buffer 70 io.Copy(&snapshot, ringBuffer) 71 err = &smithy.DeserializationError{ 72 Err: fmt.Errorf("failed to decode response body, %w", err), 73 Snapshot: snapshot.Bytes(), 74 } 75 return out, metadata, err 76 } 77 78 return out, metadata, err 79} 80 81func awsAwsjson11_deserializeOpErrorAddCustomRoutingEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { 82 var errorBuffer bytes.Buffer 83 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 84 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 85 } 86 errorBody := bytes.NewReader(errorBuffer.Bytes()) 87 88 errorCode := "UnknownError" 89 errorMessage := errorCode 90 91 code := response.Header.Get("X-Amzn-ErrorType") 92 if len(code) != 0 { 93 errorCode = restjson.SanitizeErrorCode(code) 94 } 95 96 var buff [1024]byte 97 ringBuffer := smithyio.NewRingBuffer(buff[:]) 98 99 body := io.TeeReader(errorBody, ringBuffer) 100 decoder := json.NewDecoder(body) 101 decoder.UseNumber() 102 code, message, err := restjson.GetErrorInfo(decoder) 103 if err != nil { 104 var snapshot bytes.Buffer 105 io.Copy(&snapshot, ringBuffer) 106 err = &smithy.DeserializationError{ 107 Err: fmt.Errorf("failed to decode response body, %w", err), 108 Snapshot: snapshot.Bytes(), 109 } 110 return err 111 } 112 113 errorBody.Seek(0, io.SeekStart) 114 if len(code) != 0 { 115 errorCode = restjson.SanitizeErrorCode(code) 116 } 117 if len(message) != 0 { 118 errorMessage = message 119 } 120 121 switch { 122 case strings.EqualFold("AccessDeniedException", errorCode): 123 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 124 125 case strings.EqualFold("ConflictException", errorCode): 126 return awsAwsjson11_deserializeErrorConflictException(response, errorBody) 127 128 case strings.EqualFold("EndpointAlreadyExistsException", errorCode): 129 return awsAwsjson11_deserializeErrorEndpointAlreadyExistsException(response, errorBody) 130 131 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 132 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 133 134 case strings.EqualFold("InternalServiceErrorException", errorCode): 135 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 136 137 case strings.EqualFold("InvalidArgumentException", errorCode): 138 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 139 140 case strings.EqualFold("LimitExceededException", errorCode): 141 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 142 143 default: 144 genericError := &smithy.GenericAPIError{ 145 Code: errorCode, 146 Message: errorMessage, 147 } 148 return genericError 149 150 } 151} 152 153type awsAwsjson11_deserializeOpAdvertiseByoipCidr struct { 154} 155 156func (*awsAwsjson11_deserializeOpAdvertiseByoipCidr) ID() string { 157 return "OperationDeserializer" 158} 159 160func (m *awsAwsjson11_deserializeOpAdvertiseByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 161 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 162) { 163 out, metadata, err = next.HandleDeserialize(ctx, in) 164 if err != nil { 165 return out, metadata, err 166 } 167 168 response, ok := out.RawResponse.(*smithyhttp.Response) 169 if !ok { 170 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 171 } 172 173 if response.StatusCode < 200 || response.StatusCode >= 300 { 174 return out, metadata, awsAwsjson11_deserializeOpErrorAdvertiseByoipCidr(response, &metadata) 175 } 176 output := &AdvertiseByoipCidrOutput{} 177 out.Result = output 178 179 var buff [1024]byte 180 ringBuffer := smithyio.NewRingBuffer(buff[:]) 181 182 body := io.TeeReader(response.Body, ringBuffer) 183 decoder := json.NewDecoder(body) 184 decoder.UseNumber() 185 var shape interface{} 186 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 187 var snapshot bytes.Buffer 188 io.Copy(&snapshot, ringBuffer) 189 err = &smithy.DeserializationError{ 190 Err: fmt.Errorf("failed to decode response body, %w", err), 191 Snapshot: snapshot.Bytes(), 192 } 193 return out, metadata, err 194 } 195 196 err = awsAwsjson11_deserializeOpDocumentAdvertiseByoipCidrOutput(&output, shape) 197 if err != nil { 198 var snapshot bytes.Buffer 199 io.Copy(&snapshot, ringBuffer) 200 err = &smithy.DeserializationError{ 201 Err: fmt.Errorf("failed to decode response body, %w", err), 202 Snapshot: snapshot.Bytes(), 203 } 204 return out, metadata, err 205 } 206 207 return out, metadata, err 208} 209 210func awsAwsjson11_deserializeOpErrorAdvertiseByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { 211 var errorBuffer bytes.Buffer 212 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 213 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 214 } 215 errorBody := bytes.NewReader(errorBuffer.Bytes()) 216 217 errorCode := "UnknownError" 218 errorMessage := errorCode 219 220 code := response.Header.Get("X-Amzn-ErrorType") 221 if len(code) != 0 { 222 errorCode = restjson.SanitizeErrorCode(code) 223 } 224 225 var buff [1024]byte 226 ringBuffer := smithyio.NewRingBuffer(buff[:]) 227 228 body := io.TeeReader(errorBody, ringBuffer) 229 decoder := json.NewDecoder(body) 230 decoder.UseNumber() 231 code, message, err := restjson.GetErrorInfo(decoder) 232 if err != nil { 233 var snapshot bytes.Buffer 234 io.Copy(&snapshot, ringBuffer) 235 err = &smithy.DeserializationError{ 236 Err: fmt.Errorf("failed to decode response body, %w", err), 237 Snapshot: snapshot.Bytes(), 238 } 239 return err 240 } 241 242 errorBody.Seek(0, io.SeekStart) 243 if len(code) != 0 { 244 errorCode = restjson.SanitizeErrorCode(code) 245 } 246 if len(message) != 0 { 247 errorMessage = message 248 } 249 250 switch { 251 case strings.EqualFold("AccessDeniedException", errorCode): 252 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 253 254 case strings.EqualFold("ByoipCidrNotFoundException", errorCode): 255 return awsAwsjson11_deserializeErrorByoipCidrNotFoundException(response, errorBody) 256 257 case strings.EqualFold("IncorrectCidrStateException", errorCode): 258 return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) 259 260 case strings.EqualFold("InternalServiceErrorException", errorCode): 261 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 262 263 case strings.EqualFold("InvalidArgumentException", errorCode): 264 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 265 266 default: 267 genericError := &smithy.GenericAPIError{ 268 Code: errorCode, 269 Message: errorMessage, 270 } 271 return genericError 272 273 } 274} 275 276type awsAwsjson11_deserializeOpAllowCustomRoutingTraffic struct { 277} 278 279func (*awsAwsjson11_deserializeOpAllowCustomRoutingTraffic) ID() string { 280 return "OperationDeserializer" 281} 282 283func (m *awsAwsjson11_deserializeOpAllowCustomRoutingTraffic) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 284 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 285) { 286 out, metadata, err = next.HandleDeserialize(ctx, in) 287 if err != nil { 288 return out, metadata, err 289 } 290 291 response, ok := out.RawResponse.(*smithyhttp.Response) 292 if !ok { 293 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 294 } 295 296 if response.StatusCode < 200 || response.StatusCode >= 300 { 297 return out, metadata, awsAwsjson11_deserializeOpErrorAllowCustomRoutingTraffic(response, &metadata) 298 } 299 output := &AllowCustomRoutingTrafficOutput{} 300 out.Result = output 301 302 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 303 return out, metadata, &smithy.DeserializationError{ 304 Err: fmt.Errorf("failed to discard response body, %w", err), 305 } 306 } 307 308 return out, metadata, err 309} 310 311func awsAwsjson11_deserializeOpErrorAllowCustomRoutingTraffic(response *smithyhttp.Response, metadata *middleware.Metadata) error { 312 var errorBuffer bytes.Buffer 313 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 314 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 315 } 316 errorBody := bytes.NewReader(errorBuffer.Bytes()) 317 318 errorCode := "UnknownError" 319 errorMessage := errorCode 320 321 code := response.Header.Get("X-Amzn-ErrorType") 322 if len(code) != 0 { 323 errorCode = restjson.SanitizeErrorCode(code) 324 } 325 326 var buff [1024]byte 327 ringBuffer := smithyio.NewRingBuffer(buff[:]) 328 329 body := io.TeeReader(errorBody, ringBuffer) 330 decoder := json.NewDecoder(body) 331 decoder.UseNumber() 332 code, message, err := restjson.GetErrorInfo(decoder) 333 if err != nil { 334 var snapshot bytes.Buffer 335 io.Copy(&snapshot, ringBuffer) 336 err = &smithy.DeserializationError{ 337 Err: fmt.Errorf("failed to decode response body, %w", err), 338 Snapshot: snapshot.Bytes(), 339 } 340 return err 341 } 342 343 errorBody.Seek(0, io.SeekStart) 344 if len(code) != 0 { 345 errorCode = restjson.SanitizeErrorCode(code) 346 } 347 if len(message) != 0 { 348 errorMessage = message 349 } 350 351 switch { 352 case strings.EqualFold("InternalServiceErrorException", errorCode): 353 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 354 355 case strings.EqualFold("InvalidArgumentException", errorCode): 356 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 357 358 default: 359 genericError := &smithy.GenericAPIError{ 360 Code: errorCode, 361 Message: errorMessage, 362 } 363 return genericError 364 365 } 366} 367 368type awsAwsjson11_deserializeOpCreateAccelerator struct { 369} 370 371func (*awsAwsjson11_deserializeOpCreateAccelerator) ID() string { 372 return "OperationDeserializer" 373} 374 375func (m *awsAwsjson11_deserializeOpCreateAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 376 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 377) { 378 out, metadata, err = next.HandleDeserialize(ctx, in) 379 if err != nil { 380 return out, metadata, err 381 } 382 383 response, ok := out.RawResponse.(*smithyhttp.Response) 384 if !ok { 385 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 386 } 387 388 if response.StatusCode < 200 || response.StatusCode >= 300 { 389 return out, metadata, awsAwsjson11_deserializeOpErrorCreateAccelerator(response, &metadata) 390 } 391 output := &CreateAcceleratorOutput{} 392 out.Result = output 393 394 var buff [1024]byte 395 ringBuffer := smithyio.NewRingBuffer(buff[:]) 396 397 body := io.TeeReader(response.Body, ringBuffer) 398 decoder := json.NewDecoder(body) 399 decoder.UseNumber() 400 var shape interface{} 401 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 402 var snapshot bytes.Buffer 403 io.Copy(&snapshot, ringBuffer) 404 err = &smithy.DeserializationError{ 405 Err: fmt.Errorf("failed to decode response body, %w", err), 406 Snapshot: snapshot.Bytes(), 407 } 408 return out, metadata, err 409 } 410 411 err = awsAwsjson11_deserializeOpDocumentCreateAcceleratorOutput(&output, shape) 412 if err != nil { 413 var snapshot bytes.Buffer 414 io.Copy(&snapshot, ringBuffer) 415 err = &smithy.DeserializationError{ 416 Err: fmt.Errorf("failed to decode response body, %w", err), 417 Snapshot: snapshot.Bytes(), 418 } 419 return out, metadata, err 420 } 421 422 return out, metadata, err 423} 424 425func awsAwsjson11_deserializeOpErrorCreateAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 426 var errorBuffer bytes.Buffer 427 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 428 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 429 } 430 errorBody := bytes.NewReader(errorBuffer.Bytes()) 431 432 errorCode := "UnknownError" 433 errorMessage := errorCode 434 435 code := response.Header.Get("X-Amzn-ErrorType") 436 if len(code) != 0 { 437 errorCode = restjson.SanitizeErrorCode(code) 438 } 439 440 var buff [1024]byte 441 ringBuffer := smithyio.NewRingBuffer(buff[:]) 442 443 body := io.TeeReader(errorBody, ringBuffer) 444 decoder := json.NewDecoder(body) 445 decoder.UseNumber() 446 code, message, err := restjson.GetErrorInfo(decoder) 447 if err != nil { 448 var snapshot bytes.Buffer 449 io.Copy(&snapshot, ringBuffer) 450 err = &smithy.DeserializationError{ 451 Err: fmt.Errorf("failed to decode response body, %w", err), 452 Snapshot: snapshot.Bytes(), 453 } 454 return err 455 } 456 457 errorBody.Seek(0, io.SeekStart) 458 if len(code) != 0 { 459 errorCode = restjson.SanitizeErrorCode(code) 460 } 461 if len(message) != 0 { 462 errorMessage = message 463 } 464 465 switch { 466 case strings.EqualFold("InternalServiceErrorException", errorCode): 467 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 468 469 case strings.EqualFold("InvalidArgumentException", errorCode): 470 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 471 472 case strings.EqualFold("LimitExceededException", errorCode): 473 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 474 475 default: 476 genericError := &smithy.GenericAPIError{ 477 Code: errorCode, 478 Message: errorMessage, 479 } 480 return genericError 481 482 } 483} 484 485type awsAwsjson11_deserializeOpCreateCustomRoutingAccelerator struct { 486} 487 488func (*awsAwsjson11_deserializeOpCreateCustomRoutingAccelerator) ID() string { 489 return "OperationDeserializer" 490} 491 492func (m *awsAwsjson11_deserializeOpCreateCustomRoutingAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 493 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 494) { 495 out, metadata, err = next.HandleDeserialize(ctx, in) 496 if err != nil { 497 return out, metadata, err 498 } 499 500 response, ok := out.RawResponse.(*smithyhttp.Response) 501 if !ok { 502 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 503 } 504 505 if response.StatusCode < 200 || response.StatusCode >= 300 { 506 return out, metadata, awsAwsjson11_deserializeOpErrorCreateCustomRoutingAccelerator(response, &metadata) 507 } 508 output := &CreateCustomRoutingAcceleratorOutput{} 509 out.Result = output 510 511 var buff [1024]byte 512 ringBuffer := smithyio.NewRingBuffer(buff[:]) 513 514 body := io.TeeReader(response.Body, ringBuffer) 515 decoder := json.NewDecoder(body) 516 decoder.UseNumber() 517 var shape interface{} 518 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 519 var snapshot bytes.Buffer 520 io.Copy(&snapshot, ringBuffer) 521 err = &smithy.DeserializationError{ 522 Err: fmt.Errorf("failed to decode response body, %w", err), 523 Snapshot: snapshot.Bytes(), 524 } 525 return out, metadata, err 526 } 527 528 err = awsAwsjson11_deserializeOpDocumentCreateCustomRoutingAcceleratorOutput(&output, shape) 529 if err != nil { 530 var snapshot bytes.Buffer 531 io.Copy(&snapshot, ringBuffer) 532 err = &smithy.DeserializationError{ 533 Err: fmt.Errorf("failed to decode response body, %w", err), 534 Snapshot: snapshot.Bytes(), 535 } 536 return out, metadata, err 537 } 538 539 return out, metadata, err 540} 541 542func awsAwsjson11_deserializeOpErrorCreateCustomRoutingAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 543 var errorBuffer bytes.Buffer 544 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 545 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 546 } 547 errorBody := bytes.NewReader(errorBuffer.Bytes()) 548 549 errorCode := "UnknownError" 550 errorMessage := errorCode 551 552 code := response.Header.Get("X-Amzn-ErrorType") 553 if len(code) != 0 { 554 errorCode = restjson.SanitizeErrorCode(code) 555 } 556 557 var buff [1024]byte 558 ringBuffer := smithyio.NewRingBuffer(buff[:]) 559 560 body := io.TeeReader(errorBody, ringBuffer) 561 decoder := json.NewDecoder(body) 562 decoder.UseNumber() 563 code, message, err := restjson.GetErrorInfo(decoder) 564 if err != nil { 565 var snapshot bytes.Buffer 566 io.Copy(&snapshot, ringBuffer) 567 err = &smithy.DeserializationError{ 568 Err: fmt.Errorf("failed to decode response body, %w", err), 569 Snapshot: snapshot.Bytes(), 570 } 571 return err 572 } 573 574 errorBody.Seek(0, io.SeekStart) 575 if len(code) != 0 { 576 errorCode = restjson.SanitizeErrorCode(code) 577 } 578 if len(message) != 0 { 579 errorMessage = message 580 } 581 582 switch { 583 case strings.EqualFold("AccessDeniedException", errorCode): 584 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 585 586 case strings.EqualFold("InternalServiceErrorException", errorCode): 587 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 588 589 case strings.EqualFold("InvalidArgumentException", errorCode): 590 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 591 592 case strings.EqualFold("LimitExceededException", errorCode): 593 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 594 595 default: 596 genericError := &smithy.GenericAPIError{ 597 Code: errorCode, 598 Message: errorMessage, 599 } 600 return genericError 601 602 } 603} 604 605type awsAwsjson11_deserializeOpCreateCustomRoutingEndpointGroup struct { 606} 607 608func (*awsAwsjson11_deserializeOpCreateCustomRoutingEndpointGroup) ID() string { 609 return "OperationDeserializer" 610} 611 612func (m *awsAwsjson11_deserializeOpCreateCustomRoutingEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 613 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 614) { 615 out, metadata, err = next.HandleDeserialize(ctx, in) 616 if err != nil { 617 return out, metadata, err 618 } 619 620 response, ok := out.RawResponse.(*smithyhttp.Response) 621 if !ok { 622 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 623 } 624 625 if response.StatusCode < 200 || response.StatusCode >= 300 { 626 return out, metadata, awsAwsjson11_deserializeOpErrorCreateCustomRoutingEndpointGroup(response, &metadata) 627 } 628 output := &CreateCustomRoutingEndpointGroupOutput{} 629 out.Result = output 630 631 var buff [1024]byte 632 ringBuffer := smithyio.NewRingBuffer(buff[:]) 633 634 body := io.TeeReader(response.Body, ringBuffer) 635 decoder := json.NewDecoder(body) 636 decoder.UseNumber() 637 var shape interface{} 638 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 639 var snapshot bytes.Buffer 640 io.Copy(&snapshot, ringBuffer) 641 err = &smithy.DeserializationError{ 642 Err: fmt.Errorf("failed to decode response body, %w", err), 643 Snapshot: snapshot.Bytes(), 644 } 645 return out, metadata, err 646 } 647 648 err = awsAwsjson11_deserializeOpDocumentCreateCustomRoutingEndpointGroupOutput(&output, shape) 649 if err != nil { 650 var snapshot bytes.Buffer 651 io.Copy(&snapshot, ringBuffer) 652 err = &smithy.DeserializationError{ 653 Err: fmt.Errorf("failed to decode response body, %w", err), 654 Snapshot: snapshot.Bytes(), 655 } 656 return out, metadata, err 657 } 658 659 return out, metadata, err 660} 661 662func awsAwsjson11_deserializeOpErrorCreateCustomRoutingEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 663 var errorBuffer bytes.Buffer 664 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 665 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 666 } 667 errorBody := bytes.NewReader(errorBuffer.Bytes()) 668 669 errorCode := "UnknownError" 670 errorMessage := errorCode 671 672 code := response.Header.Get("X-Amzn-ErrorType") 673 if len(code) != 0 { 674 errorCode = restjson.SanitizeErrorCode(code) 675 } 676 677 var buff [1024]byte 678 ringBuffer := smithyio.NewRingBuffer(buff[:]) 679 680 body := io.TeeReader(errorBody, ringBuffer) 681 decoder := json.NewDecoder(body) 682 decoder.UseNumber() 683 code, message, err := restjson.GetErrorInfo(decoder) 684 if err != nil { 685 var snapshot bytes.Buffer 686 io.Copy(&snapshot, ringBuffer) 687 err = &smithy.DeserializationError{ 688 Err: fmt.Errorf("failed to decode response body, %w", err), 689 Snapshot: snapshot.Bytes(), 690 } 691 return err 692 } 693 694 errorBody.Seek(0, io.SeekStart) 695 if len(code) != 0 { 696 errorCode = restjson.SanitizeErrorCode(code) 697 } 698 if len(message) != 0 { 699 errorMessage = message 700 } 701 702 switch { 703 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 704 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 705 706 case strings.EqualFold("AccessDeniedException", errorCode): 707 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 708 709 case strings.EqualFold("EndpointGroupAlreadyExistsException", errorCode): 710 return awsAwsjson11_deserializeErrorEndpointGroupAlreadyExistsException(response, errorBody) 711 712 case strings.EqualFold("InternalServiceErrorException", errorCode): 713 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 714 715 case strings.EqualFold("InvalidArgumentException", errorCode): 716 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 717 718 case strings.EqualFold("InvalidPortRangeException", errorCode): 719 return awsAwsjson11_deserializeErrorInvalidPortRangeException(response, errorBody) 720 721 case strings.EqualFold("LimitExceededException", errorCode): 722 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 723 724 case strings.EqualFold("ListenerNotFoundException", errorCode): 725 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 726 727 default: 728 genericError := &smithy.GenericAPIError{ 729 Code: errorCode, 730 Message: errorMessage, 731 } 732 return genericError 733 734 } 735} 736 737type awsAwsjson11_deserializeOpCreateCustomRoutingListener struct { 738} 739 740func (*awsAwsjson11_deserializeOpCreateCustomRoutingListener) ID() string { 741 return "OperationDeserializer" 742} 743 744func (m *awsAwsjson11_deserializeOpCreateCustomRoutingListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 745 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 746) { 747 out, metadata, err = next.HandleDeserialize(ctx, in) 748 if err != nil { 749 return out, metadata, err 750 } 751 752 response, ok := out.RawResponse.(*smithyhttp.Response) 753 if !ok { 754 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 755 } 756 757 if response.StatusCode < 200 || response.StatusCode >= 300 { 758 return out, metadata, awsAwsjson11_deserializeOpErrorCreateCustomRoutingListener(response, &metadata) 759 } 760 output := &CreateCustomRoutingListenerOutput{} 761 out.Result = output 762 763 var buff [1024]byte 764 ringBuffer := smithyio.NewRingBuffer(buff[:]) 765 766 body := io.TeeReader(response.Body, ringBuffer) 767 decoder := json.NewDecoder(body) 768 decoder.UseNumber() 769 var shape interface{} 770 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 771 var snapshot bytes.Buffer 772 io.Copy(&snapshot, ringBuffer) 773 err = &smithy.DeserializationError{ 774 Err: fmt.Errorf("failed to decode response body, %w", err), 775 Snapshot: snapshot.Bytes(), 776 } 777 return out, metadata, err 778 } 779 780 err = awsAwsjson11_deserializeOpDocumentCreateCustomRoutingListenerOutput(&output, shape) 781 if err != nil { 782 var snapshot bytes.Buffer 783 io.Copy(&snapshot, ringBuffer) 784 err = &smithy.DeserializationError{ 785 Err: fmt.Errorf("failed to decode response body, %w", err), 786 Snapshot: snapshot.Bytes(), 787 } 788 return out, metadata, err 789 } 790 791 return out, metadata, err 792} 793 794func awsAwsjson11_deserializeOpErrorCreateCustomRoutingListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 795 var errorBuffer bytes.Buffer 796 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 797 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 798 } 799 errorBody := bytes.NewReader(errorBuffer.Bytes()) 800 801 errorCode := "UnknownError" 802 errorMessage := errorCode 803 804 code := response.Header.Get("X-Amzn-ErrorType") 805 if len(code) != 0 { 806 errorCode = restjson.SanitizeErrorCode(code) 807 } 808 809 var buff [1024]byte 810 ringBuffer := smithyio.NewRingBuffer(buff[:]) 811 812 body := io.TeeReader(errorBody, ringBuffer) 813 decoder := json.NewDecoder(body) 814 decoder.UseNumber() 815 code, message, err := restjson.GetErrorInfo(decoder) 816 if err != nil { 817 var snapshot bytes.Buffer 818 io.Copy(&snapshot, ringBuffer) 819 err = &smithy.DeserializationError{ 820 Err: fmt.Errorf("failed to decode response body, %w", err), 821 Snapshot: snapshot.Bytes(), 822 } 823 return err 824 } 825 826 errorBody.Seek(0, io.SeekStart) 827 if len(code) != 0 { 828 errorCode = restjson.SanitizeErrorCode(code) 829 } 830 if len(message) != 0 { 831 errorMessage = message 832 } 833 834 switch { 835 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 836 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 837 838 case strings.EqualFold("InternalServiceErrorException", errorCode): 839 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 840 841 case strings.EqualFold("InvalidArgumentException", errorCode): 842 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 843 844 case strings.EqualFold("InvalidPortRangeException", errorCode): 845 return awsAwsjson11_deserializeErrorInvalidPortRangeException(response, errorBody) 846 847 case strings.EqualFold("LimitExceededException", errorCode): 848 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 849 850 default: 851 genericError := &smithy.GenericAPIError{ 852 Code: errorCode, 853 Message: errorMessage, 854 } 855 return genericError 856 857 } 858} 859 860type awsAwsjson11_deserializeOpCreateEndpointGroup struct { 861} 862 863func (*awsAwsjson11_deserializeOpCreateEndpointGroup) ID() string { 864 return "OperationDeserializer" 865} 866 867func (m *awsAwsjson11_deserializeOpCreateEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 868 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 869) { 870 out, metadata, err = next.HandleDeserialize(ctx, in) 871 if err != nil { 872 return out, metadata, err 873 } 874 875 response, ok := out.RawResponse.(*smithyhttp.Response) 876 if !ok { 877 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 878 } 879 880 if response.StatusCode < 200 || response.StatusCode >= 300 { 881 return out, metadata, awsAwsjson11_deserializeOpErrorCreateEndpointGroup(response, &metadata) 882 } 883 output := &CreateEndpointGroupOutput{} 884 out.Result = output 885 886 var buff [1024]byte 887 ringBuffer := smithyio.NewRingBuffer(buff[:]) 888 889 body := io.TeeReader(response.Body, ringBuffer) 890 decoder := json.NewDecoder(body) 891 decoder.UseNumber() 892 var shape interface{} 893 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 894 var snapshot bytes.Buffer 895 io.Copy(&snapshot, ringBuffer) 896 err = &smithy.DeserializationError{ 897 Err: fmt.Errorf("failed to decode response body, %w", err), 898 Snapshot: snapshot.Bytes(), 899 } 900 return out, metadata, err 901 } 902 903 err = awsAwsjson11_deserializeOpDocumentCreateEndpointGroupOutput(&output, shape) 904 if err != nil { 905 var snapshot bytes.Buffer 906 io.Copy(&snapshot, ringBuffer) 907 err = &smithy.DeserializationError{ 908 Err: fmt.Errorf("failed to decode response body, %w", err), 909 Snapshot: snapshot.Bytes(), 910 } 911 return out, metadata, err 912 } 913 914 return out, metadata, err 915} 916 917func awsAwsjson11_deserializeOpErrorCreateEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 918 var errorBuffer bytes.Buffer 919 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 920 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 921 } 922 errorBody := bytes.NewReader(errorBuffer.Bytes()) 923 924 errorCode := "UnknownError" 925 errorMessage := errorCode 926 927 code := response.Header.Get("X-Amzn-ErrorType") 928 if len(code) != 0 { 929 errorCode = restjson.SanitizeErrorCode(code) 930 } 931 932 var buff [1024]byte 933 ringBuffer := smithyio.NewRingBuffer(buff[:]) 934 935 body := io.TeeReader(errorBody, ringBuffer) 936 decoder := json.NewDecoder(body) 937 decoder.UseNumber() 938 code, message, err := restjson.GetErrorInfo(decoder) 939 if err != nil { 940 var snapshot bytes.Buffer 941 io.Copy(&snapshot, ringBuffer) 942 err = &smithy.DeserializationError{ 943 Err: fmt.Errorf("failed to decode response body, %w", err), 944 Snapshot: snapshot.Bytes(), 945 } 946 return err 947 } 948 949 errorBody.Seek(0, io.SeekStart) 950 if len(code) != 0 { 951 errorCode = restjson.SanitizeErrorCode(code) 952 } 953 if len(message) != 0 { 954 errorMessage = message 955 } 956 957 switch { 958 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 959 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 960 961 case strings.EqualFold("AccessDeniedException", errorCode): 962 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 963 964 case strings.EqualFold("EndpointGroupAlreadyExistsException", errorCode): 965 return awsAwsjson11_deserializeErrorEndpointGroupAlreadyExistsException(response, errorBody) 966 967 case strings.EqualFold("InternalServiceErrorException", errorCode): 968 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 969 970 case strings.EqualFold("InvalidArgumentException", errorCode): 971 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 972 973 case strings.EqualFold("LimitExceededException", errorCode): 974 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 975 976 case strings.EqualFold("ListenerNotFoundException", errorCode): 977 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 978 979 default: 980 genericError := &smithy.GenericAPIError{ 981 Code: errorCode, 982 Message: errorMessage, 983 } 984 return genericError 985 986 } 987} 988 989type awsAwsjson11_deserializeOpCreateListener struct { 990} 991 992func (*awsAwsjson11_deserializeOpCreateListener) ID() string { 993 return "OperationDeserializer" 994} 995 996func (m *awsAwsjson11_deserializeOpCreateListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 997 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 998) { 999 out, metadata, err = next.HandleDeserialize(ctx, in) 1000 if err != nil { 1001 return out, metadata, err 1002 } 1003 1004 response, ok := out.RawResponse.(*smithyhttp.Response) 1005 if !ok { 1006 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1007 } 1008 1009 if response.StatusCode < 200 || response.StatusCode >= 300 { 1010 return out, metadata, awsAwsjson11_deserializeOpErrorCreateListener(response, &metadata) 1011 } 1012 output := &CreateListenerOutput{} 1013 out.Result = output 1014 1015 var buff [1024]byte 1016 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1017 1018 body := io.TeeReader(response.Body, ringBuffer) 1019 decoder := json.NewDecoder(body) 1020 decoder.UseNumber() 1021 var shape interface{} 1022 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1023 var snapshot bytes.Buffer 1024 io.Copy(&snapshot, ringBuffer) 1025 err = &smithy.DeserializationError{ 1026 Err: fmt.Errorf("failed to decode response body, %w", err), 1027 Snapshot: snapshot.Bytes(), 1028 } 1029 return out, metadata, err 1030 } 1031 1032 err = awsAwsjson11_deserializeOpDocumentCreateListenerOutput(&output, shape) 1033 if err != nil { 1034 var snapshot bytes.Buffer 1035 io.Copy(&snapshot, ringBuffer) 1036 err = &smithy.DeserializationError{ 1037 Err: fmt.Errorf("failed to decode response body, %w", err), 1038 Snapshot: snapshot.Bytes(), 1039 } 1040 return out, metadata, err 1041 } 1042 1043 return out, metadata, err 1044} 1045 1046func awsAwsjson11_deserializeOpErrorCreateListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1047 var errorBuffer bytes.Buffer 1048 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1049 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1050 } 1051 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1052 1053 errorCode := "UnknownError" 1054 errorMessage := errorCode 1055 1056 code := response.Header.Get("X-Amzn-ErrorType") 1057 if len(code) != 0 { 1058 errorCode = restjson.SanitizeErrorCode(code) 1059 } 1060 1061 var buff [1024]byte 1062 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1063 1064 body := io.TeeReader(errorBody, ringBuffer) 1065 decoder := json.NewDecoder(body) 1066 decoder.UseNumber() 1067 code, message, err := restjson.GetErrorInfo(decoder) 1068 if err != nil { 1069 var snapshot bytes.Buffer 1070 io.Copy(&snapshot, ringBuffer) 1071 err = &smithy.DeserializationError{ 1072 Err: fmt.Errorf("failed to decode response body, %w", err), 1073 Snapshot: snapshot.Bytes(), 1074 } 1075 return err 1076 } 1077 1078 errorBody.Seek(0, io.SeekStart) 1079 if len(code) != 0 { 1080 errorCode = restjson.SanitizeErrorCode(code) 1081 } 1082 if len(message) != 0 { 1083 errorMessage = message 1084 } 1085 1086 switch { 1087 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 1088 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 1089 1090 case strings.EqualFold("InternalServiceErrorException", errorCode): 1091 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1092 1093 case strings.EqualFold("InvalidArgumentException", errorCode): 1094 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1095 1096 case strings.EqualFold("InvalidPortRangeException", errorCode): 1097 return awsAwsjson11_deserializeErrorInvalidPortRangeException(response, errorBody) 1098 1099 case strings.EqualFold("LimitExceededException", errorCode): 1100 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 1101 1102 default: 1103 genericError := &smithy.GenericAPIError{ 1104 Code: errorCode, 1105 Message: errorMessage, 1106 } 1107 return genericError 1108 1109 } 1110} 1111 1112type awsAwsjson11_deserializeOpDeleteAccelerator struct { 1113} 1114 1115func (*awsAwsjson11_deserializeOpDeleteAccelerator) ID() string { 1116 return "OperationDeserializer" 1117} 1118 1119func (m *awsAwsjson11_deserializeOpDeleteAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1120 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1121) { 1122 out, metadata, err = next.HandleDeserialize(ctx, in) 1123 if err != nil { 1124 return out, metadata, err 1125 } 1126 1127 response, ok := out.RawResponse.(*smithyhttp.Response) 1128 if !ok { 1129 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1130 } 1131 1132 if response.StatusCode < 200 || response.StatusCode >= 300 { 1133 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAccelerator(response, &metadata) 1134 } 1135 output := &DeleteAcceleratorOutput{} 1136 out.Result = output 1137 1138 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1139 return out, metadata, &smithy.DeserializationError{ 1140 Err: fmt.Errorf("failed to discard response body, %w", err), 1141 } 1142 } 1143 1144 return out, metadata, err 1145} 1146 1147func awsAwsjson11_deserializeOpErrorDeleteAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1148 var errorBuffer bytes.Buffer 1149 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1150 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1151 } 1152 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1153 1154 errorCode := "UnknownError" 1155 errorMessage := errorCode 1156 1157 code := response.Header.Get("X-Amzn-ErrorType") 1158 if len(code) != 0 { 1159 errorCode = restjson.SanitizeErrorCode(code) 1160 } 1161 1162 var buff [1024]byte 1163 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1164 1165 body := io.TeeReader(errorBody, ringBuffer) 1166 decoder := json.NewDecoder(body) 1167 decoder.UseNumber() 1168 code, message, err := restjson.GetErrorInfo(decoder) 1169 if err != nil { 1170 var snapshot bytes.Buffer 1171 io.Copy(&snapshot, ringBuffer) 1172 err = &smithy.DeserializationError{ 1173 Err: fmt.Errorf("failed to decode response body, %w", err), 1174 Snapshot: snapshot.Bytes(), 1175 } 1176 return err 1177 } 1178 1179 errorBody.Seek(0, io.SeekStart) 1180 if len(code) != 0 { 1181 errorCode = restjson.SanitizeErrorCode(code) 1182 } 1183 if len(message) != 0 { 1184 errorMessage = message 1185 } 1186 1187 switch { 1188 case strings.EqualFold("AcceleratorNotDisabledException", errorCode): 1189 return awsAwsjson11_deserializeErrorAcceleratorNotDisabledException(response, errorBody) 1190 1191 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 1192 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 1193 1194 case strings.EqualFold("AssociatedListenerFoundException", errorCode): 1195 return awsAwsjson11_deserializeErrorAssociatedListenerFoundException(response, errorBody) 1196 1197 case strings.EqualFold("InternalServiceErrorException", errorCode): 1198 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1199 1200 case strings.EqualFold("InvalidArgumentException", errorCode): 1201 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1202 1203 default: 1204 genericError := &smithy.GenericAPIError{ 1205 Code: errorCode, 1206 Message: errorMessage, 1207 } 1208 return genericError 1209 1210 } 1211} 1212 1213type awsAwsjson11_deserializeOpDeleteCustomRoutingAccelerator struct { 1214} 1215 1216func (*awsAwsjson11_deserializeOpDeleteCustomRoutingAccelerator) ID() string { 1217 return "OperationDeserializer" 1218} 1219 1220func (m *awsAwsjson11_deserializeOpDeleteCustomRoutingAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1221 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1222) { 1223 out, metadata, err = next.HandleDeserialize(ctx, in) 1224 if err != nil { 1225 return out, metadata, err 1226 } 1227 1228 response, ok := out.RawResponse.(*smithyhttp.Response) 1229 if !ok { 1230 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1231 } 1232 1233 if response.StatusCode < 200 || response.StatusCode >= 300 { 1234 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCustomRoutingAccelerator(response, &metadata) 1235 } 1236 output := &DeleteCustomRoutingAcceleratorOutput{} 1237 out.Result = output 1238 1239 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1240 return out, metadata, &smithy.DeserializationError{ 1241 Err: fmt.Errorf("failed to discard response body, %w", err), 1242 } 1243 } 1244 1245 return out, metadata, err 1246} 1247 1248func awsAwsjson11_deserializeOpErrorDeleteCustomRoutingAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1249 var errorBuffer bytes.Buffer 1250 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1251 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1252 } 1253 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1254 1255 errorCode := "UnknownError" 1256 errorMessage := errorCode 1257 1258 code := response.Header.Get("X-Amzn-ErrorType") 1259 if len(code) != 0 { 1260 errorCode = restjson.SanitizeErrorCode(code) 1261 } 1262 1263 var buff [1024]byte 1264 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1265 1266 body := io.TeeReader(errorBody, ringBuffer) 1267 decoder := json.NewDecoder(body) 1268 decoder.UseNumber() 1269 code, message, err := restjson.GetErrorInfo(decoder) 1270 if err != nil { 1271 var snapshot bytes.Buffer 1272 io.Copy(&snapshot, ringBuffer) 1273 err = &smithy.DeserializationError{ 1274 Err: fmt.Errorf("failed to decode response body, %w", err), 1275 Snapshot: snapshot.Bytes(), 1276 } 1277 return err 1278 } 1279 1280 errorBody.Seek(0, io.SeekStart) 1281 if len(code) != 0 { 1282 errorCode = restjson.SanitizeErrorCode(code) 1283 } 1284 if len(message) != 0 { 1285 errorMessage = message 1286 } 1287 1288 switch { 1289 case strings.EqualFold("AcceleratorNotDisabledException", errorCode): 1290 return awsAwsjson11_deserializeErrorAcceleratorNotDisabledException(response, errorBody) 1291 1292 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 1293 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 1294 1295 case strings.EqualFold("AssociatedListenerFoundException", errorCode): 1296 return awsAwsjson11_deserializeErrorAssociatedListenerFoundException(response, errorBody) 1297 1298 case strings.EqualFold("InternalServiceErrorException", errorCode): 1299 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1300 1301 case strings.EqualFold("InvalidArgumentException", errorCode): 1302 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1303 1304 default: 1305 genericError := &smithy.GenericAPIError{ 1306 Code: errorCode, 1307 Message: errorMessage, 1308 } 1309 return genericError 1310 1311 } 1312} 1313 1314type awsAwsjson11_deserializeOpDeleteCustomRoutingEndpointGroup struct { 1315} 1316 1317func (*awsAwsjson11_deserializeOpDeleteCustomRoutingEndpointGroup) ID() string { 1318 return "OperationDeserializer" 1319} 1320 1321func (m *awsAwsjson11_deserializeOpDeleteCustomRoutingEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1322 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1323) { 1324 out, metadata, err = next.HandleDeserialize(ctx, in) 1325 if err != nil { 1326 return out, metadata, err 1327 } 1328 1329 response, ok := out.RawResponse.(*smithyhttp.Response) 1330 if !ok { 1331 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1332 } 1333 1334 if response.StatusCode < 200 || response.StatusCode >= 300 { 1335 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCustomRoutingEndpointGroup(response, &metadata) 1336 } 1337 output := &DeleteCustomRoutingEndpointGroupOutput{} 1338 out.Result = output 1339 1340 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1341 return out, metadata, &smithy.DeserializationError{ 1342 Err: fmt.Errorf("failed to discard response body, %w", err), 1343 } 1344 } 1345 1346 return out, metadata, err 1347} 1348 1349func awsAwsjson11_deserializeOpErrorDeleteCustomRoutingEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1350 var errorBuffer bytes.Buffer 1351 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1352 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1353 } 1354 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1355 1356 errorCode := "UnknownError" 1357 errorMessage := errorCode 1358 1359 code := response.Header.Get("X-Amzn-ErrorType") 1360 if len(code) != 0 { 1361 errorCode = restjson.SanitizeErrorCode(code) 1362 } 1363 1364 var buff [1024]byte 1365 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1366 1367 body := io.TeeReader(errorBody, ringBuffer) 1368 decoder := json.NewDecoder(body) 1369 decoder.UseNumber() 1370 code, message, err := restjson.GetErrorInfo(decoder) 1371 if err != nil { 1372 var snapshot bytes.Buffer 1373 io.Copy(&snapshot, ringBuffer) 1374 err = &smithy.DeserializationError{ 1375 Err: fmt.Errorf("failed to decode response body, %w", err), 1376 Snapshot: snapshot.Bytes(), 1377 } 1378 return err 1379 } 1380 1381 errorBody.Seek(0, io.SeekStart) 1382 if len(code) != 0 { 1383 errorCode = restjson.SanitizeErrorCode(code) 1384 } 1385 if len(message) != 0 { 1386 errorMessage = message 1387 } 1388 1389 switch { 1390 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 1391 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 1392 1393 case strings.EqualFold("InternalServiceErrorException", errorCode): 1394 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1395 1396 case strings.EqualFold("InvalidArgumentException", errorCode): 1397 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1398 1399 default: 1400 genericError := &smithy.GenericAPIError{ 1401 Code: errorCode, 1402 Message: errorMessage, 1403 } 1404 return genericError 1405 1406 } 1407} 1408 1409type awsAwsjson11_deserializeOpDeleteCustomRoutingListener struct { 1410} 1411 1412func (*awsAwsjson11_deserializeOpDeleteCustomRoutingListener) ID() string { 1413 return "OperationDeserializer" 1414} 1415 1416func (m *awsAwsjson11_deserializeOpDeleteCustomRoutingListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1417 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1418) { 1419 out, metadata, err = next.HandleDeserialize(ctx, in) 1420 if err != nil { 1421 return out, metadata, err 1422 } 1423 1424 response, ok := out.RawResponse.(*smithyhttp.Response) 1425 if !ok { 1426 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1427 } 1428 1429 if response.StatusCode < 200 || response.StatusCode >= 300 { 1430 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCustomRoutingListener(response, &metadata) 1431 } 1432 output := &DeleteCustomRoutingListenerOutput{} 1433 out.Result = output 1434 1435 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1436 return out, metadata, &smithy.DeserializationError{ 1437 Err: fmt.Errorf("failed to discard response body, %w", err), 1438 } 1439 } 1440 1441 return out, metadata, err 1442} 1443 1444func awsAwsjson11_deserializeOpErrorDeleteCustomRoutingListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1445 var errorBuffer bytes.Buffer 1446 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1447 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1448 } 1449 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1450 1451 errorCode := "UnknownError" 1452 errorMessage := errorCode 1453 1454 code := response.Header.Get("X-Amzn-ErrorType") 1455 if len(code) != 0 { 1456 errorCode = restjson.SanitizeErrorCode(code) 1457 } 1458 1459 var buff [1024]byte 1460 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1461 1462 body := io.TeeReader(errorBody, ringBuffer) 1463 decoder := json.NewDecoder(body) 1464 decoder.UseNumber() 1465 code, message, err := restjson.GetErrorInfo(decoder) 1466 if err != nil { 1467 var snapshot bytes.Buffer 1468 io.Copy(&snapshot, ringBuffer) 1469 err = &smithy.DeserializationError{ 1470 Err: fmt.Errorf("failed to decode response body, %w", err), 1471 Snapshot: snapshot.Bytes(), 1472 } 1473 return err 1474 } 1475 1476 errorBody.Seek(0, io.SeekStart) 1477 if len(code) != 0 { 1478 errorCode = restjson.SanitizeErrorCode(code) 1479 } 1480 if len(message) != 0 { 1481 errorMessage = message 1482 } 1483 1484 switch { 1485 case strings.EqualFold("AssociatedEndpointGroupFoundException", errorCode): 1486 return awsAwsjson11_deserializeErrorAssociatedEndpointGroupFoundException(response, errorBody) 1487 1488 case strings.EqualFold("InternalServiceErrorException", errorCode): 1489 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1490 1491 case strings.EqualFold("InvalidArgumentException", errorCode): 1492 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1493 1494 case strings.EqualFold("ListenerNotFoundException", errorCode): 1495 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 1496 1497 default: 1498 genericError := &smithy.GenericAPIError{ 1499 Code: errorCode, 1500 Message: errorMessage, 1501 } 1502 return genericError 1503 1504 } 1505} 1506 1507type awsAwsjson11_deserializeOpDeleteEndpointGroup struct { 1508} 1509 1510func (*awsAwsjson11_deserializeOpDeleteEndpointGroup) ID() string { 1511 return "OperationDeserializer" 1512} 1513 1514func (m *awsAwsjson11_deserializeOpDeleteEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1515 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1516) { 1517 out, metadata, err = next.HandleDeserialize(ctx, in) 1518 if err != nil { 1519 return out, metadata, err 1520 } 1521 1522 response, ok := out.RawResponse.(*smithyhttp.Response) 1523 if !ok { 1524 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1525 } 1526 1527 if response.StatusCode < 200 || response.StatusCode >= 300 { 1528 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteEndpointGroup(response, &metadata) 1529 } 1530 output := &DeleteEndpointGroupOutput{} 1531 out.Result = output 1532 1533 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1534 return out, metadata, &smithy.DeserializationError{ 1535 Err: fmt.Errorf("failed to discard response body, %w", err), 1536 } 1537 } 1538 1539 return out, metadata, err 1540} 1541 1542func awsAwsjson11_deserializeOpErrorDeleteEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1543 var errorBuffer bytes.Buffer 1544 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1545 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1546 } 1547 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1548 1549 errorCode := "UnknownError" 1550 errorMessage := errorCode 1551 1552 code := response.Header.Get("X-Amzn-ErrorType") 1553 if len(code) != 0 { 1554 errorCode = restjson.SanitizeErrorCode(code) 1555 } 1556 1557 var buff [1024]byte 1558 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1559 1560 body := io.TeeReader(errorBody, ringBuffer) 1561 decoder := json.NewDecoder(body) 1562 decoder.UseNumber() 1563 code, message, err := restjson.GetErrorInfo(decoder) 1564 if err != nil { 1565 var snapshot bytes.Buffer 1566 io.Copy(&snapshot, ringBuffer) 1567 err = &smithy.DeserializationError{ 1568 Err: fmt.Errorf("failed to decode response body, %w", err), 1569 Snapshot: snapshot.Bytes(), 1570 } 1571 return err 1572 } 1573 1574 errorBody.Seek(0, io.SeekStart) 1575 if len(code) != 0 { 1576 errorCode = restjson.SanitizeErrorCode(code) 1577 } 1578 if len(message) != 0 { 1579 errorMessage = message 1580 } 1581 1582 switch { 1583 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 1584 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 1585 1586 case strings.EqualFold("InternalServiceErrorException", errorCode): 1587 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1588 1589 case strings.EqualFold("InvalidArgumentException", errorCode): 1590 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1591 1592 default: 1593 genericError := &smithy.GenericAPIError{ 1594 Code: errorCode, 1595 Message: errorMessage, 1596 } 1597 return genericError 1598 1599 } 1600} 1601 1602type awsAwsjson11_deserializeOpDeleteListener struct { 1603} 1604 1605func (*awsAwsjson11_deserializeOpDeleteListener) ID() string { 1606 return "OperationDeserializer" 1607} 1608 1609func (m *awsAwsjson11_deserializeOpDeleteListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1610 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1611) { 1612 out, metadata, err = next.HandleDeserialize(ctx, in) 1613 if err != nil { 1614 return out, metadata, err 1615 } 1616 1617 response, ok := out.RawResponse.(*smithyhttp.Response) 1618 if !ok { 1619 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1620 } 1621 1622 if response.StatusCode < 200 || response.StatusCode >= 300 { 1623 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteListener(response, &metadata) 1624 } 1625 output := &DeleteListenerOutput{} 1626 out.Result = output 1627 1628 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1629 return out, metadata, &smithy.DeserializationError{ 1630 Err: fmt.Errorf("failed to discard response body, %w", err), 1631 } 1632 } 1633 1634 return out, metadata, err 1635} 1636 1637func awsAwsjson11_deserializeOpErrorDeleteListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1638 var errorBuffer bytes.Buffer 1639 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1640 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1641 } 1642 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1643 1644 errorCode := "UnknownError" 1645 errorMessage := errorCode 1646 1647 code := response.Header.Get("X-Amzn-ErrorType") 1648 if len(code) != 0 { 1649 errorCode = restjson.SanitizeErrorCode(code) 1650 } 1651 1652 var buff [1024]byte 1653 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1654 1655 body := io.TeeReader(errorBody, ringBuffer) 1656 decoder := json.NewDecoder(body) 1657 decoder.UseNumber() 1658 code, message, err := restjson.GetErrorInfo(decoder) 1659 if err != nil { 1660 var snapshot bytes.Buffer 1661 io.Copy(&snapshot, ringBuffer) 1662 err = &smithy.DeserializationError{ 1663 Err: fmt.Errorf("failed to decode response body, %w", err), 1664 Snapshot: snapshot.Bytes(), 1665 } 1666 return err 1667 } 1668 1669 errorBody.Seek(0, io.SeekStart) 1670 if len(code) != 0 { 1671 errorCode = restjson.SanitizeErrorCode(code) 1672 } 1673 if len(message) != 0 { 1674 errorMessage = message 1675 } 1676 1677 switch { 1678 case strings.EqualFold("AssociatedEndpointGroupFoundException", errorCode): 1679 return awsAwsjson11_deserializeErrorAssociatedEndpointGroupFoundException(response, errorBody) 1680 1681 case strings.EqualFold("InternalServiceErrorException", errorCode): 1682 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1683 1684 case strings.EqualFold("InvalidArgumentException", errorCode): 1685 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1686 1687 case strings.EqualFold("ListenerNotFoundException", errorCode): 1688 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 1689 1690 default: 1691 genericError := &smithy.GenericAPIError{ 1692 Code: errorCode, 1693 Message: errorMessage, 1694 } 1695 return genericError 1696 1697 } 1698} 1699 1700type awsAwsjson11_deserializeOpDenyCustomRoutingTraffic struct { 1701} 1702 1703func (*awsAwsjson11_deserializeOpDenyCustomRoutingTraffic) ID() string { 1704 return "OperationDeserializer" 1705} 1706 1707func (m *awsAwsjson11_deserializeOpDenyCustomRoutingTraffic) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1708 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1709) { 1710 out, metadata, err = next.HandleDeserialize(ctx, in) 1711 if err != nil { 1712 return out, metadata, err 1713 } 1714 1715 response, ok := out.RawResponse.(*smithyhttp.Response) 1716 if !ok { 1717 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1718 } 1719 1720 if response.StatusCode < 200 || response.StatusCode >= 300 { 1721 return out, metadata, awsAwsjson11_deserializeOpErrorDenyCustomRoutingTraffic(response, &metadata) 1722 } 1723 output := &DenyCustomRoutingTrafficOutput{} 1724 out.Result = output 1725 1726 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1727 return out, metadata, &smithy.DeserializationError{ 1728 Err: fmt.Errorf("failed to discard response body, %w", err), 1729 } 1730 } 1731 1732 return out, metadata, err 1733} 1734 1735func awsAwsjson11_deserializeOpErrorDenyCustomRoutingTraffic(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1736 var errorBuffer bytes.Buffer 1737 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1738 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1739 } 1740 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1741 1742 errorCode := "UnknownError" 1743 errorMessage := errorCode 1744 1745 code := response.Header.Get("X-Amzn-ErrorType") 1746 if len(code) != 0 { 1747 errorCode = restjson.SanitizeErrorCode(code) 1748 } 1749 1750 var buff [1024]byte 1751 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1752 1753 body := io.TeeReader(errorBody, ringBuffer) 1754 decoder := json.NewDecoder(body) 1755 decoder.UseNumber() 1756 code, message, err := restjson.GetErrorInfo(decoder) 1757 if err != nil { 1758 var snapshot bytes.Buffer 1759 io.Copy(&snapshot, ringBuffer) 1760 err = &smithy.DeserializationError{ 1761 Err: fmt.Errorf("failed to decode response body, %w", err), 1762 Snapshot: snapshot.Bytes(), 1763 } 1764 return err 1765 } 1766 1767 errorBody.Seek(0, io.SeekStart) 1768 if len(code) != 0 { 1769 errorCode = restjson.SanitizeErrorCode(code) 1770 } 1771 if len(message) != 0 { 1772 errorMessage = message 1773 } 1774 1775 switch { 1776 case strings.EqualFold("InternalServiceErrorException", errorCode): 1777 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1778 1779 case strings.EqualFold("InvalidArgumentException", errorCode): 1780 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1781 1782 default: 1783 genericError := &smithy.GenericAPIError{ 1784 Code: errorCode, 1785 Message: errorMessage, 1786 } 1787 return genericError 1788 1789 } 1790} 1791 1792type awsAwsjson11_deserializeOpDeprovisionByoipCidr struct { 1793} 1794 1795func (*awsAwsjson11_deserializeOpDeprovisionByoipCidr) ID() string { 1796 return "OperationDeserializer" 1797} 1798 1799func (m *awsAwsjson11_deserializeOpDeprovisionByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1800 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1801) { 1802 out, metadata, err = next.HandleDeserialize(ctx, in) 1803 if err != nil { 1804 return out, metadata, err 1805 } 1806 1807 response, ok := out.RawResponse.(*smithyhttp.Response) 1808 if !ok { 1809 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1810 } 1811 1812 if response.StatusCode < 200 || response.StatusCode >= 300 { 1813 return out, metadata, awsAwsjson11_deserializeOpErrorDeprovisionByoipCidr(response, &metadata) 1814 } 1815 output := &DeprovisionByoipCidrOutput{} 1816 out.Result = output 1817 1818 var buff [1024]byte 1819 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1820 1821 body := io.TeeReader(response.Body, ringBuffer) 1822 decoder := json.NewDecoder(body) 1823 decoder.UseNumber() 1824 var shape interface{} 1825 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1826 var snapshot bytes.Buffer 1827 io.Copy(&snapshot, ringBuffer) 1828 err = &smithy.DeserializationError{ 1829 Err: fmt.Errorf("failed to decode response body, %w", err), 1830 Snapshot: snapshot.Bytes(), 1831 } 1832 return out, metadata, err 1833 } 1834 1835 err = awsAwsjson11_deserializeOpDocumentDeprovisionByoipCidrOutput(&output, shape) 1836 if err != nil { 1837 var snapshot bytes.Buffer 1838 io.Copy(&snapshot, ringBuffer) 1839 err = &smithy.DeserializationError{ 1840 Err: fmt.Errorf("failed to decode response body, %w", err), 1841 Snapshot: snapshot.Bytes(), 1842 } 1843 return out, metadata, err 1844 } 1845 1846 return out, metadata, err 1847} 1848 1849func awsAwsjson11_deserializeOpErrorDeprovisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1850 var errorBuffer bytes.Buffer 1851 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1852 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1853 } 1854 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1855 1856 errorCode := "UnknownError" 1857 errorMessage := errorCode 1858 1859 code := response.Header.Get("X-Amzn-ErrorType") 1860 if len(code) != 0 { 1861 errorCode = restjson.SanitizeErrorCode(code) 1862 } 1863 1864 var buff [1024]byte 1865 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1866 1867 body := io.TeeReader(errorBody, ringBuffer) 1868 decoder := json.NewDecoder(body) 1869 decoder.UseNumber() 1870 code, message, err := restjson.GetErrorInfo(decoder) 1871 if err != nil { 1872 var snapshot bytes.Buffer 1873 io.Copy(&snapshot, ringBuffer) 1874 err = &smithy.DeserializationError{ 1875 Err: fmt.Errorf("failed to decode response body, %w", err), 1876 Snapshot: snapshot.Bytes(), 1877 } 1878 return err 1879 } 1880 1881 errorBody.Seek(0, io.SeekStart) 1882 if len(code) != 0 { 1883 errorCode = restjson.SanitizeErrorCode(code) 1884 } 1885 if len(message) != 0 { 1886 errorMessage = message 1887 } 1888 1889 switch { 1890 case strings.EqualFold("AccessDeniedException", errorCode): 1891 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 1892 1893 case strings.EqualFold("ByoipCidrNotFoundException", errorCode): 1894 return awsAwsjson11_deserializeErrorByoipCidrNotFoundException(response, errorBody) 1895 1896 case strings.EqualFold("IncorrectCidrStateException", errorCode): 1897 return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) 1898 1899 case strings.EqualFold("InternalServiceErrorException", errorCode): 1900 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 1901 1902 case strings.EqualFold("InvalidArgumentException", errorCode): 1903 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 1904 1905 default: 1906 genericError := &smithy.GenericAPIError{ 1907 Code: errorCode, 1908 Message: errorMessage, 1909 } 1910 return genericError 1911 1912 } 1913} 1914 1915type awsAwsjson11_deserializeOpDescribeAccelerator struct { 1916} 1917 1918func (*awsAwsjson11_deserializeOpDescribeAccelerator) ID() string { 1919 return "OperationDeserializer" 1920} 1921 1922func (m *awsAwsjson11_deserializeOpDescribeAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1923 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1924) { 1925 out, metadata, err = next.HandleDeserialize(ctx, in) 1926 if err != nil { 1927 return out, metadata, err 1928 } 1929 1930 response, ok := out.RawResponse.(*smithyhttp.Response) 1931 if !ok { 1932 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1933 } 1934 1935 if response.StatusCode < 200 || response.StatusCode >= 300 { 1936 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAccelerator(response, &metadata) 1937 } 1938 output := &DescribeAcceleratorOutput{} 1939 out.Result = output 1940 1941 var buff [1024]byte 1942 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1943 1944 body := io.TeeReader(response.Body, ringBuffer) 1945 decoder := json.NewDecoder(body) 1946 decoder.UseNumber() 1947 var shape interface{} 1948 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1949 var snapshot bytes.Buffer 1950 io.Copy(&snapshot, ringBuffer) 1951 err = &smithy.DeserializationError{ 1952 Err: fmt.Errorf("failed to decode response body, %w", err), 1953 Snapshot: snapshot.Bytes(), 1954 } 1955 return out, metadata, err 1956 } 1957 1958 err = awsAwsjson11_deserializeOpDocumentDescribeAcceleratorOutput(&output, shape) 1959 if err != nil { 1960 var snapshot bytes.Buffer 1961 io.Copy(&snapshot, ringBuffer) 1962 err = &smithy.DeserializationError{ 1963 Err: fmt.Errorf("failed to decode response body, %w", err), 1964 Snapshot: snapshot.Bytes(), 1965 } 1966 return out, metadata, err 1967 } 1968 1969 return out, metadata, err 1970} 1971 1972func awsAwsjson11_deserializeOpErrorDescribeAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1973 var errorBuffer bytes.Buffer 1974 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1975 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1976 } 1977 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1978 1979 errorCode := "UnknownError" 1980 errorMessage := errorCode 1981 1982 code := response.Header.Get("X-Amzn-ErrorType") 1983 if len(code) != 0 { 1984 errorCode = restjson.SanitizeErrorCode(code) 1985 } 1986 1987 var buff [1024]byte 1988 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1989 1990 body := io.TeeReader(errorBody, ringBuffer) 1991 decoder := json.NewDecoder(body) 1992 decoder.UseNumber() 1993 code, message, err := restjson.GetErrorInfo(decoder) 1994 if err != nil { 1995 var snapshot bytes.Buffer 1996 io.Copy(&snapshot, ringBuffer) 1997 err = &smithy.DeserializationError{ 1998 Err: fmt.Errorf("failed to decode response body, %w", err), 1999 Snapshot: snapshot.Bytes(), 2000 } 2001 return err 2002 } 2003 2004 errorBody.Seek(0, io.SeekStart) 2005 if len(code) != 0 { 2006 errorCode = restjson.SanitizeErrorCode(code) 2007 } 2008 if len(message) != 0 { 2009 errorMessage = message 2010 } 2011 2012 switch { 2013 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 2014 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 2015 2016 case strings.EqualFold("InternalServiceErrorException", errorCode): 2017 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2018 2019 case strings.EqualFold("InvalidArgumentException", errorCode): 2020 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2021 2022 default: 2023 genericError := &smithy.GenericAPIError{ 2024 Code: errorCode, 2025 Message: errorMessage, 2026 } 2027 return genericError 2028 2029 } 2030} 2031 2032type awsAwsjson11_deserializeOpDescribeAcceleratorAttributes struct { 2033} 2034 2035func (*awsAwsjson11_deserializeOpDescribeAcceleratorAttributes) ID() string { 2036 return "OperationDeserializer" 2037} 2038 2039func (m *awsAwsjson11_deserializeOpDescribeAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2040 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2041) { 2042 out, metadata, err = next.HandleDeserialize(ctx, in) 2043 if err != nil { 2044 return out, metadata, err 2045 } 2046 2047 response, ok := out.RawResponse.(*smithyhttp.Response) 2048 if !ok { 2049 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2050 } 2051 2052 if response.StatusCode < 200 || response.StatusCode >= 300 { 2053 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAcceleratorAttributes(response, &metadata) 2054 } 2055 output := &DescribeAcceleratorAttributesOutput{} 2056 out.Result = output 2057 2058 var buff [1024]byte 2059 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2060 2061 body := io.TeeReader(response.Body, ringBuffer) 2062 decoder := json.NewDecoder(body) 2063 decoder.UseNumber() 2064 var shape interface{} 2065 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2066 var snapshot bytes.Buffer 2067 io.Copy(&snapshot, ringBuffer) 2068 err = &smithy.DeserializationError{ 2069 Err: fmt.Errorf("failed to decode response body, %w", err), 2070 Snapshot: snapshot.Bytes(), 2071 } 2072 return out, metadata, err 2073 } 2074 2075 err = awsAwsjson11_deserializeOpDocumentDescribeAcceleratorAttributesOutput(&output, shape) 2076 if err != nil { 2077 var snapshot bytes.Buffer 2078 io.Copy(&snapshot, ringBuffer) 2079 err = &smithy.DeserializationError{ 2080 Err: fmt.Errorf("failed to decode response body, %w", err), 2081 Snapshot: snapshot.Bytes(), 2082 } 2083 return out, metadata, err 2084 } 2085 2086 return out, metadata, err 2087} 2088 2089func awsAwsjson11_deserializeOpErrorDescribeAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2090 var errorBuffer bytes.Buffer 2091 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2092 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2093 } 2094 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2095 2096 errorCode := "UnknownError" 2097 errorMessage := errorCode 2098 2099 code := response.Header.Get("X-Amzn-ErrorType") 2100 if len(code) != 0 { 2101 errorCode = restjson.SanitizeErrorCode(code) 2102 } 2103 2104 var buff [1024]byte 2105 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2106 2107 body := io.TeeReader(errorBody, ringBuffer) 2108 decoder := json.NewDecoder(body) 2109 decoder.UseNumber() 2110 code, message, err := restjson.GetErrorInfo(decoder) 2111 if err != nil { 2112 var snapshot bytes.Buffer 2113 io.Copy(&snapshot, ringBuffer) 2114 err = &smithy.DeserializationError{ 2115 Err: fmt.Errorf("failed to decode response body, %w", err), 2116 Snapshot: snapshot.Bytes(), 2117 } 2118 return err 2119 } 2120 2121 errorBody.Seek(0, io.SeekStart) 2122 if len(code) != 0 { 2123 errorCode = restjson.SanitizeErrorCode(code) 2124 } 2125 if len(message) != 0 { 2126 errorMessage = message 2127 } 2128 2129 switch { 2130 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 2131 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 2132 2133 case strings.EqualFold("InternalServiceErrorException", errorCode): 2134 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2135 2136 case strings.EqualFold("InvalidArgumentException", errorCode): 2137 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2138 2139 default: 2140 genericError := &smithy.GenericAPIError{ 2141 Code: errorCode, 2142 Message: errorMessage, 2143 } 2144 return genericError 2145 2146 } 2147} 2148 2149type awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator struct { 2150} 2151 2152func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) ID() string { 2153 return "OperationDeserializer" 2154} 2155 2156func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2157 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2158) { 2159 out, metadata, err = next.HandleDeserialize(ctx, in) 2160 if err != nil { 2161 return out, metadata, err 2162 } 2163 2164 response, ok := out.RawResponse.(*smithyhttp.Response) 2165 if !ok { 2166 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2167 } 2168 2169 if response.StatusCode < 200 || response.StatusCode >= 300 { 2170 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response, &metadata) 2171 } 2172 output := &DescribeCustomRoutingAcceleratorOutput{} 2173 out.Result = output 2174 2175 var buff [1024]byte 2176 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2177 2178 body := io.TeeReader(response.Body, ringBuffer) 2179 decoder := json.NewDecoder(body) 2180 decoder.UseNumber() 2181 var shape interface{} 2182 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2183 var snapshot bytes.Buffer 2184 io.Copy(&snapshot, ringBuffer) 2185 err = &smithy.DeserializationError{ 2186 Err: fmt.Errorf("failed to decode response body, %w", err), 2187 Snapshot: snapshot.Bytes(), 2188 } 2189 return out, metadata, err 2190 } 2191 2192 err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorOutput(&output, shape) 2193 if err != nil { 2194 var snapshot bytes.Buffer 2195 io.Copy(&snapshot, ringBuffer) 2196 err = &smithy.DeserializationError{ 2197 Err: fmt.Errorf("failed to decode response body, %w", err), 2198 Snapshot: snapshot.Bytes(), 2199 } 2200 return out, metadata, err 2201 } 2202 2203 return out, metadata, err 2204} 2205 2206func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2207 var errorBuffer bytes.Buffer 2208 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2209 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2210 } 2211 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2212 2213 errorCode := "UnknownError" 2214 errorMessage := errorCode 2215 2216 code := response.Header.Get("X-Amzn-ErrorType") 2217 if len(code) != 0 { 2218 errorCode = restjson.SanitizeErrorCode(code) 2219 } 2220 2221 var buff [1024]byte 2222 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2223 2224 body := io.TeeReader(errorBody, ringBuffer) 2225 decoder := json.NewDecoder(body) 2226 decoder.UseNumber() 2227 code, message, err := restjson.GetErrorInfo(decoder) 2228 if err != nil { 2229 var snapshot bytes.Buffer 2230 io.Copy(&snapshot, ringBuffer) 2231 err = &smithy.DeserializationError{ 2232 Err: fmt.Errorf("failed to decode response body, %w", err), 2233 Snapshot: snapshot.Bytes(), 2234 } 2235 return err 2236 } 2237 2238 errorBody.Seek(0, io.SeekStart) 2239 if len(code) != 0 { 2240 errorCode = restjson.SanitizeErrorCode(code) 2241 } 2242 if len(message) != 0 { 2243 errorMessage = message 2244 } 2245 2246 switch { 2247 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 2248 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 2249 2250 case strings.EqualFold("InternalServiceErrorException", errorCode): 2251 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2252 2253 case strings.EqualFold("InvalidArgumentException", errorCode): 2254 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2255 2256 default: 2257 genericError := &smithy.GenericAPIError{ 2258 Code: errorCode, 2259 Message: errorMessage, 2260 } 2261 return genericError 2262 2263 } 2264} 2265 2266type awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes struct { 2267} 2268 2269func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) ID() string { 2270 return "OperationDeserializer" 2271} 2272 2273func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2274 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2275) { 2276 out, metadata, err = next.HandleDeserialize(ctx, in) 2277 if err != nil { 2278 return out, metadata, err 2279 } 2280 2281 response, ok := out.RawResponse.(*smithyhttp.Response) 2282 if !ok { 2283 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2284 } 2285 2286 if response.StatusCode < 200 || response.StatusCode >= 300 { 2287 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(response, &metadata) 2288 } 2289 output := &DescribeCustomRoutingAcceleratorAttributesOutput{} 2290 out.Result = output 2291 2292 var buff [1024]byte 2293 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2294 2295 body := io.TeeReader(response.Body, ringBuffer) 2296 decoder := json.NewDecoder(body) 2297 decoder.UseNumber() 2298 var shape interface{} 2299 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2300 var snapshot bytes.Buffer 2301 io.Copy(&snapshot, ringBuffer) 2302 err = &smithy.DeserializationError{ 2303 Err: fmt.Errorf("failed to decode response body, %w", err), 2304 Snapshot: snapshot.Bytes(), 2305 } 2306 return out, metadata, err 2307 } 2308 2309 err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorAttributesOutput(&output, shape) 2310 if err != nil { 2311 var snapshot bytes.Buffer 2312 io.Copy(&snapshot, ringBuffer) 2313 err = &smithy.DeserializationError{ 2314 Err: fmt.Errorf("failed to decode response body, %w", err), 2315 Snapshot: snapshot.Bytes(), 2316 } 2317 return out, metadata, err 2318 } 2319 2320 return out, metadata, err 2321} 2322 2323func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2324 var errorBuffer bytes.Buffer 2325 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2326 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2327 } 2328 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2329 2330 errorCode := "UnknownError" 2331 errorMessage := errorCode 2332 2333 code := response.Header.Get("X-Amzn-ErrorType") 2334 if len(code) != 0 { 2335 errorCode = restjson.SanitizeErrorCode(code) 2336 } 2337 2338 var buff [1024]byte 2339 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2340 2341 body := io.TeeReader(errorBody, ringBuffer) 2342 decoder := json.NewDecoder(body) 2343 decoder.UseNumber() 2344 code, message, err := restjson.GetErrorInfo(decoder) 2345 if err != nil { 2346 var snapshot bytes.Buffer 2347 io.Copy(&snapshot, ringBuffer) 2348 err = &smithy.DeserializationError{ 2349 Err: fmt.Errorf("failed to decode response body, %w", err), 2350 Snapshot: snapshot.Bytes(), 2351 } 2352 return err 2353 } 2354 2355 errorBody.Seek(0, io.SeekStart) 2356 if len(code) != 0 { 2357 errorCode = restjson.SanitizeErrorCode(code) 2358 } 2359 if len(message) != 0 { 2360 errorMessage = message 2361 } 2362 2363 switch { 2364 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 2365 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 2366 2367 case strings.EqualFold("InternalServiceErrorException", errorCode): 2368 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2369 2370 case strings.EqualFold("InvalidArgumentException", errorCode): 2371 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2372 2373 default: 2374 genericError := &smithy.GenericAPIError{ 2375 Code: errorCode, 2376 Message: errorMessage, 2377 } 2378 return genericError 2379 2380 } 2381} 2382 2383type awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup struct { 2384} 2385 2386func (*awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) ID() string { 2387 return "OperationDeserializer" 2388} 2389 2390func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2391 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2392) { 2393 out, metadata, err = next.HandleDeserialize(ctx, in) 2394 if err != nil { 2395 return out, metadata, err 2396 } 2397 2398 response, ok := out.RawResponse.(*smithyhttp.Response) 2399 if !ok { 2400 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2401 } 2402 2403 if response.StatusCode < 200 || response.StatusCode >= 300 { 2404 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response, &metadata) 2405 } 2406 output := &DescribeCustomRoutingEndpointGroupOutput{} 2407 out.Result = output 2408 2409 var buff [1024]byte 2410 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2411 2412 body := io.TeeReader(response.Body, ringBuffer) 2413 decoder := json.NewDecoder(body) 2414 decoder.UseNumber() 2415 var shape interface{} 2416 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2417 var snapshot bytes.Buffer 2418 io.Copy(&snapshot, ringBuffer) 2419 err = &smithy.DeserializationError{ 2420 Err: fmt.Errorf("failed to decode response body, %w", err), 2421 Snapshot: snapshot.Bytes(), 2422 } 2423 return out, metadata, err 2424 } 2425 2426 err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingEndpointGroupOutput(&output, shape) 2427 if err != nil { 2428 var snapshot bytes.Buffer 2429 io.Copy(&snapshot, ringBuffer) 2430 err = &smithy.DeserializationError{ 2431 Err: fmt.Errorf("failed to decode response body, %w", err), 2432 Snapshot: snapshot.Bytes(), 2433 } 2434 return out, metadata, err 2435 } 2436 2437 return out, metadata, err 2438} 2439 2440func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2441 var errorBuffer bytes.Buffer 2442 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2443 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2444 } 2445 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2446 2447 errorCode := "UnknownError" 2448 errorMessage := errorCode 2449 2450 code := response.Header.Get("X-Amzn-ErrorType") 2451 if len(code) != 0 { 2452 errorCode = restjson.SanitizeErrorCode(code) 2453 } 2454 2455 var buff [1024]byte 2456 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2457 2458 body := io.TeeReader(errorBody, ringBuffer) 2459 decoder := json.NewDecoder(body) 2460 decoder.UseNumber() 2461 code, message, err := restjson.GetErrorInfo(decoder) 2462 if err != nil { 2463 var snapshot bytes.Buffer 2464 io.Copy(&snapshot, ringBuffer) 2465 err = &smithy.DeserializationError{ 2466 Err: fmt.Errorf("failed to decode response body, %w", err), 2467 Snapshot: snapshot.Bytes(), 2468 } 2469 return err 2470 } 2471 2472 errorBody.Seek(0, io.SeekStart) 2473 if len(code) != 0 { 2474 errorCode = restjson.SanitizeErrorCode(code) 2475 } 2476 if len(message) != 0 { 2477 errorMessage = message 2478 } 2479 2480 switch { 2481 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 2482 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 2483 2484 case strings.EqualFold("InternalServiceErrorException", errorCode): 2485 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2486 2487 case strings.EqualFold("InvalidArgumentException", errorCode): 2488 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2489 2490 default: 2491 genericError := &smithy.GenericAPIError{ 2492 Code: errorCode, 2493 Message: errorMessage, 2494 } 2495 return genericError 2496 2497 } 2498} 2499 2500type awsAwsjson11_deserializeOpDescribeCustomRoutingListener struct { 2501} 2502 2503func (*awsAwsjson11_deserializeOpDescribeCustomRoutingListener) ID() string { 2504 return "OperationDeserializer" 2505} 2506 2507func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2508 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2509) { 2510 out, metadata, err = next.HandleDeserialize(ctx, in) 2511 if err != nil { 2512 return out, metadata, err 2513 } 2514 2515 response, ok := out.RawResponse.(*smithyhttp.Response) 2516 if !ok { 2517 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2518 } 2519 2520 if response.StatusCode < 200 || response.StatusCode >= 300 { 2521 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response, &metadata) 2522 } 2523 output := &DescribeCustomRoutingListenerOutput{} 2524 out.Result = output 2525 2526 var buff [1024]byte 2527 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2528 2529 body := io.TeeReader(response.Body, ringBuffer) 2530 decoder := json.NewDecoder(body) 2531 decoder.UseNumber() 2532 var shape interface{} 2533 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2534 var snapshot bytes.Buffer 2535 io.Copy(&snapshot, ringBuffer) 2536 err = &smithy.DeserializationError{ 2537 Err: fmt.Errorf("failed to decode response body, %w", err), 2538 Snapshot: snapshot.Bytes(), 2539 } 2540 return out, metadata, err 2541 } 2542 2543 err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingListenerOutput(&output, shape) 2544 if err != nil { 2545 var snapshot bytes.Buffer 2546 io.Copy(&snapshot, ringBuffer) 2547 err = &smithy.DeserializationError{ 2548 Err: fmt.Errorf("failed to decode response body, %w", err), 2549 Snapshot: snapshot.Bytes(), 2550 } 2551 return out, metadata, err 2552 } 2553 2554 return out, metadata, err 2555} 2556 2557func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2558 var errorBuffer bytes.Buffer 2559 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2560 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2561 } 2562 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2563 2564 errorCode := "UnknownError" 2565 errorMessage := errorCode 2566 2567 code := response.Header.Get("X-Amzn-ErrorType") 2568 if len(code) != 0 { 2569 errorCode = restjson.SanitizeErrorCode(code) 2570 } 2571 2572 var buff [1024]byte 2573 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2574 2575 body := io.TeeReader(errorBody, ringBuffer) 2576 decoder := json.NewDecoder(body) 2577 decoder.UseNumber() 2578 code, message, err := restjson.GetErrorInfo(decoder) 2579 if err != nil { 2580 var snapshot bytes.Buffer 2581 io.Copy(&snapshot, ringBuffer) 2582 err = &smithy.DeserializationError{ 2583 Err: fmt.Errorf("failed to decode response body, %w", err), 2584 Snapshot: snapshot.Bytes(), 2585 } 2586 return err 2587 } 2588 2589 errorBody.Seek(0, io.SeekStart) 2590 if len(code) != 0 { 2591 errorCode = restjson.SanitizeErrorCode(code) 2592 } 2593 if len(message) != 0 { 2594 errorMessage = message 2595 } 2596 2597 switch { 2598 case strings.EqualFold("InternalServiceErrorException", errorCode): 2599 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2600 2601 case strings.EqualFold("InvalidArgumentException", errorCode): 2602 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2603 2604 case strings.EqualFold("ListenerNotFoundException", errorCode): 2605 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 2606 2607 default: 2608 genericError := &smithy.GenericAPIError{ 2609 Code: errorCode, 2610 Message: errorMessage, 2611 } 2612 return genericError 2613 2614 } 2615} 2616 2617type awsAwsjson11_deserializeOpDescribeEndpointGroup struct { 2618} 2619 2620func (*awsAwsjson11_deserializeOpDescribeEndpointGroup) ID() string { 2621 return "OperationDeserializer" 2622} 2623 2624func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2625 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2626) { 2627 out, metadata, err = next.HandleDeserialize(ctx, in) 2628 if err != nil { 2629 return out, metadata, err 2630 } 2631 2632 response, ok := out.RawResponse.(*smithyhttp.Response) 2633 if !ok { 2634 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2635 } 2636 2637 if response.StatusCode < 200 || response.StatusCode >= 300 { 2638 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response, &metadata) 2639 } 2640 output := &DescribeEndpointGroupOutput{} 2641 out.Result = output 2642 2643 var buff [1024]byte 2644 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2645 2646 body := io.TeeReader(response.Body, ringBuffer) 2647 decoder := json.NewDecoder(body) 2648 decoder.UseNumber() 2649 var shape interface{} 2650 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2651 var snapshot bytes.Buffer 2652 io.Copy(&snapshot, ringBuffer) 2653 err = &smithy.DeserializationError{ 2654 Err: fmt.Errorf("failed to decode response body, %w", err), 2655 Snapshot: snapshot.Bytes(), 2656 } 2657 return out, metadata, err 2658 } 2659 2660 err = awsAwsjson11_deserializeOpDocumentDescribeEndpointGroupOutput(&output, shape) 2661 if err != nil { 2662 var snapshot bytes.Buffer 2663 io.Copy(&snapshot, ringBuffer) 2664 err = &smithy.DeserializationError{ 2665 Err: fmt.Errorf("failed to decode response body, %w", err), 2666 Snapshot: snapshot.Bytes(), 2667 } 2668 return out, metadata, err 2669 } 2670 2671 return out, metadata, err 2672} 2673 2674func awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2675 var errorBuffer bytes.Buffer 2676 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2677 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2678 } 2679 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2680 2681 errorCode := "UnknownError" 2682 errorMessage := errorCode 2683 2684 code := response.Header.Get("X-Amzn-ErrorType") 2685 if len(code) != 0 { 2686 errorCode = restjson.SanitizeErrorCode(code) 2687 } 2688 2689 var buff [1024]byte 2690 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2691 2692 body := io.TeeReader(errorBody, ringBuffer) 2693 decoder := json.NewDecoder(body) 2694 decoder.UseNumber() 2695 code, message, err := restjson.GetErrorInfo(decoder) 2696 if err != nil { 2697 var snapshot bytes.Buffer 2698 io.Copy(&snapshot, ringBuffer) 2699 err = &smithy.DeserializationError{ 2700 Err: fmt.Errorf("failed to decode response body, %w", err), 2701 Snapshot: snapshot.Bytes(), 2702 } 2703 return err 2704 } 2705 2706 errorBody.Seek(0, io.SeekStart) 2707 if len(code) != 0 { 2708 errorCode = restjson.SanitizeErrorCode(code) 2709 } 2710 if len(message) != 0 { 2711 errorMessage = message 2712 } 2713 2714 switch { 2715 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 2716 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 2717 2718 case strings.EqualFold("InternalServiceErrorException", errorCode): 2719 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2720 2721 case strings.EqualFold("InvalidArgumentException", errorCode): 2722 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2723 2724 default: 2725 genericError := &smithy.GenericAPIError{ 2726 Code: errorCode, 2727 Message: errorMessage, 2728 } 2729 return genericError 2730 2731 } 2732} 2733 2734type awsAwsjson11_deserializeOpDescribeListener struct { 2735} 2736 2737func (*awsAwsjson11_deserializeOpDescribeListener) ID() string { 2738 return "OperationDeserializer" 2739} 2740 2741func (m *awsAwsjson11_deserializeOpDescribeListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2742 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2743) { 2744 out, metadata, err = next.HandleDeserialize(ctx, in) 2745 if err != nil { 2746 return out, metadata, err 2747 } 2748 2749 response, ok := out.RawResponse.(*smithyhttp.Response) 2750 if !ok { 2751 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2752 } 2753 2754 if response.StatusCode < 200 || response.StatusCode >= 300 { 2755 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeListener(response, &metadata) 2756 } 2757 output := &DescribeListenerOutput{} 2758 out.Result = output 2759 2760 var buff [1024]byte 2761 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2762 2763 body := io.TeeReader(response.Body, ringBuffer) 2764 decoder := json.NewDecoder(body) 2765 decoder.UseNumber() 2766 var shape interface{} 2767 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2768 var snapshot bytes.Buffer 2769 io.Copy(&snapshot, ringBuffer) 2770 err = &smithy.DeserializationError{ 2771 Err: fmt.Errorf("failed to decode response body, %w", err), 2772 Snapshot: snapshot.Bytes(), 2773 } 2774 return out, metadata, err 2775 } 2776 2777 err = awsAwsjson11_deserializeOpDocumentDescribeListenerOutput(&output, shape) 2778 if err != nil { 2779 var snapshot bytes.Buffer 2780 io.Copy(&snapshot, ringBuffer) 2781 err = &smithy.DeserializationError{ 2782 Err: fmt.Errorf("failed to decode response body, %w", err), 2783 Snapshot: snapshot.Bytes(), 2784 } 2785 return out, metadata, err 2786 } 2787 2788 return out, metadata, err 2789} 2790 2791func awsAwsjson11_deserializeOpErrorDescribeListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2792 var errorBuffer bytes.Buffer 2793 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2794 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2795 } 2796 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2797 2798 errorCode := "UnknownError" 2799 errorMessage := errorCode 2800 2801 code := response.Header.Get("X-Amzn-ErrorType") 2802 if len(code) != 0 { 2803 errorCode = restjson.SanitizeErrorCode(code) 2804 } 2805 2806 var buff [1024]byte 2807 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2808 2809 body := io.TeeReader(errorBody, ringBuffer) 2810 decoder := json.NewDecoder(body) 2811 decoder.UseNumber() 2812 code, message, err := restjson.GetErrorInfo(decoder) 2813 if err != nil { 2814 var snapshot bytes.Buffer 2815 io.Copy(&snapshot, ringBuffer) 2816 err = &smithy.DeserializationError{ 2817 Err: fmt.Errorf("failed to decode response body, %w", err), 2818 Snapshot: snapshot.Bytes(), 2819 } 2820 return err 2821 } 2822 2823 errorBody.Seek(0, io.SeekStart) 2824 if len(code) != 0 { 2825 errorCode = restjson.SanitizeErrorCode(code) 2826 } 2827 if len(message) != 0 { 2828 errorMessage = message 2829 } 2830 2831 switch { 2832 case strings.EqualFold("InternalServiceErrorException", errorCode): 2833 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2834 2835 case strings.EqualFold("InvalidArgumentException", errorCode): 2836 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2837 2838 case strings.EqualFold("ListenerNotFoundException", errorCode): 2839 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 2840 2841 default: 2842 genericError := &smithy.GenericAPIError{ 2843 Code: errorCode, 2844 Message: errorMessage, 2845 } 2846 return genericError 2847 2848 } 2849} 2850 2851type awsAwsjson11_deserializeOpListAccelerators struct { 2852} 2853 2854func (*awsAwsjson11_deserializeOpListAccelerators) ID() string { 2855 return "OperationDeserializer" 2856} 2857 2858func (m *awsAwsjson11_deserializeOpListAccelerators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2859 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2860) { 2861 out, metadata, err = next.HandleDeserialize(ctx, in) 2862 if err != nil { 2863 return out, metadata, err 2864 } 2865 2866 response, ok := out.RawResponse.(*smithyhttp.Response) 2867 if !ok { 2868 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2869 } 2870 2871 if response.StatusCode < 200 || response.StatusCode >= 300 { 2872 return out, metadata, awsAwsjson11_deserializeOpErrorListAccelerators(response, &metadata) 2873 } 2874 output := &ListAcceleratorsOutput{} 2875 out.Result = output 2876 2877 var buff [1024]byte 2878 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2879 2880 body := io.TeeReader(response.Body, ringBuffer) 2881 decoder := json.NewDecoder(body) 2882 decoder.UseNumber() 2883 var shape interface{} 2884 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2885 var snapshot bytes.Buffer 2886 io.Copy(&snapshot, ringBuffer) 2887 err = &smithy.DeserializationError{ 2888 Err: fmt.Errorf("failed to decode response body, %w", err), 2889 Snapshot: snapshot.Bytes(), 2890 } 2891 return out, metadata, err 2892 } 2893 2894 err = awsAwsjson11_deserializeOpDocumentListAcceleratorsOutput(&output, shape) 2895 if err != nil { 2896 var snapshot bytes.Buffer 2897 io.Copy(&snapshot, ringBuffer) 2898 err = &smithy.DeserializationError{ 2899 Err: fmt.Errorf("failed to decode response body, %w", err), 2900 Snapshot: snapshot.Bytes(), 2901 } 2902 return out, metadata, err 2903 } 2904 2905 return out, metadata, err 2906} 2907 2908func awsAwsjson11_deserializeOpErrorListAccelerators(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2909 var errorBuffer bytes.Buffer 2910 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2911 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2912 } 2913 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2914 2915 errorCode := "UnknownError" 2916 errorMessage := errorCode 2917 2918 code := response.Header.Get("X-Amzn-ErrorType") 2919 if len(code) != 0 { 2920 errorCode = restjson.SanitizeErrorCode(code) 2921 } 2922 2923 var buff [1024]byte 2924 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2925 2926 body := io.TeeReader(errorBody, ringBuffer) 2927 decoder := json.NewDecoder(body) 2928 decoder.UseNumber() 2929 code, message, err := restjson.GetErrorInfo(decoder) 2930 if err != nil { 2931 var snapshot bytes.Buffer 2932 io.Copy(&snapshot, ringBuffer) 2933 err = &smithy.DeserializationError{ 2934 Err: fmt.Errorf("failed to decode response body, %w", err), 2935 Snapshot: snapshot.Bytes(), 2936 } 2937 return err 2938 } 2939 2940 errorBody.Seek(0, io.SeekStart) 2941 if len(code) != 0 { 2942 errorCode = restjson.SanitizeErrorCode(code) 2943 } 2944 if len(message) != 0 { 2945 errorMessage = message 2946 } 2947 2948 switch { 2949 case strings.EqualFold("InternalServiceErrorException", errorCode): 2950 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 2951 2952 case strings.EqualFold("InvalidArgumentException", errorCode): 2953 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 2954 2955 case strings.EqualFold("InvalidNextTokenException", errorCode): 2956 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 2957 2958 default: 2959 genericError := &smithy.GenericAPIError{ 2960 Code: errorCode, 2961 Message: errorMessage, 2962 } 2963 return genericError 2964 2965 } 2966} 2967 2968type awsAwsjson11_deserializeOpListByoipCidrs struct { 2969} 2970 2971func (*awsAwsjson11_deserializeOpListByoipCidrs) ID() string { 2972 return "OperationDeserializer" 2973} 2974 2975func (m *awsAwsjson11_deserializeOpListByoipCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2976 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2977) { 2978 out, metadata, err = next.HandleDeserialize(ctx, in) 2979 if err != nil { 2980 return out, metadata, err 2981 } 2982 2983 response, ok := out.RawResponse.(*smithyhttp.Response) 2984 if !ok { 2985 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2986 } 2987 2988 if response.StatusCode < 200 || response.StatusCode >= 300 { 2989 return out, metadata, awsAwsjson11_deserializeOpErrorListByoipCidrs(response, &metadata) 2990 } 2991 output := &ListByoipCidrsOutput{} 2992 out.Result = output 2993 2994 var buff [1024]byte 2995 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2996 2997 body := io.TeeReader(response.Body, ringBuffer) 2998 decoder := json.NewDecoder(body) 2999 decoder.UseNumber() 3000 var shape interface{} 3001 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3002 var snapshot bytes.Buffer 3003 io.Copy(&snapshot, ringBuffer) 3004 err = &smithy.DeserializationError{ 3005 Err: fmt.Errorf("failed to decode response body, %w", err), 3006 Snapshot: snapshot.Bytes(), 3007 } 3008 return out, metadata, err 3009 } 3010 3011 err = awsAwsjson11_deserializeOpDocumentListByoipCidrsOutput(&output, shape) 3012 if err != nil { 3013 var snapshot bytes.Buffer 3014 io.Copy(&snapshot, ringBuffer) 3015 err = &smithy.DeserializationError{ 3016 Err: fmt.Errorf("failed to decode response body, %w", err), 3017 Snapshot: snapshot.Bytes(), 3018 } 3019 return out, metadata, err 3020 } 3021 3022 return out, metadata, err 3023} 3024 3025func awsAwsjson11_deserializeOpErrorListByoipCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3026 var errorBuffer bytes.Buffer 3027 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3028 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3029 } 3030 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3031 3032 errorCode := "UnknownError" 3033 errorMessage := errorCode 3034 3035 code := response.Header.Get("X-Amzn-ErrorType") 3036 if len(code) != 0 { 3037 errorCode = restjson.SanitizeErrorCode(code) 3038 } 3039 3040 var buff [1024]byte 3041 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3042 3043 body := io.TeeReader(errorBody, ringBuffer) 3044 decoder := json.NewDecoder(body) 3045 decoder.UseNumber() 3046 code, message, err := restjson.GetErrorInfo(decoder) 3047 if err != nil { 3048 var snapshot bytes.Buffer 3049 io.Copy(&snapshot, ringBuffer) 3050 err = &smithy.DeserializationError{ 3051 Err: fmt.Errorf("failed to decode response body, %w", err), 3052 Snapshot: snapshot.Bytes(), 3053 } 3054 return err 3055 } 3056 3057 errorBody.Seek(0, io.SeekStart) 3058 if len(code) != 0 { 3059 errorCode = restjson.SanitizeErrorCode(code) 3060 } 3061 if len(message) != 0 { 3062 errorMessage = message 3063 } 3064 3065 switch { 3066 case strings.EqualFold("AccessDeniedException", errorCode): 3067 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 3068 3069 case strings.EqualFold("InternalServiceErrorException", errorCode): 3070 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3071 3072 case strings.EqualFold("InvalidArgumentException", errorCode): 3073 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3074 3075 case strings.EqualFold("InvalidNextTokenException", errorCode): 3076 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3077 3078 default: 3079 genericError := &smithy.GenericAPIError{ 3080 Code: errorCode, 3081 Message: errorMessage, 3082 } 3083 return genericError 3084 3085 } 3086} 3087 3088type awsAwsjson11_deserializeOpListCustomRoutingAccelerators struct { 3089} 3090 3091func (*awsAwsjson11_deserializeOpListCustomRoutingAccelerators) ID() string { 3092 return "OperationDeserializer" 3093} 3094 3095func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3096 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3097) { 3098 out, metadata, err = next.HandleDeserialize(ctx, in) 3099 if err != nil { 3100 return out, metadata, err 3101 } 3102 3103 response, ok := out.RawResponse.(*smithyhttp.Response) 3104 if !ok { 3105 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3106 } 3107 3108 if response.StatusCode < 200 || response.StatusCode >= 300 { 3109 return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response, &metadata) 3110 } 3111 output := &ListCustomRoutingAcceleratorsOutput{} 3112 out.Result = output 3113 3114 var buff [1024]byte 3115 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3116 3117 body := io.TeeReader(response.Body, ringBuffer) 3118 decoder := json.NewDecoder(body) 3119 decoder.UseNumber() 3120 var shape interface{} 3121 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3122 var snapshot bytes.Buffer 3123 io.Copy(&snapshot, ringBuffer) 3124 err = &smithy.DeserializationError{ 3125 Err: fmt.Errorf("failed to decode response body, %w", err), 3126 Snapshot: snapshot.Bytes(), 3127 } 3128 return out, metadata, err 3129 } 3130 3131 err = awsAwsjson11_deserializeOpDocumentListCustomRoutingAcceleratorsOutput(&output, shape) 3132 if err != nil { 3133 var snapshot bytes.Buffer 3134 io.Copy(&snapshot, ringBuffer) 3135 err = &smithy.DeserializationError{ 3136 Err: fmt.Errorf("failed to decode response body, %w", err), 3137 Snapshot: snapshot.Bytes(), 3138 } 3139 return out, metadata, err 3140 } 3141 3142 return out, metadata, err 3143} 3144 3145func awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3146 var errorBuffer bytes.Buffer 3147 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3148 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3149 } 3150 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3151 3152 errorCode := "UnknownError" 3153 errorMessage := errorCode 3154 3155 code := response.Header.Get("X-Amzn-ErrorType") 3156 if len(code) != 0 { 3157 errorCode = restjson.SanitizeErrorCode(code) 3158 } 3159 3160 var buff [1024]byte 3161 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3162 3163 body := io.TeeReader(errorBody, ringBuffer) 3164 decoder := json.NewDecoder(body) 3165 decoder.UseNumber() 3166 code, message, err := restjson.GetErrorInfo(decoder) 3167 if err != nil { 3168 var snapshot bytes.Buffer 3169 io.Copy(&snapshot, ringBuffer) 3170 err = &smithy.DeserializationError{ 3171 Err: fmt.Errorf("failed to decode response body, %w", err), 3172 Snapshot: snapshot.Bytes(), 3173 } 3174 return err 3175 } 3176 3177 errorBody.Seek(0, io.SeekStart) 3178 if len(code) != 0 { 3179 errorCode = restjson.SanitizeErrorCode(code) 3180 } 3181 if len(message) != 0 { 3182 errorMessage = message 3183 } 3184 3185 switch { 3186 case strings.EqualFold("InternalServiceErrorException", errorCode): 3187 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3188 3189 case strings.EqualFold("InvalidArgumentException", errorCode): 3190 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3191 3192 case strings.EqualFold("InvalidNextTokenException", errorCode): 3193 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3194 3195 default: 3196 genericError := &smithy.GenericAPIError{ 3197 Code: errorCode, 3198 Message: errorMessage, 3199 } 3200 return genericError 3201 3202 } 3203} 3204 3205type awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups struct { 3206} 3207 3208func (*awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) ID() string { 3209 return "OperationDeserializer" 3210} 3211 3212func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3213 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3214) { 3215 out, metadata, err = next.HandleDeserialize(ctx, in) 3216 if err != nil { 3217 return out, metadata, err 3218 } 3219 3220 response, ok := out.RawResponse.(*smithyhttp.Response) 3221 if !ok { 3222 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3223 } 3224 3225 if response.StatusCode < 200 || response.StatusCode >= 300 { 3226 return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response, &metadata) 3227 } 3228 output := &ListCustomRoutingEndpointGroupsOutput{} 3229 out.Result = output 3230 3231 var buff [1024]byte 3232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3233 3234 body := io.TeeReader(response.Body, ringBuffer) 3235 decoder := json.NewDecoder(body) 3236 decoder.UseNumber() 3237 var shape interface{} 3238 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3239 var snapshot bytes.Buffer 3240 io.Copy(&snapshot, ringBuffer) 3241 err = &smithy.DeserializationError{ 3242 Err: fmt.Errorf("failed to decode response body, %w", err), 3243 Snapshot: snapshot.Bytes(), 3244 } 3245 return out, metadata, err 3246 } 3247 3248 err = awsAwsjson11_deserializeOpDocumentListCustomRoutingEndpointGroupsOutput(&output, shape) 3249 if err != nil { 3250 var snapshot bytes.Buffer 3251 io.Copy(&snapshot, ringBuffer) 3252 err = &smithy.DeserializationError{ 3253 Err: fmt.Errorf("failed to decode response body, %w", err), 3254 Snapshot: snapshot.Bytes(), 3255 } 3256 return out, metadata, err 3257 } 3258 3259 return out, metadata, err 3260} 3261 3262func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3263 var errorBuffer bytes.Buffer 3264 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3265 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3266 } 3267 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3268 3269 errorCode := "UnknownError" 3270 errorMessage := errorCode 3271 3272 code := response.Header.Get("X-Amzn-ErrorType") 3273 if len(code) != 0 { 3274 errorCode = restjson.SanitizeErrorCode(code) 3275 } 3276 3277 var buff [1024]byte 3278 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3279 3280 body := io.TeeReader(errorBody, ringBuffer) 3281 decoder := json.NewDecoder(body) 3282 decoder.UseNumber() 3283 code, message, err := restjson.GetErrorInfo(decoder) 3284 if err != nil { 3285 var snapshot bytes.Buffer 3286 io.Copy(&snapshot, ringBuffer) 3287 err = &smithy.DeserializationError{ 3288 Err: fmt.Errorf("failed to decode response body, %w", err), 3289 Snapshot: snapshot.Bytes(), 3290 } 3291 return err 3292 } 3293 3294 errorBody.Seek(0, io.SeekStart) 3295 if len(code) != 0 { 3296 errorCode = restjson.SanitizeErrorCode(code) 3297 } 3298 if len(message) != 0 { 3299 errorMessage = message 3300 } 3301 3302 switch { 3303 case strings.EqualFold("InternalServiceErrorException", errorCode): 3304 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3305 3306 case strings.EqualFold("InvalidArgumentException", errorCode): 3307 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3308 3309 case strings.EqualFold("InvalidNextTokenException", errorCode): 3310 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3311 3312 case strings.EqualFold("ListenerNotFoundException", errorCode): 3313 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 3314 3315 default: 3316 genericError := &smithy.GenericAPIError{ 3317 Code: errorCode, 3318 Message: errorMessage, 3319 } 3320 return genericError 3321 3322 } 3323} 3324 3325type awsAwsjson11_deserializeOpListCustomRoutingListeners struct { 3326} 3327 3328func (*awsAwsjson11_deserializeOpListCustomRoutingListeners) ID() string { 3329 return "OperationDeserializer" 3330} 3331 3332func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3333 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3334) { 3335 out, metadata, err = next.HandleDeserialize(ctx, in) 3336 if err != nil { 3337 return out, metadata, err 3338 } 3339 3340 response, ok := out.RawResponse.(*smithyhttp.Response) 3341 if !ok { 3342 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3343 } 3344 3345 if response.StatusCode < 200 || response.StatusCode >= 300 { 3346 return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response, &metadata) 3347 } 3348 output := &ListCustomRoutingListenersOutput{} 3349 out.Result = output 3350 3351 var buff [1024]byte 3352 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3353 3354 body := io.TeeReader(response.Body, ringBuffer) 3355 decoder := json.NewDecoder(body) 3356 decoder.UseNumber() 3357 var shape interface{} 3358 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3359 var snapshot bytes.Buffer 3360 io.Copy(&snapshot, ringBuffer) 3361 err = &smithy.DeserializationError{ 3362 Err: fmt.Errorf("failed to decode response body, %w", err), 3363 Snapshot: snapshot.Bytes(), 3364 } 3365 return out, metadata, err 3366 } 3367 3368 err = awsAwsjson11_deserializeOpDocumentListCustomRoutingListenersOutput(&output, shape) 3369 if err != nil { 3370 var snapshot bytes.Buffer 3371 io.Copy(&snapshot, ringBuffer) 3372 err = &smithy.DeserializationError{ 3373 Err: fmt.Errorf("failed to decode response body, %w", err), 3374 Snapshot: snapshot.Bytes(), 3375 } 3376 return out, metadata, err 3377 } 3378 3379 return out, metadata, err 3380} 3381 3382func awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3383 var errorBuffer bytes.Buffer 3384 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3385 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3386 } 3387 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3388 3389 errorCode := "UnknownError" 3390 errorMessage := errorCode 3391 3392 code := response.Header.Get("X-Amzn-ErrorType") 3393 if len(code) != 0 { 3394 errorCode = restjson.SanitizeErrorCode(code) 3395 } 3396 3397 var buff [1024]byte 3398 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3399 3400 body := io.TeeReader(errorBody, ringBuffer) 3401 decoder := json.NewDecoder(body) 3402 decoder.UseNumber() 3403 code, message, err := restjson.GetErrorInfo(decoder) 3404 if err != nil { 3405 var snapshot bytes.Buffer 3406 io.Copy(&snapshot, ringBuffer) 3407 err = &smithy.DeserializationError{ 3408 Err: fmt.Errorf("failed to decode response body, %w", err), 3409 Snapshot: snapshot.Bytes(), 3410 } 3411 return err 3412 } 3413 3414 errorBody.Seek(0, io.SeekStart) 3415 if len(code) != 0 { 3416 errorCode = restjson.SanitizeErrorCode(code) 3417 } 3418 if len(message) != 0 { 3419 errorMessage = message 3420 } 3421 3422 switch { 3423 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 3424 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 3425 3426 case strings.EqualFold("InternalServiceErrorException", errorCode): 3427 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3428 3429 case strings.EqualFold("InvalidArgumentException", errorCode): 3430 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3431 3432 case strings.EqualFold("InvalidNextTokenException", errorCode): 3433 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3434 3435 default: 3436 genericError := &smithy.GenericAPIError{ 3437 Code: errorCode, 3438 Message: errorMessage, 3439 } 3440 return genericError 3441 3442 } 3443} 3444 3445type awsAwsjson11_deserializeOpListCustomRoutingPortMappings struct { 3446} 3447 3448func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappings) ID() string { 3449 return "OperationDeserializer" 3450} 3451 3452func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3453 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3454) { 3455 out, metadata, err = next.HandleDeserialize(ctx, in) 3456 if err != nil { 3457 return out, metadata, err 3458 } 3459 3460 response, ok := out.RawResponse.(*smithyhttp.Response) 3461 if !ok { 3462 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3463 } 3464 3465 if response.StatusCode < 200 || response.StatusCode >= 300 { 3466 return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response, &metadata) 3467 } 3468 output := &ListCustomRoutingPortMappingsOutput{} 3469 out.Result = output 3470 3471 var buff [1024]byte 3472 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3473 3474 body := io.TeeReader(response.Body, ringBuffer) 3475 decoder := json.NewDecoder(body) 3476 decoder.UseNumber() 3477 var shape interface{} 3478 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3479 var snapshot bytes.Buffer 3480 io.Copy(&snapshot, ringBuffer) 3481 err = &smithy.DeserializationError{ 3482 Err: fmt.Errorf("failed to decode response body, %w", err), 3483 Snapshot: snapshot.Bytes(), 3484 } 3485 return out, metadata, err 3486 } 3487 3488 err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsOutput(&output, shape) 3489 if err != nil { 3490 var snapshot bytes.Buffer 3491 io.Copy(&snapshot, ringBuffer) 3492 err = &smithy.DeserializationError{ 3493 Err: fmt.Errorf("failed to decode response body, %w", err), 3494 Snapshot: snapshot.Bytes(), 3495 } 3496 return out, metadata, err 3497 } 3498 3499 return out, metadata, err 3500} 3501 3502func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3503 var errorBuffer bytes.Buffer 3504 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3505 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3506 } 3507 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3508 3509 errorCode := "UnknownError" 3510 errorMessage := errorCode 3511 3512 code := response.Header.Get("X-Amzn-ErrorType") 3513 if len(code) != 0 { 3514 errorCode = restjson.SanitizeErrorCode(code) 3515 } 3516 3517 var buff [1024]byte 3518 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3519 3520 body := io.TeeReader(errorBody, ringBuffer) 3521 decoder := json.NewDecoder(body) 3522 decoder.UseNumber() 3523 code, message, err := restjson.GetErrorInfo(decoder) 3524 if err != nil { 3525 var snapshot bytes.Buffer 3526 io.Copy(&snapshot, ringBuffer) 3527 err = &smithy.DeserializationError{ 3528 Err: fmt.Errorf("failed to decode response body, %w", err), 3529 Snapshot: snapshot.Bytes(), 3530 } 3531 return err 3532 } 3533 3534 errorBody.Seek(0, io.SeekStart) 3535 if len(code) != 0 { 3536 errorCode = restjson.SanitizeErrorCode(code) 3537 } 3538 if len(message) != 0 { 3539 errorMessage = message 3540 } 3541 3542 switch { 3543 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 3544 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 3545 3546 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 3547 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 3548 3549 case strings.EqualFold("InternalServiceErrorException", errorCode): 3550 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3551 3552 case strings.EqualFold("InvalidArgumentException", errorCode): 3553 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3554 3555 case strings.EqualFold("InvalidNextTokenException", errorCode): 3556 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3557 3558 default: 3559 genericError := &smithy.GenericAPIError{ 3560 Code: errorCode, 3561 Message: errorMessage, 3562 } 3563 return genericError 3564 3565 } 3566} 3567 3568type awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination struct { 3569} 3570 3571func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) ID() string { 3572 return "OperationDeserializer" 3573} 3574 3575func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3576 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3577) { 3578 out, metadata, err = next.HandleDeserialize(ctx, in) 3579 if err != nil { 3580 return out, metadata, err 3581 } 3582 3583 response, ok := out.RawResponse.(*smithyhttp.Response) 3584 if !ok { 3585 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3586 } 3587 3588 if response.StatusCode < 200 || response.StatusCode >= 300 { 3589 return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(response, &metadata) 3590 } 3591 output := &ListCustomRoutingPortMappingsByDestinationOutput{} 3592 out.Result = output 3593 3594 var buff [1024]byte 3595 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3596 3597 body := io.TeeReader(response.Body, ringBuffer) 3598 decoder := json.NewDecoder(body) 3599 decoder.UseNumber() 3600 var shape interface{} 3601 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3602 var snapshot bytes.Buffer 3603 io.Copy(&snapshot, ringBuffer) 3604 err = &smithy.DeserializationError{ 3605 Err: fmt.Errorf("failed to decode response body, %w", err), 3606 Snapshot: snapshot.Bytes(), 3607 } 3608 return out, metadata, err 3609 } 3610 3611 err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsByDestinationOutput(&output, shape) 3612 if err != nil { 3613 var snapshot bytes.Buffer 3614 io.Copy(&snapshot, ringBuffer) 3615 err = &smithy.DeserializationError{ 3616 Err: fmt.Errorf("failed to decode response body, %w", err), 3617 Snapshot: snapshot.Bytes(), 3618 } 3619 return out, metadata, err 3620 } 3621 3622 return out, metadata, err 3623} 3624 3625func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3626 var errorBuffer bytes.Buffer 3627 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3628 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3629 } 3630 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3631 3632 errorCode := "UnknownError" 3633 errorMessage := errorCode 3634 3635 code := response.Header.Get("X-Amzn-ErrorType") 3636 if len(code) != 0 { 3637 errorCode = restjson.SanitizeErrorCode(code) 3638 } 3639 3640 var buff [1024]byte 3641 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3642 3643 body := io.TeeReader(errorBody, ringBuffer) 3644 decoder := json.NewDecoder(body) 3645 decoder.UseNumber() 3646 code, message, err := restjson.GetErrorInfo(decoder) 3647 if err != nil { 3648 var snapshot bytes.Buffer 3649 io.Copy(&snapshot, ringBuffer) 3650 err = &smithy.DeserializationError{ 3651 Err: fmt.Errorf("failed to decode response body, %w", err), 3652 Snapshot: snapshot.Bytes(), 3653 } 3654 return err 3655 } 3656 3657 errorBody.Seek(0, io.SeekStart) 3658 if len(code) != 0 { 3659 errorCode = restjson.SanitizeErrorCode(code) 3660 } 3661 if len(message) != 0 { 3662 errorMessage = message 3663 } 3664 3665 switch { 3666 case strings.EqualFold("EndpointNotFoundException", errorCode): 3667 return awsAwsjson11_deserializeErrorEndpointNotFoundException(response, errorBody) 3668 3669 case strings.EqualFold("InternalServiceErrorException", errorCode): 3670 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3671 3672 case strings.EqualFold("InvalidArgumentException", errorCode): 3673 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3674 3675 case strings.EqualFold("InvalidNextTokenException", errorCode): 3676 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3677 3678 default: 3679 genericError := &smithy.GenericAPIError{ 3680 Code: errorCode, 3681 Message: errorMessage, 3682 } 3683 return genericError 3684 3685 } 3686} 3687 3688type awsAwsjson11_deserializeOpListEndpointGroups struct { 3689} 3690 3691func (*awsAwsjson11_deserializeOpListEndpointGroups) ID() string { 3692 return "OperationDeserializer" 3693} 3694 3695func (m *awsAwsjson11_deserializeOpListEndpointGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3696 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3697) { 3698 out, metadata, err = next.HandleDeserialize(ctx, in) 3699 if err != nil { 3700 return out, metadata, err 3701 } 3702 3703 response, ok := out.RawResponse.(*smithyhttp.Response) 3704 if !ok { 3705 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3706 } 3707 3708 if response.StatusCode < 200 || response.StatusCode >= 300 { 3709 return out, metadata, awsAwsjson11_deserializeOpErrorListEndpointGroups(response, &metadata) 3710 } 3711 output := &ListEndpointGroupsOutput{} 3712 out.Result = output 3713 3714 var buff [1024]byte 3715 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3716 3717 body := io.TeeReader(response.Body, ringBuffer) 3718 decoder := json.NewDecoder(body) 3719 decoder.UseNumber() 3720 var shape interface{} 3721 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3722 var snapshot bytes.Buffer 3723 io.Copy(&snapshot, ringBuffer) 3724 err = &smithy.DeserializationError{ 3725 Err: fmt.Errorf("failed to decode response body, %w", err), 3726 Snapshot: snapshot.Bytes(), 3727 } 3728 return out, metadata, err 3729 } 3730 3731 err = awsAwsjson11_deserializeOpDocumentListEndpointGroupsOutput(&output, shape) 3732 if err != nil { 3733 var snapshot bytes.Buffer 3734 io.Copy(&snapshot, ringBuffer) 3735 err = &smithy.DeserializationError{ 3736 Err: fmt.Errorf("failed to decode response body, %w", err), 3737 Snapshot: snapshot.Bytes(), 3738 } 3739 return out, metadata, err 3740 } 3741 3742 return out, metadata, err 3743} 3744 3745func awsAwsjson11_deserializeOpErrorListEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3746 var errorBuffer bytes.Buffer 3747 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3748 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3749 } 3750 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3751 3752 errorCode := "UnknownError" 3753 errorMessage := errorCode 3754 3755 code := response.Header.Get("X-Amzn-ErrorType") 3756 if len(code) != 0 { 3757 errorCode = restjson.SanitizeErrorCode(code) 3758 } 3759 3760 var buff [1024]byte 3761 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3762 3763 body := io.TeeReader(errorBody, ringBuffer) 3764 decoder := json.NewDecoder(body) 3765 decoder.UseNumber() 3766 code, message, err := restjson.GetErrorInfo(decoder) 3767 if err != nil { 3768 var snapshot bytes.Buffer 3769 io.Copy(&snapshot, ringBuffer) 3770 err = &smithy.DeserializationError{ 3771 Err: fmt.Errorf("failed to decode response body, %w", err), 3772 Snapshot: snapshot.Bytes(), 3773 } 3774 return err 3775 } 3776 3777 errorBody.Seek(0, io.SeekStart) 3778 if len(code) != 0 { 3779 errorCode = restjson.SanitizeErrorCode(code) 3780 } 3781 if len(message) != 0 { 3782 errorMessage = message 3783 } 3784 3785 switch { 3786 case strings.EqualFold("InternalServiceErrorException", errorCode): 3787 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3788 3789 case strings.EqualFold("InvalidArgumentException", errorCode): 3790 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3791 3792 case strings.EqualFold("InvalidNextTokenException", errorCode): 3793 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3794 3795 case strings.EqualFold("ListenerNotFoundException", errorCode): 3796 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 3797 3798 default: 3799 genericError := &smithy.GenericAPIError{ 3800 Code: errorCode, 3801 Message: errorMessage, 3802 } 3803 return genericError 3804 3805 } 3806} 3807 3808type awsAwsjson11_deserializeOpListListeners struct { 3809} 3810 3811func (*awsAwsjson11_deserializeOpListListeners) ID() string { 3812 return "OperationDeserializer" 3813} 3814 3815func (m *awsAwsjson11_deserializeOpListListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3816 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3817) { 3818 out, metadata, err = next.HandleDeserialize(ctx, in) 3819 if err != nil { 3820 return out, metadata, err 3821 } 3822 3823 response, ok := out.RawResponse.(*smithyhttp.Response) 3824 if !ok { 3825 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3826 } 3827 3828 if response.StatusCode < 200 || response.StatusCode >= 300 { 3829 return out, metadata, awsAwsjson11_deserializeOpErrorListListeners(response, &metadata) 3830 } 3831 output := &ListListenersOutput{} 3832 out.Result = output 3833 3834 var buff [1024]byte 3835 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3836 3837 body := io.TeeReader(response.Body, ringBuffer) 3838 decoder := json.NewDecoder(body) 3839 decoder.UseNumber() 3840 var shape interface{} 3841 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3842 var snapshot bytes.Buffer 3843 io.Copy(&snapshot, ringBuffer) 3844 err = &smithy.DeserializationError{ 3845 Err: fmt.Errorf("failed to decode response body, %w", err), 3846 Snapshot: snapshot.Bytes(), 3847 } 3848 return out, metadata, err 3849 } 3850 3851 err = awsAwsjson11_deserializeOpDocumentListListenersOutput(&output, shape) 3852 if err != nil { 3853 var snapshot bytes.Buffer 3854 io.Copy(&snapshot, ringBuffer) 3855 err = &smithy.DeserializationError{ 3856 Err: fmt.Errorf("failed to decode response body, %w", err), 3857 Snapshot: snapshot.Bytes(), 3858 } 3859 return out, metadata, err 3860 } 3861 3862 return out, metadata, err 3863} 3864 3865func awsAwsjson11_deserializeOpErrorListListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3866 var errorBuffer bytes.Buffer 3867 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3868 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3869 } 3870 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3871 3872 errorCode := "UnknownError" 3873 errorMessage := errorCode 3874 3875 code := response.Header.Get("X-Amzn-ErrorType") 3876 if len(code) != 0 { 3877 errorCode = restjson.SanitizeErrorCode(code) 3878 } 3879 3880 var buff [1024]byte 3881 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3882 3883 body := io.TeeReader(errorBody, ringBuffer) 3884 decoder := json.NewDecoder(body) 3885 decoder.UseNumber() 3886 code, message, err := restjson.GetErrorInfo(decoder) 3887 if err != nil { 3888 var snapshot bytes.Buffer 3889 io.Copy(&snapshot, ringBuffer) 3890 err = &smithy.DeserializationError{ 3891 Err: fmt.Errorf("failed to decode response body, %w", err), 3892 Snapshot: snapshot.Bytes(), 3893 } 3894 return err 3895 } 3896 3897 errorBody.Seek(0, io.SeekStart) 3898 if len(code) != 0 { 3899 errorCode = restjson.SanitizeErrorCode(code) 3900 } 3901 if len(message) != 0 { 3902 errorMessage = message 3903 } 3904 3905 switch { 3906 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 3907 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 3908 3909 case strings.EqualFold("InternalServiceErrorException", errorCode): 3910 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 3911 3912 case strings.EqualFold("InvalidArgumentException", errorCode): 3913 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 3914 3915 case strings.EqualFold("InvalidNextTokenException", errorCode): 3916 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 3917 3918 default: 3919 genericError := &smithy.GenericAPIError{ 3920 Code: errorCode, 3921 Message: errorMessage, 3922 } 3923 return genericError 3924 3925 } 3926} 3927 3928type awsAwsjson11_deserializeOpListTagsForResource struct { 3929} 3930 3931func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { 3932 return "OperationDeserializer" 3933} 3934 3935func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3936 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3937) { 3938 out, metadata, err = next.HandleDeserialize(ctx, in) 3939 if err != nil { 3940 return out, metadata, err 3941 } 3942 3943 response, ok := out.RawResponse.(*smithyhttp.Response) 3944 if !ok { 3945 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3946 } 3947 3948 if response.StatusCode < 200 || response.StatusCode >= 300 { 3949 return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) 3950 } 3951 output := &ListTagsForResourceOutput{} 3952 out.Result = output 3953 3954 var buff [1024]byte 3955 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3956 3957 body := io.TeeReader(response.Body, ringBuffer) 3958 decoder := json.NewDecoder(body) 3959 decoder.UseNumber() 3960 var shape interface{} 3961 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3962 var snapshot bytes.Buffer 3963 io.Copy(&snapshot, ringBuffer) 3964 err = &smithy.DeserializationError{ 3965 Err: fmt.Errorf("failed to decode response body, %w", err), 3966 Snapshot: snapshot.Bytes(), 3967 } 3968 return out, metadata, err 3969 } 3970 3971 err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 3972 if err != nil { 3973 var snapshot bytes.Buffer 3974 io.Copy(&snapshot, ringBuffer) 3975 err = &smithy.DeserializationError{ 3976 Err: fmt.Errorf("failed to decode response body, %w", err), 3977 Snapshot: snapshot.Bytes(), 3978 } 3979 return out, metadata, err 3980 } 3981 3982 return out, metadata, err 3983} 3984 3985func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3986 var errorBuffer bytes.Buffer 3987 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3988 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3989 } 3990 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3991 3992 errorCode := "UnknownError" 3993 errorMessage := errorCode 3994 3995 code := response.Header.Get("X-Amzn-ErrorType") 3996 if len(code) != 0 { 3997 errorCode = restjson.SanitizeErrorCode(code) 3998 } 3999 4000 var buff [1024]byte 4001 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4002 4003 body := io.TeeReader(errorBody, ringBuffer) 4004 decoder := json.NewDecoder(body) 4005 decoder.UseNumber() 4006 code, message, err := restjson.GetErrorInfo(decoder) 4007 if err != nil { 4008 var snapshot bytes.Buffer 4009 io.Copy(&snapshot, ringBuffer) 4010 err = &smithy.DeserializationError{ 4011 Err: fmt.Errorf("failed to decode response body, %w", err), 4012 Snapshot: snapshot.Bytes(), 4013 } 4014 return err 4015 } 4016 4017 errorBody.Seek(0, io.SeekStart) 4018 if len(code) != 0 { 4019 errorCode = restjson.SanitizeErrorCode(code) 4020 } 4021 if len(message) != 0 { 4022 errorMessage = message 4023 } 4024 4025 switch { 4026 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4027 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4028 4029 case strings.EqualFold("InternalServiceErrorException", errorCode): 4030 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4031 4032 case strings.EqualFold("InvalidArgumentException", errorCode): 4033 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4034 4035 default: 4036 genericError := &smithy.GenericAPIError{ 4037 Code: errorCode, 4038 Message: errorMessage, 4039 } 4040 return genericError 4041 4042 } 4043} 4044 4045type awsAwsjson11_deserializeOpProvisionByoipCidr struct { 4046} 4047 4048func (*awsAwsjson11_deserializeOpProvisionByoipCidr) ID() string { 4049 return "OperationDeserializer" 4050} 4051 4052func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4053 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4054) { 4055 out, metadata, err = next.HandleDeserialize(ctx, in) 4056 if err != nil { 4057 return out, metadata, err 4058 } 4059 4060 response, ok := out.RawResponse.(*smithyhttp.Response) 4061 if !ok { 4062 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4063 } 4064 4065 if response.StatusCode < 200 || response.StatusCode >= 300 { 4066 return out, metadata, awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response, &metadata) 4067 } 4068 output := &ProvisionByoipCidrOutput{} 4069 out.Result = output 4070 4071 var buff [1024]byte 4072 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4073 4074 body := io.TeeReader(response.Body, ringBuffer) 4075 decoder := json.NewDecoder(body) 4076 decoder.UseNumber() 4077 var shape interface{} 4078 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4079 var snapshot bytes.Buffer 4080 io.Copy(&snapshot, ringBuffer) 4081 err = &smithy.DeserializationError{ 4082 Err: fmt.Errorf("failed to decode response body, %w", err), 4083 Snapshot: snapshot.Bytes(), 4084 } 4085 return out, metadata, err 4086 } 4087 4088 err = awsAwsjson11_deserializeOpDocumentProvisionByoipCidrOutput(&output, shape) 4089 if err != nil { 4090 var snapshot bytes.Buffer 4091 io.Copy(&snapshot, ringBuffer) 4092 err = &smithy.DeserializationError{ 4093 Err: fmt.Errorf("failed to decode response body, %w", err), 4094 Snapshot: snapshot.Bytes(), 4095 } 4096 return out, metadata, err 4097 } 4098 4099 return out, metadata, err 4100} 4101 4102func awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4103 var errorBuffer bytes.Buffer 4104 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4105 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4106 } 4107 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4108 4109 errorCode := "UnknownError" 4110 errorMessage := errorCode 4111 4112 code := response.Header.Get("X-Amzn-ErrorType") 4113 if len(code) != 0 { 4114 errorCode = restjson.SanitizeErrorCode(code) 4115 } 4116 4117 var buff [1024]byte 4118 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4119 4120 body := io.TeeReader(errorBody, ringBuffer) 4121 decoder := json.NewDecoder(body) 4122 decoder.UseNumber() 4123 code, message, err := restjson.GetErrorInfo(decoder) 4124 if err != nil { 4125 var snapshot bytes.Buffer 4126 io.Copy(&snapshot, ringBuffer) 4127 err = &smithy.DeserializationError{ 4128 Err: fmt.Errorf("failed to decode response body, %w", err), 4129 Snapshot: snapshot.Bytes(), 4130 } 4131 return err 4132 } 4133 4134 errorBody.Seek(0, io.SeekStart) 4135 if len(code) != 0 { 4136 errorCode = restjson.SanitizeErrorCode(code) 4137 } 4138 if len(message) != 0 { 4139 errorMessage = message 4140 } 4141 4142 switch { 4143 case strings.EqualFold("AccessDeniedException", errorCode): 4144 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 4145 4146 case strings.EqualFold("IncorrectCidrStateException", errorCode): 4147 return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) 4148 4149 case strings.EqualFold("InternalServiceErrorException", errorCode): 4150 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4151 4152 case strings.EqualFold("InvalidArgumentException", errorCode): 4153 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4154 4155 case strings.EqualFold("LimitExceededException", errorCode): 4156 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 4157 4158 default: 4159 genericError := &smithy.GenericAPIError{ 4160 Code: errorCode, 4161 Message: errorMessage, 4162 } 4163 return genericError 4164 4165 } 4166} 4167 4168type awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints struct { 4169} 4170 4171func (*awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) ID() string { 4172 return "OperationDeserializer" 4173} 4174 4175func (m *awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4176 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4177) { 4178 out, metadata, err = next.HandleDeserialize(ctx, in) 4179 if err != nil { 4180 return out, metadata, err 4181 } 4182 4183 response, ok := out.RawResponse.(*smithyhttp.Response) 4184 if !ok { 4185 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4186 } 4187 4188 if response.StatusCode < 200 || response.StatusCode >= 300 { 4189 return out, metadata, awsAwsjson11_deserializeOpErrorRemoveCustomRoutingEndpoints(response, &metadata) 4190 } 4191 output := &RemoveCustomRoutingEndpointsOutput{} 4192 out.Result = output 4193 4194 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 4195 return out, metadata, &smithy.DeserializationError{ 4196 Err: fmt.Errorf("failed to discard response body, %w", err), 4197 } 4198 } 4199 4200 return out, metadata, err 4201} 4202 4203func awsAwsjson11_deserializeOpErrorRemoveCustomRoutingEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4204 var errorBuffer bytes.Buffer 4205 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4206 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4207 } 4208 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4209 4210 errorCode := "UnknownError" 4211 errorMessage := errorCode 4212 4213 code := response.Header.Get("X-Amzn-ErrorType") 4214 if len(code) != 0 { 4215 errorCode = restjson.SanitizeErrorCode(code) 4216 } 4217 4218 var buff [1024]byte 4219 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4220 4221 body := io.TeeReader(errorBody, ringBuffer) 4222 decoder := json.NewDecoder(body) 4223 decoder.UseNumber() 4224 code, message, err := restjson.GetErrorInfo(decoder) 4225 if err != nil { 4226 var snapshot bytes.Buffer 4227 io.Copy(&snapshot, ringBuffer) 4228 err = &smithy.DeserializationError{ 4229 Err: fmt.Errorf("failed to decode response body, %w", err), 4230 Snapshot: snapshot.Bytes(), 4231 } 4232 return err 4233 } 4234 4235 errorBody.Seek(0, io.SeekStart) 4236 if len(code) != 0 { 4237 errorCode = restjson.SanitizeErrorCode(code) 4238 } 4239 if len(message) != 0 { 4240 errorMessage = message 4241 } 4242 4243 switch { 4244 case strings.EqualFold("AccessDeniedException", errorCode): 4245 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 4246 4247 case strings.EqualFold("ConflictException", errorCode): 4248 return awsAwsjson11_deserializeErrorConflictException(response, errorBody) 4249 4250 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 4251 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 4252 4253 case strings.EqualFold("EndpointNotFoundException", errorCode): 4254 return awsAwsjson11_deserializeErrorEndpointNotFoundException(response, errorBody) 4255 4256 case strings.EqualFold("InternalServiceErrorException", errorCode): 4257 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4258 4259 case strings.EqualFold("InvalidArgumentException", errorCode): 4260 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4261 4262 default: 4263 genericError := &smithy.GenericAPIError{ 4264 Code: errorCode, 4265 Message: errorMessage, 4266 } 4267 return genericError 4268 4269 } 4270} 4271 4272type awsAwsjson11_deserializeOpTagResource struct { 4273} 4274 4275func (*awsAwsjson11_deserializeOpTagResource) ID() string { 4276 return "OperationDeserializer" 4277} 4278 4279func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4280 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4281) { 4282 out, metadata, err = next.HandleDeserialize(ctx, in) 4283 if err != nil { 4284 return out, metadata, err 4285 } 4286 4287 response, ok := out.RawResponse.(*smithyhttp.Response) 4288 if !ok { 4289 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4290 } 4291 4292 if response.StatusCode < 200 || response.StatusCode >= 300 { 4293 return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) 4294 } 4295 output := &TagResourceOutput{} 4296 out.Result = output 4297 4298 var buff [1024]byte 4299 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4300 4301 body := io.TeeReader(response.Body, ringBuffer) 4302 decoder := json.NewDecoder(body) 4303 decoder.UseNumber() 4304 var shape interface{} 4305 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4306 var snapshot bytes.Buffer 4307 io.Copy(&snapshot, ringBuffer) 4308 err = &smithy.DeserializationError{ 4309 Err: fmt.Errorf("failed to decode response body, %w", err), 4310 Snapshot: snapshot.Bytes(), 4311 } 4312 return out, metadata, err 4313 } 4314 4315 err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) 4316 if err != nil { 4317 var snapshot bytes.Buffer 4318 io.Copy(&snapshot, ringBuffer) 4319 err = &smithy.DeserializationError{ 4320 Err: fmt.Errorf("failed to decode response body, %w", err), 4321 Snapshot: snapshot.Bytes(), 4322 } 4323 return out, metadata, err 4324 } 4325 4326 return out, metadata, err 4327} 4328 4329func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4330 var errorBuffer bytes.Buffer 4331 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4332 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4333 } 4334 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4335 4336 errorCode := "UnknownError" 4337 errorMessage := errorCode 4338 4339 code := response.Header.Get("X-Amzn-ErrorType") 4340 if len(code) != 0 { 4341 errorCode = restjson.SanitizeErrorCode(code) 4342 } 4343 4344 var buff [1024]byte 4345 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4346 4347 body := io.TeeReader(errorBody, ringBuffer) 4348 decoder := json.NewDecoder(body) 4349 decoder.UseNumber() 4350 code, message, err := restjson.GetErrorInfo(decoder) 4351 if err != nil { 4352 var snapshot bytes.Buffer 4353 io.Copy(&snapshot, ringBuffer) 4354 err = &smithy.DeserializationError{ 4355 Err: fmt.Errorf("failed to decode response body, %w", err), 4356 Snapshot: snapshot.Bytes(), 4357 } 4358 return err 4359 } 4360 4361 errorBody.Seek(0, io.SeekStart) 4362 if len(code) != 0 { 4363 errorCode = restjson.SanitizeErrorCode(code) 4364 } 4365 if len(message) != 0 { 4366 errorMessage = message 4367 } 4368 4369 switch { 4370 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4371 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4372 4373 case strings.EqualFold("InternalServiceErrorException", errorCode): 4374 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4375 4376 case strings.EqualFold("InvalidArgumentException", errorCode): 4377 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4378 4379 default: 4380 genericError := &smithy.GenericAPIError{ 4381 Code: errorCode, 4382 Message: errorMessage, 4383 } 4384 return genericError 4385 4386 } 4387} 4388 4389type awsAwsjson11_deserializeOpUntagResource struct { 4390} 4391 4392func (*awsAwsjson11_deserializeOpUntagResource) ID() string { 4393 return "OperationDeserializer" 4394} 4395 4396func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4397 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4398) { 4399 out, metadata, err = next.HandleDeserialize(ctx, in) 4400 if err != nil { 4401 return out, metadata, err 4402 } 4403 4404 response, ok := out.RawResponse.(*smithyhttp.Response) 4405 if !ok { 4406 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4407 } 4408 4409 if response.StatusCode < 200 || response.StatusCode >= 300 { 4410 return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) 4411 } 4412 output := &UntagResourceOutput{} 4413 out.Result = output 4414 4415 var buff [1024]byte 4416 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4417 4418 body := io.TeeReader(response.Body, ringBuffer) 4419 decoder := json.NewDecoder(body) 4420 decoder.UseNumber() 4421 var shape interface{} 4422 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4423 var snapshot bytes.Buffer 4424 io.Copy(&snapshot, ringBuffer) 4425 err = &smithy.DeserializationError{ 4426 Err: fmt.Errorf("failed to decode response body, %w", err), 4427 Snapshot: snapshot.Bytes(), 4428 } 4429 return out, metadata, err 4430 } 4431 4432 err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) 4433 if err != nil { 4434 var snapshot bytes.Buffer 4435 io.Copy(&snapshot, ringBuffer) 4436 err = &smithy.DeserializationError{ 4437 Err: fmt.Errorf("failed to decode response body, %w", err), 4438 Snapshot: snapshot.Bytes(), 4439 } 4440 return out, metadata, err 4441 } 4442 4443 return out, metadata, err 4444} 4445 4446func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4447 var errorBuffer bytes.Buffer 4448 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4449 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4450 } 4451 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4452 4453 errorCode := "UnknownError" 4454 errorMessage := errorCode 4455 4456 code := response.Header.Get("X-Amzn-ErrorType") 4457 if len(code) != 0 { 4458 errorCode = restjson.SanitizeErrorCode(code) 4459 } 4460 4461 var buff [1024]byte 4462 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4463 4464 body := io.TeeReader(errorBody, ringBuffer) 4465 decoder := json.NewDecoder(body) 4466 decoder.UseNumber() 4467 code, message, err := restjson.GetErrorInfo(decoder) 4468 if err != nil { 4469 var snapshot bytes.Buffer 4470 io.Copy(&snapshot, ringBuffer) 4471 err = &smithy.DeserializationError{ 4472 Err: fmt.Errorf("failed to decode response body, %w", err), 4473 Snapshot: snapshot.Bytes(), 4474 } 4475 return err 4476 } 4477 4478 errorBody.Seek(0, io.SeekStart) 4479 if len(code) != 0 { 4480 errorCode = restjson.SanitizeErrorCode(code) 4481 } 4482 if len(message) != 0 { 4483 errorMessage = message 4484 } 4485 4486 switch { 4487 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4488 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4489 4490 case strings.EqualFold("InternalServiceErrorException", errorCode): 4491 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4492 4493 case strings.EqualFold("InvalidArgumentException", errorCode): 4494 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4495 4496 default: 4497 genericError := &smithy.GenericAPIError{ 4498 Code: errorCode, 4499 Message: errorMessage, 4500 } 4501 return genericError 4502 4503 } 4504} 4505 4506type awsAwsjson11_deserializeOpUpdateAccelerator struct { 4507} 4508 4509func (*awsAwsjson11_deserializeOpUpdateAccelerator) ID() string { 4510 return "OperationDeserializer" 4511} 4512 4513func (m *awsAwsjson11_deserializeOpUpdateAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4514 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4515) { 4516 out, metadata, err = next.HandleDeserialize(ctx, in) 4517 if err != nil { 4518 return out, metadata, err 4519 } 4520 4521 response, ok := out.RawResponse.(*smithyhttp.Response) 4522 if !ok { 4523 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4524 } 4525 4526 if response.StatusCode < 200 || response.StatusCode >= 300 { 4527 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAccelerator(response, &metadata) 4528 } 4529 output := &UpdateAcceleratorOutput{} 4530 out.Result = output 4531 4532 var buff [1024]byte 4533 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4534 4535 body := io.TeeReader(response.Body, ringBuffer) 4536 decoder := json.NewDecoder(body) 4537 decoder.UseNumber() 4538 var shape interface{} 4539 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4540 var snapshot bytes.Buffer 4541 io.Copy(&snapshot, ringBuffer) 4542 err = &smithy.DeserializationError{ 4543 Err: fmt.Errorf("failed to decode response body, %w", err), 4544 Snapshot: snapshot.Bytes(), 4545 } 4546 return out, metadata, err 4547 } 4548 4549 err = awsAwsjson11_deserializeOpDocumentUpdateAcceleratorOutput(&output, shape) 4550 if err != nil { 4551 var snapshot bytes.Buffer 4552 io.Copy(&snapshot, ringBuffer) 4553 err = &smithy.DeserializationError{ 4554 Err: fmt.Errorf("failed to decode response body, %w", err), 4555 Snapshot: snapshot.Bytes(), 4556 } 4557 return out, metadata, err 4558 } 4559 4560 return out, metadata, err 4561} 4562 4563func awsAwsjson11_deserializeOpErrorUpdateAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4564 var errorBuffer bytes.Buffer 4565 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4566 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4567 } 4568 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4569 4570 errorCode := "UnknownError" 4571 errorMessage := errorCode 4572 4573 code := response.Header.Get("X-Amzn-ErrorType") 4574 if len(code) != 0 { 4575 errorCode = restjson.SanitizeErrorCode(code) 4576 } 4577 4578 var buff [1024]byte 4579 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4580 4581 body := io.TeeReader(errorBody, ringBuffer) 4582 decoder := json.NewDecoder(body) 4583 decoder.UseNumber() 4584 code, message, err := restjson.GetErrorInfo(decoder) 4585 if err != nil { 4586 var snapshot bytes.Buffer 4587 io.Copy(&snapshot, ringBuffer) 4588 err = &smithy.DeserializationError{ 4589 Err: fmt.Errorf("failed to decode response body, %w", err), 4590 Snapshot: snapshot.Bytes(), 4591 } 4592 return err 4593 } 4594 4595 errorBody.Seek(0, io.SeekStart) 4596 if len(code) != 0 { 4597 errorCode = restjson.SanitizeErrorCode(code) 4598 } 4599 if len(message) != 0 { 4600 errorMessage = message 4601 } 4602 4603 switch { 4604 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4605 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4606 4607 case strings.EqualFold("InternalServiceErrorException", errorCode): 4608 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4609 4610 case strings.EqualFold("InvalidArgumentException", errorCode): 4611 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4612 4613 default: 4614 genericError := &smithy.GenericAPIError{ 4615 Code: errorCode, 4616 Message: errorMessage, 4617 } 4618 return genericError 4619 4620 } 4621} 4622 4623type awsAwsjson11_deserializeOpUpdateAcceleratorAttributes struct { 4624} 4625 4626func (*awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) ID() string { 4627 return "OperationDeserializer" 4628} 4629 4630func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4631 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4632) { 4633 out, metadata, err = next.HandleDeserialize(ctx, in) 4634 if err != nil { 4635 return out, metadata, err 4636 } 4637 4638 response, ok := out.RawResponse.(*smithyhttp.Response) 4639 if !ok { 4640 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4641 } 4642 4643 if response.StatusCode < 200 || response.StatusCode >= 300 { 4644 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(response, &metadata) 4645 } 4646 output := &UpdateAcceleratorAttributesOutput{} 4647 out.Result = output 4648 4649 var buff [1024]byte 4650 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4651 4652 body := io.TeeReader(response.Body, ringBuffer) 4653 decoder := json.NewDecoder(body) 4654 decoder.UseNumber() 4655 var shape interface{} 4656 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4657 var snapshot bytes.Buffer 4658 io.Copy(&snapshot, ringBuffer) 4659 err = &smithy.DeserializationError{ 4660 Err: fmt.Errorf("failed to decode response body, %w", err), 4661 Snapshot: snapshot.Bytes(), 4662 } 4663 return out, metadata, err 4664 } 4665 4666 err = awsAwsjson11_deserializeOpDocumentUpdateAcceleratorAttributesOutput(&output, shape) 4667 if err != nil { 4668 var snapshot bytes.Buffer 4669 io.Copy(&snapshot, ringBuffer) 4670 err = &smithy.DeserializationError{ 4671 Err: fmt.Errorf("failed to decode response body, %w", err), 4672 Snapshot: snapshot.Bytes(), 4673 } 4674 return out, metadata, err 4675 } 4676 4677 return out, metadata, err 4678} 4679 4680func awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4681 var errorBuffer bytes.Buffer 4682 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4683 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4684 } 4685 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4686 4687 errorCode := "UnknownError" 4688 errorMessage := errorCode 4689 4690 code := response.Header.Get("X-Amzn-ErrorType") 4691 if len(code) != 0 { 4692 errorCode = restjson.SanitizeErrorCode(code) 4693 } 4694 4695 var buff [1024]byte 4696 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4697 4698 body := io.TeeReader(errorBody, ringBuffer) 4699 decoder := json.NewDecoder(body) 4700 decoder.UseNumber() 4701 code, message, err := restjson.GetErrorInfo(decoder) 4702 if err != nil { 4703 var snapshot bytes.Buffer 4704 io.Copy(&snapshot, ringBuffer) 4705 err = &smithy.DeserializationError{ 4706 Err: fmt.Errorf("failed to decode response body, %w", err), 4707 Snapshot: snapshot.Bytes(), 4708 } 4709 return err 4710 } 4711 4712 errorBody.Seek(0, io.SeekStart) 4713 if len(code) != 0 { 4714 errorCode = restjson.SanitizeErrorCode(code) 4715 } 4716 if len(message) != 0 { 4717 errorMessage = message 4718 } 4719 4720 switch { 4721 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4722 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4723 4724 case strings.EqualFold("AccessDeniedException", errorCode): 4725 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 4726 4727 case strings.EqualFold("InternalServiceErrorException", errorCode): 4728 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4729 4730 case strings.EqualFold("InvalidArgumentException", errorCode): 4731 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4732 4733 default: 4734 genericError := &smithy.GenericAPIError{ 4735 Code: errorCode, 4736 Message: errorMessage, 4737 } 4738 return genericError 4739 4740 } 4741} 4742 4743type awsAwsjson11_deserializeOpUpdateCustomRoutingAccelerator struct { 4744} 4745 4746func (*awsAwsjson11_deserializeOpUpdateCustomRoutingAccelerator) ID() string { 4747 return "OperationDeserializer" 4748} 4749 4750func (m *awsAwsjson11_deserializeOpUpdateCustomRoutingAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4751 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4752) { 4753 out, metadata, err = next.HandleDeserialize(ctx, in) 4754 if err != nil { 4755 return out, metadata, err 4756 } 4757 4758 response, ok := out.RawResponse.(*smithyhttp.Response) 4759 if !ok { 4760 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4761 } 4762 4763 if response.StatusCode < 200 || response.StatusCode >= 300 { 4764 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCustomRoutingAccelerator(response, &metadata) 4765 } 4766 output := &UpdateCustomRoutingAcceleratorOutput{} 4767 out.Result = output 4768 4769 var buff [1024]byte 4770 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4771 4772 body := io.TeeReader(response.Body, ringBuffer) 4773 decoder := json.NewDecoder(body) 4774 decoder.UseNumber() 4775 var shape interface{} 4776 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4777 var snapshot bytes.Buffer 4778 io.Copy(&snapshot, ringBuffer) 4779 err = &smithy.DeserializationError{ 4780 Err: fmt.Errorf("failed to decode response body, %w", err), 4781 Snapshot: snapshot.Bytes(), 4782 } 4783 return out, metadata, err 4784 } 4785 4786 err = awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingAcceleratorOutput(&output, shape) 4787 if err != nil { 4788 var snapshot bytes.Buffer 4789 io.Copy(&snapshot, ringBuffer) 4790 err = &smithy.DeserializationError{ 4791 Err: fmt.Errorf("failed to decode response body, %w", err), 4792 Snapshot: snapshot.Bytes(), 4793 } 4794 return out, metadata, err 4795 } 4796 4797 return out, metadata, err 4798} 4799 4800func awsAwsjson11_deserializeOpErrorUpdateCustomRoutingAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4801 var errorBuffer bytes.Buffer 4802 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4803 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4804 } 4805 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4806 4807 errorCode := "UnknownError" 4808 errorMessage := errorCode 4809 4810 code := response.Header.Get("X-Amzn-ErrorType") 4811 if len(code) != 0 { 4812 errorCode = restjson.SanitizeErrorCode(code) 4813 } 4814 4815 var buff [1024]byte 4816 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4817 4818 body := io.TeeReader(errorBody, ringBuffer) 4819 decoder := json.NewDecoder(body) 4820 decoder.UseNumber() 4821 code, message, err := restjson.GetErrorInfo(decoder) 4822 if err != nil { 4823 var snapshot bytes.Buffer 4824 io.Copy(&snapshot, ringBuffer) 4825 err = &smithy.DeserializationError{ 4826 Err: fmt.Errorf("failed to decode response body, %w", err), 4827 Snapshot: snapshot.Bytes(), 4828 } 4829 return err 4830 } 4831 4832 errorBody.Seek(0, io.SeekStart) 4833 if len(code) != 0 { 4834 errorCode = restjson.SanitizeErrorCode(code) 4835 } 4836 if len(message) != 0 { 4837 errorMessage = message 4838 } 4839 4840 switch { 4841 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4842 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4843 4844 case strings.EqualFold("InternalServiceErrorException", errorCode): 4845 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4846 4847 case strings.EqualFold("InvalidArgumentException", errorCode): 4848 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4849 4850 default: 4851 genericError := &smithy.GenericAPIError{ 4852 Code: errorCode, 4853 Message: errorMessage, 4854 } 4855 return genericError 4856 4857 } 4858} 4859 4860type awsAwsjson11_deserializeOpUpdateCustomRoutingAcceleratorAttributes struct { 4861} 4862 4863func (*awsAwsjson11_deserializeOpUpdateCustomRoutingAcceleratorAttributes) ID() string { 4864 return "OperationDeserializer" 4865} 4866 4867func (m *awsAwsjson11_deserializeOpUpdateCustomRoutingAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4868 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4869) { 4870 out, metadata, err = next.HandleDeserialize(ctx, in) 4871 if err != nil { 4872 return out, metadata, err 4873 } 4874 4875 response, ok := out.RawResponse.(*smithyhttp.Response) 4876 if !ok { 4877 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4878 } 4879 4880 if response.StatusCode < 200 || response.StatusCode >= 300 { 4881 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCustomRoutingAcceleratorAttributes(response, &metadata) 4882 } 4883 output := &UpdateCustomRoutingAcceleratorAttributesOutput{} 4884 out.Result = output 4885 4886 var buff [1024]byte 4887 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4888 4889 body := io.TeeReader(response.Body, ringBuffer) 4890 decoder := json.NewDecoder(body) 4891 decoder.UseNumber() 4892 var shape interface{} 4893 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4894 var snapshot bytes.Buffer 4895 io.Copy(&snapshot, ringBuffer) 4896 err = &smithy.DeserializationError{ 4897 Err: fmt.Errorf("failed to decode response body, %w", err), 4898 Snapshot: snapshot.Bytes(), 4899 } 4900 return out, metadata, err 4901 } 4902 4903 err = awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingAcceleratorAttributesOutput(&output, shape) 4904 if err != nil { 4905 var snapshot bytes.Buffer 4906 io.Copy(&snapshot, ringBuffer) 4907 err = &smithy.DeserializationError{ 4908 Err: fmt.Errorf("failed to decode response body, %w", err), 4909 Snapshot: snapshot.Bytes(), 4910 } 4911 return out, metadata, err 4912 } 4913 4914 return out, metadata, err 4915} 4916 4917func awsAwsjson11_deserializeOpErrorUpdateCustomRoutingAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4918 var errorBuffer bytes.Buffer 4919 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4920 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4921 } 4922 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4923 4924 errorCode := "UnknownError" 4925 errorMessage := errorCode 4926 4927 code := response.Header.Get("X-Amzn-ErrorType") 4928 if len(code) != 0 { 4929 errorCode = restjson.SanitizeErrorCode(code) 4930 } 4931 4932 var buff [1024]byte 4933 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4934 4935 body := io.TeeReader(errorBody, ringBuffer) 4936 decoder := json.NewDecoder(body) 4937 decoder.UseNumber() 4938 code, message, err := restjson.GetErrorInfo(decoder) 4939 if err != nil { 4940 var snapshot bytes.Buffer 4941 io.Copy(&snapshot, ringBuffer) 4942 err = &smithy.DeserializationError{ 4943 Err: fmt.Errorf("failed to decode response body, %w", err), 4944 Snapshot: snapshot.Bytes(), 4945 } 4946 return err 4947 } 4948 4949 errorBody.Seek(0, io.SeekStart) 4950 if len(code) != 0 { 4951 errorCode = restjson.SanitizeErrorCode(code) 4952 } 4953 if len(message) != 0 { 4954 errorMessage = message 4955 } 4956 4957 switch { 4958 case strings.EqualFold("AcceleratorNotFoundException", errorCode): 4959 return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) 4960 4961 case strings.EqualFold("AccessDeniedException", errorCode): 4962 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 4963 4964 case strings.EqualFold("InternalServiceErrorException", errorCode): 4965 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 4966 4967 case strings.EqualFold("InvalidArgumentException", errorCode): 4968 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 4969 4970 default: 4971 genericError := &smithy.GenericAPIError{ 4972 Code: errorCode, 4973 Message: errorMessage, 4974 } 4975 return genericError 4976 4977 } 4978} 4979 4980type awsAwsjson11_deserializeOpUpdateCustomRoutingListener struct { 4981} 4982 4983func (*awsAwsjson11_deserializeOpUpdateCustomRoutingListener) ID() string { 4984 return "OperationDeserializer" 4985} 4986 4987func (m *awsAwsjson11_deserializeOpUpdateCustomRoutingListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4988 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4989) { 4990 out, metadata, err = next.HandleDeserialize(ctx, in) 4991 if err != nil { 4992 return out, metadata, err 4993 } 4994 4995 response, ok := out.RawResponse.(*smithyhttp.Response) 4996 if !ok { 4997 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4998 } 4999 5000 if response.StatusCode < 200 || response.StatusCode >= 300 { 5001 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCustomRoutingListener(response, &metadata) 5002 } 5003 output := &UpdateCustomRoutingListenerOutput{} 5004 out.Result = output 5005 5006 var buff [1024]byte 5007 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5008 5009 body := io.TeeReader(response.Body, ringBuffer) 5010 decoder := json.NewDecoder(body) 5011 decoder.UseNumber() 5012 var shape interface{} 5013 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5014 var snapshot bytes.Buffer 5015 io.Copy(&snapshot, ringBuffer) 5016 err = &smithy.DeserializationError{ 5017 Err: fmt.Errorf("failed to decode response body, %w", err), 5018 Snapshot: snapshot.Bytes(), 5019 } 5020 return out, metadata, err 5021 } 5022 5023 err = awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingListenerOutput(&output, shape) 5024 if err != nil { 5025 var snapshot bytes.Buffer 5026 io.Copy(&snapshot, ringBuffer) 5027 err = &smithy.DeserializationError{ 5028 Err: fmt.Errorf("failed to decode response body, %w", err), 5029 Snapshot: snapshot.Bytes(), 5030 } 5031 return out, metadata, err 5032 } 5033 5034 return out, metadata, err 5035} 5036 5037func awsAwsjson11_deserializeOpErrorUpdateCustomRoutingListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5038 var errorBuffer bytes.Buffer 5039 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5040 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5041 } 5042 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5043 5044 errorCode := "UnknownError" 5045 errorMessage := errorCode 5046 5047 code := response.Header.Get("X-Amzn-ErrorType") 5048 if len(code) != 0 { 5049 errorCode = restjson.SanitizeErrorCode(code) 5050 } 5051 5052 var buff [1024]byte 5053 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5054 5055 body := io.TeeReader(errorBody, ringBuffer) 5056 decoder := json.NewDecoder(body) 5057 decoder.UseNumber() 5058 code, message, err := restjson.GetErrorInfo(decoder) 5059 if err != nil { 5060 var snapshot bytes.Buffer 5061 io.Copy(&snapshot, ringBuffer) 5062 err = &smithy.DeserializationError{ 5063 Err: fmt.Errorf("failed to decode response body, %w", err), 5064 Snapshot: snapshot.Bytes(), 5065 } 5066 return err 5067 } 5068 5069 errorBody.Seek(0, io.SeekStart) 5070 if len(code) != 0 { 5071 errorCode = restjson.SanitizeErrorCode(code) 5072 } 5073 if len(message) != 0 { 5074 errorMessage = message 5075 } 5076 5077 switch { 5078 case strings.EqualFold("InternalServiceErrorException", errorCode): 5079 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 5080 5081 case strings.EqualFold("InvalidArgumentException", errorCode): 5082 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 5083 5084 case strings.EqualFold("InvalidPortRangeException", errorCode): 5085 return awsAwsjson11_deserializeErrorInvalidPortRangeException(response, errorBody) 5086 5087 case strings.EqualFold("LimitExceededException", errorCode): 5088 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 5089 5090 case strings.EqualFold("ListenerNotFoundException", errorCode): 5091 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 5092 5093 default: 5094 genericError := &smithy.GenericAPIError{ 5095 Code: errorCode, 5096 Message: errorMessage, 5097 } 5098 return genericError 5099 5100 } 5101} 5102 5103type awsAwsjson11_deserializeOpUpdateEndpointGroup struct { 5104} 5105 5106func (*awsAwsjson11_deserializeOpUpdateEndpointGroup) ID() string { 5107 return "OperationDeserializer" 5108} 5109 5110func (m *awsAwsjson11_deserializeOpUpdateEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5111 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5112) { 5113 out, metadata, err = next.HandleDeserialize(ctx, in) 5114 if err != nil { 5115 return out, metadata, err 5116 } 5117 5118 response, ok := out.RawResponse.(*smithyhttp.Response) 5119 if !ok { 5120 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5121 } 5122 5123 if response.StatusCode < 200 || response.StatusCode >= 300 { 5124 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateEndpointGroup(response, &metadata) 5125 } 5126 output := &UpdateEndpointGroupOutput{} 5127 out.Result = output 5128 5129 var buff [1024]byte 5130 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5131 5132 body := io.TeeReader(response.Body, ringBuffer) 5133 decoder := json.NewDecoder(body) 5134 decoder.UseNumber() 5135 var shape interface{} 5136 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5137 var snapshot bytes.Buffer 5138 io.Copy(&snapshot, ringBuffer) 5139 err = &smithy.DeserializationError{ 5140 Err: fmt.Errorf("failed to decode response body, %w", err), 5141 Snapshot: snapshot.Bytes(), 5142 } 5143 return out, metadata, err 5144 } 5145 5146 err = awsAwsjson11_deserializeOpDocumentUpdateEndpointGroupOutput(&output, shape) 5147 if err != nil { 5148 var snapshot bytes.Buffer 5149 io.Copy(&snapshot, ringBuffer) 5150 err = &smithy.DeserializationError{ 5151 Err: fmt.Errorf("failed to decode response body, %w", err), 5152 Snapshot: snapshot.Bytes(), 5153 } 5154 return out, metadata, err 5155 } 5156 5157 return out, metadata, err 5158} 5159 5160func awsAwsjson11_deserializeOpErrorUpdateEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5161 var errorBuffer bytes.Buffer 5162 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5163 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5164 } 5165 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5166 5167 errorCode := "UnknownError" 5168 errorMessage := errorCode 5169 5170 code := response.Header.Get("X-Amzn-ErrorType") 5171 if len(code) != 0 { 5172 errorCode = restjson.SanitizeErrorCode(code) 5173 } 5174 5175 var buff [1024]byte 5176 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5177 5178 body := io.TeeReader(errorBody, ringBuffer) 5179 decoder := json.NewDecoder(body) 5180 decoder.UseNumber() 5181 code, message, err := restjson.GetErrorInfo(decoder) 5182 if err != nil { 5183 var snapshot bytes.Buffer 5184 io.Copy(&snapshot, ringBuffer) 5185 err = &smithy.DeserializationError{ 5186 Err: fmt.Errorf("failed to decode response body, %w", err), 5187 Snapshot: snapshot.Bytes(), 5188 } 5189 return err 5190 } 5191 5192 errorBody.Seek(0, io.SeekStart) 5193 if len(code) != 0 { 5194 errorCode = restjson.SanitizeErrorCode(code) 5195 } 5196 if len(message) != 0 { 5197 errorMessage = message 5198 } 5199 5200 switch { 5201 case strings.EqualFold("AccessDeniedException", errorCode): 5202 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 5203 5204 case strings.EqualFold("EndpointGroupNotFoundException", errorCode): 5205 return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) 5206 5207 case strings.EqualFold("InternalServiceErrorException", errorCode): 5208 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 5209 5210 case strings.EqualFold("InvalidArgumentException", errorCode): 5211 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 5212 5213 case strings.EqualFold("LimitExceededException", errorCode): 5214 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 5215 5216 default: 5217 genericError := &smithy.GenericAPIError{ 5218 Code: errorCode, 5219 Message: errorMessage, 5220 } 5221 return genericError 5222 5223 } 5224} 5225 5226type awsAwsjson11_deserializeOpUpdateListener struct { 5227} 5228 5229func (*awsAwsjson11_deserializeOpUpdateListener) ID() string { 5230 return "OperationDeserializer" 5231} 5232 5233func (m *awsAwsjson11_deserializeOpUpdateListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5234 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5235) { 5236 out, metadata, err = next.HandleDeserialize(ctx, in) 5237 if err != nil { 5238 return out, metadata, err 5239 } 5240 5241 response, ok := out.RawResponse.(*smithyhttp.Response) 5242 if !ok { 5243 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5244 } 5245 5246 if response.StatusCode < 200 || response.StatusCode >= 300 { 5247 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateListener(response, &metadata) 5248 } 5249 output := &UpdateListenerOutput{} 5250 out.Result = output 5251 5252 var buff [1024]byte 5253 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5254 5255 body := io.TeeReader(response.Body, ringBuffer) 5256 decoder := json.NewDecoder(body) 5257 decoder.UseNumber() 5258 var shape interface{} 5259 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5260 var snapshot bytes.Buffer 5261 io.Copy(&snapshot, ringBuffer) 5262 err = &smithy.DeserializationError{ 5263 Err: fmt.Errorf("failed to decode response body, %w", err), 5264 Snapshot: snapshot.Bytes(), 5265 } 5266 return out, metadata, err 5267 } 5268 5269 err = awsAwsjson11_deserializeOpDocumentUpdateListenerOutput(&output, shape) 5270 if err != nil { 5271 var snapshot bytes.Buffer 5272 io.Copy(&snapshot, ringBuffer) 5273 err = &smithy.DeserializationError{ 5274 Err: fmt.Errorf("failed to decode response body, %w", err), 5275 Snapshot: snapshot.Bytes(), 5276 } 5277 return out, metadata, err 5278 } 5279 5280 return out, metadata, err 5281} 5282 5283func awsAwsjson11_deserializeOpErrorUpdateListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5284 var errorBuffer bytes.Buffer 5285 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5286 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5287 } 5288 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5289 5290 errorCode := "UnknownError" 5291 errorMessage := errorCode 5292 5293 code := response.Header.Get("X-Amzn-ErrorType") 5294 if len(code) != 0 { 5295 errorCode = restjson.SanitizeErrorCode(code) 5296 } 5297 5298 var buff [1024]byte 5299 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5300 5301 body := io.TeeReader(errorBody, ringBuffer) 5302 decoder := json.NewDecoder(body) 5303 decoder.UseNumber() 5304 code, message, err := restjson.GetErrorInfo(decoder) 5305 if err != nil { 5306 var snapshot bytes.Buffer 5307 io.Copy(&snapshot, ringBuffer) 5308 err = &smithy.DeserializationError{ 5309 Err: fmt.Errorf("failed to decode response body, %w", err), 5310 Snapshot: snapshot.Bytes(), 5311 } 5312 return err 5313 } 5314 5315 errorBody.Seek(0, io.SeekStart) 5316 if len(code) != 0 { 5317 errorCode = restjson.SanitizeErrorCode(code) 5318 } 5319 if len(message) != 0 { 5320 errorMessage = message 5321 } 5322 5323 switch { 5324 case strings.EqualFold("InternalServiceErrorException", errorCode): 5325 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 5326 5327 case strings.EqualFold("InvalidArgumentException", errorCode): 5328 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 5329 5330 case strings.EqualFold("InvalidPortRangeException", errorCode): 5331 return awsAwsjson11_deserializeErrorInvalidPortRangeException(response, errorBody) 5332 5333 case strings.EqualFold("LimitExceededException", errorCode): 5334 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 5335 5336 case strings.EqualFold("ListenerNotFoundException", errorCode): 5337 return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) 5338 5339 default: 5340 genericError := &smithy.GenericAPIError{ 5341 Code: errorCode, 5342 Message: errorMessage, 5343 } 5344 return genericError 5345 5346 } 5347} 5348 5349type awsAwsjson11_deserializeOpWithdrawByoipCidr struct { 5350} 5351 5352func (*awsAwsjson11_deserializeOpWithdrawByoipCidr) ID() string { 5353 return "OperationDeserializer" 5354} 5355 5356func (m *awsAwsjson11_deserializeOpWithdrawByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5357 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5358) { 5359 out, metadata, err = next.HandleDeserialize(ctx, in) 5360 if err != nil { 5361 return out, metadata, err 5362 } 5363 5364 response, ok := out.RawResponse.(*smithyhttp.Response) 5365 if !ok { 5366 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5367 } 5368 5369 if response.StatusCode < 200 || response.StatusCode >= 300 { 5370 return out, metadata, awsAwsjson11_deserializeOpErrorWithdrawByoipCidr(response, &metadata) 5371 } 5372 output := &WithdrawByoipCidrOutput{} 5373 out.Result = output 5374 5375 var buff [1024]byte 5376 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5377 5378 body := io.TeeReader(response.Body, ringBuffer) 5379 decoder := json.NewDecoder(body) 5380 decoder.UseNumber() 5381 var shape interface{} 5382 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5383 var snapshot bytes.Buffer 5384 io.Copy(&snapshot, ringBuffer) 5385 err = &smithy.DeserializationError{ 5386 Err: fmt.Errorf("failed to decode response body, %w", err), 5387 Snapshot: snapshot.Bytes(), 5388 } 5389 return out, metadata, err 5390 } 5391 5392 err = awsAwsjson11_deserializeOpDocumentWithdrawByoipCidrOutput(&output, shape) 5393 if err != nil { 5394 var snapshot bytes.Buffer 5395 io.Copy(&snapshot, ringBuffer) 5396 err = &smithy.DeserializationError{ 5397 Err: fmt.Errorf("failed to decode response body, %w", err), 5398 Snapshot: snapshot.Bytes(), 5399 } 5400 return out, metadata, err 5401 } 5402 5403 return out, metadata, err 5404} 5405 5406func awsAwsjson11_deserializeOpErrorWithdrawByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5407 var errorBuffer bytes.Buffer 5408 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5409 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5410 } 5411 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5412 5413 errorCode := "UnknownError" 5414 errorMessage := errorCode 5415 5416 code := response.Header.Get("X-Amzn-ErrorType") 5417 if len(code) != 0 { 5418 errorCode = restjson.SanitizeErrorCode(code) 5419 } 5420 5421 var buff [1024]byte 5422 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5423 5424 body := io.TeeReader(errorBody, ringBuffer) 5425 decoder := json.NewDecoder(body) 5426 decoder.UseNumber() 5427 code, message, err := restjson.GetErrorInfo(decoder) 5428 if err != nil { 5429 var snapshot bytes.Buffer 5430 io.Copy(&snapshot, ringBuffer) 5431 err = &smithy.DeserializationError{ 5432 Err: fmt.Errorf("failed to decode response body, %w", err), 5433 Snapshot: snapshot.Bytes(), 5434 } 5435 return err 5436 } 5437 5438 errorBody.Seek(0, io.SeekStart) 5439 if len(code) != 0 { 5440 errorCode = restjson.SanitizeErrorCode(code) 5441 } 5442 if len(message) != 0 { 5443 errorMessage = message 5444 } 5445 5446 switch { 5447 case strings.EqualFold("AccessDeniedException", errorCode): 5448 return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) 5449 5450 case strings.EqualFold("ByoipCidrNotFoundException", errorCode): 5451 return awsAwsjson11_deserializeErrorByoipCidrNotFoundException(response, errorBody) 5452 5453 case strings.EqualFold("IncorrectCidrStateException", errorCode): 5454 return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) 5455 5456 case strings.EqualFold("InternalServiceErrorException", errorCode): 5457 return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) 5458 5459 case strings.EqualFold("InvalidArgumentException", errorCode): 5460 return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) 5461 5462 default: 5463 genericError := &smithy.GenericAPIError{ 5464 Code: errorCode, 5465 Message: errorMessage, 5466 } 5467 return genericError 5468 5469 } 5470} 5471 5472func awsAwsjson11_deserializeErrorAcceleratorNotDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5473 var buff [1024]byte 5474 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5475 5476 body := io.TeeReader(errorBody, ringBuffer) 5477 decoder := json.NewDecoder(body) 5478 decoder.UseNumber() 5479 var shape interface{} 5480 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5481 var snapshot bytes.Buffer 5482 io.Copy(&snapshot, ringBuffer) 5483 err = &smithy.DeserializationError{ 5484 Err: fmt.Errorf("failed to decode response body, %w", err), 5485 Snapshot: snapshot.Bytes(), 5486 } 5487 return err 5488 } 5489 5490 output := &types.AcceleratorNotDisabledException{} 5491 err := awsAwsjson11_deserializeDocumentAcceleratorNotDisabledException(&output, shape) 5492 5493 if err != nil { 5494 var snapshot bytes.Buffer 5495 io.Copy(&snapshot, ringBuffer) 5496 err = &smithy.DeserializationError{ 5497 Err: fmt.Errorf("failed to decode response body, %w", err), 5498 Snapshot: snapshot.Bytes(), 5499 } 5500 return err 5501 } 5502 5503 errorBody.Seek(0, io.SeekStart) 5504 return output 5505} 5506 5507func awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5508 var buff [1024]byte 5509 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5510 5511 body := io.TeeReader(errorBody, ringBuffer) 5512 decoder := json.NewDecoder(body) 5513 decoder.UseNumber() 5514 var shape interface{} 5515 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5516 var snapshot bytes.Buffer 5517 io.Copy(&snapshot, ringBuffer) 5518 err = &smithy.DeserializationError{ 5519 Err: fmt.Errorf("failed to decode response body, %w", err), 5520 Snapshot: snapshot.Bytes(), 5521 } 5522 return err 5523 } 5524 5525 output := &types.AcceleratorNotFoundException{} 5526 err := awsAwsjson11_deserializeDocumentAcceleratorNotFoundException(&output, shape) 5527 5528 if err != nil { 5529 var snapshot bytes.Buffer 5530 io.Copy(&snapshot, ringBuffer) 5531 err = &smithy.DeserializationError{ 5532 Err: fmt.Errorf("failed to decode response body, %w", err), 5533 Snapshot: snapshot.Bytes(), 5534 } 5535 return err 5536 } 5537 5538 errorBody.Seek(0, io.SeekStart) 5539 return output 5540} 5541 5542func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5543 var buff [1024]byte 5544 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5545 5546 body := io.TeeReader(errorBody, ringBuffer) 5547 decoder := json.NewDecoder(body) 5548 decoder.UseNumber() 5549 var shape interface{} 5550 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5551 var snapshot bytes.Buffer 5552 io.Copy(&snapshot, ringBuffer) 5553 err = &smithy.DeserializationError{ 5554 Err: fmt.Errorf("failed to decode response body, %w", err), 5555 Snapshot: snapshot.Bytes(), 5556 } 5557 return err 5558 } 5559 5560 output := &types.AccessDeniedException{} 5561 err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) 5562 5563 if err != nil { 5564 var snapshot bytes.Buffer 5565 io.Copy(&snapshot, ringBuffer) 5566 err = &smithy.DeserializationError{ 5567 Err: fmt.Errorf("failed to decode response body, %w", err), 5568 Snapshot: snapshot.Bytes(), 5569 } 5570 return err 5571 } 5572 5573 errorBody.Seek(0, io.SeekStart) 5574 return output 5575} 5576 5577func awsAwsjson11_deserializeErrorAssociatedEndpointGroupFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5578 var buff [1024]byte 5579 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5580 5581 body := io.TeeReader(errorBody, ringBuffer) 5582 decoder := json.NewDecoder(body) 5583 decoder.UseNumber() 5584 var shape interface{} 5585 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5586 var snapshot bytes.Buffer 5587 io.Copy(&snapshot, ringBuffer) 5588 err = &smithy.DeserializationError{ 5589 Err: fmt.Errorf("failed to decode response body, %w", err), 5590 Snapshot: snapshot.Bytes(), 5591 } 5592 return err 5593 } 5594 5595 output := &types.AssociatedEndpointGroupFoundException{} 5596 err := awsAwsjson11_deserializeDocumentAssociatedEndpointGroupFoundException(&output, shape) 5597 5598 if err != nil { 5599 var snapshot bytes.Buffer 5600 io.Copy(&snapshot, ringBuffer) 5601 err = &smithy.DeserializationError{ 5602 Err: fmt.Errorf("failed to decode response body, %w", err), 5603 Snapshot: snapshot.Bytes(), 5604 } 5605 return err 5606 } 5607 5608 errorBody.Seek(0, io.SeekStart) 5609 return output 5610} 5611 5612func awsAwsjson11_deserializeErrorAssociatedListenerFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5613 var buff [1024]byte 5614 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5615 5616 body := io.TeeReader(errorBody, ringBuffer) 5617 decoder := json.NewDecoder(body) 5618 decoder.UseNumber() 5619 var shape interface{} 5620 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5621 var snapshot bytes.Buffer 5622 io.Copy(&snapshot, ringBuffer) 5623 err = &smithy.DeserializationError{ 5624 Err: fmt.Errorf("failed to decode response body, %w", err), 5625 Snapshot: snapshot.Bytes(), 5626 } 5627 return err 5628 } 5629 5630 output := &types.AssociatedListenerFoundException{} 5631 err := awsAwsjson11_deserializeDocumentAssociatedListenerFoundException(&output, shape) 5632 5633 if err != nil { 5634 var snapshot bytes.Buffer 5635 io.Copy(&snapshot, ringBuffer) 5636 err = &smithy.DeserializationError{ 5637 Err: fmt.Errorf("failed to decode response body, %w", err), 5638 Snapshot: snapshot.Bytes(), 5639 } 5640 return err 5641 } 5642 5643 errorBody.Seek(0, io.SeekStart) 5644 return output 5645} 5646 5647func awsAwsjson11_deserializeErrorByoipCidrNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5648 var buff [1024]byte 5649 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5650 5651 body := io.TeeReader(errorBody, ringBuffer) 5652 decoder := json.NewDecoder(body) 5653 decoder.UseNumber() 5654 var shape interface{} 5655 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5656 var snapshot bytes.Buffer 5657 io.Copy(&snapshot, ringBuffer) 5658 err = &smithy.DeserializationError{ 5659 Err: fmt.Errorf("failed to decode response body, %w", err), 5660 Snapshot: snapshot.Bytes(), 5661 } 5662 return err 5663 } 5664 5665 output := &types.ByoipCidrNotFoundException{} 5666 err := awsAwsjson11_deserializeDocumentByoipCidrNotFoundException(&output, shape) 5667 5668 if err != nil { 5669 var snapshot bytes.Buffer 5670 io.Copy(&snapshot, ringBuffer) 5671 err = &smithy.DeserializationError{ 5672 Err: fmt.Errorf("failed to decode response body, %w", err), 5673 Snapshot: snapshot.Bytes(), 5674 } 5675 return err 5676 } 5677 5678 errorBody.Seek(0, io.SeekStart) 5679 return output 5680} 5681 5682func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5683 var buff [1024]byte 5684 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5685 5686 body := io.TeeReader(errorBody, ringBuffer) 5687 decoder := json.NewDecoder(body) 5688 decoder.UseNumber() 5689 var shape interface{} 5690 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5691 var snapshot bytes.Buffer 5692 io.Copy(&snapshot, ringBuffer) 5693 err = &smithy.DeserializationError{ 5694 Err: fmt.Errorf("failed to decode response body, %w", err), 5695 Snapshot: snapshot.Bytes(), 5696 } 5697 return err 5698 } 5699 5700 output := &types.ConflictException{} 5701 err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) 5702 5703 if err != nil { 5704 var snapshot bytes.Buffer 5705 io.Copy(&snapshot, ringBuffer) 5706 err = &smithy.DeserializationError{ 5707 Err: fmt.Errorf("failed to decode response body, %w", err), 5708 Snapshot: snapshot.Bytes(), 5709 } 5710 return err 5711 } 5712 5713 errorBody.Seek(0, io.SeekStart) 5714 return output 5715} 5716 5717func awsAwsjson11_deserializeErrorEndpointAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5718 var buff [1024]byte 5719 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5720 5721 body := io.TeeReader(errorBody, ringBuffer) 5722 decoder := json.NewDecoder(body) 5723 decoder.UseNumber() 5724 var shape interface{} 5725 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5726 var snapshot bytes.Buffer 5727 io.Copy(&snapshot, ringBuffer) 5728 err = &smithy.DeserializationError{ 5729 Err: fmt.Errorf("failed to decode response body, %w", err), 5730 Snapshot: snapshot.Bytes(), 5731 } 5732 return err 5733 } 5734 5735 output := &types.EndpointAlreadyExistsException{} 5736 err := awsAwsjson11_deserializeDocumentEndpointAlreadyExistsException(&output, shape) 5737 5738 if err != nil { 5739 var snapshot bytes.Buffer 5740 io.Copy(&snapshot, ringBuffer) 5741 err = &smithy.DeserializationError{ 5742 Err: fmt.Errorf("failed to decode response body, %w", err), 5743 Snapshot: snapshot.Bytes(), 5744 } 5745 return err 5746 } 5747 5748 errorBody.Seek(0, io.SeekStart) 5749 return output 5750} 5751 5752func awsAwsjson11_deserializeErrorEndpointGroupAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5753 var buff [1024]byte 5754 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5755 5756 body := io.TeeReader(errorBody, ringBuffer) 5757 decoder := json.NewDecoder(body) 5758 decoder.UseNumber() 5759 var shape interface{} 5760 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5761 var snapshot bytes.Buffer 5762 io.Copy(&snapshot, ringBuffer) 5763 err = &smithy.DeserializationError{ 5764 Err: fmt.Errorf("failed to decode response body, %w", err), 5765 Snapshot: snapshot.Bytes(), 5766 } 5767 return err 5768 } 5769 5770 output := &types.EndpointGroupAlreadyExistsException{} 5771 err := awsAwsjson11_deserializeDocumentEndpointGroupAlreadyExistsException(&output, shape) 5772 5773 if err != nil { 5774 var snapshot bytes.Buffer 5775 io.Copy(&snapshot, ringBuffer) 5776 err = &smithy.DeserializationError{ 5777 Err: fmt.Errorf("failed to decode response body, %w", err), 5778 Snapshot: snapshot.Bytes(), 5779 } 5780 return err 5781 } 5782 5783 errorBody.Seek(0, io.SeekStart) 5784 return output 5785} 5786 5787func awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5788 var buff [1024]byte 5789 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5790 5791 body := io.TeeReader(errorBody, ringBuffer) 5792 decoder := json.NewDecoder(body) 5793 decoder.UseNumber() 5794 var shape interface{} 5795 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5796 var snapshot bytes.Buffer 5797 io.Copy(&snapshot, ringBuffer) 5798 err = &smithy.DeserializationError{ 5799 Err: fmt.Errorf("failed to decode response body, %w", err), 5800 Snapshot: snapshot.Bytes(), 5801 } 5802 return err 5803 } 5804 5805 output := &types.EndpointGroupNotFoundException{} 5806 err := awsAwsjson11_deserializeDocumentEndpointGroupNotFoundException(&output, shape) 5807 5808 if err != nil { 5809 var snapshot bytes.Buffer 5810 io.Copy(&snapshot, ringBuffer) 5811 err = &smithy.DeserializationError{ 5812 Err: fmt.Errorf("failed to decode response body, %w", err), 5813 Snapshot: snapshot.Bytes(), 5814 } 5815 return err 5816 } 5817 5818 errorBody.Seek(0, io.SeekStart) 5819 return output 5820} 5821 5822func awsAwsjson11_deserializeErrorEndpointNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5823 var buff [1024]byte 5824 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5825 5826 body := io.TeeReader(errorBody, ringBuffer) 5827 decoder := json.NewDecoder(body) 5828 decoder.UseNumber() 5829 var shape interface{} 5830 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5831 var snapshot bytes.Buffer 5832 io.Copy(&snapshot, ringBuffer) 5833 err = &smithy.DeserializationError{ 5834 Err: fmt.Errorf("failed to decode response body, %w", err), 5835 Snapshot: snapshot.Bytes(), 5836 } 5837 return err 5838 } 5839 5840 output := &types.EndpointNotFoundException{} 5841 err := awsAwsjson11_deserializeDocumentEndpointNotFoundException(&output, shape) 5842 5843 if err != nil { 5844 var snapshot bytes.Buffer 5845 io.Copy(&snapshot, ringBuffer) 5846 err = &smithy.DeserializationError{ 5847 Err: fmt.Errorf("failed to decode response body, %w", err), 5848 Snapshot: snapshot.Bytes(), 5849 } 5850 return err 5851 } 5852 5853 errorBody.Seek(0, io.SeekStart) 5854 return output 5855} 5856 5857func awsAwsjson11_deserializeErrorIncorrectCidrStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5858 var buff [1024]byte 5859 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5860 5861 body := io.TeeReader(errorBody, ringBuffer) 5862 decoder := json.NewDecoder(body) 5863 decoder.UseNumber() 5864 var shape interface{} 5865 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5866 var snapshot bytes.Buffer 5867 io.Copy(&snapshot, ringBuffer) 5868 err = &smithy.DeserializationError{ 5869 Err: fmt.Errorf("failed to decode response body, %w", err), 5870 Snapshot: snapshot.Bytes(), 5871 } 5872 return err 5873 } 5874 5875 output := &types.IncorrectCidrStateException{} 5876 err := awsAwsjson11_deserializeDocumentIncorrectCidrStateException(&output, shape) 5877 5878 if err != nil { 5879 var snapshot bytes.Buffer 5880 io.Copy(&snapshot, ringBuffer) 5881 err = &smithy.DeserializationError{ 5882 Err: fmt.Errorf("failed to decode response body, %w", err), 5883 Snapshot: snapshot.Bytes(), 5884 } 5885 return err 5886 } 5887 5888 errorBody.Seek(0, io.SeekStart) 5889 return output 5890} 5891 5892func awsAwsjson11_deserializeErrorInternalServiceErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5893 var buff [1024]byte 5894 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5895 5896 body := io.TeeReader(errorBody, ringBuffer) 5897 decoder := json.NewDecoder(body) 5898 decoder.UseNumber() 5899 var shape interface{} 5900 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5901 var snapshot bytes.Buffer 5902 io.Copy(&snapshot, ringBuffer) 5903 err = &smithy.DeserializationError{ 5904 Err: fmt.Errorf("failed to decode response body, %w", err), 5905 Snapshot: snapshot.Bytes(), 5906 } 5907 return err 5908 } 5909 5910 output := &types.InternalServiceErrorException{} 5911 err := awsAwsjson11_deserializeDocumentInternalServiceErrorException(&output, shape) 5912 5913 if err != nil { 5914 var snapshot bytes.Buffer 5915 io.Copy(&snapshot, ringBuffer) 5916 err = &smithy.DeserializationError{ 5917 Err: fmt.Errorf("failed to decode response body, %w", err), 5918 Snapshot: snapshot.Bytes(), 5919 } 5920 return err 5921 } 5922 5923 errorBody.Seek(0, io.SeekStart) 5924 return output 5925} 5926 5927func awsAwsjson11_deserializeErrorInvalidArgumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5928 var buff [1024]byte 5929 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5930 5931 body := io.TeeReader(errorBody, ringBuffer) 5932 decoder := json.NewDecoder(body) 5933 decoder.UseNumber() 5934 var shape interface{} 5935 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5936 var snapshot bytes.Buffer 5937 io.Copy(&snapshot, ringBuffer) 5938 err = &smithy.DeserializationError{ 5939 Err: fmt.Errorf("failed to decode response body, %w", err), 5940 Snapshot: snapshot.Bytes(), 5941 } 5942 return err 5943 } 5944 5945 output := &types.InvalidArgumentException{} 5946 err := awsAwsjson11_deserializeDocumentInvalidArgumentException(&output, shape) 5947 5948 if err != nil { 5949 var snapshot bytes.Buffer 5950 io.Copy(&snapshot, ringBuffer) 5951 err = &smithy.DeserializationError{ 5952 Err: fmt.Errorf("failed to decode response body, %w", err), 5953 Snapshot: snapshot.Bytes(), 5954 } 5955 return err 5956 } 5957 5958 errorBody.Seek(0, io.SeekStart) 5959 return output 5960} 5961 5962func awsAwsjson11_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5963 var buff [1024]byte 5964 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5965 5966 body := io.TeeReader(errorBody, ringBuffer) 5967 decoder := json.NewDecoder(body) 5968 decoder.UseNumber() 5969 var shape interface{} 5970 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5971 var snapshot bytes.Buffer 5972 io.Copy(&snapshot, ringBuffer) 5973 err = &smithy.DeserializationError{ 5974 Err: fmt.Errorf("failed to decode response body, %w", err), 5975 Snapshot: snapshot.Bytes(), 5976 } 5977 return err 5978 } 5979 5980 output := &types.InvalidNextTokenException{} 5981 err := awsAwsjson11_deserializeDocumentInvalidNextTokenException(&output, shape) 5982 5983 if err != nil { 5984 var snapshot bytes.Buffer 5985 io.Copy(&snapshot, ringBuffer) 5986 err = &smithy.DeserializationError{ 5987 Err: fmt.Errorf("failed to decode response body, %w", err), 5988 Snapshot: snapshot.Bytes(), 5989 } 5990 return err 5991 } 5992 5993 errorBody.Seek(0, io.SeekStart) 5994 return output 5995} 5996 5997func awsAwsjson11_deserializeErrorInvalidPortRangeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5998 var buff [1024]byte 5999 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6000 6001 body := io.TeeReader(errorBody, ringBuffer) 6002 decoder := json.NewDecoder(body) 6003 decoder.UseNumber() 6004 var shape interface{} 6005 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6006 var snapshot bytes.Buffer 6007 io.Copy(&snapshot, ringBuffer) 6008 err = &smithy.DeserializationError{ 6009 Err: fmt.Errorf("failed to decode response body, %w", err), 6010 Snapshot: snapshot.Bytes(), 6011 } 6012 return err 6013 } 6014 6015 output := &types.InvalidPortRangeException{} 6016 err := awsAwsjson11_deserializeDocumentInvalidPortRangeException(&output, shape) 6017 6018 if err != nil { 6019 var snapshot bytes.Buffer 6020 io.Copy(&snapshot, ringBuffer) 6021 err = &smithy.DeserializationError{ 6022 Err: fmt.Errorf("failed to decode response body, %w", err), 6023 Snapshot: snapshot.Bytes(), 6024 } 6025 return err 6026 } 6027 6028 errorBody.Seek(0, io.SeekStart) 6029 return output 6030} 6031 6032func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6033 var buff [1024]byte 6034 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6035 6036 body := io.TeeReader(errorBody, ringBuffer) 6037 decoder := json.NewDecoder(body) 6038 decoder.UseNumber() 6039 var shape interface{} 6040 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6041 var snapshot bytes.Buffer 6042 io.Copy(&snapshot, ringBuffer) 6043 err = &smithy.DeserializationError{ 6044 Err: fmt.Errorf("failed to decode response body, %w", err), 6045 Snapshot: snapshot.Bytes(), 6046 } 6047 return err 6048 } 6049 6050 output := &types.LimitExceededException{} 6051 err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) 6052 6053 if err != nil { 6054 var snapshot bytes.Buffer 6055 io.Copy(&snapshot, ringBuffer) 6056 err = &smithy.DeserializationError{ 6057 Err: fmt.Errorf("failed to decode response body, %w", err), 6058 Snapshot: snapshot.Bytes(), 6059 } 6060 return err 6061 } 6062 6063 errorBody.Seek(0, io.SeekStart) 6064 return output 6065} 6066 6067func awsAwsjson11_deserializeErrorListenerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6068 var buff [1024]byte 6069 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6070 6071 body := io.TeeReader(errorBody, ringBuffer) 6072 decoder := json.NewDecoder(body) 6073 decoder.UseNumber() 6074 var shape interface{} 6075 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6076 var snapshot bytes.Buffer 6077 io.Copy(&snapshot, ringBuffer) 6078 err = &smithy.DeserializationError{ 6079 Err: fmt.Errorf("failed to decode response body, %w", err), 6080 Snapshot: snapshot.Bytes(), 6081 } 6082 return err 6083 } 6084 6085 output := &types.ListenerNotFoundException{} 6086 err := awsAwsjson11_deserializeDocumentListenerNotFoundException(&output, shape) 6087 6088 if err != nil { 6089 var snapshot bytes.Buffer 6090 io.Copy(&snapshot, ringBuffer) 6091 err = &smithy.DeserializationError{ 6092 Err: fmt.Errorf("failed to decode response body, %w", err), 6093 Snapshot: snapshot.Bytes(), 6094 } 6095 return err 6096 } 6097 6098 errorBody.Seek(0, io.SeekStart) 6099 return output 6100} 6101 6102func awsAwsjson11_deserializeDocumentAccelerator(v **types.Accelerator, value interface{}) error { 6103 if v == nil { 6104 return fmt.Errorf("unexpected nil of type %T", v) 6105 } 6106 if value == nil { 6107 return nil 6108 } 6109 6110 shape, ok := value.(map[string]interface{}) 6111 if !ok { 6112 return fmt.Errorf("unexpected JSON type %v", value) 6113 } 6114 6115 var sv *types.Accelerator 6116 if *v == nil { 6117 sv = &types.Accelerator{} 6118 } else { 6119 sv = *v 6120 } 6121 6122 for key, value := range shape { 6123 switch key { 6124 case "AcceleratorArn": 6125 if value != nil { 6126 jtv, ok := value.(string) 6127 if !ok { 6128 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6129 } 6130 sv.AcceleratorArn = ptr.String(jtv) 6131 } 6132 6133 case "CreatedTime": 6134 if value != nil { 6135 switch jtv := value.(type) { 6136 case json.Number: 6137 f64, err := jtv.Float64() 6138 if err != nil { 6139 return err 6140 } 6141 sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6142 6143 default: 6144 return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) 6145 6146 } 6147 } 6148 6149 case "DnsName": 6150 if value != nil { 6151 jtv, ok := value.(string) 6152 if !ok { 6153 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6154 } 6155 sv.DnsName = ptr.String(jtv) 6156 } 6157 6158 case "Enabled": 6159 if value != nil { 6160 jtv, ok := value.(bool) 6161 if !ok { 6162 return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) 6163 } 6164 sv.Enabled = ptr.Bool(jtv) 6165 } 6166 6167 case "IpAddressType": 6168 if value != nil { 6169 jtv, ok := value.(string) 6170 if !ok { 6171 return fmt.Errorf("expected IpAddressType to be of type string, got %T instead", value) 6172 } 6173 sv.IpAddressType = types.IpAddressType(jtv) 6174 } 6175 6176 case "IpSets": 6177 if err := awsAwsjson11_deserializeDocumentIpSets(&sv.IpSets, value); err != nil { 6178 return err 6179 } 6180 6181 case "LastModifiedTime": 6182 if value != nil { 6183 switch jtv := value.(type) { 6184 case json.Number: 6185 f64, err := jtv.Float64() 6186 if err != nil { 6187 return err 6188 } 6189 sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6190 6191 default: 6192 return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) 6193 6194 } 6195 } 6196 6197 case "Name": 6198 if value != nil { 6199 jtv, ok := value.(string) 6200 if !ok { 6201 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6202 } 6203 sv.Name = ptr.String(jtv) 6204 } 6205 6206 case "Status": 6207 if value != nil { 6208 jtv, ok := value.(string) 6209 if !ok { 6210 return fmt.Errorf("expected AcceleratorStatus to be of type string, got %T instead", value) 6211 } 6212 sv.Status = types.AcceleratorStatus(jtv) 6213 } 6214 6215 default: 6216 _, _ = key, value 6217 6218 } 6219 } 6220 *v = sv 6221 return nil 6222} 6223 6224func awsAwsjson11_deserializeDocumentAcceleratorAttributes(v **types.AcceleratorAttributes, value interface{}) error { 6225 if v == nil { 6226 return fmt.Errorf("unexpected nil of type %T", v) 6227 } 6228 if value == nil { 6229 return nil 6230 } 6231 6232 shape, ok := value.(map[string]interface{}) 6233 if !ok { 6234 return fmt.Errorf("unexpected JSON type %v", value) 6235 } 6236 6237 var sv *types.AcceleratorAttributes 6238 if *v == nil { 6239 sv = &types.AcceleratorAttributes{} 6240 } else { 6241 sv = *v 6242 } 6243 6244 for key, value := range shape { 6245 switch key { 6246 case "FlowLogsEnabled": 6247 if value != nil { 6248 jtv, ok := value.(bool) 6249 if !ok { 6250 return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) 6251 } 6252 sv.FlowLogsEnabled = ptr.Bool(jtv) 6253 } 6254 6255 case "FlowLogsS3Bucket": 6256 if value != nil { 6257 jtv, ok := value.(string) 6258 if !ok { 6259 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6260 } 6261 sv.FlowLogsS3Bucket = ptr.String(jtv) 6262 } 6263 6264 case "FlowLogsS3Prefix": 6265 if value != nil { 6266 jtv, ok := value.(string) 6267 if !ok { 6268 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6269 } 6270 sv.FlowLogsS3Prefix = ptr.String(jtv) 6271 } 6272 6273 default: 6274 _, _ = key, value 6275 6276 } 6277 } 6278 *v = sv 6279 return nil 6280} 6281 6282func awsAwsjson11_deserializeDocumentAcceleratorNotDisabledException(v **types.AcceleratorNotDisabledException, value interface{}) error { 6283 if v == nil { 6284 return fmt.Errorf("unexpected nil of type %T", v) 6285 } 6286 if value == nil { 6287 return nil 6288 } 6289 6290 shape, ok := value.(map[string]interface{}) 6291 if !ok { 6292 return fmt.Errorf("unexpected JSON type %v", value) 6293 } 6294 6295 var sv *types.AcceleratorNotDisabledException 6296 if *v == nil { 6297 sv = &types.AcceleratorNotDisabledException{} 6298 } else { 6299 sv = *v 6300 } 6301 6302 for key, value := range shape { 6303 switch key { 6304 case "Message": 6305 if value != nil { 6306 jtv, ok := value.(string) 6307 if !ok { 6308 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6309 } 6310 sv.Message = ptr.String(jtv) 6311 } 6312 6313 default: 6314 _, _ = key, value 6315 6316 } 6317 } 6318 *v = sv 6319 return nil 6320} 6321 6322func awsAwsjson11_deserializeDocumentAcceleratorNotFoundException(v **types.AcceleratorNotFoundException, value interface{}) error { 6323 if v == nil { 6324 return fmt.Errorf("unexpected nil of type %T", v) 6325 } 6326 if value == nil { 6327 return nil 6328 } 6329 6330 shape, ok := value.(map[string]interface{}) 6331 if !ok { 6332 return fmt.Errorf("unexpected JSON type %v", value) 6333 } 6334 6335 var sv *types.AcceleratorNotFoundException 6336 if *v == nil { 6337 sv = &types.AcceleratorNotFoundException{} 6338 } else { 6339 sv = *v 6340 } 6341 6342 for key, value := range shape { 6343 switch key { 6344 case "Message": 6345 if value != nil { 6346 jtv, ok := value.(string) 6347 if !ok { 6348 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6349 } 6350 sv.Message = ptr.String(jtv) 6351 } 6352 6353 default: 6354 _, _ = key, value 6355 6356 } 6357 } 6358 *v = sv 6359 return nil 6360} 6361 6362func awsAwsjson11_deserializeDocumentAccelerators(v *[]types.Accelerator, value interface{}) error { 6363 if v == nil { 6364 return fmt.Errorf("unexpected nil of type %T", v) 6365 } 6366 if value == nil { 6367 return nil 6368 } 6369 6370 shape, ok := value.([]interface{}) 6371 if !ok { 6372 return fmt.Errorf("unexpected JSON type %v", value) 6373 } 6374 6375 var cv []types.Accelerator 6376 if *v == nil { 6377 cv = []types.Accelerator{} 6378 } else { 6379 cv = *v 6380 } 6381 6382 for _, value := range shape { 6383 var col types.Accelerator 6384 destAddr := &col 6385 if err := awsAwsjson11_deserializeDocumentAccelerator(&destAddr, value); err != nil { 6386 return err 6387 } 6388 col = *destAddr 6389 cv = append(cv, col) 6390 6391 } 6392 *v = cv 6393 return nil 6394} 6395 6396func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { 6397 if v == nil { 6398 return fmt.Errorf("unexpected nil of type %T", v) 6399 } 6400 if value == nil { 6401 return nil 6402 } 6403 6404 shape, ok := value.(map[string]interface{}) 6405 if !ok { 6406 return fmt.Errorf("unexpected JSON type %v", value) 6407 } 6408 6409 var sv *types.AccessDeniedException 6410 if *v == nil { 6411 sv = &types.AccessDeniedException{} 6412 } else { 6413 sv = *v 6414 } 6415 6416 for key, value := range shape { 6417 switch key { 6418 case "Message": 6419 if value != nil { 6420 jtv, ok := value.(string) 6421 if !ok { 6422 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6423 } 6424 sv.Message = ptr.String(jtv) 6425 } 6426 6427 default: 6428 _, _ = key, value 6429 6430 } 6431 } 6432 *v = sv 6433 return nil 6434} 6435 6436func awsAwsjson11_deserializeDocumentAssociatedEndpointGroupFoundException(v **types.AssociatedEndpointGroupFoundException, value interface{}) error { 6437 if v == nil { 6438 return fmt.Errorf("unexpected nil of type %T", v) 6439 } 6440 if value == nil { 6441 return nil 6442 } 6443 6444 shape, ok := value.(map[string]interface{}) 6445 if !ok { 6446 return fmt.Errorf("unexpected JSON type %v", value) 6447 } 6448 6449 var sv *types.AssociatedEndpointGroupFoundException 6450 if *v == nil { 6451 sv = &types.AssociatedEndpointGroupFoundException{} 6452 } else { 6453 sv = *v 6454 } 6455 6456 for key, value := range shape { 6457 switch key { 6458 case "Message": 6459 if value != nil { 6460 jtv, ok := value.(string) 6461 if !ok { 6462 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6463 } 6464 sv.Message = ptr.String(jtv) 6465 } 6466 6467 default: 6468 _, _ = key, value 6469 6470 } 6471 } 6472 *v = sv 6473 return nil 6474} 6475 6476func awsAwsjson11_deserializeDocumentAssociatedListenerFoundException(v **types.AssociatedListenerFoundException, value interface{}) error { 6477 if v == nil { 6478 return fmt.Errorf("unexpected nil of type %T", v) 6479 } 6480 if value == nil { 6481 return nil 6482 } 6483 6484 shape, ok := value.(map[string]interface{}) 6485 if !ok { 6486 return fmt.Errorf("unexpected JSON type %v", value) 6487 } 6488 6489 var sv *types.AssociatedListenerFoundException 6490 if *v == nil { 6491 sv = &types.AssociatedListenerFoundException{} 6492 } else { 6493 sv = *v 6494 } 6495 6496 for key, value := range shape { 6497 switch key { 6498 case "Message": 6499 if value != nil { 6500 jtv, ok := value.(string) 6501 if !ok { 6502 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6503 } 6504 sv.Message = ptr.String(jtv) 6505 } 6506 6507 default: 6508 _, _ = key, value 6509 6510 } 6511 } 6512 *v = sv 6513 return nil 6514} 6515 6516func awsAwsjson11_deserializeDocumentByoipCidr(v **types.ByoipCidr, value interface{}) error { 6517 if v == nil { 6518 return fmt.Errorf("unexpected nil of type %T", v) 6519 } 6520 if value == nil { 6521 return nil 6522 } 6523 6524 shape, ok := value.(map[string]interface{}) 6525 if !ok { 6526 return fmt.Errorf("unexpected JSON type %v", value) 6527 } 6528 6529 var sv *types.ByoipCidr 6530 if *v == nil { 6531 sv = &types.ByoipCidr{} 6532 } else { 6533 sv = *v 6534 } 6535 6536 for key, value := range shape { 6537 switch key { 6538 case "Cidr": 6539 if value != nil { 6540 jtv, ok := value.(string) 6541 if !ok { 6542 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6543 } 6544 sv.Cidr = ptr.String(jtv) 6545 } 6546 6547 case "Events": 6548 if err := awsAwsjson11_deserializeDocumentByoipCidrEvents(&sv.Events, value); err != nil { 6549 return err 6550 } 6551 6552 case "State": 6553 if value != nil { 6554 jtv, ok := value.(string) 6555 if !ok { 6556 return fmt.Errorf("expected ByoipCidrState to be of type string, got %T instead", value) 6557 } 6558 sv.State = types.ByoipCidrState(jtv) 6559 } 6560 6561 default: 6562 _, _ = key, value 6563 6564 } 6565 } 6566 *v = sv 6567 return nil 6568} 6569 6570func awsAwsjson11_deserializeDocumentByoipCidrEvent(v **types.ByoipCidrEvent, value interface{}) error { 6571 if v == nil { 6572 return fmt.Errorf("unexpected nil of type %T", v) 6573 } 6574 if value == nil { 6575 return nil 6576 } 6577 6578 shape, ok := value.(map[string]interface{}) 6579 if !ok { 6580 return fmt.Errorf("unexpected JSON type %v", value) 6581 } 6582 6583 var sv *types.ByoipCidrEvent 6584 if *v == nil { 6585 sv = &types.ByoipCidrEvent{} 6586 } else { 6587 sv = *v 6588 } 6589 6590 for key, value := range shape { 6591 switch key { 6592 case "Message": 6593 if value != nil { 6594 jtv, ok := value.(string) 6595 if !ok { 6596 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6597 } 6598 sv.Message = ptr.String(jtv) 6599 } 6600 6601 case "Timestamp": 6602 if value != nil { 6603 switch jtv := value.(type) { 6604 case json.Number: 6605 f64, err := jtv.Float64() 6606 if err != nil { 6607 return err 6608 } 6609 sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6610 6611 default: 6612 return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) 6613 6614 } 6615 } 6616 6617 default: 6618 _, _ = key, value 6619 6620 } 6621 } 6622 *v = sv 6623 return nil 6624} 6625 6626func awsAwsjson11_deserializeDocumentByoipCidrEvents(v *[]types.ByoipCidrEvent, value interface{}) error { 6627 if v == nil { 6628 return fmt.Errorf("unexpected nil of type %T", v) 6629 } 6630 if value == nil { 6631 return nil 6632 } 6633 6634 shape, ok := value.([]interface{}) 6635 if !ok { 6636 return fmt.Errorf("unexpected JSON type %v", value) 6637 } 6638 6639 var cv []types.ByoipCidrEvent 6640 if *v == nil { 6641 cv = []types.ByoipCidrEvent{} 6642 } else { 6643 cv = *v 6644 } 6645 6646 for _, value := range shape { 6647 var col types.ByoipCidrEvent 6648 destAddr := &col 6649 if err := awsAwsjson11_deserializeDocumentByoipCidrEvent(&destAddr, value); err != nil { 6650 return err 6651 } 6652 col = *destAddr 6653 cv = append(cv, col) 6654 6655 } 6656 *v = cv 6657 return nil 6658} 6659 6660func awsAwsjson11_deserializeDocumentByoipCidrNotFoundException(v **types.ByoipCidrNotFoundException, value interface{}) error { 6661 if v == nil { 6662 return fmt.Errorf("unexpected nil of type %T", v) 6663 } 6664 if value == nil { 6665 return nil 6666 } 6667 6668 shape, ok := value.(map[string]interface{}) 6669 if !ok { 6670 return fmt.Errorf("unexpected JSON type %v", value) 6671 } 6672 6673 var sv *types.ByoipCidrNotFoundException 6674 if *v == nil { 6675 sv = &types.ByoipCidrNotFoundException{} 6676 } else { 6677 sv = *v 6678 } 6679 6680 for key, value := range shape { 6681 switch key { 6682 case "Message": 6683 if value != nil { 6684 jtv, ok := value.(string) 6685 if !ok { 6686 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6687 } 6688 sv.Message = ptr.String(jtv) 6689 } 6690 6691 default: 6692 _, _ = key, value 6693 6694 } 6695 } 6696 *v = sv 6697 return nil 6698} 6699 6700func awsAwsjson11_deserializeDocumentByoipCidrs(v *[]types.ByoipCidr, value interface{}) error { 6701 if v == nil { 6702 return fmt.Errorf("unexpected nil of type %T", v) 6703 } 6704 if value == nil { 6705 return nil 6706 } 6707 6708 shape, ok := value.([]interface{}) 6709 if !ok { 6710 return fmt.Errorf("unexpected JSON type %v", value) 6711 } 6712 6713 var cv []types.ByoipCidr 6714 if *v == nil { 6715 cv = []types.ByoipCidr{} 6716 } else { 6717 cv = *v 6718 } 6719 6720 for _, value := range shape { 6721 var col types.ByoipCidr 6722 destAddr := &col 6723 if err := awsAwsjson11_deserializeDocumentByoipCidr(&destAddr, value); err != nil { 6724 return err 6725 } 6726 col = *destAddr 6727 cv = append(cv, col) 6728 6729 } 6730 *v = cv 6731 return nil 6732} 6733 6734func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { 6735 if v == nil { 6736 return fmt.Errorf("unexpected nil of type %T", v) 6737 } 6738 if value == nil { 6739 return nil 6740 } 6741 6742 shape, ok := value.(map[string]interface{}) 6743 if !ok { 6744 return fmt.Errorf("unexpected JSON type %v", value) 6745 } 6746 6747 var sv *types.ConflictException 6748 if *v == nil { 6749 sv = &types.ConflictException{} 6750 } else { 6751 sv = *v 6752 } 6753 6754 for key, value := range shape { 6755 switch key { 6756 case "Message": 6757 if value != nil { 6758 jtv, ok := value.(string) 6759 if !ok { 6760 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6761 } 6762 sv.Message = ptr.String(jtv) 6763 } 6764 6765 default: 6766 _, _ = key, value 6767 6768 } 6769 } 6770 *v = sv 6771 return nil 6772} 6773 6774func awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(v **types.CustomRoutingAccelerator, value interface{}) error { 6775 if v == nil { 6776 return fmt.Errorf("unexpected nil of type %T", v) 6777 } 6778 if value == nil { 6779 return nil 6780 } 6781 6782 shape, ok := value.(map[string]interface{}) 6783 if !ok { 6784 return fmt.Errorf("unexpected JSON type %v", value) 6785 } 6786 6787 var sv *types.CustomRoutingAccelerator 6788 if *v == nil { 6789 sv = &types.CustomRoutingAccelerator{} 6790 } else { 6791 sv = *v 6792 } 6793 6794 for key, value := range shape { 6795 switch key { 6796 case "AcceleratorArn": 6797 if value != nil { 6798 jtv, ok := value.(string) 6799 if !ok { 6800 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6801 } 6802 sv.AcceleratorArn = ptr.String(jtv) 6803 } 6804 6805 case "CreatedTime": 6806 if value != nil { 6807 switch jtv := value.(type) { 6808 case json.Number: 6809 f64, err := jtv.Float64() 6810 if err != nil { 6811 return err 6812 } 6813 sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6814 6815 default: 6816 return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) 6817 6818 } 6819 } 6820 6821 case "DnsName": 6822 if value != nil { 6823 jtv, ok := value.(string) 6824 if !ok { 6825 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6826 } 6827 sv.DnsName = ptr.String(jtv) 6828 } 6829 6830 case "Enabled": 6831 if value != nil { 6832 jtv, ok := value.(bool) 6833 if !ok { 6834 return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) 6835 } 6836 sv.Enabled = ptr.Bool(jtv) 6837 } 6838 6839 case "IpAddressType": 6840 if value != nil { 6841 jtv, ok := value.(string) 6842 if !ok { 6843 return fmt.Errorf("expected IpAddressType to be of type string, got %T instead", value) 6844 } 6845 sv.IpAddressType = types.IpAddressType(jtv) 6846 } 6847 6848 case "IpSets": 6849 if err := awsAwsjson11_deserializeDocumentIpSets(&sv.IpSets, value); err != nil { 6850 return err 6851 } 6852 6853 case "LastModifiedTime": 6854 if value != nil { 6855 switch jtv := value.(type) { 6856 case json.Number: 6857 f64, err := jtv.Float64() 6858 if err != nil { 6859 return err 6860 } 6861 sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6862 6863 default: 6864 return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) 6865 6866 } 6867 } 6868 6869 case "Name": 6870 if value != nil { 6871 jtv, ok := value.(string) 6872 if !ok { 6873 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6874 } 6875 sv.Name = ptr.String(jtv) 6876 } 6877 6878 case "Status": 6879 if value != nil { 6880 jtv, ok := value.(string) 6881 if !ok { 6882 return fmt.Errorf("expected CustomRoutingAcceleratorStatus to be of type string, got %T instead", value) 6883 } 6884 sv.Status = types.CustomRoutingAcceleratorStatus(jtv) 6885 } 6886 6887 default: 6888 _, _ = key, value 6889 6890 } 6891 } 6892 *v = sv 6893 return nil 6894} 6895 6896func awsAwsjson11_deserializeDocumentCustomRoutingAcceleratorAttributes(v **types.CustomRoutingAcceleratorAttributes, value interface{}) error { 6897 if v == nil { 6898 return fmt.Errorf("unexpected nil of type %T", v) 6899 } 6900 if value == nil { 6901 return nil 6902 } 6903 6904 shape, ok := value.(map[string]interface{}) 6905 if !ok { 6906 return fmt.Errorf("unexpected JSON type %v", value) 6907 } 6908 6909 var sv *types.CustomRoutingAcceleratorAttributes 6910 if *v == nil { 6911 sv = &types.CustomRoutingAcceleratorAttributes{} 6912 } else { 6913 sv = *v 6914 } 6915 6916 for key, value := range shape { 6917 switch key { 6918 case "FlowLogsEnabled": 6919 if value != nil { 6920 jtv, ok := value.(bool) 6921 if !ok { 6922 return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) 6923 } 6924 sv.FlowLogsEnabled = ptr.Bool(jtv) 6925 } 6926 6927 case "FlowLogsS3Bucket": 6928 if value != nil { 6929 jtv, ok := value.(string) 6930 if !ok { 6931 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6932 } 6933 sv.FlowLogsS3Bucket = ptr.String(jtv) 6934 } 6935 6936 case "FlowLogsS3Prefix": 6937 if value != nil { 6938 jtv, ok := value.(string) 6939 if !ok { 6940 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 6941 } 6942 sv.FlowLogsS3Prefix = ptr.String(jtv) 6943 } 6944 6945 default: 6946 _, _ = key, value 6947 6948 } 6949 } 6950 *v = sv 6951 return nil 6952} 6953 6954func awsAwsjson11_deserializeDocumentCustomRoutingAccelerators(v *[]types.CustomRoutingAccelerator, value interface{}) error { 6955 if v == nil { 6956 return fmt.Errorf("unexpected nil of type %T", v) 6957 } 6958 if value == nil { 6959 return nil 6960 } 6961 6962 shape, ok := value.([]interface{}) 6963 if !ok { 6964 return fmt.Errorf("unexpected JSON type %v", value) 6965 } 6966 6967 var cv []types.CustomRoutingAccelerator 6968 if *v == nil { 6969 cv = []types.CustomRoutingAccelerator{} 6970 } else { 6971 cv = *v 6972 } 6973 6974 for _, value := range shape { 6975 var col types.CustomRoutingAccelerator 6976 destAddr := &col 6977 if err := awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(&destAddr, value); err != nil { 6978 return err 6979 } 6980 col = *destAddr 6981 cv = append(cv, col) 6982 6983 } 6984 *v = cv 6985 return nil 6986} 6987 6988func awsAwsjson11_deserializeDocumentCustomRoutingDestinationDescription(v **types.CustomRoutingDestinationDescription, value interface{}) error { 6989 if v == nil { 6990 return fmt.Errorf("unexpected nil of type %T", v) 6991 } 6992 if value == nil { 6993 return nil 6994 } 6995 6996 shape, ok := value.(map[string]interface{}) 6997 if !ok { 6998 return fmt.Errorf("unexpected JSON type %v", value) 6999 } 7000 7001 var sv *types.CustomRoutingDestinationDescription 7002 if *v == nil { 7003 sv = &types.CustomRoutingDestinationDescription{} 7004 } else { 7005 sv = *v 7006 } 7007 7008 for key, value := range shape { 7009 switch key { 7010 case "FromPort": 7011 if value != nil { 7012 jtv, ok := value.(json.Number) 7013 if !ok { 7014 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 7015 } 7016 i64, err := jtv.Int64() 7017 if err != nil { 7018 return err 7019 } 7020 sv.FromPort = ptr.Int32(int32(i64)) 7021 } 7022 7023 case "Protocols": 7024 if err := awsAwsjson11_deserializeDocumentProtocols(&sv.Protocols, value); err != nil { 7025 return err 7026 } 7027 7028 case "ToPort": 7029 if value != nil { 7030 jtv, ok := value.(json.Number) 7031 if !ok { 7032 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 7033 } 7034 i64, err := jtv.Int64() 7035 if err != nil { 7036 return err 7037 } 7038 sv.ToPort = ptr.Int32(int32(i64)) 7039 } 7040 7041 default: 7042 _, _ = key, value 7043 7044 } 7045 } 7046 *v = sv 7047 return nil 7048} 7049 7050func awsAwsjson11_deserializeDocumentCustomRoutingDestinationDescriptions(v *[]types.CustomRoutingDestinationDescription, value interface{}) error { 7051 if v == nil { 7052 return fmt.Errorf("unexpected nil of type %T", v) 7053 } 7054 if value == nil { 7055 return nil 7056 } 7057 7058 shape, ok := value.([]interface{}) 7059 if !ok { 7060 return fmt.Errorf("unexpected JSON type %v", value) 7061 } 7062 7063 var cv []types.CustomRoutingDestinationDescription 7064 if *v == nil { 7065 cv = []types.CustomRoutingDestinationDescription{} 7066 } else { 7067 cv = *v 7068 } 7069 7070 for _, value := range shape { 7071 var col types.CustomRoutingDestinationDescription 7072 destAddr := &col 7073 if err := awsAwsjson11_deserializeDocumentCustomRoutingDestinationDescription(&destAddr, value); err != nil { 7074 return err 7075 } 7076 col = *destAddr 7077 cv = append(cv, col) 7078 7079 } 7080 *v = cv 7081 return nil 7082} 7083 7084func awsAwsjson11_deserializeDocumentCustomRoutingEndpointDescription(v **types.CustomRoutingEndpointDescription, value interface{}) error { 7085 if v == nil { 7086 return fmt.Errorf("unexpected nil of type %T", v) 7087 } 7088 if value == nil { 7089 return nil 7090 } 7091 7092 shape, ok := value.(map[string]interface{}) 7093 if !ok { 7094 return fmt.Errorf("unexpected JSON type %v", value) 7095 } 7096 7097 var sv *types.CustomRoutingEndpointDescription 7098 if *v == nil { 7099 sv = &types.CustomRoutingEndpointDescription{} 7100 } else { 7101 sv = *v 7102 } 7103 7104 for key, value := range shape { 7105 switch key { 7106 case "EndpointId": 7107 if value != nil { 7108 jtv, ok := value.(string) 7109 if !ok { 7110 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7111 } 7112 sv.EndpointId = ptr.String(jtv) 7113 } 7114 7115 default: 7116 _, _ = key, value 7117 7118 } 7119 } 7120 *v = sv 7121 return nil 7122} 7123 7124func awsAwsjson11_deserializeDocumentCustomRoutingEndpointDescriptions(v *[]types.CustomRoutingEndpointDescription, value interface{}) error { 7125 if v == nil { 7126 return fmt.Errorf("unexpected nil of type %T", v) 7127 } 7128 if value == nil { 7129 return nil 7130 } 7131 7132 shape, ok := value.([]interface{}) 7133 if !ok { 7134 return fmt.Errorf("unexpected JSON type %v", value) 7135 } 7136 7137 var cv []types.CustomRoutingEndpointDescription 7138 if *v == nil { 7139 cv = []types.CustomRoutingEndpointDescription{} 7140 } else { 7141 cv = *v 7142 } 7143 7144 for _, value := range shape { 7145 var col types.CustomRoutingEndpointDescription 7146 destAddr := &col 7147 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointDescription(&destAddr, value); err != nil { 7148 return err 7149 } 7150 col = *destAddr 7151 cv = append(cv, col) 7152 7153 } 7154 *v = cv 7155 return nil 7156} 7157 7158func awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroup(v **types.CustomRoutingEndpointGroup, value interface{}) error { 7159 if v == nil { 7160 return fmt.Errorf("unexpected nil of type %T", v) 7161 } 7162 if value == nil { 7163 return nil 7164 } 7165 7166 shape, ok := value.(map[string]interface{}) 7167 if !ok { 7168 return fmt.Errorf("unexpected JSON type %v", value) 7169 } 7170 7171 var sv *types.CustomRoutingEndpointGroup 7172 if *v == nil { 7173 sv = &types.CustomRoutingEndpointGroup{} 7174 } else { 7175 sv = *v 7176 } 7177 7178 for key, value := range shape { 7179 switch key { 7180 case "DestinationDescriptions": 7181 if err := awsAwsjson11_deserializeDocumentCustomRoutingDestinationDescriptions(&sv.DestinationDescriptions, value); err != nil { 7182 return err 7183 } 7184 7185 case "EndpointDescriptions": 7186 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointDescriptions(&sv.EndpointDescriptions, value); err != nil { 7187 return err 7188 } 7189 7190 case "EndpointGroupArn": 7191 if value != nil { 7192 jtv, ok := value.(string) 7193 if !ok { 7194 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7195 } 7196 sv.EndpointGroupArn = ptr.String(jtv) 7197 } 7198 7199 case "EndpointGroupRegion": 7200 if value != nil { 7201 jtv, ok := value.(string) 7202 if !ok { 7203 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7204 } 7205 sv.EndpointGroupRegion = ptr.String(jtv) 7206 } 7207 7208 default: 7209 _, _ = key, value 7210 7211 } 7212 } 7213 *v = sv 7214 return nil 7215} 7216 7217func awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroups(v *[]types.CustomRoutingEndpointGroup, value interface{}) error { 7218 if v == nil { 7219 return fmt.Errorf("unexpected nil of type %T", v) 7220 } 7221 if value == nil { 7222 return nil 7223 } 7224 7225 shape, ok := value.([]interface{}) 7226 if !ok { 7227 return fmt.Errorf("unexpected JSON type %v", value) 7228 } 7229 7230 var cv []types.CustomRoutingEndpointGroup 7231 if *v == nil { 7232 cv = []types.CustomRoutingEndpointGroup{} 7233 } else { 7234 cv = *v 7235 } 7236 7237 for _, value := range shape { 7238 var col types.CustomRoutingEndpointGroup 7239 destAddr := &col 7240 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroup(&destAddr, value); err != nil { 7241 return err 7242 } 7243 col = *destAddr 7244 cv = append(cv, col) 7245 7246 } 7247 *v = cv 7248 return nil 7249} 7250 7251func awsAwsjson11_deserializeDocumentCustomRoutingListener(v **types.CustomRoutingListener, value interface{}) error { 7252 if v == nil { 7253 return fmt.Errorf("unexpected nil of type %T", v) 7254 } 7255 if value == nil { 7256 return nil 7257 } 7258 7259 shape, ok := value.(map[string]interface{}) 7260 if !ok { 7261 return fmt.Errorf("unexpected JSON type %v", value) 7262 } 7263 7264 var sv *types.CustomRoutingListener 7265 if *v == nil { 7266 sv = &types.CustomRoutingListener{} 7267 } else { 7268 sv = *v 7269 } 7270 7271 for key, value := range shape { 7272 switch key { 7273 case "ListenerArn": 7274 if value != nil { 7275 jtv, ok := value.(string) 7276 if !ok { 7277 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7278 } 7279 sv.ListenerArn = ptr.String(jtv) 7280 } 7281 7282 case "PortRanges": 7283 if err := awsAwsjson11_deserializeDocumentPortRanges(&sv.PortRanges, value); err != nil { 7284 return err 7285 } 7286 7287 default: 7288 _, _ = key, value 7289 7290 } 7291 } 7292 *v = sv 7293 return nil 7294} 7295 7296func awsAwsjson11_deserializeDocumentCustomRoutingListeners(v *[]types.CustomRoutingListener, value interface{}) error { 7297 if v == nil { 7298 return fmt.Errorf("unexpected nil of type %T", v) 7299 } 7300 if value == nil { 7301 return nil 7302 } 7303 7304 shape, ok := value.([]interface{}) 7305 if !ok { 7306 return fmt.Errorf("unexpected JSON type %v", value) 7307 } 7308 7309 var cv []types.CustomRoutingListener 7310 if *v == nil { 7311 cv = []types.CustomRoutingListener{} 7312 } else { 7313 cv = *v 7314 } 7315 7316 for _, value := range shape { 7317 var col types.CustomRoutingListener 7318 destAddr := &col 7319 if err := awsAwsjson11_deserializeDocumentCustomRoutingListener(&destAddr, value); err != nil { 7320 return err 7321 } 7322 col = *destAddr 7323 cv = append(cv, col) 7324 7325 } 7326 *v = cv 7327 return nil 7328} 7329 7330func awsAwsjson11_deserializeDocumentCustomRoutingProtocols(v *[]types.CustomRoutingProtocol, value interface{}) error { 7331 if v == nil { 7332 return fmt.Errorf("unexpected nil of type %T", v) 7333 } 7334 if value == nil { 7335 return nil 7336 } 7337 7338 shape, ok := value.([]interface{}) 7339 if !ok { 7340 return fmt.Errorf("unexpected JSON type %v", value) 7341 } 7342 7343 var cv []types.CustomRoutingProtocol 7344 if *v == nil { 7345 cv = []types.CustomRoutingProtocol{} 7346 } else { 7347 cv = *v 7348 } 7349 7350 for _, value := range shape { 7351 var col types.CustomRoutingProtocol 7352 if value != nil { 7353 jtv, ok := value.(string) 7354 if !ok { 7355 return fmt.Errorf("expected CustomRoutingProtocol to be of type string, got %T instead", value) 7356 } 7357 col = types.CustomRoutingProtocol(jtv) 7358 } 7359 cv = append(cv, col) 7360 7361 } 7362 *v = cv 7363 return nil 7364} 7365 7366func awsAwsjson11_deserializeDocumentDestinationPortMapping(v **types.DestinationPortMapping, value interface{}) error { 7367 if v == nil { 7368 return fmt.Errorf("unexpected nil of type %T", v) 7369 } 7370 if value == nil { 7371 return nil 7372 } 7373 7374 shape, ok := value.(map[string]interface{}) 7375 if !ok { 7376 return fmt.Errorf("unexpected JSON type %v", value) 7377 } 7378 7379 var sv *types.DestinationPortMapping 7380 if *v == nil { 7381 sv = &types.DestinationPortMapping{} 7382 } else { 7383 sv = *v 7384 } 7385 7386 for key, value := range shape { 7387 switch key { 7388 case "AcceleratorArn": 7389 if value != nil { 7390 jtv, ok := value.(string) 7391 if !ok { 7392 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7393 } 7394 sv.AcceleratorArn = ptr.String(jtv) 7395 } 7396 7397 case "AcceleratorSocketAddresses": 7398 if err := awsAwsjson11_deserializeDocumentSocketAddresses(&sv.AcceleratorSocketAddresses, value); err != nil { 7399 return err 7400 } 7401 7402 case "DestinationSocketAddress": 7403 if err := awsAwsjson11_deserializeDocumentSocketAddress(&sv.DestinationSocketAddress, value); err != nil { 7404 return err 7405 } 7406 7407 case "DestinationTrafficState": 7408 if value != nil { 7409 jtv, ok := value.(string) 7410 if !ok { 7411 return fmt.Errorf("expected CustomRoutingDestinationTrafficState to be of type string, got %T instead", value) 7412 } 7413 sv.DestinationTrafficState = types.CustomRoutingDestinationTrafficState(jtv) 7414 } 7415 7416 case "EndpointGroupArn": 7417 if value != nil { 7418 jtv, ok := value.(string) 7419 if !ok { 7420 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7421 } 7422 sv.EndpointGroupArn = ptr.String(jtv) 7423 } 7424 7425 case "EndpointGroupRegion": 7426 if value != nil { 7427 jtv, ok := value.(string) 7428 if !ok { 7429 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7430 } 7431 sv.EndpointGroupRegion = ptr.String(jtv) 7432 } 7433 7434 case "EndpointId": 7435 if value != nil { 7436 jtv, ok := value.(string) 7437 if !ok { 7438 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7439 } 7440 sv.EndpointId = ptr.String(jtv) 7441 } 7442 7443 case "IpAddressType": 7444 if value != nil { 7445 jtv, ok := value.(string) 7446 if !ok { 7447 return fmt.Errorf("expected IpAddressType to be of type string, got %T instead", value) 7448 } 7449 sv.IpAddressType = types.IpAddressType(jtv) 7450 } 7451 7452 default: 7453 _, _ = key, value 7454 7455 } 7456 } 7457 *v = sv 7458 return nil 7459} 7460 7461func awsAwsjson11_deserializeDocumentDestinationPortMappings(v *[]types.DestinationPortMapping, value interface{}) error { 7462 if v == nil { 7463 return fmt.Errorf("unexpected nil of type %T", v) 7464 } 7465 if value == nil { 7466 return nil 7467 } 7468 7469 shape, ok := value.([]interface{}) 7470 if !ok { 7471 return fmt.Errorf("unexpected JSON type %v", value) 7472 } 7473 7474 var cv []types.DestinationPortMapping 7475 if *v == nil { 7476 cv = []types.DestinationPortMapping{} 7477 } else { 7478 cv = *v 7479 } 7480 7481 for _, value := range shape { 7482 var col types.DestinationPortMapping 7483 destAddr := &col 7484 if err := awsAwsjson11_deserializeDocumentDestinationPortMapping(&destAddr, value); err != nil { 7485 return err 7486 } 7487 col = *destAddr 7488 cv = append(cv, col) 7489 7490 } 7491 *v = cv 7492 return nil 7493} 7494 7495func awsAwsjson11_deserializeDocumentEndpointAlreadyExistsException(v **types.EndpointAlreadyExistsException, value interface{}) error { 7496 if v == nil { 7497 return fmt.Errorf("unexpected nil of type %T", v) 7498 } 7499 if value == nil { 7500 return nil 7501 } 7502 7503 shape, ok := value.(map[string]interface{}) 7504 if !ok { 7505 return fmt.Errorf("unexpected JSON type %v", value) 7506 } 7507 7508 var sv *types.EndpointAlreadyExistsException 7509 if *v == nil { 7510 sv = &types.EndpointAlreadyExistsException{} 7511 } else { 7512 sv = *v 7513 } 7514 7515 for key, value := range shape { 7516 switch key { 7517 case "Message": 7518 if value != nil { 7519 jtv, ok := value.(string) 7520 if !ok { 7521 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7522 } 7523 sv.Message = ptr.String(jtv) 7524 } 7525 7526 default: 7527 _, _ = key, value 7528 7529 } 7530 } 7531 *v = sv 7532 return nil 7533} 7534 7535func awsAwsjson11_deserializeDocumentEndpointDescription(v **types.EndpointDescription, value interface{}) error { 7536 if v == nil { 7537 return fmt.Errorf("unexpected nil of type %T", v) 7538 } 7539 if value == nil { 7540 return nil 7541 } 7542 7543 shape, ok := value.(map[string]interface{}) 7544 if !ok { 7545 return fmt.Errorf("unexpected JSON type %v", value) 7546 } 7547 7548 var sv *types.EndpointDescription 7549 if *v == nil { 7550 sv = &types.EndpointDescription{} 7551 } else { 7552 sv = *v 7553 } 7554 7555 for key, value := range shape { 7556 switch key { 7557 case "ClientIPPreservationEnabled": 7558 if value != nil { 7559 jtv, ok := value.(bool) 7560 if !ok { 7561 return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) 7562 } 7563 sv.ClientIPPreservationEnabled = ptr.Bool(jtv) 7564 } 7565 7566 case "EndpointId": 7567 if value != nil { 7568 jtv, ok := value.(string) 7569 if !ok { 7570 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7571 } 7572 sv.EndpointId = ptr.String(jtv) 7573 } 7574 7575 case "HealthReason": 7576 if value != nil { 7577 jtv, ok := value.(string) 7578 if !ok { 7579 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7580 } 7581 sv.HealthReason = ptr.String(jtv) 7582 } 7583 7584 case "HealthState": 7585 if value != nil { 7586 jtv, ok := value.(string) 7587 if !ok { 7588 return fmt.Errorf("expected HealthState to be of type string, got %T instead", value) 7589 } 7590 sv.HealthState = types.HealthState(jtv) 7591 } 7592 7593 case "Weight": 7594 if value != nil { 7595 jtv, ok := value.(json.Number) 7596 if !ok { 7597 return fmt.Errorf("expected EndpointWeight to be json.Number, got %T instead", value) 7598 } 7599 i64, err := jtv.Int64() 7600 if err != nil { 7601 return err 7602 } 7603 sv.Weight = ptr.Int32(int32(i64)) 7604 } 7605 7606 default: 7607 _, _ = key, value 7608 7609 } 7610 } 7611 *v = sv 7612 return nil 7613} 7614 7615func awsAwsjson11_deserializeDocumentEndpointDescriptions(v *[]types.EndpointDescription, value interface{}) error { 7616 if v == nil { 7617 return fmt.Errorf("unexpected nil of type %T", v) 7618 } 7619 if value == nil { 7620 return nil 7621 } 7622 7623 shape, ok := value.([]interface{}) 7624 if !ok { 7625 return fmt.Errorf("unexpected JSON type %v", value) 7626 } 7627 7628 var cv []types.EndpointDescription 7629 if *v == nil { 7630 cv = []types.EndpointDescription{} 7631 } else { 7632 cv = *v 7633 } 7634 7635 for _, value := range shape { 7636 var col types.EndpointDescription 7637 destAddr := &col 7638 if err := awsAwsjson11_deserializeDocumentEndpointDescription(&destAddr, value); err != nil { 7639 return err 7640 } 7641 col = *destAddr 7642 cv = append(cv, col) 7643 7644 } 7645 *v = cv 7646 return nil 7647} 7648 7649func awsAwsjson11_deserializeDocumentEndpointGroup(v **types.EndpointGroup, value interface{}) error { 7650 if v == nil { 7651 return fmt.Errorf("unexpected nil of type %T", v) 7652 } 7653 if value == nil { 7654 return nil 7655 } 7656 7657 shape, ok := value.(map[string]interface{}) 7658 if !ok { 7659 return fmt.Errorf("unexpected JSON type %v", value) 7660 } 7661 7662 var sv *types.EndpointGroup 7663 if *v == nil { 7664 sv = &types.EndpointGroup{} 7665 } else { 7666 sv = *v 7667 } 7668 7669 for key, value := range shape { 7670 switch key { 7671 case "EndpointDescriptions": 7672 if err := awsAwsjson11_deserializeDocumentEndpointDescriptions(&sv.EndpointDescriptions, value); err != nil { 7673 return err 7674 } 7675 7676 case "EndpointGroupArn": 7677 if value != nil { 7678 jtv, ok := value.(string) 7679 if !ok { 7680 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7681 } 7682 sv.EndpointGroupArn = ptr.String(jtv) 7683 } 7684 7685 case "EndpointGroupRegion": 7686 if value != nil { 7687 jtv, ok := value.(string) 7688 if !ok { 7689 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 7690 } 7691 sv.EndpointGroupRegion = ptr.String(jtv) 7692 } 7693 7694 case "HealthCheckIntervalSeconds": 7695 if value != nil { 7696 jtv, ok := value.(json.Number) 7697 if !ok { 7698 return fmt.Errorf("expected HealthCheckIntervalSeconds to be json.Number, got %T instead", value) 7699 } 7700 i64, err := jtv.Int64() 7701 if err != nil { 7702 return err 7703 } 7704 sv.HealthCheckIntervalSeconds = ptr.Int32(int32(i64)) 7705 } 7706 7707 case "HealthCheckPath": 7708 if value != nil { 7709 jtv, ok := value.(string) 7710 if !ok { 7711 return fmt.Errorf("expected HealthCheckPath to be of type string, got %T instead", value) 7712 } 7713 sv.HealthCheckPath = ptr.String(jtv) 7714 } 7715 7716 case "HealthCheckPort": 7717 if value != nil { 7718 jtv, ok := value.(json.Number) 7719 if !ok { 7720 return fmt.Errorf("expected HealthCheckPort to be json.Number, got %T instead", value) 7721 } 7722 i64, err := jtv.Int64() 7723 if err != nil { 7724 return err 7725 } 7726 sv.HealthCheckPort = ptr.Int32(int32(i64)) 7727 } 7728 7729 case "HealthCheckProtocol": 7730 if value != nil { 7731 jtv, ok := value.(string) 7732 if !ok { 7733 return fmt.Errorf("expected HealthCheckProtocol to be of type string, got %T instead", value) 7734 } 7735 sv.HealthCheckProtocol = types.HealthCheckProtocol(jtv) 7736 } 7737 7738 case "PortOverrides": 7739 if err := awsAwsjson11_deserializeDocumentPortOverrides(&sv.PortOverrides, value); err != nil { 7740 return err 7741 } 7742 7743 case "ThresholdCount": 7744 if value != nil { 7745 jtv, ok := value.(json.Number) 7746 if !ok { 7747 return fmt.Errorf("expected ThresholdCount to be json.Number, got %T instead", value) 7748 } 7749 i64, err := jtv.Int64() 7750 if err != nil { 7751 return err 7752 } 7753 sv.ThresholdCount = ptr.Int32(int32(i64)) 7754 } 7755 7756 case "TrafficDialPercentage": 7757 if value != nil { 7758 switch jtv := value.(type) { 7759 case json.Number: 7760 f64, err := jtv.Float64() 7761 if err != nil { 7762 return err 7763 } 7764 sv.TrafficDialPercentage = ptr.Float32(float32(f64)) 7765 7766 case string: 7767 var f64 float64 7768 switch { 7769 case strings.EqualFold(jtv, "NaN"): 7770 f64 = math.NaN() 7771 7772 case strings.EqualFold(jtv, "Infinity"): 7773 f64 = math.Inf(1) 7774 7775 case strings.EqualFold(jtv, "-Infinity"): 7776 f64 = math.Inf(-1) 7777 7778 default: 7779 return fmt.Errorf("unknown JSON number value: %s", jtv) 7780 7781 } 7782 sv.TrafficDialPercentage = ptr.Float32(float32(f64)) 7783 7784 default: 7785 return fmt.Errorf("expected TrafficDialPercentage to be a JSON Number, got %T instead", value) 7786 7787 } 7788 } 7789 7790 default: 7791 _, _ = key, value 7792 7793 } 7794 } 7795 *v = sv 7796 return nil 7797} 7798 7799func awsAwsjson11_deserializeDocumentEndpointGroupAlreadyExistsException(v **types.EndpointGroupAlreadyExistsException, value interface{}) error { 7800 if v == nil { 7801 return fmt.Errorf("unexpected nil of type %T", v) 7802 } 7803 if value == nil { 7804 return nil 7805 } 7806 7807 shape, ok := value.(map[string]interface{}) 7808 if !ok { 7809 return fmt.Errorf("unexpected JSON type %v", value) 7810 } 7811 7812 var sv *types.EndpointGroupAlreadyExistsException 7813 if *v == nil { 7814 sv = &types.EndpointGroupAlreadyExistsException{} 7815 } else { 7816 sv = *v 7817 } 7818 7819 for key, value := range shape { 7820 switch key { 7821 case "Message": 7822 if value != nil { 7823 jtv, ok := value.(string) 7824 if !ok { 7825 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7826 } 7827 sv.Message = ptr.String(jtv) 7828 } 7829 7830 default: 7831 _, _ = key, value 7832 7833 } 7834 } 7835 *v = sv 7836 return nil 7837} 7838 7839func awsAwsjson11_deserializeDocumentEndpointGroupNotFoundException(v **types.EndpointGroupNotFoundException, value interface{}) error { 7840 if v == nil { 7841 return fmt.Errorf("unexpected nil of type %T", v) 7842 } 7843 if value == nil { 7844 return nil 7845 } 7846 7847 shape, ok := value.(map[string]interface{}) 7848 if !ok { 7849 return fmt.Errorf("unexpected JSON type %v", value) 7850 } 7851 7852 var sv *types.EndpointGroupNotFoundException 7853 if *v == nil { 7854 sv = &types.EndpointGroupNotFoundException{} 7855 } else { 7856 sv = *v 7857 } 7858 7859 for key, value := range shape { 7860 switch key { 7861 case "Message": 7862 if value != nil { 7863 jtv, ok := value.(string) 7864 if !ok { 7865 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7866 } 7867 sv.Message = ptr.String(jtv) 7868 } 7869 7870 default: 7871 _, _ = key, value 7872 7873 } 7874 } 7875 *v = sv 7876 return nil 7877} 7878 7879func awsAwsjson11_deserializeDocumentEndpointGroups(v *[]types.EndpointGroup, value interface{}) error { 7880 if v == nil { 7881 return fmt.Errorf("unexpected nil of type %T", v) 7882 } 7883 if value == nil { 7884 return nil 7885 } 7886 7887 shape, ok := value.([]interface{}) 7888 if !ok { 7889 return fmt.Errorf("unexpected JSON type %v", value) 7890 } 7891 7892 var cv []types.EndpointGroup 7893 if *v == nil { 7894 cv = []types.EndpointGroup{} 7895 } else { 7896 cv = *v 7897 } 7898 7899 for _, value := range shape { 7900 var col types.EndpointGroup 7901 destAddr := &col 7902 if err := awsAwsjson11_deserializeDocumentEndpointGroup(&destAddr, value); err != nil { 7903 return err 7904 } 7905 col = *destAddr 7906 cv = append(cv, col) 7907 7908 } 7909 *v = cv 7910 return nil 7911} 7912 7913func awsAwsjson11_deserializeDocumentEndpointNotFoundException(v **types.EndpointNotFoundException, value interface{}) error { 7914 if v == nil { 7915 return fmt.Errorf("unexpected nil of type %T", v) 7916 } 7917 if value == nil { 7918 return nil 7919 } 7920 7921 shape, ok := value.(map[string]interface{}) 7922 if !ok { 7923 return fmt.Errorf("unexpected JSON type %v", value) 7924 } 7925 7926 var sv *types.EndpointNotFoundException 7927 if *v == nil { 7928 sv = &types.EndpointNotFoundException{} 7929 } else { 7930 sv = *v 7931 } 7932 7933 for key, value := range shape { 7934 switch key { 7935 case "Message": 7936 if value != nil { 7937 jtv, ok := value.(string) 7938 if !ok { 7939 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7940 } 7941 sv.Message = ptr.String(jtv) 7942 } 7943 7944 default: 7945 _, _ = key, value 7946 7947 } 7948 } 7949 *v = sv 7950 return nil 7951} 7952 7953func awsAwsjson11_deserializeDocumentIncorrectCidrStateException(v **types.IncorrectCidrStateException, value interface{}) error { 7954 if v == nil { 7955 return fmt.Errorf("unexpected nil of type %T", v) 7956 } 7957 if value == nil { 7958 return nil 7959 } 7960 7961 shape, ok := value.(map[string]interface{}) 7962 if !ok { 7963 return fmt.Errorf("unexpected JSON type %v", value) 7964 } 7965 7966 var sv *types.IncorrectCidrStateException 7967 if *v == nil { 7968 sv = &types.IncorrectCidrStateException{} 7969 } else { 7970 sv = *v 7971 } 7972 7973 for key, value := range shape { 7974 switch key { 7975 case "Message": 7976 if value != nil { 7977 jtv, ok := value.(string) 7978 if !ok { 7979 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7980 } 7981 sv.Message = ptr.String(jtv) 7982 } 7983 7984 default: 7985 _, _ = key, value 7986 7987 } 7988 } 7989 *v = sv 7990 return nil 7991} 7992 7993func awsAwsjson11_deserializeDocumentInternalServiceErrorException(v **types.InternalServiceErrorException, value interface{}) error { 7994 if v == nil { 7995 return fmt.Errorf("unexpected nil of type %T", v) 7996 } 7997 if value == nil { 7998 return nil 7999 } 8000 8001 shape, ok := value.(map[string]interface{}) 8002 if !ok { 8003 return fmt.Errorf("unexpected JSON type %v", value) 8004 } 8005 8006 var sv *types.InternalServiceErrorException 8007 if *v == nil { 8008 sv = &types.InternalServiceErrorException{} 8009 } else { 8010 sv = *v 8011 } 8012 8013 for key, value := range shape { 8014 switch key { 8015 case "Message": 8016 if value != nil { 8017 jtv, ok := value.(string) 8018 if !ok { 8019 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8020 } 8021 sv.Message = ptr.String(jtv) 8022 } 8023 8024 default: 8025 _, _ = key, value 8026 8027 } 8028 } 8029 *v = sv 8030 return nil 8031} 8032 8033func awsAwsjson11_deserializeDocumentInvalidArgumentException(v **types.InvalidArgumentException, value interface{}) error { 8034 if v == nil { 8035 return fmt.Errorf("unexpected nil of type %T", v) 8036 } 8037 if value == nil { 8038 return nil 8039 } 8040 8041 shape, ok := value.(map[string]interface{}) 8042 if !ok { 8043 return fmt.Errorf("unexpected JSON type %v", value) 8044 } 8045 8046 var sv *types.InvalidArgumentException 8047 if *v == nil { 8048 sv = &types.InvalidArgumentException{} 8049 } else { 8050 sv = *v 8051 } 8052 8053 for key, value := range shape { 8054 switch key { 8055 case "Message": 8056 if value != nil { 8057 jtv, ok := value.(string) 8058 if !ok { 8059 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8060 } 8061 sv.Message = ptr.String(jtv) 8062 } 8063 8064 default: 8065 _, _ = key, value 8066 8067 } 8068 } 8069 *v = sv 8070 return nil 8071} 8072 8073func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { 8074 if v == nil { 8075 return fmt.Errorf("unexpected nil of type %T", v) 8076 } 8077 if value == nil { 8078 return nil 8079 } 8080 8081 shape, ok := value.(map[string]interface{}) 8082 if !ok { 8083 return fmt.Errorf("unexpected JSON type %v", value) 8084 } 8085 8086 var sv *types.InvalidNextTokenException 8087 if *v == nil { 8088 sv = &types.InvalidNextTokenException{} 8089 } else { 8090 sv = *v 8091 } 8092 8093 for key, value := range shape { 8094 switch key { 8095 case "Message": 8096 if value != nil { 8097 jtv, ok := value.(string) 8098 if !ok { 8099 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8100 } 8101 sv.Message = ptr.String(jtv) 8102 } 8103 8104 default: 8105 _, _ = key, value 8106 8107 } 8108 } 8109 *v = sv 8110 return nil 8111} 8112 8113func awsAwsjson11_deserializeDocumentInvalidPortRangeException(v **types.InvalidPortRangeException, value interface{}) error { 8114 if v == nil { 8115 return fmt.Errorf("unexpected nil of type %T", v) 8116 } 8117 if value == nil { 8118 return nil 8119 } 8120 8121 shape, ok := value.(map[string]interface{}) 8122 if !ok { 8123 return fmt.Errorf("unexpected JSON type %v", value) 8124 } 8125 8126 var sv *types.InvalidPortRangeException 8127 if *v == nil { 8128 sv = &types.InvalidPortRangeException{} 8129 } else { 8130 sv = *v 8131 } 8132 8133 for key, value := range shape { 8134 switch key { 8135 case "Message": 8136 if value != nil { 8137 jtv, ok := value.(string) 8138 if !ok { 8139 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8140 } 8141 sv.Message = ptr.String(jtv) 8142 } 8143 8144 default: 8145 _, _ = key, value 8146 8147 } 8148 } 8149 *v = sv 8150 return nil 8151} 8152 8153func awsAwsjson11_deserializeDocumentIpAddresses(v *[]string, value interface{}) error { 8154 if v == nil { 8155 return fmt.Errorf("unexpected nil of type %T", v) 8156 } 8157 if value == nil { 8158 return nil 8159 } 8160 8161 shape, ok := value.([]interface{}) 8162 if !ok { 8163 return fmt.Errorf("unexpected JSON type %v", value) 8164 } 8165 8166 var cv []string 8167 if *v == nil { 8168 cv = []string{} 8169 } else { 8170 cv = *v 8171 } 8172 8173 for _, value := range shape { 8174 var col string 8175 if value != nil { 8176 jtv, ok := value.(string) 8177 if !ok { 8178 return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) 8179 } 8180 col = jtv 8181 } 8182 cv = append(cv, col) 8183 8184 } 8185 *v = cv 8186 return nil 8187} 8188 8189func awsAwsjson11_deserializeDocumentIpSet(v **types.IpSet, value interface{}) error { 8190 if v == nil { 8191 return fmt.Errorf("unexpected nil of type %T", v) 8192 } 8193 if value == nil { 8194 return nil 8195 } 8196 8197 shape, ok := value.(map[string]interface{}) 8198 if !ok { 8199 return fmt.Errorf("unexpected JSON type %v", value) 8200 } 8201 8202 var sv *types.IpSet 8203 if *v == nil { 8204 sv = &types.IpSet{} 8205 } else { 8206 sv = *v 8207 } 8208 8209 for key, value := range shape { 8210 switch key { 8211 case "IpAddresses": 8212 if err := awsAwsjson11_deserializeDocumentIpAddresses(&sv.IpAddresses, value); err != nil { 8213 return err 8214 } 8215 8216 case "IpFamily": 8217 if value != nil { 8218 jtv, ok := value.(string) 8219 if !ok { 8220 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8221 } 8222 sv.IpFamily = ptr.String(jtv) 8223 } 8224 8225 default: 8226 _, _ = key, value 8227 8228 } 8229 } 8230 *v = sv 8231 return nil 8232} 8233 8234func awsAwsjson11_deserializeDocumentIpSets(v *[]types.IpSet, value interface{}) error { 8235 if v == nil { 8236 return fmt.Errorf("unexpected nil of type %T", v) 8237 } 8238 if value == nil { 8239 return nil 8240 } 8241 8242 shape, ok := value.([]interface{}) 8243 if !ok { 8244 return fmt.Errorf("unexpected JSON type %v", value) 8245 } 8246 8247 var cv []types.IpSet 8248 if *v == nil { 8249 cv = []types.IpSet{} 8250 } else { 8251 cv = *v 8252 } 8253 8254 for _, value := range shape { 8255 var col types.IpSet 8256 destAddr := &col 8257 if err := awsAwsjson11_deserializeDocumentIpSet(&destAddr, value); err != nil { 8258 return err 8259 } 8260 col = *destAddr 8261 cv = append(cv, col) 8262 8263 } 8264 *v = cv 8265 return nil 8266} 8267 8268func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 8269 if v == nil { 8270 return fmt.Errorf("unexpected nil of type %T", v) 8271 } 8272 if value == nil { 8273 return nil 8274 } 8275 8276 shape, ok := value.(map[string]interface{}) 8277 if !ok { 8278 return fmt.Errorf("unexpected JSON type %v", value) 8279 } 8280 8281 var sv *types.LimitExceededException 8282 if *v == nil { 8283 sv = &types.LimitExceededException{} 8284 } else { 8285 sv = *v 8286 } 8287 8288 for key, value := range shape { 8289 switch key { 8290 case "Message": 8291 if value != nil { 8292 jtv, ok := value.(string) 8293 if !ok { 8294 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8295 } 8296 sv.Message = ptr.String(jtv) 8297 } 8298 8299 default: 8300 _, _ = key, value 8301 8302 } 8303 } 8304 *v = sv 8305 return nil 8306} 8307 8308func awsAwsjson11_deserializeDocumentListener(v **types.Listener, value interface{}) error { 8309 if v == nil { 8310 return fmt.Errorf("unexpected nil of type %T", v) 8311 } 8312 if value == nil { 8313 return nil 8314 } 8315 8316 shape, ok := value.(map[string]interface{}) 8317 if !ok { 8318 return fmt.Errorf("unexpected JSON type %v", value) 8319 } 8320 8321 var sv *types.Listener 8322 if *v == nil { 8323 sv = &types.Listener{} 8324 } else { 8325 sv = *v 8326 } 8327 8328 for key, value := range shape { 8329 switch key { 8330 case "ClientAffinity": 8331 if value != nil { 8332 jtv, ok := value.(string) 8333 if !ok { 8334 return fmt.Errorf("expected ClientAffinity to be of type string, got %T instead", value) 8335 } 8336 sv.ClientAffinity = types.ClientAffinity(jtv) 8337 } 8338 8339 case "ListenerArn": 8340 if value != nil { 8341 jtv, ok := value.(string) 8342 if !ok { 8343 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8344 } 8345 sv.ListenerArn = ptr.String(jtv) 8346 } 8347 8348 case "PortRanges": 8349 if err := awsAwsjson11_deserializeDocumentPortRanges(&sv.PortRanges, value); err != nil { 8350 return err 8351 } 8352 8353 case "Protocol": 8354 if value != nil { 8355 jtv, ok := value.(string) 8356 if !ok { 8357 return fmt.Errorf("expected Protocol to be of type string, got %T instead", value) 8358 } 8359 sv.Protocol = types.Protocol(jtv) 8360 } 8361 8362 default: 8363 _, _ = key, value 8364 8365 } 8366 } 8367 *v = sv 8368 return nil 8369} 8370 8371func awsAwsjson11_deserializeDocumentListenerNotFoundException(v **types.ListenerNotFoundException, value interface{}) error { 8372 if v == nil { 8373 return fmt.Errorf("unexpected nil of type %T", v) 8374 } 8375 if value == nil { 8376 return nil 8377 } 8378 8379 shape, ok := value.(map[string]interface{}) 8380 if !ok { 8381 return fmt.Errorf("unexpected JSON type %v", value) 8382 } 8383 8384 var sv *types.ListenerNotFoundException 8385 if *v == nil { 8386 sv = &types.ListenerNotFoundException{} 8387 } else { 8388 sv = *v 8389 } 8390 8391 for key, value := range shape { 8392 switch key { 8393 case "Message": 8394 if value != nil { 8395 jtv, ok := value.(string) 8396 if !ok { 8397 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8398 } 8399 sv.Message = ptr.String(jtv) 8400 } 8401 8402 default: 8403 _, _ = key, value 8404 8405 } 8406 } 8407 *v = sv 8408 return nil 8409} 8410 8411func awsAwsjson11_deserializeDocumentListeners(v *[]types.Listener, value interface{}) error { 8412 if v == nil { 8413 return fmt.Errorf("unexpected nil of type %T", v) 8414 } 8415 if value == nil { 8416 return nil 8417 } 8418 8419 shape, ok := value.([]interface{}) 8420 if !ok { 8421 return fmt.Errorf("unexpected JSON type %v", value) 8422 } 8423 8424 var cv []types.Listener 8425 if *v == nil { 8426 cv = []types.Listener{} 8427 } else { 8428 cv = *v 8429 } 8430 8431 for _, value := range shape { 8432 var col types.Listener 8433 destAddr := &col 8434 if err := awsAwsjson11_deserializeDocumentListener(&destAddr, value); err != nil { 8435 return err 8436 } 8437 col = *destAddr 8438 cv = append(cv, col) 8439 8440 } 8441 *v = cv 8442 return nil 8443} 8444 8445func awsAwsjson11_deserializeDocumentPortMapping(v **types.PortMapping, value interface{}) error { 8446 if v == nil { 8447 return fmt.Errorf("unexpected nil of type %T", v) 8448 } 8449 if value == nil { 8450 return nil 8451 } 8452 8453 shape, ok := value.(map[string]interface{}) 8454 if !ok { 8455 return fmt.Errorf("unexpected JSON type %v", value) 8456 } 8457 8458 var sv *types.PortMapping 8459 if *v == nil { 8460 sv = &types.PortMapping{} 8461 } else { 8462 sv = *v 8463 } 8464 8465 for key, value := range shape { 8466 switch key { 8467 case "AcceleratorPort": 8468 if value != nil { 8469 jtv, ok := value.(json.Number) 8470 if !ok { 8471 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8472 } 8473 i64, err := jtv.Int64() 8474 if err != nil { 8475 return err 8476 } 8477 sv.AcceleratorPort = ptr.Int32(int32(i64)) 8478 } 8479 8480 case "DestinationSocketAddress": 8481 if err := awsAwsjson11_deserializeDocumentSocketAddress(&sv.DestinationSocketAddress, value); err != nil { 8482 return err 8483 } 8484 8485 case "DestinationTrafficState": 8486 if value != nil { 8487 jtv, ok := value.(string) 8488 if !ok { 8489 return fmt.Errorf("expected CustomRoutingDestinationTrafficState to be of type string, got %T instead", value) 8490 } 8491 sv.DestinationTrafficState = types.CustomRoutingDestinationTrafficState(jtv) 8492 } 8493 8494 case "EndpointGroupArn": 8495 if value != nil { 8496 jtv, ok := value.(string) 8497 if !ok { 8498 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8499 } 8500 sv.EndpointGroupArn = ptr.String(jtv) 8501 } 8502 8503 case "EndpointId": 8504 if value != nil { 8505 jtv, ok := value.(string) 8506 if !ok { 8507 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8508 } 8509 sv.EndpointId = ptr.String(jtv) 8510 } 8511 8512 case "Protocols": 8513 if err := awsAwsjson11_deserializeDocumentCustomRoutingProtocols(&sv.Protocols, value); err != nil { 8514 return err 8515 } 8516 8517 default: 8518 _, _ = key, value 8519 8520 } 8521 } 8522 *v = sv 8523 return nil 8524} 8525 8526func awsAwsjson11_deserializeDocumentPortMappings(v *[]types.PortMapping, value interface{}) error { 8527 if v == nil { 8528 return fmt.Errorf("unexpected nil of type %T", v) 8529 } 8530 if value == nil { 8531 return nil 8532 } 8533 8534 shape, ok := value.([]interface{}) 8535 if !ok { 8536 return fmt.Errorf("unexpected JSON type %v", value) 8537 } 8538 8539 var cv []types.PortMapping 8540 if *v == nil { 8541 cv = []types.PortMapping{} 8542 } else { 8543 cv = *v 8544 } 8545 8546 for _, value := range shape { 8547 var col types.PortMapping 8548 destAddr := &col 8549 if err := awsAwsjson11_deserializeDocumentPortMapping(&destAddr, value); err != nil { 8550 return err 8551 } 8552 col = *destAddr 8553 cv = append(cv, col) 8554 8555 } 8556 *v = cv 8557 return nil 8558} 8559 8560func awsAwsjson11_deserializeDocumentPortOverride(v **types.PortOverride, value interface{}) error { 8561 if v == nil { 8562 return fmt.Errorf("unexpected nil of type %T", v) 8563 } 8564 if value == nil { 8565 return nil 8566 } 8567 8568 shape, ok := value.(map[string]interface{}) 8569 if !ok { 8570 return fmt.Errorf("unexpected JSON type %v", value) 8571 } 8572 8573 var sv *types.PortOverride 8574 if *v == nil { 8575 sv = &types.PortOverride{} 8576 } else { 8577 sv = *v 8578 } 8579 8580 for key, value := range shape { 8581 switch key { 8582 case "EndpointPort": 8583 if value != nil { 8584 jtv, ok := value.(json.Number) 8585 if !ok { 8586 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8587 } 8588 i64, err := jtv.Int64() 8589 if err != nil { 8590 return err 8591 } 8592 sv.EndpointPort = ptr.Int32(int32(i64)) 8593 } 8594 8595 case "ListenerPort": 8596 if value != nil { 8597 jtv, ok := value.(json.Number) 8598 if !ok { 8599 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8600 } 8601 i64, err := jtv.Int64() 8602 if err != nil { 8603 return err 8604 } 8605 sv.ListenerPort = ptr.Int32(int32(i64)) 8606 } 8607 8608 default: 8609 _, _ = key, value 8610 8611 } 8612 } 8613 *v = sv 8614 return nil 8615} 8616 8617func awsAwsjson11_deserializeDocumentPortOverrides(v *[]types.PortOverride, value interface{}) error { 8618 if v == nil { 8619 return fmt.Errorf("unexpected nil of type %T", v) 8620 } 8621 if value == nil { 8622 return nil 8623 } 8624 8625 shape, ok := value.([]interface{}) 8626 if !ok { 8627 return fmt.Errorf("unexpected JSON type %v", value) 8628 } 8629 8630 var cv []types.PortOverride 8631 if *v == nil { 8632 cv = []types.PortOverride{} 8633 } else { 8634 cv = *v 8635 } 8636 8637 for _, value := range shape { 8638 var col types.PortOverride 8639 destAddr := &col 8640 if err := awsAwsjson11_deserializeDocumentPortOverride(&destAddr, value); err != nil { 8641 return err 8642 } 8643 col = *destAddr 8644 cv = append(cv, col) 8645 8646 } 8647 *v = cv 8648 return nil 8649} 8650 8651func awsAwsjson11_deserializeDocumentPortRange(v **types.PortRange, value interface{}) error { 8652 if v == nil { 8653 return fmt.Errorf("unexpected nil of type %T", v) 8654 } 8655 if value == nil { 8656 return nil 8657 } 8658 8659 shape, ok := value.(map[string]interface{}) 8660 if !ok { 8661 return fmt.Errorf("unexpected JSON type %v", value) 8662 } 8663 8664 var sv *types.PortRange 8665 if *v == nil { 8666 sv = &types.PortRange{} 8667 } else { 8668 sv = *v 8669 } 8670 8671 for key, value := range shape { 8672 switch key { 8673 case "FromPort": 8674 if value != nil { 8675 jtv, ok := value.(json.Number) 8676 if !ok { 8677 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8678 } 8679 i64, err := jtv.Int64() 8680 if err != nil { 8681 return err 8682 } 8683 sv.FromPort = ptr.Int32(int32(i64)) 8684 } 8685 8686 case "ToPort": 8687 if value != nil { 8688 jtv, ok := value.(json.Number) 8689 if !ok { 8690 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8691 } 8692 i64, err := jtv.Int64() 8693 if err != nil { 8694 return err 8695 } 8696 sv.ToPort = ptr.Int32(int32(i64)) 8697 } 8698 8699 default: 8700 _, _ = key, value 8701 8702 } 8703 } 8704 *v = sv 8705 return nil 8706} 8707 8708func awsAwsjson11_deserializeDocumentPortRanges(v *[]types.PortRange, value interface{}) error { 8709 if v == nil { 8710 return fmt.Errorf("unexpected nil of type %T", v) 8711 } 8712 if value == nil { 8713 return nil 8714 } 8715 8716 shape, ok := value.([]interface{}) 8717 if !ok { 8718 return fmt.Errorf("unexpected JSON type %v", value) 8719 } 8720 8721 var cv []types.PortRange 8722 if *v == nil { 8723 cv = []types.PortRange{} 8724 } else { 8725 cv = *v 8726 } 8727 8728 for _, value := range shape { 8729 var col types.PortRange 8730 destAddr := &col 8731 if err := awsAwsjson11_deserializeDocumentPortRange(&destAddr, value); err != nil { 8732 return err 8733 } 8734 col = *destAddr 8735 cv = append(cv, col) 8736 8737 } 8738 *v = cv 8739 return nil 8740} 8741 8742func awsAwsjson11_deserializeDocumentProtocols(v *[]types.Protocol, value interface{}) error { 8743 if v == nil { 8744 return fmt.Errorf("unexpected nil of type %T", v) 8745 } 8746 if value == nil { 8747 return nil 8748 } 8749 8750 shape, ok := value.([]interface{}) 8751 if !ok { 8752 return fmt.Errorf("unexpected JSON type %v", value) 8753 } 8754 8755 var cv []types.Protocol 8756 if *v == nil { 8757 cv = []types.Protocol{} 8758 } else { 8759 cv = *v 8760 } 8761 8762 for _, value := range shape { 8763 var col types.Protocol 8764 if value != nil { 8765 jtv, ok := value.(string) 8766 if !ok { 8767 return fmt.Errorf("expected Protocol to be of type string, got %T instead", value) 8768 } 8769 col = types.Protocol(jtv) 8770 } 8771 cv = append(cv, col) 8772 8773 } 8774 *v = cv 8775 return nil 8776} 8777 8778func awsAwsjson11_deserializeDocumentSocketAddress(v **types.SocketAddress, value interface{}) error { 8779 if v == nil { 8780 return fmt.Errorf("unexpected nil of type %T", v) 8781 } 8782 if value == nil { 8783 return nil 8784 } 8785 8786 shape, ok := value.(map[string]interface{}) 8787 if !ok { 8788 return fmt.Errorf("unexpected JSON type %v", value) 8789 } 8790 8791 var sv *types.SocketAddress 8792 if *v == nil { 8793 sv = &types.SocketAddress{} 8794 } else { 8795 sv = *v 8796 } 8797 8798 for key, value := range shape { 8799 switch key { 8800 case "IpAddress": 8801 if value != nil { 8802 jtv, ok := value.(string) 8803 if !ok { 8804 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8805 } 8806 sv.IpAddress = ptr.String(jtv) 8807 } 8808 8809 case "Port": 8810 if value != nil { 8811 jtv, ok := value.(json.Number) 8812 if !ok { 8813 return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) 8814 } 8815 i64, err := jtv.Int64() 8816 if err != nil { 8817 return err 8818 } 8819 sv.Port = ptr.Int32(int32(i64)) 8820 } 8821 8822 default: 8823 _, _ = key, value 8824 8825 } 8826 } 8827 *v = sv 8828 return nil 8829} 8830 8831func awsAwsjson11_deserializeDocumentSocketAddresses(v *[]types.SocketAddress, value interface{}) error { 8832 if v == nil { 8833 return fmt.Errorf("unexpected nil of type %T", v) 8834 } 8835 if value == nil { 8836 return nil 8837 } 8838 8839 shape, ok := value.([]interface{}) 8840 if !ok { 8841 return fmt.Errorf("unexpected JSON type %v", value) 8842 } 8843 8844 var cv []types.SocketAddress 8845 if *v == nil { 8846 cv = []types.SocketAddress{} 8847 } else { 8848 cv = *v 8849 } 8850 8851 for _, value := range shape { 8852 var col types.SocketAddress 8853 destAddr := &col 8854 if err := awsAwsjson11_deserializeDocumentSocketAddress(&destAddr, value); err != nil { 8855 return err 8856 } 8857 col = *destAddr 8858 cv = append(cv, col) 8859 8860 } 8861 *v = cv 8862 return nil 8863} 8864 8865func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { 8866 if v == nil { 8867 return fmt.Errorf("unexpected nil of type %T", v) 8868 } 8869 if value == nil { 8870 return nil 8871 } 8872 8873 shape, ok := value.(map[string]interface{}) 8874 if !ok { 8875 return fmt.Errorf("unexpected JSON type %v", value) 8876 } 8877 8878 var sv *types.Tag 8879 if *v == nil { 8880 sv = &types.Tag{} 8881 } else { 8882 sv = *v 8883 } 8884 8885 for key, value := range shape { 8886 switch key { 8887 case "Key": 8888 if value != nil { 8889 jtv, ok := value.(string) 8890 if !ok { 8891 return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) 8892 } 8893 sv.Key = ptr.String(jtv) 8894 } 8895 8896 case "Value": 8897 if value != nil { 8898 jtv, ok := value.(string) 8899 if !ok { 8900 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 8901 } 8902 sv.Value = ptr.String(jtv) 8903 } 8904 8905 default: 8906 _, _ = key, value 8907 8908 } 8909 } 8910 *v = sv 8911 return nil 8912} 8913 8914func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, value interface{}) error { 8915 if v == nil { 8916 return fmt.Errorf("unexpected nil of type %T", v) 8917 } 8918 if value == nil { 8919 return nil 8920 } 8921 8922 shape, ok := value.([]interface{}) 8923 if !ok { 8924 return fmt.Errorf("unexpected JSON type %v", value) 8925 } 8926 8927 var cv []types.Tag 8928 if *v == nil { 8929 cv = []types.Tag{} 8930 } else { 8931 cv = *v 8932 } 8933 8934 for _, value := range shape { 8935 var col types.Tag 8936 destAddr := &col 8937 if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { 8938 return err 8939 } 8940 col = *destAddr 8941 cv = append(cv, col) 8942 8943 } 8944 *v = cv 8945 return nil 8946} 8947 8948func awsAwsjson11_deserializeOpDocumentAddCustomRoutingEndpointsOutput(v **AddCustomRoutingEndpointsOutput, value interface{}) error { 8949 if v == nil { 8950 return fmt.Errorf("unexpected nil of type %T", v) 8951 } 8952 if value == nil { 8953 return nil 8954 } 8955 8956 shape, ok := value.(map[string]interface{}) 8957 if !ok { 8958 return fmt.Errorf("unexpected JSON type %v", value) 8959 } 8960 8961 var sv *AddCustomRoutingEndpointsOutput 8962 if *v == nil { 8963 sv = &AddCustomRoutingEndpointsOutput{} 8964 } else { 8965 sv = *v 8966 } 8967 8968 for key, value := range shape { 8969 switch key { 8970 case "EndpointDescriptions": 8971 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointDescriptions(&sv.EndpointDescriptions, value); err != nil { 8972 return err 8973 } 8974 8975 case "EndpointGroupArn": 8976 if value != nil { 8977 jtv, ok := value.(string) 8978 if !ok { 8979 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 8980 } 8981 sv.EndpointGroupArn = ptr.String(jtv) 8982 } 8983 8984 default: 8985 _, _ = key, value 8986 8987 } 8988 } 8989 *v = sv 8990 return nil 8991} 8992 8993func awsAwsjson11_deserializeOpDocumentAdvertiseByoipCidrOutput(v **AdvertiseByoipCidrOutput, value interface{}) error { 8994 if v == nil { 8995 return fmt.Errorf("unexpected nil of type %T", v) 8996 } 8997 if value == nil { 8998 return nil 8999 } 9000 9001 shape, ok := value.(map[string]interface{}) 9002 if !ok { 9003 return fmt.Errorf("unexpected JSON type %v", value) 9004 } 9005 9006 var sv *AdvertiseByoipCidrOutput 9007 if *v == nil { 9008 sv = &AdvertiseByoipCidrOutput{} 9009 } else { 9010 sv = *v 9011 } 9012 9013 for key, value := range shape { 9014 switch key { 9015 case "ByoipCidr": 9016 if err := awsAwsjson11_deserializeDocumentByoipCidr(&sv.ByoipCidr, value); err != nil { 9017 return err 9018 } 9019 9020 default: 9021 _, _ = key, value 9022 9023 } 9024 } 9025 *v = sv 9026 return nil 9027} 9028 9029func awsAwsjson11_deserializeOpDocumentCreateAcceleratorOutput(v **CreateAcceleratorOutput, value interface{}) error { 9030 if v == nil { 9031 return fmt.Errorf("unexpected nil of type %T", v) 9032 } 9033 if value == nil { 9034 return nil 9035 } 9036 9037 shape, ok := value.(map[string]interface{}) 9038 if !ok { 9039 return fmt.Errorf("unexpected JSON type %v", value) 9040 } 9041 9042 var sv *CreateAcceleratorOutput 9043 if *v == nil { 9044 sv = &CreateAcceleratorOutput{} 9045 } else { 9046 sv = *v 9047 } 9048 9049 for key, value := range shape { 9050 switch key { 9051 case "Accelerator": 9052 if err := awsAwsjson11_deserializeDocumentAccelerator(&sv.Accelerator, value); err != nil { 9053 return err 9054 } 9055 9056 default: 9057 _, _ = key, value 9058 9059 } 9060 } 9061 *v = sv 9062 return nil 9063} 9064 9065func awsAwsjson11_deserializeOpDocumentCreateCustomRoutingAcceleratorOutput(v **CreateCustomRoutingAcceleratorOutput, value interface{}) error { 9066 if v == nil { 9067 return fmt.Errorf("unexpected nil of type %T", v) 9068 } 9069 if value == nil { 9070 return nil 9071 } 9072 9073 shape, ok := value.(map[string]interface{}) 9074 if !ok { 9075 return fmt.Errorf("unexpected JSON type %v", value) 9076 } 9077 9078 var sv *CreateCustomRoutingAcceleratorOutput 9079 if *v == nil { 9080 sv = &CreateCustomRoutingAcceleratorOutput{} 9081 } else { 9082 sv = *v 9083 } 9084 9085 for key, value := range shape { 9086 switch key { 9087 case "Accelerator": 9088 if err := awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(&sv.Accelerator, value); err != nil { 9089 return err 9090 } 9091 9092 default: 9093 _, _ = key, value 9094 9095 } 9096 } 9097 *v = sv 9098 return nil 9099} 9100 9101func awsAwsjson11_deserializeOpDocumentCreateCustomRoutingEndpointGroupOutput(v **CreateCustomRoutingEndpointGroupOutput, value interface{}) error { 9102 if v == nil { 9103 return fmt.Errorf("unexpected nil of type %T", v) 9104 } 9105 if value == nil { 9106 return nil 9107 } 9108 9109 shape, ok := value.(map[string]interface{}) 9110 if !ok { 9111 return fmt.Errorf("unexpected JSON type %v", value) 9112 } 9113 9114 var sv *CreateCustomRoutingEndpointGroupOutput 9115 if *v == nil { 9116 sv = &CreateCustomRoutingEndpointGroupOutput{} 9117 } else { 9118 sv = *v 9119 } 9120 9121 for key, value := range shape { 9122 switch key { 9123 case "EndpointGroup": 9124 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroup(&sv.EndpointGroup, value); err != nil { 9125 return err 9126 } 9127 9128 default: 9129 _, _ = key, value 9130 9131 } 9132 } 9133 *v = sv 9134 return nil 9135} 9136 9137func awsAwsjson11_deserializeOpDocumentCreateCustomRoutingListenerOutput(v **CreateCustomRoutingListenerOutput, value interface{}) error { 9138 if v == nil { 9139 return fmt.Errorf("unexpected nil of type %T", v) 9140 } 9141 if value == nil { 9142 return nil 9143 } 9144 9145 shape, ok := value.(map[string]interface{}) 9146 if !ok { 9147 return fmt.Errorf("unexpected JSON type %v", value) 9148 } 9149 9150 var sv *CreateCustomRoutingListenerOutput 9151 if *v == nil { 9152 sv = &CreateCustomRoutingListenerOutput{} 9153 } else { 9154 sv = *v 9155 } 9156 9157 for key, value := range shape { 9158 switch key { 9159 case "Listener": 9160 if err := awsAwsjson11_deserializeDocumentCustomRoutingListener(&sv.Listener, value); err != nil { 9161 return err 9162 } 9163 9164 default: 9165 _, _ = key, value 9166 9167 } 9168 } 9169 *v = sv 9170 return nil 9171} 9172 9173func awsAwsjson11_deserializeOpDocumentCreateEndpointGroupOutput(v **CreateEndpointGroupOutput, value interface{}) error { 9174 if v == nil { 9175 return fmt.Errorf("unexpected nil of type %T", v) 9176 } 9177 if value == nil { 9178 return nil 9179 } 9180 9181 shape, ok := value.(map[string]interface{}) 9182 if !ok { 9183 return fmt.Errorf("unexpected JSON type %v", value) 9184 } 9185 9186 var sv *CreateEndpointGroupOutput 9187 if *v == nil { 9188 sv = &CreateEndpointGroupOutput{} 9189 } else { 9190 sv = *v 9191 } 9192 9193 for key, value := range shape { 9194 switch key { 9195 case "EndpointGroup": 9196 if err := awsAwsjson11_deserializeDocumentEndpointGroup(&sv.EndpointGroup, value); err != nil { 9197 return err 9198 } 9199 9200 default: 9201 _, _ = key, value 9202 9203 } 9204 } 9205 *v = sv 9206 return nil 9207} 9208 9209func awsAwsjson11_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOutput, value interface{}) error { 9210 if v == nil { 9211 return fmt.Errorf("unexpected nil of type %T", v) 9212 } 9213 if value == nil { 9214 return nil 9215 } 9216 9217 shape, ok := value.(map[string]interface{}) 9218 if !ok { 9219 return fmt.Errorf("unexpected JSON type %v", value) 9220 } 9221 9222 var sv *CreateListenerOutput 9223 if *v == nil { 9224 sv = &CreateListenerOutput{} 9225 } else { 9226 sv = *v 9227 } 9228 9229 for key, value := range shape { 9230 switch key { 9231 case "Listener": 9232 if err := awsAwsjson11_deserializeDocumentListener(&sv.Listener, value); err != nil { 9233 return err 9234 } 9235 9236 default: 9237 _, _ = key, value 9238 9239 } 9240 } 9241 *v = sv 9242 return nil 9243} 9244 9245func awsAwsjson11_deserializeOpDocumentDeprovisionByoipCidrOutput(v **DeprovisionByoipCidrOutput, value interface{}) error { 9246 if v == nil { 9247 return fmt.Errorf("unexpected nil of type %T", v) 9248 } 9249 if value == nil { 9250 return nil 9251 } 9252 9253 shape, ok := value.(map[string]interface{}) 9254 if !ok { 9255 return fmt.Errorf("unexpected JSON type %v", value) 9256 } 9257 9258 var sv *DeprovisionByoipCidrOutput 9259 if *v == nil { 9260 sv = &DeprovisionByoipCidrOutput{} 9261 } else { 9262 sv = *v 9263 } 9264 9265 for key, value := range shape { 9266 switch key { 9267 case "ByoipCidr": 9268 if err := awsAwsjson11_deserializeDocumentByoipCidr(&sv.ByoipCidr, value); err != nil { 9269 return err 9270 } 9271 9272 default: 9273 _, _ = key, value 9274 9275 } 9276 } 9277 *v = sv 9278 return nil 9279} 9280 9281func awsAwsjson11_deserializeOpDocumentDescribeAcceleratorAttributesOutput(v **DescribeAcceleratorAttributesOutput, value interface{}) error { 9282 if v == nil { 9283 return fmt.Errorf("unexpected nil of type %T", v) 9284 } 9285 if value == nil { 9286 return nil 9287 } 9288 9289 shape, ok := value.(map[string]interface{}) 9290 if !ok { 9291 return fmt.Errorf("unexpected JSON type %v", value) 9292 } 9293 9294 var sv *DescribeAcceleratorAttributesOutput 9295 if *v == nil { 9296 sv = &DescribeAcceleratorAttributesOutput{} 9297 } else { 9298 sv = *v 9299 } 9300 9301 for key, value := range shape { 9302 switch key { 9303 case "AcceleratorAttributes": 9304 if err := awsAwsjson11_deserializeDocumentAcceleratorAttributes(&sv.AcceleratorAttributes, value); err != nil { 9305 return err 9306 } 9307 9308 default: 9309 _, _ = key, value 9310 9311 } 9312 } 9313 *v = sv 9314 return nil 9315} 9316 9317func awsAwsjson11_deserializeOpDocumentDescribeAcceleratorOutput(v **DescribeAcceleratorOutput, value interface{}) error { 9318 if v == nil { 9319 return fmt.Errorf("unexpected nil of type %T", v) 9320 } 9321 if value == nil { 9322 return nil 9323 } 9324 9325 shape, ok := value.(map[string]interface{}) 9326 if !ok { 9327 return fmt.Errorf("unexpected JSON type %v", value) 9328 } 9329 9330 var sv *DescribeAcceleratorOutput 9331 if *v == nil { 9332 sv = &DescribeAcceleratorOutput{} 9333 } else { 9334 sv = *v 9335 } 9336 9337 for key, value := range shape { 9338 switch key { 9339 case "Accelerator": 9340 if err := awsAwsjson11_deserializeDocumentAccelerator(&sv.Accelerator, value); err != nil { 9341 return err 9342 } 9343 9344 default: 9345 _, _ = key, value 9346 9347 } 9348 } 9349 *v = sv 9350 return nil 9351} 9352 9353func awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorAttributesOutput(v **DescribeCustomRoutingAcceleratorAttributesOutput, value interface{}) error { 9354 if v == nil { 9355 return fmt.Errorf("unexpected nil of type %T", v) 9356 } 9357 if value == nil { 9358 return nil 9359 } 9360 9361 shape, ok := value.(map[string]interface{}) 9362 if !ok { 9363 return fmt.Errorf("unexpected JSON type %v", value) 9364 } 9365 9366 var sv *DescribeCustomRoutingAcceleratorAttributesOutput 9367 if *v == nil { 9368 sv = &DescribeCustomRoutingAcceleratorAttributesOutput{} 9369 } else { 9370 sv = *v 9371 } 9372 9373 for key, value := range shape { 9374 switch key { 9375 case "AcceleratorAttributes": 9376 if err := awsAwsjson11_deserializeDocumentCustomRoutingAcceleratorAttributes(&sv.AcceleratorAttributes, value); err != nil { 9377 return err 9378 } 9379 9380 default: 9381 _, _ = key, value 9382 9383 } 9384 } 9385 *v = sv 9386 return nil 9387} 9388 9389func awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorOutput(v **DescribeCustomRoutingAcceleratorOutput, value interface{}) error { 9390 if v == nil { 9391 return fmt.Errorf("unexpected nil of type %T", v) 9392 } 9393 if value == nil { 9394 return nil 9395 } 9396 9397 shape, ok := value.(map[string]interface{}) 9398 if !ok { 9399 return fmt.Errorf("unexpected JSON type %v", value) 9400 } 9401 9402 var sv *DescribeCustomRoutingAcceleratorOutput 9403 if *v == nil { 9404 sv = &DescribeCustomRoutingAcceleratorOutput{} 9405 } else { 9406 sv = *v 9407 } 9408 9409 for key, value := range shape { 9410 switch key { 9411 case "Accelerator": 9412 if err := awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(&sv.Accelerator, value); err != nil { 9413 return err 9414 } 9415 9416 default: 9417 _, _ = key, value 9418 9419 } 9420 } 9421 *v = sv 9422 return nil 9423} 9424 9425func awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingEndpointGroupOutput(v **DescribeCustomRoutingEndpointGroupOutput, value interface{}) error { 9426 if v == nil { 9427 return fmt.Errorf("unexpected nil of type %T", v) 9428 } 9429 if value == nil { 9430 return nil 9431 } 9432 9433 shape, ok := value.(map[string]interface{}) 9434 if !ok { 9435 return fmt.Errorf("unexpected JSON type %v", value) 9436 } 9437 9438 var sv *DescribeCustomRoutingEndpointGroupOutput 9439 if *v == nil { 9440 sv = &DescribeCustomRoutingEndpointGroupOutput{} 9441 } else { 9442 sv = *v 9443 } 9444 9445 for key, value := range shape { 9446 switch key { 9447 case "EndpointGroup": 9448 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroup(&sv.EndpointGroup, value); err != nil { 9449 return err 9450 } 9451 9452 default: 9453 _, _ = key, value 9454 9455 } 9456 } 9457 *v = sv 9458 return nil 9459} 9460 9461func awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingListenerOutput(v **DescribeCustomRoutingListenerOutput, value interface{}) error { 9462 if v == nil { 9463 return fmt.Errorf("unexpected nil of type %T", v) 9464 } 9465 if value == nil { 9466 return nil 9467 } 9468 9469 shape, ok := value.(map[string]interface{}) 9470 if !ok { 9471 return fmt.Errorf("unexpected JSON type %v", value) 9472 } 9473 9474 var sv *DescribeCustomRoutingListenerOutput 9475 if *v == nil { 9476 sv = &DescribeCustomRoutingListenerOutput{} 9477 } else { 9478 sv = *v 9479 } 9480 9481 for key, value := range shape { 9482 switch key { 9483 case "Listener": 9484 if err := awsAwsjson11_deserializeDocumentCustomRoutingListener(&sv.Listener, value); err != nil { 9485 return err 9486 } 9487 9488 default: 9489 _, _ = key, value 9490 9491 } 9492 } 9493 *v = sv 9494 return nil 9495} 9496 9497func awsAwsjson11_deserializeOpDocumentDescribeEndpointGroupOutput(v **DescribeEndpointGroupOutput, value interface{}) error { 9498 if v == nil { 9499 return fmt.Errorf("unexpected nil of type %T", v) 9500 } 9501 if value == nil { 9502 return nil 9503 } 9504 9505 shape, ok := value.(map[string]interface{}) 9506 if !ok { 9507 return fmt.Errorf("unexpected JSON type %v", value) 9508 } 9509 9510 var sv *DescribeEndpointGroupOutput 9511 if *v == nil { 9512 sv = &DescribeEndpointGroupOutput{} 9513 } else { 9514 sv = *v 9515 } 9516 9517 for key, value := range shape { 9518 switch key { 9519 case "EndpointGroup": 9520 if err := awsAwsjson11_deserializeDocumentEndpointGroup(&sv.EndpointGroup, value); err != nil { 9521 return err 9522 } 9523 9524 default: 9525 _, _ = key, value 9526 9527 } 9528 } 9529 *v = sv 9530 return nil 9531} 9532 9533func awsAwsjson11_deserializeOpDocumentDescribeListenerOutput(v **DescribeListenerOutput, value interface{}) error { 9534 if v == nil { 9535 return fmt.Errorf("unexpected nil of type %T", v) 9536 } 9537 if value == nil { 9538 return nil 9539 } 9540 9541 shape, ok := value.(map[string]interface{}) 9542 if !ok { 9543 return fmt.Errorf("unexpected JSON type %v", value) 9544 } 9545 9546 var sv *DescribeListenerOutput 9547 if *v == nil { 9548 sv = &DescribeListenerOutput{} 9549 } else { 9550 sv = *v 9551 } 9552 9553 for key, value := range shape { 9554 switch key { 9555 case "Listener": 9556 if err := awsAwsjson11_deserializeDocumentListener(&sv.Listener, value); err != nil { 9557 return err 9558 } 9559 9560 default: 9561 _, _ = key, value 9562 9563 } 9564 } 9565 *v = sv 9566 return nil 9567} 9568 9569func awsAwsjson11_deserializeOpDocumentListAcceleratorsOutput(v **ListAcceleratorsOutput, value interface{}) error { 9570 if v == nil { 9571 return fmt.Errorf("unexpected nil of type %T", v) 9572 } 9573 if value == nil { 9574 return nil 9575 } 9576 9577 shape, ok := value.(map[string]interface{}) 9578 if !ok { 9579 return fmt.Errorf("unexpected JSON type %v", value) 9580 } 9581 9582 var sv *ListAcceleratorsOutput 9583 if *v == nil { 9584 sv = &ListAcceleratorsOutput{} 9585 } else { 9586 sv = *v 9587 } 9588 9589 for key, value := range shape { 9590 switch key { 9591 case "Accelerators": 9592 if err := awsAwsjson11_deserializeDocumentAccelerators(&sv.Accelerators, value); err != nil { 9593 return err 9594 } 9595 9596 case "NextToken": 9597 if value != nil { 9598 jtv, ok := value.(string) 9599 if !ok { 9600 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9601 } 9602 sv.NextToken = ptr.String(jtv) 9603 } 9604 9605 default: 9606 _, _ = key, value 9607 9608 } 9609 } 9610 *v = sv 9611 return nil 9612} 9613 9614func awsAwsjson11_deserializeOpDocumentListByoipCidrsOutput(v **ListByoipCidrsOutput, value interface{}) error { 9615 if v == nil { 9616 return fmt.Errorf("unexpected nil of type %T", v) 9617 } 9618 if value == nil { 9619 return nil 9620 } 9621 9622 shape, ok := value.(map[string]interface{}) 9623 if !ok { 9624 return fmt.Errorf("unexpected JSON type %v", value) 9625 } 9626 9627 var sv *ListByoipCidrsOutput 9628 if *v == nil { 9629 sv = &ListByoipCidrsOutput{} 9630 } else { 9631 sv = *v 9632 } 9633 9634 for key, value := range shape { 9635 switch key { 9636 case "ByoipCidrs": 9637 if err := awsAwsjson11_deserializeDocumentByoipCidrs(&sv.ByoipCidrs, value); err != nil { 9638 return err 9639 } 9640 9641 case "NextToken": 9642 if value != nil { 9643 jtv, ok := value.(string) 9644 if !ok { 9645 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9646 } 9647 sv.NextToken = ptr.String(jtv) 9648 } 9649 9650 default: 9651 _, _ = key, value 9652 9653 } 9654 } 9655 *v = sv 9656 return nil 9657} 9658 9659func awsAwsjson11_deserializeOpDocumentListCustomRoutingAcceleratorsOutput(v **ListCustomRoutingAcceleratorsOutput, value interface{}) error { 9660 if v == nil { 9661 return fmt.Errorf("unexpected nil of type %T", v) 9662 } 9663 if value == nil { 9664 return nil 9665 } 9666 9667 shape, ok := value.(map[string]interface{}) 9668 if !ok { 9669 return fmt.Errorf("unexpected JSON type %v", value) 9670 } 9671 9672 var sv *ListCustomRoutingAcceleratorsOutput 9673 if *v == nil { 9674 sv = &ListCustomRoutingAcceleratorsOutput{} 9675 } else { 9676 sv = *v 9677 } 9678 9679 for key, value := range shape { 9680 switch key { 9681 case "Accelerators": 9682 if err := awsAwsjson11_deserializeDocumentCustomRoutingAccelerators(&sv.Accelerators, value); err != nil { 9683 return err 9684 } 9685 9686 case "NextToken": 9687 if value != nil { 9688 jtv, ok := value.(string) 9689 if !ok { 9690 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9691 } 9692 sv.NextToken = ptr.String(jtv) 9693 } 9694 9695 default: 9696 _, _ = key, value 9697 9698 } 9699 } 9700 *v = sv 9701 return nil 9702} 9703 9704func awsAwsjson11_deserializeOpDocumentListCustomRoutingEndpointGroupsOutput(v **ListCustomRoutingEndpointGroupsOutput, value interface{}) error { 9705 if v == nil { 9706 return fmt.Errorf("unexpected nil of type %T", v) 9707 } 9708 if value == nil { 9709 return nil 9710 } 9711 9712 shape, ok := value.(map[string]interface{}) 9713 if !ok { 9714 return fmt.Errorf("unexpected JSON type %v", value) 9715 } 9716 9717 var sv *ListCustomRoutingEndpointGroupsOutput 9718 if *v == nil { 9719 sv = &ListCustomRoutingEndpointGroupsOutput{} 9720 } else { 9721 sv = *v 9722 } 9723 9724 for key, value := range shape { 9725 switch key { 9726 case "EndpointGroups": 9727 if err := awsAwsjson11_deserializeDocumentCustomRoutingEndpointGroups(&sv.EndpointGroups, value); err != nil { 9728 return err 9729 } 9730 9731 case "NextToken": 9732 if value != nil { 9733 jtv, ok := value.(string) 9734 if !ok { 9735 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9736 } 9737 sv.NextToken = ptr.String(jtv) 9738 } 9739 9740 default: 9741 _, _ = key, value 9742 9743 } 9744 } 9745 *v = sv 9746 return nil 9747} 9748 9749func awsAwsjson11_deserializeOpDocumentListCustomRoutingListenersOutput(v **ListCustomRoutingListenersOutput, value interface{}) error { 9750 if v == nil { 9751 return fmt.Errorf("unexpected nil of type %T", v) 9752 } 9753 if value == nil { 9754 return nil 9755 } 9756 9757 shape, ok := value.(map[string]interface{}) 9758 if !ok { 9759 return fmt.Errorf("unexpected JSON type %v", value) 9760 } 9761 9762 var sv *ListCustomRoutingListenersOutput 9763 if *v == nil { 9764 sv = &ListCustomRoutingListenersOutput{} 9765 } else { 9766 sv = *v 9767 } 9768 9769 for key, value := range shape { 9770 switch key { 9771 case "Listeners": 9772 if err := awsAwsjson11_deserializeDocumentCustomRoutingListeners(&sv.Listeners, value); err != nil { 9773 return err 9774 } 9775 9776 case "NextToken": 9777 if value != nil { 9778 jtv, ok := value.(string) 9779 if !ok { 9780 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9781 } 9782 sv.NextToken = ptr.String(jtv) 9783 } 9784 9785 default: 9786 _, _ = key, value 9787 9788 } 9789 } 9790 *v = sv 9791 return nil 9792} 9793 9794func awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsByDestinationOutput(v **ListCustomRoutingPortMappingsByDestinationOutput, value interface{}) error { 9795 if v == nil { 9796 return fmt.Errorf("unexpected nil of type %T", v) 9797 } 9798 if value == nil { 9799 return nil 9800 } 9801 9802 shape, ok := value.(map[string]interface{}) 9803 if !ok { 9804 return fmt.Errorf("unexpected JSON type %v", value) 9805 } 9806 9807 var sv *ListCustomRoutingPortMappingsByDestinationOutput 9808 if *v == nil { 9809 sv = &ListCustomRoutingPortMappingsByDestinationOutput{} 9810 } else { 9811 sv = *v 9812 } 9813 9814 for key, value := range shape { 9815 switch key { 9816 case "DestinationPortMappings": 9817 if err := awsAwsjson11_deserializeDocumentDestinationPortMappings(&sv.DestinationPortMappings, value); err != nil { 9818 return err 9819 } 9820 9821 case "NextToken": 9822 if value != nil { 9823 jtv, ok := value.(string) 9824 if !ok { 9825 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9826 } 9827 sv.NextToken = ptr.String(jtv) 9828 } 9829 9830 default: 9831 _, _ = key, value 9832 9833 } 9834 } 9835 *v = sv 9836 return nil 9837} 9838 9839func awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsOutput(v **ListCustomRoutingPortMappingsOutput, value interface{}) error { 9840 if v == nil { 9841 return fmt.Errorf("unexpected nil of type %T", v) 9842 } 9843 if value == nil { 9844 return nil 9845 } 9846 9847 shape, ok := value.(map[string]interface{}) 9848 if !ok { 9849 return fmt.Errorf("unexpected JSON type %v", value) 9850 } 9851 9852 var sv *ListCustomRoutingPortMappingsOutput 9853 if *v == nil { 9854 sv = &ListCustomRoutingPortMappingsOutput{} 9855 } else { 9856 sv = *v 9857 } 9858 9859 for key, value := range shape { 9860 switch key { 9861 case "NextToken": 9862 if value != nil { 9863 jtv, ok := value.(string) 9864 if !ok { 9865 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9866 } 9867 sv.NextToken = ptr.String(jtv) 9868 } 9869 9870 case "PortMappings": 9871 if err := awsAwsjson11_deserializeDocumentPortMappings(&sv.PortMappings, value); err != nil { 9872 return err 9873 } 9874 9875 default: 9876 _, _ = key, value 9877 9878 } 9879 } 9880 *v = sv 9881 return nil 9882} 9883 9884func awsAwsjson11_deserializeOpDocumentListEndpointGroupsOutput(v **ListEndpointGroupsOutput, value interface{}) error { 9885 if v == nil { 9886 return fmt.Errorf("unexpected nil of type %T", v) 9887 } 9888 if value == nil { 9889 return nil 9890 } 9891 9892 shape, ok := value.(map[string]interface{}) 9893 if !ok { 9894 return fmt.Errorf("unexpected JSON type %v", value) 9895 } 9896 9897 var sv *ListEndpointGroupsOutput 9898 if *v == nil { 9899 sv = &ListEndpointGroupsOutput{} 9900 } else { 9901 sv = *v 9902 } 9903 9904 for key, value := range shape { 9905 switch key { 9906 case "EndpointGroups": 9907 if err := awsAwsjson11_deserializeDocumentEndpointGroups(&sv.EndpointGroups, value); err != nil { 9908 return err 9909 } 9910 9911 case "NextToken": 9912 if value != nil { 9913 jtv, ok := value.(string) 9914 if !ok { 9915 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9916 } 9917 sv.NextToken = ptr.String(jtv) 9918 } 9919 9920 default: 9921 _, _ = key, value 9922 9923 } 9924 } 9925 *v = sv 9926 return nil 9927} 9928 9929func awsAwsjson11_deserializeOpDocumentListListenersOutput(v **ListListenersOutput, value interface{}) error { 9930 if v == nil { 9931 return fmt.Errorf("unexpected nil of type %T", v) 9932 } 9933 if value == nil { 9934 return nil 9935 } 9936 9937 shape, ok := value.(map[string]interface{}) 9938 if !ok { 9939 return fmt.Errorf("unexpected JSON type %v", value) 9940 } 9941 9942 var sv *ListListenersOutput 9943 if *v == nil { 9944 sv = &ListListenersOutput{} 9945 } else { 9946 sv = *v 9947 } 9948 9949 for key, value := range shape { 9950 switch key { 9951 case "Listeners": 9952 if err := awsAwsjson11_deserializeDocumentListeners(&sv.Listeners, value); err != nil { 9953 return err 9954 } 9955 9956 case "NextToken": 9957 if value != nil { 9958 jtv, ok := value.(string) 9959 if !ok { 9960 return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) 9961 } 9962 sv.NextToken = ptr.String(jtv) 9963 } 9964 9965 default: 9966 _, _ = key, value 9967 9968 } 9969 } 9970 *v = sv 9971 return nil 9972} 9973 9974func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 9975 if v == nil { 9976 return fmt.Errorf("unexpected nil of type %T", v) 9977 } 9978 if value == nil { 9979 return nil 9980 } 9981 9982 shape, ok := value.(map[string]interface{}) 9983 if !ok { 9984 return fmt.Errorf("unexpected JSON type %v", value) 9985 } 9986 9987 var sv *ListTagsForResourceOutput 9988 if *v == nil { 9989 sv = &ListTagsForResourceOutput{} 9990 } else { 9991 sv = *v 9992 } 9993 9994 for key, value := range shape { 9995 switch key { 9996 case "Tags": 9997 if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { 9998 return err 9999 } 10000 10001 default: 10002 _, _ = key, value 10003 10004 } 10005 } 10006 *v = sv 10007 return nil 10008} 10009 10010func awsAwsjson11_deserializeOpDocumentProvisionByoipCidrOutput(v **ProvisionByoipCidrOutput, value interface{}) error { 10011 if v == nil { 10012 return fmt.Errorf("unexpected nil of type %T", v) 10013 } 10014 if value == nil { 10015 return nil 10016 } 10017 10018 shape, ok := value.(map[string]interface{}) 10019 if !ok { 10020 return fmt.Errorf("unexpected JSON type %v", value) 10021 } 10022 10023 var sv *ProvisionByoipCidrOutput 10024 if *v == nil { 10025 sv = &ProvisionByoipCidrOutput{} 10026 } else { 10027 sv = *v 10028 } 10029 10030 for key, value := range shape { 10031 switch key { 10032 case "ByoipCidr": 10033 if err := awsAwsjson11_deserializeDocumentByoipCidr(&sv.ByoipCidr, value); err != nil { 10034 return err 10035 } 10036 10037 default: 10038 _, _ = key, value 10039 10040 } 10041 } 10042 *v = sv 10043 return nil 10044} 10045 10046func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { 10047 if v == nil { 10048 return fmt.Errorf("unexpected nil of type %T", v) 10049 } 10050 if value == nil { 10051 return nil 10052 } 10053 10054 shape, ok := value.(map[string]interface{}) 10055 if !ok { 10056 return fmt.Errorf("unexpected JSON type %v", value) 10057 } 10058 10059 var sv *TagResourceOutput 10060 if *v == nil { 10061 sv = &TagResourceOutput{} 10062 } else { 10063 sv = *v 10064 } 10065 10066 for key, value := range shape { 10067 switch key { 10068 default: 10069 _, _ = key, value 10070 10071 } 10072 } 10073 *v = sv 10074 return nil 10075} 10076 10077func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { 10078 if v == nil { 10079 return fmt.Errorf("unexpected nil of type %T", v) 10080 } 10081 if value == nil { 10082 return nil 10083 } 10084 10085 shape, ok := value.(map[string]interface{}) 10086 if !ok { 10087 return fmt.Errorf("unexpected JSON type %v", value) 10088 } 10089 10090 var sv *UntagResourceOutput 10091 if *v == nil { 10092 sv = &UntagResourceOutput{} 10093 } else { 10094 sv = *v 10095 } 10096 10097 for key, value := range shape { 10098 switch key { 10099 default: 10100 _, _ = key, value 10101 10102 } 10103 } 10104 *v = sv 10105 return nil 10106} 10107 10108func awsAwsjson11_deserializeOpDocumentUpdateAcceleratorAttributesOutput(v **UpdateAcceleratorAttributesOutput, value interface{}) error { 10109 if v == nil { 10110 return fmt.Errorf("unexpected nil of type %T", v) 10111 } 10112 if value == nil { 10113 return nil 10114 } 10115 10116 shape, ok := value.(map[string]interface{}) 10117 if !ok { 10118 return fmt.Errorf("unexpected JSON type %v", value) 10119 } 10120 10121 var sv *UpdateAcceleratorAttributesOutput 10122 if *v == nil { 10123 sv = &UpdateAcceleratorAttributesOutput{} 10124 } else { 10125 sv = *v 10126 } 10127 10128 for key, value := range shape { 10129 switch key { 10130 case "AcceleratorAttributes": 10131 if err := awsAwsjson11_deserializeDocumentAcceleratorAttributes(&sv.AcceleratorAttributes, value); err != nil { 10132 return err 10133 } 10134 10135 default: 10136 _, _ = key, value 10137 10138 } 10139 } 10140 *v = sv 10141 return nil 10142} 10143 10144func awsAwsjson11_deserializeOpDocumentUpdateAcceleratorOutput(v **UpdateAcceleratorOutput, value interface{}) error { 10145 if v == nil { 10146 return fmt.Errorf("unexpected nil of type %T", v) 10147 } 10148 if value == nil { 10149 return nil 10150 } 10151 10152 shape, ok := value.(map[string]interface{}) 10153 if !ok { 10154 return fmt.Errorf("unexpected JSON type %v", value) 10155 } 10156 10157 var sv *UpdateAcceleratorOutput 10158 if *v == nil { 10159 sv = &UpdateAcceleratorOutput{} 10160 } else { 10161 sv = *v 10162 } 10163 10164 for key, value := range shape { 10165 switch key { 10166 case "Accelerator": 10167 if err := awsAwsjson11_deserializeDocumentAccelerator(&sv.Accelerator, value); err != nil { 10168 return err 10169 } 10170 10171 default: 10172 _, _ = key, value 10173 10174 } 10175 } 10176 *v = sv 10177 return nil 10178} 10179 10180func awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingAcceleratorAttributesOutput(v **UpdateCustomRoutingAcceleratorAttributesOutput, value interface{}) error { 10181 if v == nil { 10182 return fmt.Errorf("unexpected nil of type %T", v) 10183 } 10184 if value == nil { 10185 return nil 10186 } 10187 10188 shape, ok := value.(map[string]interface{}) 10189 if !ok { 10190 return fmt.Errorf("unexpected JSON type %v", value) 10191 } 10192 10193 var sv *UpdateCustomRoutingAcceleratorAttributesOutput 10194 if *v == nil { 10195 sv = &UpdateCustomRoutingAcceleratorAttributesOutput{} 10196 } else { 10197 sv = *v 10198 } 10199 10200 for key, value := range shape { 10201 switch key { 10202 case "AcceleratorAttributes": 10203 if err := awsAwsjson11_deserializeDocumentCustomRoutingAcceleratorAttributes(&sv.AcceleratorAttributes, value); err != nil { 10204 return err 10205 } 10206 10207 default: 10208 _, _ = key, value 10209 10210 } 10211 } 10212 *v = sv 10213 return nil 10214} 10215 10216func awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingAcceleratorOutput(v **UpdateCustomRoutingAcceleratorOutput, value interface{}) error { 10217 if v == nil { 10218 return fmt.Errorf("unexpected nil of type %T", v) 10219 } 10220 if value == nil { 10221 return nil 10222 } 10223 10224 shape, ok := value.(map[string]interface{}) 10225 if !ok { 10226 return fmt.Errorf("unexpected JSON type %v", value) 10227 } 10228 10229 var sv *UpdateCustomRoutingAcceleratorOutput 10230 if *v == nil { 10231 sv = &UpdateCustomRoutingAcceleratorOutput{} 10232 } else { 10233 sv = *v 10234 } 10235 10236 for key, value := range shape { 10237 switch key { 10238 case "Accelerator": 10239 if err := awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(&sv.Accelerator, value); err != nil { 10240 return err 10241 } 10242 10243 default: 10244 _, _ = key, value 10245 10246 } 10247 } 10248 *v = sv 10249 return nil 10250} 10251 10252func awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingListenerOutput(v **UpdateCustomRoutingListenerOutput, value interface{}) error { 10253 if v == nil { 10254 return fmt.Errorf("unexpected nil of type %T", v) 10255 } 10256 if value == nil { 10257 return nil 10258 } 10259 10260 shape, ok := value.(map[string]interface{}) 10261 if !ok { 10262 return fmt.Errorf("unexpected JSON type %v", value) 10263 } 10264 10265 var sv *UpdateCustomRoutingListenerOutput 10266 if *v == nil { 10267 sv = &UpdateCustomRoutingListenerOutput{} 10268 } else { 10269 sv = *v 10270 } 10271 10272 for key, value := range shape { 10273 switch key { 10274 case "Listener": 10275 if err := awsAwsjson11_deserializeDocumentCustomRoutingListener(&sv.Listener, value); err != nil { 10276 return err 10277 } 10278 10279 default: 10280 _, _ = key, value 10281 10282 } 10283 } 10284 *v = sv 10285 return nil 10286} 10287 10288func awsAwsjson11_deserializeOpDocumentUpdateEndpointGroupOutput(v **UpdateEndpointGroupOutput, value interface{}) error { 10289 if v == nil { 10290 return fmt.Errorf("unexpected nil of type %T", v) 10291 } 10292 if value == nil { 10293 return nil 10294 } 10295 10296 shape, ok := value.(map[string]interface{}) 10297 if !ok { 10298 return fmt.Errorf("unexpected JSON type %v", value) 10299 } 10300 10301 var sv *UpdateEndpointGroupOutput 10302 if *v == nil { 10303 sv = &UpdateEndpointGroupOutput{} 10304 } else { 10305 sv = *v 10306 } 10307 10308 for key, value := range shape { 10309 switch key { 10310 case "EndpointGroup": 10311 if err := awsAwsjson11_deserializeDocumentEndpointGroup(&sv.EndpointGroup, value); err != nil { 10312 return err 10313 } 10314 10315 default: 10316 _, _ = key, value 10317 10318 } 10319 } 10320 *v = sv 10321 return nil 10322} 10323 10324func awsAwsjson11_deserializeOpDocumentUpdateListenerOutput(v **UpdateListenerOutput, value interface{}) error { 10325 if v == nil { 10326 return fmt.Errorf("unexpected nil of type %T", v) 10327 } 10328 if value == nil { 10329 return nil 10330 } 10331 10332 shape, ok := value.(map[string]interface{}) 10333 if !ok { 10334 return fmt.Errorf("unexpected JSON type %v", value) 10335 } 10336 10337 var sv *UpdateListenerOutput 10338 if *v == nil { 10339 sv = &UpdateListenerOutput{} 10340 } else { 10341 sv = *v 10342 } 10343 10344 for key, value := range shape { 10345 switch key { 10346 case "Listener": 10347 if err := awsAwsjson11_deserializeDocumentListener(&sv.Listener, value); err != nil { 10348 return err 10349 } 10350 10351 default: 10352 _, _ = key, value 10353 10354 } 10355 } 10356 *v = sv 10357 return nil 10358} 10359 10360func awsAwsjson11_deserializeOpDocumentWithdrawByoipCidrOutput(v **WithdrawByoipCidrOutput, value interface{}) error { 10361 if v == nil { 10362 return fmt.Errorf("unexpected nil of type %T", v) 10363 } 10364 if value == nil { 10365 return nil 10366 } 10367 10368 shape, ok := value.(map[string]interface{}) 10369 if !ok { 10370 return fmt.Errorf("unexpected JSON type %v", value) 10371 } 10372 10373 var sv *WithdrawByoipCidrOutput 10374 if *v == nil { 10375 sv = &WithdrawByoipCidrOutput{} 10376 } else { 10377 sv = *v 10378 } 10379 10380 for key, value := range shape { 10381 switch key { 10382 case "ByoipCidr": 10383 if err := awsAwsjson11_deserializeDocumentByoipCidr(&sv.ByoipCidr, value); err != nil { 10384 return err 10385 } 10386 10387 default: 10388 _, _ = key, value 10389 10390 } 10391 } 10392 *v = sv 10393 return nil 10394} 10395