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