1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package wafregional 4 5import ( 6 "bytes" 7 "context" 8 "encoding/base64" 9 "encoding/json" 10 "fmt" 11 "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" 12 "github.com/aws/aws-sdk-go-v2/service/wafregional/types" 13 smithy "github.com/aws/smithy-go" 14 smithyio "github.com/aws/smithy-go/io" 15 "github.com/aws/smithy-go/middleware" 16 "github.com/aws/smithy-go/ptr" 17 smithytime "github.com/aws/smithy-go/time" 18 smithyhttp "github.com/aws/smithy-go/transport/http" 19 "io" 20 "strings" 21) 22 23type awsAwsjson11_deserializeOpAssociateWebACL struct { 24} 25 26func (*awsAwsjson11_deserializeOpAssociateWebACL) ID() string { 27 return "OperationDeserializer" 28} 29 30func (m *awsAwsjson11_deserializeOpAssociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 31 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 32) { 33 out, metadata, err = next.HandleDeserialize(ctx, in) 34 if err != nil { 35 return out, metadata, err 36 } 37 38 response, ok := out.RawResponse.(*smithyhttp.Response) 39 if !ok { 40 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 41 } 42 43 if response.StatusCode < 200 || response.StatusCode >= 300 { 44 return out, metadata, awsAwsjson11_deserializeOpErrorAssociateWebACL(response, &metadata) 45 } 46 output := &AssociateWebACLOutput{} 47 out.Result = output 48 49 var buff [1024]byte 50 ringBuffer := smithyio.NewRingBuffer(buff[:]) 51 52 body := io.TeeReader(response.Body, ringBuffer) 53 decoder := json.NewDecoder(body) 54 decoder.UseNumber() 55 var shape interface{} 56 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 57 var snapshot bytes.Buffer 58 io.Copy(&snapshot, ringBuffer) 59 err = &smithy.DeserializationError{ 60 Err: fmt.Errorf("failed to decode response body, %w", err), 61 Snapshot: snapshot.Bytes(), 62 } 63 return out, metadata, err 64 } 65 66 err = awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(&output, shape) 67 if err != nil { 68 var snapshot bytes.Buffer 69 io.Copy(&snapshot, ringBuffer) 70 err = &smithy.DeserializationError{ 71 Err: fmt.Errorf("failed to decode response body, %w", err), 72 Snapshot: snapshot.Bytes(), 73 } 74 return out, metadata, err 75 } 76 77 return out, metadata, err 78} 79 80func awsAwsjson11_deserializeOpErrorAssociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 81 var errorBuffer bytes.Buffer 82 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 83 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 84 } 85 errorBody := bytes.NewReader(errorBuffer.Bytes()) 86 87 errorCode := "UnknownError" 88 errorMessage := errorCode 89 90 code := response.Header.Get("X-Amzn-ErrorType") 91 if len(code) != 0 { 92 errorCode = restjson.SanitizeErrorCode(code) 93 } 94 95 var buff [1024]byte 96 ringBuffer := smithyio.NewRingBuffer(buff[:]) 97 98 body := io.TeeReader(errorBody, ringBuffer) 99 decoder := json.NewDecoder(body) 100 decoder.UseNumber() 101 code, message, err := restjson.GetErrorInfo(decoder) 102 if err != nil { 103 var snapshot bytes.Buffer 104 io.Copy(&snapshot, ringBuffer) 105 err = &smithy.DeserializationError{ 106 Err: fmt.Errorf("failed to decode response body, %w", err), 107 Snapshot: snapshot.Bytes(), 108 } 109 return err 110 } 111 112 errorBody.Seek(0, io.SeekStart) 113 if len(code) != 0 { 114 errorCode = restjson.SanitizeErrorCode(code) 115 } 116 if len(message) != 0 { 117 errorMessage = message 118 } 119 120 switch { 121 case strings.EqualFold("WAFInternalErrorException", errorCode): 122 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 123 124 case strings.EqualFold("WAFInvalidAccountException", errorCode): 125 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 126 127 case strings.EqualFold("WAFInvalidParameterException", errorCode): 128 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 129 130 case strings.EqualFold("WAFNonexistentItemException", errorCode): 131 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 132 133 case strings.EqualFold("WAFUnavailableEntityException", errorCode): 134 return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody) 135 136 default: 137 genericError := &smithy.GenericAPIError{ 138 Code: errorCode, 139 Message: errorMessage, 140 } 141 return genericError 142 143 } 144} 145 146type awsAwsjson11_deserializeOpCreateByteMatchSet struct { 147} 148 149func (*awsAwsjson11_deserializeOpCreateByteMatchSet) ID() string { 150 return "OperationDeserializer" 151} 152 153func (m *awsAwsjson11_deserializeOpCreateByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 154 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 155) { 156 out, metadata, err = next.HandleDeserialize(ctx, in) 157 if err != nil { 158 return out, metadata, err 159 } 160 161 response, ok := out.RawResponse.(*smithyhttp.Response) 162 if !ok { 163 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 164 } 165 166 if response.StatusCode < 200 || response.StatusCode >= 300 { 167 return out, metadata, awsAwsjson11_deserializeOpErrorCreateByteMatchSet(response, &metadata) 168 } 169 output := &CreateByteMatchSetOutput{} 170 out.Result = output 171 172 var buff [1024]byte 173 ringBuffer := smithyio.NewRingBuffer(buff[:]) 174 175 body := io.TeeReader(response.Body, ringBuffer) 176 decoder := json.NewDecoder(body) 177 decoder.UseNumber() 178 var shape interface{} 179 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 180 var snapshot bytes.Buffer 181 io.Copy(&snapshot, ringBuffer) 182 err = &smithy.DeserializationError{ 183 Err: fmt.Errorf("failed to decode response body, %w", err), 184 Snapshot: snapshot.Bytes(), 185 } 186 return out, metadata, err 187 } 188 189 err = awsAwsjson11_deserializeOpDocumentCreateByteMatchSetOutput(&output, shape) 190 if err != nil { 191 var snapshot bytes.Buffer 192 io.Copy(&snapshot, ringBuffer) 193 err = &smithy.DeserializationError{ 194 Err: fmt.Errorf("failed to decode response body, %w", err), 195 Snapshot: snapshot.Bytes(), 196 } 197 return out, metadata, err 198 } 199 200 return out, metadata, err 201} 202 203func awsAwsjson11_deserializeOpErrorCreateByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 204 var errorBuffer bytes.Buffer 205 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 206 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 207 } 208 errorBody := bytes.NewReader(errorBuffer.Bytes()) 209 210 errorCode := "UnknownError" 211 errorMessage := errorCode 212 213 code := response.Header.Get("X-Amzn-ErrorType") 214 if len(code) != 0 { 215 errorCode = restjson.SanitizeErrorCode(code) 216 } 217 218 var buff [1024]byte 219 ringBuffer := smithyio.NewRingBuffer(buff[:]) 220 221 body := io.TeeReader(errorBody, ringBuffer) 222 decoder := json.NewDecoder(body) 223 decoder.UseNumber() 224 code, message, err := restjson.GetErrorInfo(decoder) 225 if err != nil { 226 var snapshot bytes.Buffer 227 io.Copy(&snapshot, ringBuffer) 228 err = &smithy.DeserializationError{ 229 Err: fmt.Errorf("failed to decode response body, %w", err), 230 Snapshot: snapshot.Bytes(), 231 } 232 return err 233 } 234 235 errorBody.Seek(0, io.SeekStart) 236 if len(code) != 0 { 237 errorCode = restjson.SanitizeErrorCode(code) 238 } 239 if len(message) != 0 { 240 errorMessage = message 241 } 242 243 switch { 244 case strings.EqualFold("WAFDisallowedNameException", errorCode): 245 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 246 247 case strings.EqualFold("WAFInternalErrorException", errorCode): 248 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 249 250 case strings.EqualFold("WAFInvalidAccountException", errorCode): 251 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 252 253 case strings.EqualFold("WAFInvalidParameterException", errorCode): 254 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 255 256 case strings.EqualFold("WAFLimitsExceededException", errorCode): 257 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 258 259 case strings.EqualFold("WAFStaleDataException", errorCode): 260 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 261 262 default: 263 genericError := &smithy.GenericAPIError{ 264 Code: errorCode, 265 Message: errorMessage, 266 } 267 return genericError 268 269 } 270} 271 272type awsAwsjson11_deserializeOpCreateGeoMatchSet struct { 273} 274 275func (*awsAwsjson11_deserializeOpCreateGeoMatchSet) ID() string { 276 return "OperationDeserializer" 277} 278 279func (m *awsAwsjson11_deserializeOpCreateGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 280 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 281) { 282 out, metadata, err = next.HandleDeserialize(ctx, in) 283 if err != nil { 284 return out, metadata, err 285 } 286 287 response, ok := out.RawResponse.(*smithyhttp.Response) 288 if !ok { 289 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 290 } 291 292 if response.StatusCode < 200 || response.StatusCode >= 300 { 293 return out, metadata, awsAwsjson11_deserializeOpErrorCreateGeoMatchSet(response, &metadata) 294 } 295 output := &CreateGeoMatchSetOutput{} 296 out.Result = output 297 298 var buff [1024]byte 299 ringBuffer := smithyio.NewRingBuffer(buff[:]) 300 301 body := io.TeeReader(response.Body, ringBuffer) 302 decoder := json.NewDecoder(body) 303 decoder.UseNumber() 304 var shape interface{} 305 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 306 var snapshot bytes.Buffer 307 io.Copy(&snapshot, ringBuffer) 308 err = &smithy.DeserializationError{ 309 Err: fmt.Errorf("failed to decode response body, %w", err), 310 Snapshot: snapshot.Bytes(), 311 } 312 return out, metadata, err 313 } 314 315 err = awsAwsjson11_deserializeOpDocumentCreateGeoMatchSetOutput(&output, shape) 316 if err != nil { 317 var snapshot bytes.Buffer 318 io.Copy(&snapshot, ringBuffer) 319 err = &smithy.DeserializationError{ 320 Err: fmt.Errorf("failed to decode response body, %w", err), 321 Snapshot: snapshot.Bytes(), 322 } 323 return out, metadata, err 324 } 325 326 return out, metadata, err 327} 328 329func awsAwsjson11_deserializeOpErrorCreateGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 330 var errorBuffer bytes.Buffer 331 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 332 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 333 } 334 errorBody := bytes.NewReader(errorBuffer.Bytes()) 335 336 errorCode := "UnknownError" 337 errorMessage := errorCode 338 339 code := response.Header.Get("X-Amzn-ErrorType") 340 if len(code) != 0 { 341 errorCode = restjson.SanitizeErrorCode(code) 342 } 343 344 var buff [1024]byte 345 ringBuffer := smithyio.NewRingBuffer(buff[:]) 346 347 body := io.TeeReader(errorBody, ringBuffer) 348 decoder := json.NewDecoder(body) 349 decoder.UseNumber() 350 code, message, err := restjson.GetErrorInfo(decoder) 351 if err != nil { 352 var snapshot bytes.Buffer 353 io.Copy(&snapshot, ringBuffer) 354 err = &smithy.DeserializationError{ 355 Err: fmt.Errorf("failed to decode response body, %w", err), 356 Snapshot: snapshot.Bytes(), 357 } 358 return err 359 } 360 361 errorBody.Seek(0, io.SeekStart) 362 if len(code) != 0 { 363 errorCode = restjson.SanitizeErrorCode(code) 364 } 365 if len(message) != 0 { 366 errorMessage = message 367 } 368 369 switch { 370 case strings.EqualFold("WAFDisallowedNameException", errorCode): 371 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 372 373 case strings.EqualFold("WAFInternalErrorException", errorCode): 374 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 375 376 case strings.EqualFold("WAFInvalidAccountException", errorCode): 377 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 378 379 case strings.EqualFold("WAFInvalidParameterException", errorCode): 380 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 381 382 case strings.EqualFold("WAFLimitsExceededException", errorCode): 383 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 384 385 case strings.EqualFold("WAFStaleDataException", errorCode): 386 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 387 388 default: 389 genericError := &smithy.GenericAPIError{ 390 Code: errorCode, 391 Message: errorMessage, 392 } 393 return genericError 394 395 } 396} 397 398type awsAwsjson11_deserializeOpCreateIPSet struct { 399} 400 401func (*awsAwsjson11_deserializeOpCreateIPSet) ID() string { 402 return "OperationDeserializer" 403} 404 405func (m *awsAwsjson11_deserializeOpCreateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 406 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 407) { 408 out, metadata, err = next.HandleDeserialize(ctx, in) 409 if err != nil { 410 return out, metadata, err 411 } 412 413 response, ok := out.RawResponse.(*smithyhttp.Response) 414 if !ok { 415 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 416 } 417 418 if response.StatusCode < 200 || response.StatusCode >= 300 { 419 return out, metadata, awsAwsjson11_deserializeOpErrorCreateIPSet(response, &metadata) 420 } 421 output := &CreateIPSetOutput{} 422 out.Result = output 423 424 var buff [1024]byte 425 ringBuffer := smithyio.NewRingBuffer(buff[:]) 426 427 body := io.TeeReader(response.Body, ringBuffer) 428 decoder := json.NewDecoder(body) 429 decoder.UseNumber() 430 var shape interface{} 431 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 432 var snapshot bytes.Buffer 433 io.Copy(&snapshot, ringBuffer) 434 err = &smithy.DeserializationError{ 435 Err: fmt.Errorf("failed to decode response body, %w", err), 436 Snapshot: snapshot.Bytes(), 437 } 438 return out, metadata, err 439 } 440 441 err = awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(&output, shape) 442 if err != nil { 443 var snapshot bytes.Buffer 444 io.Copy(&snapshot, ringBuffer) 445 err = &smithy.DeserializationError{ 446 Err: fmt.Errorf("failed to decode response body, %w", err), 447 Snapshot: snapshot.Bytes(), 448 } 449 return out, metadata, err 450 } 451 452 return out, metadata, err 453} 454 455func awsAwsjson11_deserializeOpErrorCreateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 456 var errorBuffer bytes.Buffer 457 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 458 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 459 } 460 errorBody := bytes.NewReader(errorBuffer.Bytes()) 461 462 errorCode := "UnknownError" 463 errorMessage := errorCode 464 465 code := response.Header.Get("X-Amzn-ErrorType") 466 if len(code) != 0 { 467 errorCode = restjson.SanitizeErrorCode(code) 468 } 469 470 var buff [1024]byte 471 ringBuffer := smithyio.NewRingBuffer(buff[:]) 472 473 body := io.TeeReader(errorBody, ringBuffer) 474 decoder := json.NewDecoder(body) 475 decoder.UseNumber() 476 code, message, err := restjson.GetErrorInfo(decoder) 477 if err != nil { 478 var snapshot bytes.Buffer 479 io.Copy(&snapshot, ringBuffer) 480 err = &smithy.DeserializationError{ 481 Err: fmt.Errorf("failed to decode response body, %w", err), 482 Snapshot: snapshot.Bytes(), 483 } 484 return err 485 } 486 487 errorBody.Seek(0, io.SeekStart) 488 if len(code) != 0 { 489 errorCode = restjson.SanitizeErrorCode(code) 490 } 491 if len(message) != 0 { 492 errorMessage = message 493 } 494 495 switch { 496 case strings.EqualFold("WAFDisallowedNameException", errorCode): 497 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 498 499 case strings.EqualFold("WAFInternalErrorException", errorCode): 500 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 501 502 case strings.EqualFold("WAFInvalidAccountException", errorCode): 503 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 504 505 case strings.EqualFold("WAFInvalidParameterException", errorCode): 506 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 507 508 case strings.EqualFold("WAFLimitsExceededException", errorCode): 509 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 510 511 case strings.EqualFold("WAFStaleDataException", errorCode): 512 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 513 514 default: 515 genericError := &smithy.GenericAPIError{ 516 Code: errorCode, 517 Message: errorMessage, 518 } 519 return genericError 520 521 } 522} 523 524type awsAwsjson11_deserializeOpCreateRateBasedRule struct { 525} 526 527func (*awsAwsjson11_deserializeOpCreateRateBasedRule) ID() string { 528 return "OperationDeserializer" 529} 530 531func (m *awsAwsjson11_deserializeOpCreateRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 532 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 533) { 534 out, metadata, err = next.HandleDeserialize(ctx, in) 535 if err != nil { 536 return out, metadata, err 537 } 538 539 response, ok := out.RawResponse.(*smithyhttp.Response) 540 if !ok { 541 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 542 } 543 544 if response.StatusCode < 200 || response.StatusCode >= 300 { 545 return out, metadata, awsAwsjson11_deserializeOpErrorCreateRateBasedRule(response, &metadata) 546 } 547 output := &CreateRateBasedRuleOutput{} 548 out.Result = output 549 550 var buff [1024]byte 551 ringBuffer := smithyio.NewRingBuffer(buff[:]) 552 553 body := io.TeeReader(response.Body, ringBuffer) 554 decoder := json.NewDecoder(body) 555 decoder.UseNumber() 556 var shape interface{} 557 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 558 var snapshot bytes.Buffer 559 io.Copy(&snapshot, ringBuffer) 560 err = &smithy.DeserializationError{ 561 Err: fmt.Errorf("failed to decode response body, %w", err), 562 Snapshot: snapshot.Bytes(), 563 } 564 return out, metadata, err 565 } 566 567 err = awsAwsjson11_deserializeOpDocumentCreateRateBasedRuleOutput(&output, shape) 568 if err != nil { 569 var snapshot bytes.Buffer 570 io.Copy(&snapshot, ringBuffer) 571 err = &smithy.DeserializationError{ 572 Err: fmt.Errorf("failed to decode response body, %w", err), 573 Snapshot: snapshot.Bytes(), 574 } 575 return out, metadata, err 576 } 577 578 return out, metadata, err 579} 580 581func awsAwsjson11_deserializeOpErrorCreateRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 582 var errorBuffer bytes.Buffer 583 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 584 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 585 } 586 errorBody := bytes.NewReader(errorBuffer.Bytes()) 587 588 errorCode := "UnknownError" 589 errorMessage := errorCode 590 591 code := response.Header.Get("X-Amzn-ErrorType") 592 if len(code) != 0 { 593 errorCode = restjson.SanitizeErrorCode(code) 594 } 595 596 var buff [1024]byte 597 ringBuffer := smithyio.NewRingBuffer(buff[:]) 598 599 body := io.TeeReader(errorBody, ringBuffer) 600 decoder := json.NewDecoder(body) 601 decoder.UseNumber() 602 code, message, err := restjson.GetErrorInfo(decoder) 603 if err != nil { 604 var snapshot bytes.Buffer 605 io.Copy(&snapshot, ringBuffer) 606 err = &smithy.DeserializationError{ 607 Err: fmt.Errorf("failed to decode response body, %w", err), 608 Snapshot: snapshot.Bytes(), 609 } 610 return err 611 } 612 613 errorBody.Seek(0, io.SeekStart) 614 if len(code) != 0 { 615 errorCode = restjson.SanitizeErrorCode(code) 616 } 617 if len(message) != 0 { 618 errorMessage = message 619 } 620 621 switch { 622 case strings.EqualFold("WAFBadRequestException", errorCode): 623 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 624 625 case strings.EqualFold("WAFDisallowedNameException", errorCode): 626 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 627 628 case strings.EqualFold("WAFInternalErrorException", errorCode): 629 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 630 631 case strings.EqualFold("WAFInvalidParameterException", errorCode): 632 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 633 634 case strings.EqualFold("WAFLimitsExceededException", errorCode): 635 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 636 637 case strings.EqualFold("WAFStaleDataException", errorCode): 638 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 639 640 case strings.EqualFold("WAFTagOperationException", errorCode): 641 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 642 643 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 644 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 645 646 default: 647 genericError := &smithy.GenericAPIError{ 648 Code: errorCode, 649 Message: errorMessage, 650 } 651 return genericError 652 653 } 654} 655 656type awsAwsjson11_deserializeOpCreateRegexMatchSet struct { 657} 658 659func (*awsAwsjson11_deserializeOpCreateRegexMatchSet) ID() string { 660 return "OperationDeserializer" 661} 662 663func (m *awsAwsjson11_deserializeOpCreateRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 664 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 665) { 666 out, metadata, err = next.HandleDeserialize(ctx, in) 667 if err != nil { 668 return out, metadata, err 669 } 670 671 response, ok := out.RawResponse.(*smithyhttp.Response) 672 if !ok { 673 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 674 } 675 676 if response.StatusCode < 200 || response.StatusCode >= 300 { 677 return out, metadata, awsAwsjson11_deserializeOpErrorCreateRegexMatchSet(response, &metadata) 678 } 679 output := &CreateRegexMatchSetOutput{} 680 out.Result = output 681 682 var buff [1024]byte 683 ringBuffer := smithyio.NewRingBuffer(buff[:]) 684 685 body := io.TeeReader(response.Body, ringBuffer) 686 decoder := json.NewDecoder(body) 687 decoder.UseNumber() 688 var shape interface{} 689 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 690 var snapshot bytes.Buffer 691 io.Copy(&snapshot, ringBuffer) 692 err = &smithy.DeserializationError{ 693 Err: fmt.Errorf("failed to decode response body, %w", err), 694 Snapshot: snapshot.Bytes(), 695 } 696 return out, metadata, err 697 } 698 699 err = awsAwsjson11_deserializeOpDocumentCreateRegexMatchSetOutput(&output, shape) 700 if err != nil { 701 var snapshot bytes.Buffer 702 io.Copy(&snapshot, ringBuffer) 703 err = &smithy.DeserializationError{ 704 Err: fmt.Errorf("failed to decode response body, %w", err), 705 Snapshot: snapshot.Bytes(), 706 } 707 return out, metadata, err 708 } 709 710 return out, metadata, err 711} 712 713func awsAwsjson11_deserializeOpErrorCreateRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 714 var errorBuffer bytes.Buffer 715 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 716 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 717 } 718 errorBody := bytes.NewReader(errorBuffer.Bytes()) 719 720 errorCode := "UnknownError" 721 errorMessage := errorCode 722 723 code := response.Header.Get("X-Amzn-ErrorType") 724 if len(code) != 0 { 725 errorCode = restjson.SanitizeErrorCode(code) 726 } 727 728 var buff [1024]byte 729 ringBuffer := smithyio.NewRingBuffer(buff[:]) 730 731 body := io.TeeReader(errorBody, ringBuffer) 732 decoder := json.NewDecoder(body) 733 decoder.UseNumber() 734 code, message, err := restjson.GetErrorInfo(decoder) 735 if err != nil { 736 var snapshot bytes.Buffer 737 io.Copy(&snapshot, ringBuffer) 738 err = &smithy.DeserializationError{ 739 Err: fmt.Errorf("failed to decode response body, %w", err), 740 Snapshot: snapshot.Bytes(), 741 } 742 return err 743 } 744 745 errorBody.Seek(0, io.SeekStart) 746 if len(code) != 0 { 747 errorCode = restjson.SanitizeErrorCode(code) 748 } 749 if len(message) != 0 { 750 errorMessage = message 751 } 752 753 switch { 754 case strings.EqualFold("WAFDisallowedNameException", errorCode): 755 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 756 757 case strings.EqualFold("WAFInternalErrorException", errorCode): 758 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 759 760 case strings.EqualFold("WAFLimitsExceededException", errorCode): 761 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 762 763 case strings.EqualFold("WAFStaleDataException", errorCode): 764 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 765 766 default: 767 genericError := &smithy.GenericAPIError{ 768 Code: errorCode, 769 Message: errorMessage, 770 } 771 return genericError 772 773 } 774} 775 776type awsAwsjson11_deserializeOpCreateRegexPatternSet struct { 777} 778 779func (*awsAwsjson11_deserializeOpCreateRegexPatternSet) ID() string { 780 return "OperationDeserializer" 781} 782 783func (m *awsAwsjson11_deserializeOpCreateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 784 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 785) { 786 out, metadata, err = next.HandleDeserialize(ctx, in) 787 if err != nil { 788 return out, metadata, err 789 } 790 791 response, ok := out.RawResponse.(*smithyhttp.Response) 792 if !ok { 793 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 794 } 795 796 if response.StatusCode < 200 || response.StatusCode >= 300 { 797 return out, metadata, awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response, &metadata) 798 } 799 output := &CreateRegexPatternSetOutput{} 800 out.Result = output 801 802 var buff [1024]byte 803 ringBuffer := smithyio.NewRingBuffer(buff[:]) 804 805 body := io.TeeReader(response.Body, ringBuffer) 806 decoder := json.NewDecoder(body) 807 decoder.UseNumber() 808 var shape interface{} 809 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 810 var snapshot bytes.Buffer 811 io.Copy(&snapshot, ringBuffer) 812 err = &smithy.DeserializationError{ 813 Err: fmt.Errorf("failed to decode response body, %w", err), 814 Snapshot: snapshot.Bytes(), 815 } 816 return out, metadata, err 817 } 818 819 err = awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(&output, shape) 820 if err != nil { 821 var snapshot bytes.Buffer 822 io.Copy(&snapshot, ringBuffer) 823 err = &smithy.DeserializationError{ 824 Err: fmt.Errorf("failed to decode response body, %w", err), 825 Snapshot: snapshot.Bytes(), 826 } 827 return out, metadata, err 828 } 829 830 return out, metadata, err 831} 832 833func awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 834 var errorBuffer bytes.Buffer 835 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 836 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 837 } 838 errorBody := bytes.NewReader(errorBuffer.Bytes()) 839 840 errorCode := "UnknownError" 841 errorMessage := errorCode 842 843 code := response.Header.Get("X-Amzn-ErrorType") 844 if len(code) != 0 { 845 errorCode = restjson.SanitizeErrorCode(code) 846 } 847 848 var buff [1024]byte 849 ringBuffer := smithyio.NewRingBuffer(buff[:]) 850 851 body := io.TeeReader(errorBody, ringBuffer) 852 decoder := json.NewDecoder(body) 853 decoder.UseNumber() 854 code, message, err := restjson.GetErrorInfo(decoder) 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 err 863 } 864 865 errorBody.Seek(0, io.SeekStart) 866 if len(code) != 0 { 867 errorCode = restjson.SanitizeErrorCode(code) 868 } 869 if len(message) != 0 { 870 errorMessage = message 871 } 872 873 switch { 874 case strings.EqualFold("WAFDisallowedNameException", errorCode): 875 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 876 877 case strings.EqualFold("WAFInternalErrorException", errorCode): 878 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 879 880 case strings.EqualFold("WAFLimitsExceededException", errorCode): 881 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 882 883 case strings.EqualFold("WAFStaleDataException", errorCode): 884 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 885 886 default: 887 genericError := &smithy.GenericAPIError{ 888 Code: errorCode, 889 Message: errorMessage, 890 } 891 return genericError 892 893 } 894} 895 896type awsAwsjson11_deserializeOpCreateRule struct { 897} 898 899func (*awsAwsjson11_deserializeOpCreateRule) ID() string { 900 return "OperationDeserializer" 901} 902 903func (m *awsAwsjson11_deserializeOpCreateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 904 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 905) { 906 out, metadata, err = next.HandleDeserialize(ctx, in) 907 if err != nil { 908 return out, metadata, err 909 } 910 911 response, ok := out.RawResponse.(*smithyhttp.Response) 912 if !ok { 913 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 914 } 915 916 if response.StatusCode < 200 || response.StatusCode >= 300 { 917 return out, metadata, awsAwsjson11_deserializeOpErrorCreateRule(response, &metadata) 918 } 919 output := &CreateRuleOutput{} 920 out.Result = output 921 922 var buff [1024]byte 923 ringBuffer := smithyio.NewRingBuffer(buff[:]) 924 925 body := io.TeeReader(response.Body, ringBuffer) 926 decoder := json.NewDecoder(body) 927 decoder.UseNumber() 928 var shape interface{} 929 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 930 var snapshot bytes.Buffer 931 io.Copy(&snapshot, ringBuffer) 932 err = &smithy.DeserializationError{ 933 Err: fmt.Errorf("failed to decode response body, %w", err), 934 Snapshot: snapshot.Bytes(), 935 } 936 return out, metadata, err 937 } 938 939 err = awsAwsjson11_deserializeOpDocumentCreateRuleOutput(&output, shape) 940 if err != nil { 941 var snapshot bytes.Buffer 942 io.Copy(&snapshot, ringBuffer) 943 err = &smithy.DeserializationError{ 944 Err: fmt.Errorf("failed to decode response body, %w", err), 945 Snapshot: snapshot.Bytes(), 946 } 947 return out, metadata, err 948 } 949 950 return out, metadata, err 951} 952 953func awsAwsjson11_deserializeOpErrorCreateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 954 var errorBuffer bytes.Buffer 955 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 956 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 957 } 958 errorBody := bytes.NewReader(errorBuffer.Bytes()) 959 960 errorCode := "UnknownError" 961 errorMessage := errorCode 962 963 code := response.Header.Get("X-Amzn-ErrorType") 964 if len(code) != 0 { 965 errorCode = restjson.SanitizeErrorCode(code) 966 } 967 968 var buff [1024]byte 969 ringBuffer := smithyio.NewRingBuffer(buff[:]) 970 971 body := io.TeeReader(errorBody, ringBuffer) 972 decoder := json.NewDecoder(body) 973 decoder.UseNumber() 974 code, message, err := restjson.GetErrorInfo(decoder) 975 if err != nil { 976 var snapshot bytes.Buffer 977 io.Copy(&snapshot, ringBuffer) 978 err = &smithy.DeserializationError{ 979 Err: fmt.Errorf("failed to decode response body, %w", err), 980 Snapshot: snapshot.Bytes(), 981 } 982 return err 983 } 984 985 errorBody.Seek(0, io.SeekStart) 986 if len(code) != 0 { 987 errorCode = restjson.SanitizeErrorCode(code) 988 } 989 if len(message) != 0 { 990 errorMessage = message 991 } 992 993 switch { 994 case strings.EqualFold("WAFBadRequestException", errorCode): 995 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 996 997 case strings.EqualFold("WAFDisallowedNameException", errorCode): 998 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 999 1000 case strings.EqualFold("WAFInternalErrorException", errorCode): 1001 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1002 1003 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1004 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1005 1006 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1007 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1008 1009 case strings.EqualFold("WAFStaleDataException", errorCode): 1010 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1011 1012 case strings.EqualFold("WAFTagOperationException", errorCode): 1013 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 1014 1015 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 1016 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 1017 1018 default: 1019 genericError := &smithy.GenericAPIError{ 1020 Code: errorCode, 1021 Message: errorMessage, 1022 } 1023 return genericError 1024 1025 } 1026} 1027 1028type awsAwsjson11_deserializeOpCreateRuleGroup struct { 1029} 1030 1031func (*awsAwsjson11_deserializeOpCreateRuleGroup) ID() string { 1032 return "OperationDeserializer" 1033} 1034 1035func (m *awsAwsjson11_deserializeOpCreateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1036 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1037) { 1038 out, metadata, err = next.HandleDeserialize(ctx, in) 1039 if err != nil { 1040 return out, metadata, err 1041 } 1042 1043 response, ok := out.RawResponse.(*smithyhttp.Response) 1044 if !ok { 1045 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1046 } 1047 1048 if response.StatusCode < 200 || response.StatusCode >= 300 { 1049 return out, metadata, awsAwsjson11_deserializeOpErrorCreateRuleGroup(response, &metadata) 1050 } 1051 output := &CreateRuleGroupOutput{} 1052 out.Result = output 1053 1054 var buff [1024]byte 1055 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1056 1057 body := io.TeeReader(response.Body, ringBuffer) 1058 decoder := json.NewDecoder(body) 1059 decoder.UseNumber() 1060 var shape interface{} 1061 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1062 var snapshot bytes.Buffer 1063 io.Copy(&snapshot, ringBuffer) 1064 err = &smithy.DeserializationError{ 1065 Err: fmt.Errorf("failed to decode response body, %w", err), 1066 Snapshot: snapshot.Bytes(), 1067 } 1068 return out, metadata, err 1069 } 1070 1071 err = awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(&output, shape) 1072 if err != nil { 1073 var snapshot bytes.Buffer 1074 io.Copy(&snapshot, ringBuffer) 1075 err = &smithy.DeserializationError{ 1076 Err: fmt.Errorf("failed to decode response body, %w", err), 1077 Snapshot: snapshot.Bytes(), 1078 } 1079 return out, metadata, err 1080 } 1081 1082 return out, metadata, err 1083} 1084 1085func awsAwsjson11_deserializeOpErrorCreateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1086 var errorBuffer bytes.Buffer 1087 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1088 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1089 } 1090 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1091 1092 errorCode := "UnknownError" 1093 errorMessage := errorCode 1094 1095 code := response.Header.Get("X-Amzn-ErrorType") 1096 if len(code) != 0 { 1097 errorCode = restjson.SanitizeErrorCode(code) 1098 } 1099 1100 var buff [1024]byte 1101 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1102 1103 body := io.TeeReader(errorBody, ringBuffer) 1104 decoder := json.NewDecoder(body) 1105 decoder.UseNumber() 1106 code, message, err := restjson.GetErrorInfo(decoder) 1107 if err != nil { 1108 var snapshot bytes.Buffer 1109 io.Copy(&snapshot, ringBuffer) 1110 err = &smithy.DeserializationError{ 1111 Err: fmt.Errorf("failed to decode response body, %w", err), 1112 Snapshot: snapshot.Bytes(), 1113 } 1114 return err 1115 } 1116 1117 errorBody.Seek(0, io.SeekStart) 1118 if len(code) != 0 { 1119 errorCode = restjson.SanitizeErrorCode(code) 1120 } 1121 if len(message) != 0 { 1122 errorMessage = message 1123 } 1124 1125 switch { 1126 case strings.EqualFold("WAFBadRequestException", errorCode): 1127 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 1128 1129 case strings.EqualFold("WAFDisallowedNameException", errorCode): 1130 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 1131 1132 case strings.EqualFold("WAFInternalErrorException", errorCode): 1133 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1134 1135 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1136 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1137 1138 case strings.EqualFold("WAFStaleDataException", errorCode): 1139 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1140 1141 case strings.EqualFold("WAFTagOperationException", errorCode): 1142 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 1143 1144 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 1145 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 1146 1147 default: 1148 genericError := &smithy.GenericAPIError{ 1149 Code: errorCode, 1150 Message: errorMessage, 1151 } 1152 return genericError 1153 1154 } 1155} 1156 1157type awsAwsjson11_deserializeOpCreateSizeConstraintSet struct { 1158} 1159 1160func (*awsAwsjson11_deserializeOpCreateSizeConstraintSet) ID() string { 1161 return "OperationDeserializer" 1162} 1163 1164func (m *awsAwsjson11_deserializeOpCreateSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1165 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1166) { 1167 out, metadata, err = next.HandleDeserialize(ctx, in) 1168 if err != nil { 1169 return out, metadata, err 1170 } 1171 1172 response, ok := out.RawResponse.(*smithyhttp.Response) 1173 if !ok { 1174 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1175 } 1176 1177 if response.StatusCode < 200 || response.StatusCode >= 300 { 1178 return out, metadata, awsAwsjson11_deserializeOpErrorCreateSizeConstraintSet(response, &metadata) 1179 } 1180 output := &CreateSizeConstraintSetOutput{} 1181 out.Result = output 1182 1183 var buff [1024]byte 1184 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1185 1186 body := io.TeeReader(response.Body, ringBuffer) 1187 decoder := json.NewDecoder(body) 1188 decoder.UseNumber() 1189 var shape interface{} 1190 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1191 var snapshot bytes.Buffer 1192 io.Copy(&snapshot, ringBuffer) 1193 err = &smithy.DeserializationError{ 1194 Err: fmt.Errorf("failed to decode response body, %w", err), 1195 Snapshot: snapshot.Bytes(), 1196 } 1197 return out, metadata, err 1198 } 1199 1200 err = awsAwsjson11_deserializeOpDocumentCreateSizeConstraintSetOutput(&output, shape) 1201 if err != nil { 1202 var snapshot bytes.Buffer 1203 io.Copy(&snapshot, ringBuffer) 1204 err = &smithy.DeserializationError{ 1205 Err: fmt.Errorf("failed to decode response body, %w", err), 1206 Snapshot: snapshot.Bytes(), 1207 } 1208 return out, metadata, err 1209 } 1210 1211 return out, metadata, err 1212} 1213 1214func awsAwsjson11_deserializeOpErrorCreateSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1215 var errorBuffer bytes.Buffer 1216 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1217 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1218 } 1219 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1220 1221 errorCode := "UnknownError" 1222 errorMessage := errorCode 1223 1224 code := response.Header.Get("X-Amzn-ErrorType") 1225 if len(code) != 0 { 1226 errorCode = restjson.SanitizeErrorCode(code) 1227 } 1228 1229 var buff [1024]byte 1230 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1231 1232 body := io.TeeReader(errorBody, ringBuffer) 1233 decoder := json.NewDecoder(body) 1234 decoder.UseNumber() 1235 code, message, err := restjson.GetErrorInfo(decoder) 1236 if err != nil { 1237 var snapshot bytes.Buffer 1238 io.Copy(&snapshot, ringBuffer) 1239 err = &smithy.DeserializationError{ 1240 Err: fmt.Errorf("failed to decode response body, %w", err), 1241 Snapshot: snapshot.Bytes(), 1242 } 1243 return err 1244 } 1245 1246 errorBody.Seek(0, io.SeekStart) 1247 if len(code) != 0 { 1248 errorCode = restjson.SanitizeErrorCode(code) 1249 } 1250 if len(message) != 0 { 1251 errorMessage = message 1252 } 1253 1254 switch { 1255 case strings.EqualFold("WAFDisallowedNameException", errorCode): 1256 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 1257 1258 case strings.EqualFold("WAFInternalErrorException", errorCode): 1259 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1260 1261 case strings.EqualFold("WAFInvalidAccountException", errorCode): 1262 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 1263 1264 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1265 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1266 1267 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1268 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1269 1270 case strings.EqualFold("WAFStaleDataException", errorCode): 1271 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1272 1273 default: 1274 genericError := &smithy.GenericAPIError{ 1275 Code: errorCode, 1276 Message: errorMessage, 1277 } 1278 return genericError 1279 1280 } 1281} 1282 1283type awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet struct { 1284} 1285 1286func (*awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet) ID() string { 1287 return "OperationDeserializer" 1288} 1289 1290func (m *awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1291 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1292) { 1293 out, metadata, err = next.HandleDeserialize(ctx, in) 1294 if err != nil { 1295 return out, metadata, err 1296 } 1297 1298 response, ok := out.RawResponse.(*smithyhttp.Response) 1299 if !ok { 1300 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1301 } 1302 1303 if response.StatusCode < 200 || response.StatusCode >= 300 { 1304 return out, metadata, awsAwsjson11_deserializeOpErrorCreateSqlInjectionMatchSet(response, &metadata) 1305 } 1306 output := &CreateSqlInjectionMatchSetOutput{} 1307 out.Result = output 1308 1309 var buff [1024]byte 1310 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1311 1312 body := io.TeeReader(response.Body, ringBuffer) 1313 decoder := json.NewDecoder(body) 1314 decoder.UseNumber() 1315 var shape interface{} 1316 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1317 var snapshot bytes.Buffer 1318 io.Copy(&snapshot, ringBuffer) 1319 err = &smithy.DeserializationError{ 1320 Err: fmt.Errorf("failed to decode response body, %w", err), 1321 Snapshot: snapshot.Bytes(), 1322 } 1323 return out, metadata, err 1324 } 1325 1326 err = awsAwsjson11_deserializeOpDocumentCreateSqlInjectionMatchSetOutput(&output, shape) 1327 if err != nil { 1328 var snapshot bytes.Buffer 1329 io.Copy(&snapshot, ringBuffer) 1330 err = &smithy.DeserializationError{ 1331 Err: fmt.Errorf("failed to decode response body, %w", err), 1332 Snapshot: snapshot.Bytes(), 1333 } 1334 return out, metadata, err 1335 } 1336 1337 return out, metadata, err 1338} 1339 1340func awsAwsjson11_deserializeOpErrorCreateSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1341 var errorBuffer bytes.Buffer 1342 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1343 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1344 } 1345 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1346 1347 errorCode := "UnknownError" 1348 errorMessage := errorCode 1349 1350 code := response.Header.Get("X-Amzn-ErrorType") 1351 if len(code) != 0 { 1352 errorCode = restjson.SanitizeErrorCode(code) 1353 } 1354 1355 var buff [1024]byte 1356 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1357 1358 body := io.TeeReader(errorBody, ringBuffer) 1359 decoder := json.NewDecoder(body) 1360 decoder.UseNumber() 1361 code, message, err := restjson.GetErrorInfo(decoder) 1362 if err != nil { 1363 var snapshot bytes.Buffer 1364 io.Copy(&snapshot, ringBuffer) 1365 err = &smithy.DeserializationError{ 1366 Err: fmt.Errorf("failed to decode response body, %w", err), 1367 Snapshot: snapshot.Bytes(), 1368 } 1369 return err 1370 } 1371 1372 errorBody.Seek(0, io.SeekStart) 1373 if len(code) != 0 { 1374 errorCode = restjson.SanitizeErrorCode(code) 1375 } 1376 if len(message) != 0 { 1377 errorMessage = message 1378 } 1379 1380 switch { 1381 case strings.EqualFold("WAFDisallowedNameException", errorCode): 1382 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 1383 1384 case strings.EqualFold("WAFInternalErrorException", errorCode): 1385 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1386 1387 case strings.EqualFold("WAFInvalidAccountException", errorCode): 1388 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 1389 1390 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1391 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1392 1393 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1394 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1395 1396 case strings.EqualFold("WAFStaleDataException", errorCode): 1397 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1398 1399 default: 1400 genericError := &smithy.GenericAPIError{ 1401 Code: errorCode, 1402 Message: errorMessage, 1403 } 1404 return genericError 1405 1406 } 1407} 1408 1409type awsAwsjson11_deserializeOpCreateWebACL struct { 1410} 1411 1412func (*awsAwsjson11_deserializeOpCreateWebACL) ID() string { 1413 return "OperationDeserializer" 1414} 1415 1416func (m *awsAwsjson11_deserializeOpCreateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1417 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1418) { 1419 out, metadata, err = next.HandleDeserialize(ctx, in) 1420 if err != nil { 1421 return out, metadata, err 1422 } 1423 1424 response, ok := out.RawResponse.(*smithyhttp.Response) 1425 if !ok { 1426 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1427 } 1428 1429 if response.StatusCode < 200 || response.StatusCode >= 300 { 1430 return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebACL(response, &metadata) 1431 } 1432 output := &CreateWebACLOutput{} 1433 out.Result = output 1434 1435 var buff [1024]byte 1436 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1437 1438 body := io.TeeReader(response.Body, ringBuffer) 1439 decoder := json.NewDecoder(body) 1440 decoder.UseNumber() 1441 var shape interface{} 1442 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1443 var snapshot bytes.Buffer 1444 io.Copy(&snapshot, ringBuffer) 1445 err = &smithy.DeserializationError{ 1446 Err: fmt.Errorf("failed to decode response body, %w", err), 1447 Snapshot: snapshot.Bytes(), 1448 } 1449 return out, metadata, err 1450 } 1451 1452 err = awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(&output, shape) 1453 if err != nil { 1454 var snapshot bytes.Buffer 1455 io.Copy(&snapshot, ringBuffer) 1456 err = &smithy.DeserializationError{ 1457 Err: fmt.Errorf("failed to decode response body, %w", err), 1458 Snapshot: snapshot.Bytes(), 1459 } 1460 return out, metadata, err 1461 } 1462 1463 return out, metadata, err 1464} 1465 1466func awsAwsjson11_deserializeOpErrorCreateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1467 var errorBuffer bytes.Buffer 1468 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1469 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1470 } 1471 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1472 1473 errorCode := "UnknownError" 1474 errorMessage := errorCode 1475 1476 code := response.Header.Get("X-Amzn-ErrorType") 1477 if len(code) != 0 { 1478 errorCode = restjson.SanitizeErrorCode(code) 1479 } 1480 1481 var buff [1024]byte 1482 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1483 1484 body := io.TeeReader(errorBody, ringBuffer) 1485 decoder := json.NewDecoder(body) 1486 decoder.UseNumber() 1487 code, message, err := restjson.GetErrorInfo(decoder) 1488 if err != nil { 1489 var snapshot bytes.Buffer 1490 io.Copy(&snapshot, ringBuffer) 1491 err = &smithy.DeserializationError{ 1492 Err: fmt.Errorf("failed to decode response body, %w", err), 1493 Snapshot: snapshot.Bytes(), 1494 } 1495 return err 1496 } 1497 1498 errorBody.Seek(0, io.SeekStart) 1499 if len(code) != 0 { 1500 errorCode = restjson.SanitizeErrorCode(code) 1501 } 1502 if len(message) != 0 { 1503 errorMessage = message 1504 } 1505 1506 switch { 1507 case strings.EqualFold("WAFBadRequestException", errorCode): 1508 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 1509 1510 case strings.EqualFold("WAFDisallowedNameException", errorCode): 1511 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 1512 1513 case strings.EqualFold("WAFInternalErrorException", errorCode): 1514 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1515 1516 case strings.EqualFold("WAFInvalidAccountException", errorCode): 1517 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 1518 1519 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1520 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1521 1522 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1523 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1524 1525 case strings.EqualFold("WAFStaleDataException", errorCode): 1526 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1527 1528 case strings.EqualFold("WAFTagOperationException", errorCode): 1529 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 1530 1531 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 1532 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 1533 1534 default: 1535 genericError := &smithy.GenericAPIError{ 1536 Code: errorCode, 1537 Message: errorMessage, 1538 } 1539 return genericError 1540 1541 } 1542} 1543 1544type awsAwsjson11_deserializeOpCreateWebACLMigrationStack struct { 1545} 1546 1547func (*awsAwsjson11_deserializeOpCreateWebACLMigrationStack) ID() string { 1548 return "OperationDeserializer" 1549} 1550 1551func (m *awsAwsjson11_deserializeOpCreateWebACLMigrationStack) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1552 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1553) { 1554 out, metadata, err = next.HandleDeserialize(ctx, in) 1555 if err != nil { 1556 return out, metadata, err 1557 } 1558 1559 response, ok := out.RawResponse.(*smithyhttp.Response) 1560 if !ok { 1561 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1562 } 1563 1564 if response.StatusCode < 200 || response.StatusCode >= 300 { 1565 return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebACLMigrationStack(response, &metadata) 1566 } 1567 output := &CreateWebACLMigrationStackOutput{} 1568 out.Result = output 1569 1570 var buff [1024]byte 1571 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1572 1573 body := io.TeeReader(response.Body, ringBuffer) 1574 decoder := json.NewDecoder(body) 1575 decoder.UseNumber() 1576 var shape interface{} 1577 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1578 var snapshot bytes.Buffer 1579 io.Copy(&snapshot, ringBuffer) 1580 err = &smithy.DeserializationError{ 1581 Err: fmt.Errorf("failed to decode response body, %w", err), 1582 Snapshot: snapshot.Bytes(), 1583 } 1584 return out, metadata, err 1585 } 1586 1587 err = awsAwsjson11_deserializeOpDocumentCreateWebACLMigrationStackOutput(&output, shape) 1588 if err != nil { 1589 var snapshot bytes.Buffer 1590 io.Copy(&snapshot, ringBuffer) 1591 err = &smithy.DeserializationError{ 1592 Err: fmt.Errorf("failed to decode response body, %w", err), 1593 Snapshot: snapshot.Bytes(), 1594 } 1595 return out, metadata, err 1596 } 1597 1598 return out, metadata, err 1599} 1600 1601func awsAwsjson11_deserializeOpErrorCreateWebACLMigrationStack(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1602 var errorBuffer bytes.Buffer 1603 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1604 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1605 } 1606 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1607 1608 errorCode := "UnknownError" 1609 errorMessage := errorCode 1610 1611 code := response.Header.Get("X-Amzn-ErrorType") 1612 if len(code) != 0 { 1613 errorCode = restjson.SanitizeErrorCode(code) 1614 } 1615 1616 var buff [1024]byte 1617 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1618 1619 body := io.TeeReader(errorBody, ringBuffer) 1620 decoder := json.NewDecoder(body) 1621 decoder.UseNumber() 1622 code, message, err := restjson.GetErrorInfo(decoder) 1623 if err != nil { 1624 var snapshot bytes.Buffer 1625 io.Copy(&snapshot, ringBuffer) 1626 err = &smithy.DeserializationError{ 1627 Err: fmt.Errorf("failed to decode response body, %w", err), 1628 Snapshot: snapshot.Bytes(), 1629 } 1630 return err 1631 } 1632 1633 errorBody.Seek(0, io.SeekStart) 1634 if len(code) != 0 { 1635 errorCode = restjson.SanitizeErrorCode(code) 1636 } 1637 if len(message) != 0 { 1638 errorMessage = message 1639 } 1640 1641 switch { 1642 case strings.EqualFold("WAFEntityMigrationException", errorCode): 1643 return awsAwsjson11_deserializeErrorWAFEntityMigrationException(response, errorBody) 1644 1645 case strings.EqualFold("WAFInternalErrorException", errorCode): 1646 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1647 1648 case strings.EqualFold("WAFInvalidOperationException", errorCode): 1649 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 1650 1651 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1652 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1653 1654 case strings.EqualFold("WAFNonexistentItemException", errorCode): 1655 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 1656 1657 default: 1658 genericError := &smithy.GenericAPIError{ 1659 Code: errorCode, 1660 Message: errorMessage, 1661 } 1662 return genericError 1663 1664 } 1665} 1666 1667type awsAwsjson11_deserializeOpCreateXssMatchSet struct { 1668} 1669 1670func (*awsAwsjson11_deserializeOpCreateXssMatchSet) ID() string { 1671 return "OperationDeserializer" 1672} 1673 1674func (m *awsAwsjson11_deserializeOpCreateXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1675 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1676) { 1677 out, metadata, err = next.HandleDeserialize(ctx, in) 1678 if err != nil { 1679 return out, metadata, err 1680 } 1681 1682 response, ok := out.RawResponse.(*smithyhttp.Response) 1683 if !ok { 1684 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1685 } 1686 1687 if response.StatusCode < 200 || response.StatusCode >= 300 { 1688 return out, metadata, awsAwsjson11_deserializeOpErrorCreateXssMatchSet(response, &metadata) 1689 } 1690 output := &CreateXssMatchSetOutput{} 1691 out.Result = output 1692 1693 var buff [1024]byte 1694 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1695 1696 body := io.TeeReader(response.Body, ringBuffer) 1697 decoder := json.NewDecoder(body) 1698 decoder.UseNumber() 1699 var shape interface{} 1700 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1701 var snapshot bytes.Buffer 1702 io.Copy(&snapshot, ringBuffer) 1703 err = &smithy.DeserializationError{ 1704 Err: fmt.Errorf("failed to decode response body, %w", err), 1705 Snapshot: snapshot.Bytes(), 1706 } 1707 return out, metadata, err 1708 } 1709 1710 err = awsAwsjson11_deserializeOpDocumentCreateXssMatchSetOutput(&output, shape) 1711 if err != nil { 1712 var snapshot bytes.Buffer 1713 io.Copy(&snapshot, ringBuffer) 1714 err = &smithy.DeserializationError{ 1715 Err: fmt.Errorf("failed to decode response body, %w", err), 1716 Snapshot: snapshot.Bytes(), 1717 } 1718 return out, metadata, err 1719 } 1720 1721 return out, metadata, err 1722} 1723 1724func awsAwsjson11_deserializeOpErrorCreateXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1725 var errorBuffer bytes.Buffer 1726 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1727 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1728 } 1729 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1730 1731 errorCode := "UnknownError" 1732 errorMessage := errorCode 1733 1734 code := response.Header.Get("X-Amzn-ErrorType") 1735 if len(code) != 0 { 1736 errorCode = restjson.SanitizeErrorCode(code) 1737 } 1738 1739 var buff [1024]byte 1740 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1741 1742 body := io.TeeReader(errorBody, ringBuffer) 1743 decoder := json.NewDecoder(body) 1744 decoder.UseNumber() 1745 code, message, err := restjson.GetErrorInfo(decoder) 1746 if err != nil { 1747 var snapshot bytes.Buffer 1748 io.Copy(&snapshot, ringBuffer) 1749 err = &smithy.DeserializationError{ 1750 Err: fmt.Errorf("failed to decode response body, %w", err), 1751 Snapshot: snapshot.Bytes(), 1752 } 1753 return err 1754 } 1755 1756 errorBody.Seek(0, io.SeekStart) 1757 if len(code) != 0 { 1758 errorCode = restjson.SanitizeErrorCode(code) 1759 } 1760 if len(message) != 0 { 1761 errorMessage = message 1762 } 1763 1764 switch { 1765 case strings.EqualFold("WAFDisallowedNameException", errorCode): 1766 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 1767 1768 case strings.EqualFold("WAFInternalErrorException", errorCode): 1769 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1770 1771 case strings.EqualFold("WAFInvalidAccountException", errorCode): 1772 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 1773 1774 case strings.EqualFold("WAFInvalidParameterException", errorCode): 1775 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 1776 1777 case strings.EqualFold("WAFLimitsExceededException", errorCode): 1778 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 1779 1780 case strings.EqualFold("WAFStaleDataException", errorCode): 1781 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1782 1783 default: 1784 genericError := &smithy.GenericAPIError{ 1785 Code: errorCode, 1786 Message: errorMessage, 1787 } 1788 return genericError 1789 1790 } 1791} 1792 1793type awsAwsjson11_deserializeOpDeleteByteMatchSet struct { 1794} 1795 1796func (*awsAwsjson11_deserializeOpDeleteByteMatchSet) ID() string { 1797 return "OperationDeserializer" 1798} 1799 1800func (m *awsAwsjson11_deserializeOpDeleteByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1801 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1802) { 1803 out, metadata, err = next.HandleDeserialize(ctx, in) 1804 if err != nil { 1805 return out, metadata, err 1806 } 1807 1808 response, ok := out.RawResponse.(*smithyhttp.Response) 1809 if !ok { 1810 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1811 } 1812 1813 if response.StatusCode < 200 || response.StatusCode >= 300 { 1814 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteByteMatchSet(response, &metadata) 1815 } 1816 output := &DeleteByteMatchSetOutput{} 1817 out.Result = output 1818 1819 var buff [1024]byte 1820 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1821 1822 body := io.TeeReader(response.Body, ringBuffer) 1823 decoder := json.NewDecoder(body) 1824 decoder.UseNumber() 1825 var shape interface{} 1826 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1827 var snapshot bytes.Buffer 1828 io.Copy(&snapshot, ringBuffer) 1829 err = &smithy.DeserializationError{ 1830 Err: fmt.Errorf("failed to decode response body, %w", err), 1831 Snapshot: snapshot.Bytes(), 1832 } 1833 return out, metadata, err 1834 } 1835 1836 err = awsAwsjson11_deserializeOpDocumentDeleteByteMatchSetOutput(&output, shape) 1837 if err != nil { 1838 var snapshot bytes.Buffer 1839 io.Copy(&snapshot, ringBuffer) 1840 err = &smithy.DeserializationError{ 1841 Err: fmt.Errorf("failed to decode response body, %w", err), 1842 Snapshot: snapshot.Bytes(), 1843 } 1844 return out, metadata, err 1845 } 1846 1847 return out, metadata, err 1848} 1849 1850func awsAwsjson11_deserializeOpErrorDeleteByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1851 var errorBuffer bytes.Buffer 1852 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1853 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1854 } 1855 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1856 1857 errorCode := "UnknownError" 1858 errorMessage := errorCode 1859 1860 code := response.Header.Get("X-Amzn-ErrorType") 1861 if len(code) != 0 { 1862 errorCode = restjson.SanitizeErrorCode(code) 1863 } 1864 1865 var buff [1024]byte 1866 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1867 1868 body := io.TeeReader(errorBody, ringBuffer) 1869 decoder := json.NewDecoder(body) 1870 decoder.UseNumber() 1871 code, message, err := restjson.GetErrorInfo(decoder) 1872 if err != nil { 1873 var snapshot bytes.Buffer 1874 io.Copy(&snapshot, ringBuffer) 1875 err = &smithy.DeserializationError{ 1876 Err: fmt.Errorf("failed to decode response body, %w", err), 1877 Snapshot: snapshot.Bytes(), 1878 } 1879 return err 1880 } 1881 1882 errorBody.Seek(0, io.SeekStart) 1883 if len(code) != 0 { 1884 errorCode = restjson.SanitizeErrorCode(code) 1885 } 1886 if len(message) != 0 { 1887 errorMessage = message 1888 } 1889 1890 switch { 1891 case strings.EqualFold("WAFInternalErrorException", errorCode): 1892 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 1893 1894 case strings.EqualFold("WAFInvalidAccountException", errorCode): 1895 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 1896 1897 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 1898 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 1899 1900 case strings.EqualFold("WAFNonexistentItemException", errorCode): 1901 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 1902 1903 case strings.EqualFold("WAFReferencedItemException", errorCode): 1904 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 1905 1906 case strings.EqualFold("WAFStaleDataException", errorCode): 1907 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 1908 1909 default: 1910 genericError := &smithy.GenericAPIError{ 1911 Code: errorCode, 1912 Message: errorMessage, 1913 } 1914 return genericError 1915 1916 } 1917} 1918 1919type awsAwsjson11_deserializeOpDeleteGeoMatchSet struct { 1920} 1921 1922func (*awsAwsjson11_deserializeOpDeleteGeoMatchSet) ID() string { 1923 return "OperationDeserializer" 1924} 1925 1926func (m *awsAwsjson11_deserializeOpDeleteGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1927 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1928) { 1929 out, metadata, err = next.HandleDeserialize(ctx, in) 1930 if err != nil { 1931 return out, metadata, err 1932 } 1933 1934 response, ok := out.RawResponse.(*smithyhttp.Response) 1935 if !ok { 1936 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1937 } 1938 1939 if response.StatusCode < 200 || response.StatusCode >= 300 { 1940 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteGeoMatchSet(response, &metadata) 1941 } 1942 output := &DeleteGeoMatchSetOutput{} 1943 out.Result = output 1944 1945 var buff [1024]byte 1946 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1947 1948 body := io.TeeReader(response.Body, ringBuffer) 1949 decoder := json.NewDecoder(body) 1950 decoder.UseNumber() 1951 var shape interface{} 1952 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1953 var snapshot bytes.Buffer 1954 io.Copy(&snapshot, ringBuffer) 1955 err = &smithy.DeserializationError{ 1956 Err: fmt.Errorf("failed to decode response body, %w", err), 1957 Snapshot: snapshot.Bytes(), 1958 } 1959 return out, metadata, err 1960 } 1961 1962 err = awsAwsjson11_deserializeOpDocumentDeleteGeoMatchSetOutput(&output, shape) 1963 if err != nil { 1964 var snapshot bytes.Buffer 1965 io.Copy(&snapshot, ringBuffer) 1966 err = &smithy.DeserializationError{ 1967 Err: fmt.Errorf("failed to decode response body, %w", err), 1968 Snapshot: snapshot.Bytes(), 1969 } 1970 return out, metadata, err 1971 } 1972 1973 return out, metadata, err 1974} 1975 1976func awsAwsjson11_deserializeOpErrorDeleteGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1977 var errorBuffer bytes.Buffer 1978 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1979 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1980 } 1981 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1982 1983 errorCode := "UnknownError" 1984 errorMessage := errorCode 1985 1986 code := response.Header.Get("X-Amzn-ErrorType") 1987 if len(code) != 0 { 1988 errorCode = restjson.SanitizeErrorCode(code) 1989 } 1990 1991 var buff [1024]byte 1992 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1993 1994 body := io.TeeReader(errorBody, ringBuffer) 1995 decoder := json.NewDecoder(body) 1996 decoder.UseNumber() 1997 code, message, err := restjson.GetErrorInfo(decoder) 1998 if err != nil { 1999 var snapshot bytes.Buffer 2000 io.Copy(&snapshot, ringBuffer) 2001 err = &smithy.DeserializationError{ 2002 Err: fmt.Errorf("failed to decode response body, %w", err), 2003 Snapshot: snapshot.Bytes(), 2004 } 2005 return err 2006 } 2007 2008 errorBody.Seek(0, io.SeekStart) 2009 if len(code) != 0 { 2010 errorCode = restjson.SanitizeErrorCode(code) 2011 } 2012 if len(message) != 0 { 2013 errorMessage = message 2014 } 2015 2016 switch { 2017 case strings.EqualFold("WAFInternalErrorException", errorCode): 2018 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2019 2020 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2021 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2022 2023 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2024 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2025 2026 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2027 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2028 2029 case strings.EqualFold("WAFReferencedItemException", errorCode): 2030 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2031 2032 case strings.EqualFold("WAFStaleDataException", errorCode): 2033 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2034 2035 default: 2036 genericError := &smithy.GenericAPIError{ 2037 Code: errorCode, 2038 Message: errorMessage, 2039 } 2040 return genericError 2041 2042 } 2043} 2044 2045type awsAwsjson11_deserializeOpDeleteIPSet struct { 2046} 2047 2048func (*awsAwsjson11_deserializeOpDeleteIPSet) ID() string { 2049 return "OperationDeserializer" 2050} 2051 2052func (m *awsAwsjson11_deserializeOpDeleteIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2053 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2054) { 2055 out, metadata, err = next.HandleDeserialize(ctx, in) 2056 if err != nil { 2057 return out, metadata, err 2058 } 2059 2060 response, ok := out.RawResponse.(*smithyhttp.Response) 2061 if !ok { 2062 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2063 } 2064 2065 if response.StatusCode < 200 || response.StatusCode >= 300 { 2066 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIPSet(response, &metadata) 2067 } 2068 output := &DeleteIPSetOutput{} 2069 out.Result = output 2070 2071 var buff [1024]byte 2072 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2073 2074 body := io.TeeReader(response.Body, ringBuffer) 2075 decoder := json.NewDecoder(body) 2076 decoder.UseNumber() 2077 var shape interface{} 2078 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2079 var snapshot bytes.Buffer 2080 io.Copy(&snapshot, ringBuffer) 2081 err = &smithy.DeserializationError{ 2082 Err: fmt.Errorf("failed to decode response body, %w", err), 2083 Snapshot: snapshot.Bytes(), 2084 } 2085 return out, metadata, err 2086 } 2087 2088 err = awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(&output, shape) 2089 if err != nil { 2090 var snapshot bytes.Buffer 2091 io.Copy(&snapshot, ringBuffer) 2092 err = &smithy.DeserializationError{ 2093 Err: fmt.Errorf("failed to decode response body, %w", err), 2094 Snapshot: snapshot.Bytes(), 2095 } 2096 return out, metadata, err 2097 } 2098 2099 return out, metadata, err 2100} 2101 2102func awsAwsjson11_deserializeOpErrorDeleteIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2103 var errorBuffer bytes.Buffer 2104 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2105 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2106 } 2107 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2108 2109 errorCode := "UnknownError" 2110 errorMessage := errorCode 2111 2112 code := response.Header.Get("X-Amzn-ErrorType") 2113 if len(code) != 0 { 2114 errorCode = restjson.SanitizeErrorCode(code) 2115 } 2116 2117 var buff [1024]byte 2118 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2119 2120 body := io.TeeReader(errorBody, ringBuffer) 2121 decoder := json.NewDecoder(body) 2122 decoder.UseNumber() 2123 code, message, err := restjson.GetErrorInfo(decoder) 2124 if err != nil { 2125 var snapshot bytes.Buffer 2126 io.Copy(&snapshot, ringBuffer) 2127 err = &smithy.DeserializationError{ 2128 Err: fmt.Errorf("failed to decode response body, %w", err), 2129 Snapshot: snapshot.Bytes(), 2130 } 2131 return err 2132 } 2133 2134 errorBody.Seek(0, io.SeekStart) 2135 if len(code) != 0 { 2136 errorCode = restjson.SanitizeErrorCode(code) 2137 } 2138 if len(message) != 0 { 2139 errorMessage = message 2140 } 2141 2142 switch { 2143 case strings.EqualFold("WAFInternalErrorException", errorCode): 2144 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2145 2146 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2147 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2148 2149 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2150 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2151 2152 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2153 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2154 2155 case strings.EqualFold("WAFReferencedItemException", errorCode): 2156 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2157 2158 case strings.EqualFold("WAFStaleDataException", errorCode): 2159 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2160 2161 default: 2162 genericError := &smithy.GenericAPIError{ 2163 Code: errorCode, 2164 Message: errorMessage, 2165 } 2166 return genericError 2167 2168 } 2169} 2170 2171type awsAwsjson11_deserializeOpDeleteLoggingConfiguration struct { 2172} 2173 2174func (*awsAwsjson11_deserializeOpDeleteLoggingConfiguration) ID() string { 2175 return "OperationDeserializer" 2176} 2177 2178func (m *awsAwsjson11_deserializeOpDeleteLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2179 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2180) { 2181 out, metadata, err = next.HandleDeserialize(ctx, in) 2182 if err != nil { 2183 return out, metadata, err 2184 } 2185 2186 response, ok := out.RawResponse.(*smithyhttp.Response) 2187 if !ok { 2188 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2189 } 2190 2191 if response.StatusCode < 200 || response.StatusCode >= 300 { 2192 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response, &metadata) 2193 } 2194 output := &DeleteLoggingConfigurationOutput{} 2195 out.Result = output 2196 2197 var buff [1024]byte 2198 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2199 2200 body := io.TeeReader(response.Body, ringBuffer) 2201 decoder := json.NewDecoder(body) 2202 decoder.UseNumber() 2203 var shape interface{} 2204 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2205 var snapshot bytes.Buffer 2206 io.Copy(&snapshot, ringBuffer) 2207 err = &smithy.DeserializationError{ 2208 Err: fmt.Errorf("failed to decode response body, %w", err), 2209 Snapshot: snapshot.Bytes(), 2210 } 2211 return out, metadata, err 2212 } 2213 2214 err = awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(&output, shape) 2215 if err != nil { 2216 var snapshot bytes.Buffer 2217 io.Copy(&snapshot, ringBuffer) 2218 err = &smithy.DeserializationError{ 2219 Err: fmt.Errorf("failed to decode response body, %w", err), 2220 Snapshot: snapshot.Bytes(), 2221 } 2222 return out, metadata, err 2223 } 2224 2225 return out, metadata, err 2226} 2227 2228func awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2229 var errorBuffer bytes.Buffer 2230 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2231 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2232 } 2233 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2234 2235 errorCode := "UnknownError" 2236 errorMessage := errorCode 2237 2238 code := response.Header.Get("X-Amzn-ErrorType") 2239 if len(code) != 0 { 2240 errorCode = restjson.SanitizeErrorCode(code) 2241 } 2242 2243 var buff [1024]byte 2244 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2245 2246 body := io.TeeReader(errorBody, ringBuffer) 2247 decoder := json.NewDecoder(body) 2248 decoder.UseNumber() 2249 code, message, err := restjson.GetErrorInfo(decoder) 2250 if err != nil { 2251 var snapshot bytes.Buffer 2252 io.Copy(&snapshot, ringBuffer) 2253 err = &smithy.DeserializationError{ 2254 Err: fmt.Errorf("failed to decode response body, %w", err), 2255 Snapshot: snapshot.Bytes(), 2256 } 2257 return err 2258 } 2259 2260 errorBody.Seek(0, io.SeekStart) 2261 if len(code) != 0 { 2262 errorCode = restjson.SanitizeErrorCode(code) 2263 } 2264 if len(message) != 0 { 2265 errorMessage = message 2266 } 2267 2268 switch { 2269 case strings.EqualFold("WAFInternalErrorException", errorCode): 2270 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2271 2272 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2273 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2274 2275 case strings.EqualFold("WAFStaleDataException", errorCode): 2276 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2277 2278 default: 2279 genericError := &smithy.GenericAPIError{ 2280 Code: errorCode, 2281 Message: errorMessage, 2282 } 2283 return genericError 2284 2285 } 2286} 2287 2288type awsAwsjson11_deserializeOpDeletePermissionPolicy struct { 2289} 2290 2291func (*awsAwsjson11_deserializeOpDeletePermissionPolicy) ID() string { 2292 return "OperationDeserializer" 2293} 2294 2295func (m *awsAwsjson11_deserializeOpDeletePermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2296 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2297) { 2298 out, metadata, err = next.HandleDeserialize(ctx, in) 2299 if err != nil { 2300 return out, metadata, err 2301 } 2302 2303 response, ok := out.RawResponse.(*smithyhttp.Response) 2304 if !ok { 2305 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2306 } 2307 2308 if response.StatusCode < 200 || response.StatusCode >= 300 { 2309 return out, metadata, awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response, &metadata) 2310 } 2311 output := &DeletePermissionPolicyOutput{} 2312 out.Result = output 2313 2314 var buff [1024]byte 2315 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2316 2317 body := io.TeeReader(response.Body, ringBuffer) 2318 decoder := json.NewDecoder(body) 2319 decoder.UseNumber() 2320 var shape interface{} 2321 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2322 var snapshot bytes.Buffer 2323 io.Copy(&snapshot, ringBuffer) 2324 err = &smithy.DeserializationError{ 2325 Err: fmt.Errorf("failed to decode response body, %w", err), 2326 Snapshot: snapshot.Bytes(), 2327 } 2328 return out, metadata, err 2329 } 2330 2331 err = awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(&output, shape) 2332 if err != nil { 2333 var snapshot bytes.Buffer 2334 io.Copy(&snapshot, ringBuffer) 2335 err = &smithy.DeserializationError{ 2336 Err: fmt.Errorf("failed to decode response body, %w", err), 2337 Snapshot: snapshot.Bytes(), 2338 } 2339 return out, metadata, err 2340 } 2341 2342 return out, metadata, err 2343} 2344 2345func awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2346 var errorBuffer bytes.Buffer 2347 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2348 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2349 } 2350 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2351 2352 errorCode := "UnknownError" 2353 errorMessage := errorCode 2354 2355 code := response.Header.Get("X-Amzn-ErrorType") 2356 if len(code) != 0 { 2357 errorCode = restjson.SanitizeErrorCode(code) 2358 } 2359 2360 var buff [1024]byte 2361 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2362 2363 body := io.TeeReader(errorBody, ringBuffer) 2364 decoder := json.NewDecoder(body) 2365 decoder.UseNumber() 2366 code, message, err := restjson.GetErrorInfo(decoder) 2367 if err != nil { 2368 var snapshot bytes.Buffer 2369 io.Copy(&snapshot, ringBuffer) 2370 err = &smithy.DeserializationError{ 2371 Err: fmt.Errorf("failed to decode response body, %w", err), 2372 Snapshot: snapshot.Bytes(), 2373 } 2374 return err 2375 } 2376 2377 errorBody.Seek(0, io.SeekStart) 2378 if len(code) != 0 { 2379 errorCode = restjson.SanitizeErrorCode(code) 2380 } 2381 if len(message) != 0 { 2382 errorMessage = message 2383 } 2384 2385 switch { 2386 case strings.EqualFold("WAFInternalErrorException", errorCode): 2387 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2388 2389 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2390 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2391 2392 case strings.EqualFold("WAFStaleDataException", errorCode): 2393 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2394 2395 default: 2396 genericError := &smithy.GenericAPIError{ 2397 Code: errorCode, 2398 Message: errorMessage, 2399 } 2400 return genericError 2401 2402 } 2403} 2404 2405type awsAwsjson11_deserializeOpDeleteRateBasedRule struct { 2406} 2407 2408func (*awsAwsjson11_deserializeOpDeleteRateBasedRule) ID() string { 2409 return "OperationDeserializer" 2410} 2411 2412func (m *awsAwsjson11_deserializeOpDeleteRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2413 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2414) { 2415 out, metadata, err = next.HandleDeserialize(ctx, in) 2416 if err != nil { 2417 return out, metadata, err 2418 } 2419 2420 response, ok := out.RawResponse.(*smithyhttp.Response) 2421 if !ok { 2422 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2423 } 2424 2425 if response.StatusCode < 200 || response.StatusCode >= 300 { 2426 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRateBasedRule(response, &metadata) 2427 } 2428 output := &DeleteRateBasedRuleOutput{} 2429 out.Result = output 2430 2431 var buff [1024]byte 2432 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2433 2434 body := io.TeeReader(response.Body, ringBuffer) 2435 decoder := json.NewDecoder(body) 2436 decoder.UseNumber() 2437 var shape interface{} 2438 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2439 var snapshot bytes.Buffer 2440 io.Copy(&snapshot, ringBuffer) 2441 err = &smithy.DeserializationError{ 2442 Err: fmt.Errorf("failed to decode response body, %w", err), 2443 Snapshot: snapshot.Bytes(), 2444 } 2445 return out, metadata, err 2446 } 2447 2448 err = awsAwsjson11_deserializeOpDocumentDeleteRateBasedRuleOutput(&output, shape) 2449 if err != nil { 2450 var snapshot bytes.Buffer 2451 io.Copy(&snapshot, ringBuffer) 2452 err = &smithy.DeserializationError{ 2453 Err: fmt.Errorf("failed to decode response body, %w", err), 2454 Snapshot: snapshot.Bytes(), 2455 } 2456 return out, metadata, err 2457 } 2458 2459 return out, metadata, err 2460} 2461 2462func awsAwsjson11_deserializeOpErrorDeleteRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2463 var errorBuffer bytes.Buffer 2464 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2465 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2466 } 2467 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2468 2469 errorCode := "UnknownError" 2470 errorMessage := errorCode 2471 2472 code := response.Header.Get("X-Amzn-ErrorType") 2473 if len(code) != 0 { 2474 errorCode = restjson.SanitizeErrorCode(code) 2475 } 2476 2477 var buff [1024]byte 2478 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2479 2480 body := io.TeeReader(errorBody, ringBuffer) 2481 decoder := json.NewDecoder(body) 2482 decoder.UseNumber() 2483 code, message, err := restjson.GetErrorInfo(decoder) 2484 if err != nil { 2485 var snapshot bytes.Buffer 2486 io.Copy(&snapshot, ringBuffer) 2487 err = &smithy.DeserializationError{ 2488 Err: fmt.Errorf("failed to decode response body, %w", err), 2489 Snapshot: snapshot.Bytes(), 2490 } 2491 return err 2492 } 2493 2494 errorBody.Seek(0, io.SeekStart) 2495 if len(code) != 0 { 2496 errorCode = restjson.SanitizeErrorCode(code) 2497 } 2498 if len(message) != 0 { 2499 errorMessage = message 2500 } 2501 2502 switch { 2503 case strings.EqualFold("WAFInternalErrorException", errorCode): 2504 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2505 2506 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2507 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2508 2509 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2510 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2511 2512 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2513 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2514 2515 case strings.EqualFold("WAFReferencedItemException", errorCode): 2516 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2517 2518 case strings.EqualFold("WAFStaleDataException", errorCode): 2519 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2520 2521 case strings.EqualFold("WAFTagOperationException", errorCode): 2522 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 2523 2524 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 2525 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 2526 2527 default: 2528 genericError := &smithy.GenericAPIError{ 2529 Code: errorCode, 2530 Message: errorMessage, 2531 } 2532 return genericError 2533 2534 } 2535} 2536 2537type awsAwsjson11_deserializeOpDeleteRegexMatchSet struct { 2538} 2539 2540func (*awsAwsjson11_deserializeOpDeleteRegexMatchSet) ID() string { 2541 return "OperationDeserializer" 2542} 2543 2544func (m *awsAwsjson11_deserializeOpDeleteRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2545 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2546) { 2547 out, metadata, err = next.HandleDeserialize(ctx, in) 2548 if err != nil { 2549 return out, metadata, err 2550 } 2551 2552 response, ok := out.RawResponse.(*smithyhttp.Response) 2553 if !ok { 2554 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2555 } 2556 2557 if response.StatusCode < 200 || response.StatusCode >= 300 { 2558 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegexMatchSet(response, &metadata) 2559 } 2560 output := &DeleteRegexMatchSetOutput{} 2561 out.Result = output 2562 2563 var buff [1024]byte 2564 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2565 2566 body := io.TeeReader(response.Body, ringBuffer) 2567 decoder := json.NewDecoder(body) 2568 decoder.UseNumber() 2569 var shape interface{} 2570 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2571 var snapshot bytes.Buffer 2572 io.Copy(&snapshot, ringBuffer) 2573 err = &smithy.DeserializationError{ 2574 Err: fmt.Errorf("failed to decode response body, %w", err), 2575 Snapshot: snapshot.Bytes(), 2576 } 2577 return out, metadata, err 2578 } 2579 2580 err = awsAwsjson11_deserializeOpDocumentDeleteRegexMatchSetOutput(&output, shape) 2581 if err != nil { 2582 var snapshot bytes.Buffer 2583 io.Copy(&snapshot, ringBuffer) 2584 err = &smithy.DeserializationError{ 2585 Err: fmt.Errorf("failed to decode response body, %w", err), 2586 Snapshot: snapshot.Bytes(), 2587 } 2588 return out, metadata, err 2589 } 2590 2591 return out, metadata, err 2592} 2593 2594func awsAwsjson11_deserializeOpErrorDeleteRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2595 var errorBuffer bytes.Buffer 2596 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2597 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2598 } 2599 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2600 2601 errorCode := "UnknownError" 2602 errorMessage := errorCode 2603 2604 code := response.Header.Get("X-Amzn-ErrorType") 2605 if len(code) != 0 { 2606 errorCode = restjson.SanitizeErrorCode(code) 2607 } 2608 2609 var buff [1024]byte 2610 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2611 2612 body := io.TeeReader(errorBody, ringBuffer) 2613 decoder := json.NewDecoder(body) 2614 decoder.UseNumber() 2615 code, message, err := restjson.GetErrorInfo(decoder) 2616 if err != nil { 2617 var snapshot bytes.Buffer 2618 io.Copy(&snapshot, ringBuffer) 2619 err = &smithy.DeserializationError{ 2620 Err: fmt.Errorf("failed to decode response body, %w", err), 2621 Snapshot: snapshot.Bytes(), 2622 } 2623 return err 2624 } 2625 2626 errorBody.Seek(0, io.SeekStart) 2627 if len(code) != 0 { 2628 errorCode = restjson.SanitizeErrorCode(code) 2629 } 2630 if len(message) != 0 { 2631 errorMessage = message 2632 } 2633 2634 switch { 2635 case strings.EqualFold("WAFInternalErrorException", errorCode): 2636 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2637 2638 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2639 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2640 2641 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2642 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2643 2644 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2645 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2646 2647 case strings.EqualFold("WAFReferencedItemException", errorCode): 2648 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2649 2650 case strings.EqualFold("WAFStaleDataException", errorCode): 2651 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2652 2653 default: 2654 genericError := &smithy.GenericAPIError{ 2655 Code: errorCode, 2656 Message: errorMessage, 2657 } 2658 return genericError 2659 2660 } 2661} 2662 2663type awsAwsjson11_deserializeOpDeleteRegexPatternSet struct { 2664} 2665 2666func (*awsAwsjson11_deserializeOpDeleteRegexPatternSet) ID() string { 2667 return "OperationDeserializer" 2668} 2669 2670func (m *awsAwsjson11_deserializeOpDeleteRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2671 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2672) { 2673 out, metadata, err = next.HandleDeserialize(ctx, in) 2674 if err != nil { 2675 return out, metadata, err 2676 } 2677 2678 response, ok := out.RawResponse.(*smithyhttp.Response) 2679 if !ok { 2680 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2681 } 2682 2683 if response.StatusCode < 200 || response.StatusCode >= 300 { 2684 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response, &metadata) 2685 } 2686 output := &DeleteRegexPatternSetOutput{} 2687 out.Result = output 2688 2689 var buff [1024]byte 2690 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2691 2692 body := io.TeeReader(response.Body, ringBuffer) 2693 decoder := json.NewDecoder(body) 2694 decoder.UseNumber() 2695 var shape interface{} 2696 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2697 var snapshot bytes.Buffer 2698 io.Copy(&snapshot, ringBuffer) 2699 err = &smithy.DeserializationError{ 2700 Err: fmt.Errorf("failed to decode response body, %w", err), 2701 Snapshot: snapshot.Bytes(), 2702 } 2703 return out, metadata, err 2704 } 2705 2706 err = awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(&output, shape) 2707 if err != nil { 2708 var snapshot bytes.Buffer 2709 io.Copy(&snapshot, ringBuffer) 2710 err = &smithy.DeserializationError{ 2711 Err: fmt.Errorf("failed to decode response body, %w", err), 2712 Snapshot: snapshot.Bytes(), 2713 } 2714 return out, metadata, err 2715 } 2716 2717 return out, metadata, err 2718} 2719 2720func awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2721 var errorBuffer bytes.Buffer 2722 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2723 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2724 } 2725 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2726 2727 errorCode := "UnknownError" 2728 errorMessage := errorCode 2729 2730 code := response.Header.Get("X-Amzn-ErrorType") 2731 if len(code) != 0 { 2732 errorCode = restjson.SanitizeErrorCode(code) 2733 } 2734 2735 var buff [1024]byte 2736 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2737 2738 body := io.TeeReader(errorBody, ringBuffer) 2739 decoder := json.NewDecoder(body) 2740 decoder.UseNumber() 2741 code, message, err := restjson.GetErrorInfo(decoder) 2742 if err != nil { 2743 var snapshot bytes.Buffer 2744 io.Copy(&snapshot, ringBuffer) 2745 err = &smithy.DeserializationError{ 2746 Err: fmt.Errorf("failed to decode response body, %w", err), 2747 Snapshot: snapshot.Bytes(), 2748 } 2749 return err 2750 } 2751 2752 errorBody.Seek(0, io.SeekStart) 2753 if len(code) != 0 { 2754 errorCode = restjson.SanitizeErrorCode(code) 2755 } 2756 if len(message) != 0 { 2757 errorMessage = message 2758 } 2759 2760 switch { 2761 case strings.EqualFold("WAFInternalErrorException", errorCode): 2762 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2763 2764 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2765 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2766 2767 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2768 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2769 2770 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2771 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2772 2773 case strings.EqualFold("WAFReferencedItemException", errorCode): 2774 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2775 2776 case strings.EqualFold("WAFStaleDataException", errorCode): 2777 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2778 2779 default: 2780 genericError := &smithy.GenericAPIError{ 2781 Code: errorCode, 2782 Message: errorMessage, 2783 } 2784 return genericError 2785 2786 } 2787} 2788 2789type awsAwsjson11_deserializeOpDeleteRule struct { 2790} 2791 2792func (*awsAwsjson11_deserializeOpDeleteRule) ID() string { 2793 return "OperationDeserializer" 2794} 2795 2796func (m *awsAwsjson11_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2797 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2798) { 2799 out, metadata, err = next.HandleDeserialize(ctx, in) 2800 if err != nil { 2801 return out, metadata, err 2802 } 2803 2804 response, ok := out.RawResponse.(*smithyhttp.Response) 2805 if !ok { 2806 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2807 } 2808 2809 if response.StatusCode < 200 || response.StatusCode >= 300 { 2810 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRule(response, &metadata) 2811 } 2812 output := &DeleteRuleOutput{} 2813 out.Result = output 2814 2815 var buff [1024]byte 2816 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2817 2818 body := io.TeeReader(response.Body, ringBuffer) 2819 decoder := json.NewDecoder(body) 2820 decoder.UseNumber() 2821 var shape interface{} 2822 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2823 var snapshot bytes.Buffer 2824 io.Copy(&snapshot, ringBuffer) 2825 err = &smithy.DeserializationError{ 2826 Err: fmt.Errorf("failed to decode response body, %w", err), 2827 Snapshot: snapshot.Bytes(), 2828 } 2829 return out, metadata, err 2830 } 2831 2832 err = awsAwsjson11_deserializeOpDocumentDeleteRuleOutput(&output, shape) 2833 if err != nil { 2834 var snapshot bytes.Buffer 2835 io.Copy(&snapshot, ringBuffer) 2836 err = &smithy.DeserializationError{ 2837 Err: fmt.Errorf("failed to decode response body, %w", err), 2838 Snapshot: snapshot.Bytes(), 2839 } 2840 return out, metadata, err 2841 } 2842 2843 return out, metadata, err 2844} 2845 2846func awsAwsjson11_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2847 var errorBuffer bytes.Buffer 2848 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2849 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2850 } 2851 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2852 2853 errorCode := "UnknownError" 2854 errorMessage := errorCode 2855 2856 code := response.Header.Get("X-Amzn-ErrorType") 2857 if len(code) != 0 { 2858 errorCode = restjson.SanitizeErrorCode(code) 2859 } 2860 2861 var buff [1024]byte 2862 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2863 2864 body := io.TeeReader(errorBody, ringBuffer) 2865 decoder := json.NewDecoder(body) 2866 decoder.UseNumber() 2867 code, message, err := restjson.GetErrorInfo(decoder) 2868 if err != nil { 2869 var snapshot bytes.Buffer 2870 io.Copy(&snapshot, ringBuffer) 2871 err = &smithy.DeserializationError{ 2872 Err: fmt.Errorf("failed to decode response body, %w", err), 2873 Snapshot: snapshot.Bytes(), 2874 } 2875 return err 2876 } 2877 2878 errorBody.Seek(0, io.SeekStart) 2879 if len(code) != 0 { 2880 errorCode = restjson.SanitizeErrorCode(code) 2881 } 2882 if len(message) != 0 { 2883 errorMessage = message 2884 } 2885 2886 switch { 2887 case strings.EqualFold("WAFInternalErrorException", errorCode): 2888 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 2889 2890 case strings.EqualFold("WAFInvalidAccountException", errorCode): 2891 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 2892 2893 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 2894 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 2895 2896 case strings.EqualFold("WAFNonexistentItemException", errorCode): 2897 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 2898 2899 case strings.EqualFold("WAFReferencedItemException", errorCode): 2900 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 2901 2902 case strings.EqualFold("WAFStaleDataException", errorCode): 2903 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 2904 2905 case strings.EqualFold("WAFTagOperationException", errorCode): 2906 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 2907 2908 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 2909 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 2910 2911 default: 2912 genericError := &smithy.GenericAPIError{ 2913 Code: errorCode, 2914 Message: errorMessage, 2915 } 2916 return genericError 2917 2918 } 2919} 2920 2921type awsAwsjson11_deserializeOpDeleteRuleGroup struct { 2922} 2923 2924func (*awsAwsjson11_deserializeOpDeleteRuleGroup) ID() string { 2925 return "OperationDeserializer" 2926} 2927 2928func (m *awsAwsjson11_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2929 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2930) { 2931 out, metadata, err = next.HandleDeserialize(ctx, in) 2932 if err != nil { 2933 return out, metadata, err 2934 } 2935 2936 response, ok := out.RawResponse.(*smithyhttp.Response) 2937 if !ok { 2938 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2939 } 2940 2941 if response.StatusCode < 200 || response.StatusCode >= 300 { 2942 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response, &metadata) 2943 } 2944 output := &DeleteRuleGroupOutput{} 2945 out.Result = output 2946 2947 var buff [1024]byte 2948 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2949 2950 body := io.TeeReader(response.Body, ringBuffer) 2951 decoder := json.NewDecoder(body) 2952 decoder.UseNumber() 2953 var shape interface{} 2954 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2955 var snapshot bytes.Buffer 2956 io.Copy(&snapshot, ringBuffer) 2957 err = &smithy.DeserializationError{ 2958 Err: fmt.Errorf("failed to decode response body, %w", err), 2959 Snapshot: snapshot.Bytes(), 2960 } 2961 return out, metadata, err 2962 } 2963 2964 err = awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(&output, shape) 2965 if err != nil { 2966 var snapshot bytes.Buffer 2967 io.Copy(&snapshot, ringBuffer) 2968 err = &smithy.DeserializationError{ 2969 Err: fmt.Errorf("failed to decode response body, %w", err), 2970 Snapshot: snapshot.Bytes(), 2971 } 2972 return out, metadata, err 2973 } 2974 2975 return out, metadata, err 2976} 2977 2978func awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2979 var errorBuffer bytes.Buffer 2980 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2981 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2982 } 2983 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2984 2985 errorCode := "UnknownError" 2986 errorMessage := errorCode 2987 2988 code := response.Header.Get("X-Amzn-ErrorType") 2989 if len(code) != 0 { 2990 errorCode = restjson.SanitizeErrorCode(code) 2991 } 2992 2993 var buff [1024]byte 2994 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2995 2996 body := io.TeeReader(errorBody, ringBuffer) 2997 decoder := json.NewDecoder(body) 2998 decoder.UseNumber() 2999 code, message, err := restjson.GetErrorInfo(decoder) 3000 if err != nil { 3001 var snapshot bytes.Buffer 3002 io.Copy(&snapshot, ringBuffer) 3003 err = &smithy.DeserializationError{ 3004 Err: fmt.Errorf("failed to decode response body, %w", err), 3005 Snapshot: snapshot.Bytes(), 3006 } 3007 return err 3008 } 3009 3010 errorBody.Seek(0, io.SeekStart) 3011 if len(code) != 0 { 3012 errorCode = restjson.SanitizeErrorCode(code) 3013 } 3014 if len(message) != 0 { 3015 errorMessage = message 3016 } 3017 3018 switch { 3019 case strings.EqualFold("WAFInternalErrorException", errorCode): 3020 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3021 3022 case strings.EqualFold("WAFInvalidOperationException", errorCode): 3023 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 3024 3025 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 3026 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 3027 3028 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3029 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3030 3031 case strings.EqualFold("WAFReferencedItemException", errorCode): 3032 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 3033 3034 case strings.EqualFold("WAFStaleDataException", errorCode): 3035 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 3036 3037 case strings.EqualFold("WAFTagOperationException", errorCode): 3038 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 3039 3040 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 3041 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 3042 3043 default: 3044 genericError := &smithy.GenericAPIError{ 3045 Code: errorCode, 3046 Message: errorMessage, 3047 } 3048 return genericError 3049 3050 } 3051} 3052 3053type awsAwsjson11_deserializeOpDeleteSizeConstraintSet struct { 3054} 3055 3056func (*awsAwsjson11_deserializeOpDeleteSizeConstraintSet) ID() string { 3057 return "OperationDeserializer" 3058} 3059 3060func (m *awsAwsjson11_deserializeOpDeleteSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3061 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3062) { 3063 out, metadata, err = next.HandleDeserialize(ctx, in) 3064 if err != nil { 3065 return out, metadata, err 3066 } 3067 3068 response, ok := out.RawResponse.(*smithyhttp.Response) 3069 if !ok { 3070 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3071 } 3072 3073 if response.StatusCode < 200 || response.StatusCode >= 300 { 3074 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSizeConstraintSet(response, &metadata) 3075 } 3076 output := &DeleteSizeConstraintSetOutput{} 3077 out.Result = output 3078 3079 var buff [1024]byte 3080 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3081 3082 body := io.TeeReader(response.Body, ringBuffer) 3083 decoder := json.NewDecoder(body) 3084 decoder.UseNumber() 3085 var shape interface{} 3086 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3087 var snapshot bytes.Buffer 3088 io.Copy(&snapshot, ringBuffer) 3089 err = &smithy.DeserializationError{ 3090 Err: fmt.Errorf("failed to decode response body, %w", err), 3091 Snapshot: snapshot.Bytes(), 3092 } 3093 return out, metadata, err 3094 } 3095 3096 err = awsAwsjson11_deserializeOpDocumentDeleteSizeConstraintSetOutput(&output, shape) 3097 if err != nil { 3098 var snapshot bytes.Buffer 3099 io.Copy(&snapshot, ringBuffer) 3100 err = &smithy.DeserializationError{ 3101 Err: fmt.Errorf("failed to decode response body, %w", err), 3102 Snapshot: snapshot.Bytes(), 3103 } 3104 return out, metadata, err 3105 } 3106 3107 return out, metadata, err 3108} 3109 3110func awsAwsjson11_deserializeOpErrorDeleteSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3111 var errorBuffer bytes.Buffer 3112 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3113 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3114 } 3115 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3116 3117 errorCode := "UnknownError" 3118 errorMessage := errorCode 3119 3120 code := response.Header.Get("X-Amzn-ErrorType") 3121 if len(code) != 0 { 3122 errorCode = restjson.SanitizeErrorCode(code) 3123 } 3124 3125 var buff [1024]byte 3126 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3127 3128 body := io.TeeReader(errorBody, ringBuffer) 3129 decoder := json.NewDecoder(body) 3130 decoder.UseNumber() 3131 code, message, err := restjson.GetErrorInfo(decoder) 3132 if err != nil { 3133 var snapshot bytes.Buffer 3134 io.Copy(&snapshot, ringBuffer) 3135 err = &smithy.DeserializationError{ 3136 Err: fmt.Errorf("failed to decode response body, %w", err), 3137 Snapshot: snapshot.Bytes(), 3138 } 3139 return err 3140 } 3141 3142 errorBody.Seek(0, io.SeekStart) 3143 if len(code) != 0 { 3144 errorCode = restjson.SanitizeErrorCode(code) 3145 } 3146 if len(message) != 0 { 3147 errorMessage = message 3148 } 3149 3150 switch { 3151 case strings.EqualFold("WAFInternalErrorException", errorCode): 3152 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3153 3154 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3155 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3156 3157 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 3158 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 3159 3160 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3161 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3162 3163 case strings.EqualFold("WAFReferencedItemException", errorCode): 3164 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 3165 3166 case strings.EqualFold("WAFStaleDataException", errorCode): 3167 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 3168 3169 default: 3170 genericError := &smithy.GenericAPIError{ 3171 Code: errorCode, 3172 Message: errorMessage, 3173 } 3174 return genericError 3175 3176 } 3177} 3178 3179type awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet struct { 3180} 3181 3182func (*awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet) ID() string { 3183 return "OperationDeserializer" 3184} 3185 3186func (m *awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3187 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3188) { 3189 out, metadata, err = next.HandleDeserialize(ctx, in) 3190 if err != nil { 3191 return out, metadata, err 3192 } 3193 3194 response, ok := out.RawResponse.(*smithyhttp.Response) 3195 if !ok { 3196 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3197 } 3198 3199 if response.StatusCode < 200 || response.StatusCode >= 300 { 3200 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSqlInjectionMatchSet(response, &metadata) 3201 } 3202 output := &DeleteSqlInjectionMatchSetOutput{} 3203 out.Result = output 3204 3205 var buff [1024]byte 3206 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3207 3208 body := io.TeeReader(response.Body, ringBuffer) 3209 decoder := json.NewDecoder(body) 3210 decoder.UseNumber() 3211 var shape interface{} 3212 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3213 var snapshot bytes.Buffer 3214 io.Copy(&snapshot, ringBuffer) 3215 err = &smithy.DeserializationError{ 3216 Err: fmt.Errorf("failed to decode response body, %w", err), 3217 Snapshot: snapshot.Bytes(), 3218 } 3219 return out, metadata, err 3220 } 3221 3222 err = awsAwsjson11_deserializeOpDocumentDeleteSqlInjectionMatchSetOutput(&output, shape) 3223 if err != nil { 3224 var snapshot bytes.Buffer 3225 io.Copy(&snapshot, ringBuffer) 3226 err = &smithy.DeserializationError{ 3227 Err: fmt.Errorf("failed to decode response body, %w", err), 3228 Snapshot: snapshot.Bytes(), 3229 } 3230 return out, metadata, err 3231 } 3232 3233 return out, metadata, err 3234} 3235 3236func awsAwsjson11_deserializeOpErrorDeleteSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3237 var errorBuffer bytes.Buffer 3238 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3239 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3240 } 3241 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3242 3243 errorCode := "UnknownError" 3244 errorMessage := errorCode 3245 3246 code := response.Header.Get("X-Amzn-ErrorType") 3247 if len(code) != 0 { 3248 errorCode = restjson.SanitizeErrorCode(code) 3249 } 3250 3251 var buff [1024]byte 3252 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3253 3254 body := io.TeeReader(errorBody, ringBuffer) 3255 decoder := json.NewDecoder(body) 3256 decoder.UseNumber() 3257 code, message, err := restjson.GetErrorInfo(decoder) 3258 if err != nil { 3259 var snapshot bytes.Buffer 3260 io.Copy(&snapshot, ringBuffer) 3261 err = &smithy.DeserializationError{ 3262 Err: fmt.Errorf("failed to decode response body, %w", err), 3263 Snapshot: snapshot.Bytes(), 3264 } 3265 return err 3266 } 3267 3268 errorBody.Seek(0, io.SeekStart) 3269 if len(code) != 0 { 3270 errorCode = restjson.SanitizeErrorCode(code) 3271 } 3272 if len(message) != 0 { 3273 errorMessage = message 3274 } 3275 3276 switch { 3277 case strings.EqualFold("WAFInternalErrorException", errorCode): 3278 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3279 3280 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3281 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3282 3283 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 3284 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 3285 3286 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3287 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3288 3289 case strings.EqualFold("WAFReferencedItemException", errorCode): 3290 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 3291 3292 case strings.EqualFold("WAFStaleDataException", errorCode): 3293 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 3294 3295 default: 3296 genericError := &smithy.GenericAPIError{ 3297 Code: errorCode, 3298 Message: errorMessage, 3299 } 3300 return genericError 3301 3302 } 3303} 3304 3305type awsAwsjson11_deserializeOpDeleteWebACL struct { 3306} 3307 3308func (*awsAwsjson11_deserializeOpDeleteWebACL) ID() string { 3309 return "OperationDeserializer" 3310} 3311 3312func (m *awsAwsjson11_deserializeOpDeleteWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3313 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3314) { 3315 out, metadata, err = next.HandleDeserialize(ctx, in) 3316 if err != nil { 3317 return out, metadata, err 3318 } 3319 3320 response, ok := out.RawResponse.(*smithyhttp.Response) 3321 if !ok { 3322 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3323 } 3324 3325 if response.StatusCode < 200 || response.StatusCode >= 300 { 3326 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteWebACL(response, &metadata) 3327 } 3328 output := &DeleteWebACLOutput{} 3329 out.Result = output 3330 3331 var buff [1024]byte 3332 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3333 3334 body := io.TeeReader(response.Body, ringBuffer) 3335 decoder := json.NewDecoder(body) 3336 decoder.UseNumber() 3337 var shape interface{} 3338 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3339 var snapshot bytes.Buffer 3340 io.Copy(&snapshot, ringBuffer) 3341 err = &smithy.DeserializationError{ 3342 Err: fmt.Errorf("failed to decode response body, %w", err), 3343 Snapshot: snapshot.Bytes(), 3344 } 3345 return out, metadata, err 3346 } 3347 3348 err = awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(&output, shape) 3349 if err != nil { 3350 var snapshot bytes.Buffer 3351 io.Copy(&snapshot, ringBuffer) 3352 err = &smithy.DeserializationError{ 3353 Err: fmt.Errorf("failed to decode response body, %w", err), 3354 Snapshot: snapshot.Bytes(), 3355 } 3356 return out, metadata, err 3357 } 3358 3359 return out, metadata, err 3360} 3361 3362func awsAwsjson11_deserializeOpErrorDeleteWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3363 var errorBuffer bytes.Buffer 3364 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3365 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3366 } 3367 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3368 3369 errorCode := "UnknownError" 3370 errorMessage := errorCode 3371 3372 code := response.Header.Get("X-Amzn-ErrorType") 3373 if len(code) != 0 { 3374 errorCode = restjson.SanitizeErrorCode(code) 3375 } 3376 3377 var buff [1024]byte 3378 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3379 3380 body := io.TeeReader(errorBody, ringBuffer) 3381 decoder := json.NewDecoder(body) 3382 decoder.UseNumber() 3383 code, message, err := restjson.GetErrorInfo(decoder) 3384 if err != nil { 3385 var snapshot bytes.Buffer 3386 io.Copy(&snapshot, ringBuffer) 3387 err = &smithy.DeserializationError{ 3388 Err: fmt.Errorf("failed to decode response body, %w", err), 3389 Snapshot: snapshot.Bytes(), 3390 } 3391 return err 3392 } 3393 3394 errorBody.Seek(0, io.SeekStart) 3395 if len(code) != 0 { 3396 errorCode = restjson.SanitizeErrorCode(code) 3397 } 3398 if len(message) != 0 { 3399 errorMessage = message 3400 } 3401 3402 switch { 3403 case strings.EqualFold("WAFInternalErrorException", errorCode): 3404 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3405 3406 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3407 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3408 3409 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 3410 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 3411 3412 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3413 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3414 3415 case strings.EqualFold("WAFReferencedItemException", errorCode): 3416 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 3417 3418 case strings.EqualFold("WAFStaleDataException", errorCode): 3419 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 3420 3421 case strings.EqualFold("WAFTagOperationException", errorCode): 3422 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 3423 3424 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 3425 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 3426 3427 default: 3428 genericError := &smithy.GenericAPIError{ 3429 Code: errorCode, 3430 Message: errorMessage, 3431 } 3432 return genericError 3433 3434 } 3435} 3436 3437type awsAwsjson11_deserializeOpDeleteXssMatchSet struct { 3438} 3439 3440func (*awsAwsjson11_deserializeOpDeleteXssMatchSet) ID() string { 3441 return "OperationDeserializer" 3442} 3443 3444func (m *awsAwsjson11_deserializeOpDeleteXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3445 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3446) { 3447 out, metadata, err = next.HandleDeserialize(ctx, in) 3448 if err != nil { 3449 return out, metadata, err 3450 } 3451 3452 response, ok := out.RawResponse.(*smithyhttp.Response) 3453 if !ok { 3454 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3455 } 3456 3457 if response.StatusCode < 200 || response.StatusCode >= 300 { 3458 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteXssMatchSet(response, &metadata) 3459 } 3460 output := &DeleteXssMatchSetOutput{} 3461 out.Result = output 3462 3463 var buff [1024]byte 3464 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3465 3466 body := io.TeeReader(response.Body, ringBuffer) 3467 decoder := json.NewDecoder(body) 3468 decoder.UseNumber() 3469 var shape interface{} 3470 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3471 var snapshot bytes.Buffer 3472 io.Copy(&snapshot, ringBuffer) 3473 err = &smithy.DeserializationError{ 3474 Err: fmt.Errorf("failed to decode response body, %w", err), 3475 Snapshot: snapshot.Bytes(), 3476 } 3477 return out, metadata, err 3478 } 3479 3480 err = awsAwsjson11_deserializeOpDocumentDeleteXssMatchSetOutput(&output, shape) 3481 if err != nil { 3482 var snapshot bytes.Buffer 3483 io.Copy(&snapshot, ringBuffer) 3484 err = &smithy.DeserializationError{ 3485 Err: fmt.Errorf("failed to decode response body, %w", err), 3486 Snapshot: snapshot.Bytes(), 3487 } 3488 return out, metadata, err 3489 } 3490 3491 return out, metadata, err 3492} 3493 3494func awsAwsjson11_deserializeOpErrorDeleteXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3495 var errorBuffer bytes.Buffer 3496 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3497 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3498 } 3499 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3500 3501 errorCode := "UnknownError" 3502 errorMessage := errorCode 3503 3504 code := response.Header.Get("X-Amzn-ErrorType") 3505 if len(code) != 0 { 3506 errorCode = restjson.SanitizeErrorCode(code) 3507 } 3508 3509 var buff [1024]byte 3510 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3511 3512 body := io.TeeReader(errorBody, ringBuffer) 3513 decoder := json.NewDecoder(body) 3514 decoder.UseNumber() 3515 code, message, err := restjson.GetErrorInfo(decoder) 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 err 3524 } 3525 3526 errorBody.Seek(0, io.SeekStart) 3527 if len(code) != 0 { 3528 errorCode = restjson.SanitizeErrorCode(code) 3529 } 3530 if len(message) != 0 { 3531 errorMessage = message 3532 } 3533 3534 switch { 3535 case strings.EqualFold("WAFInternalErrorException", errorCode): 3536 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3537 3538 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3539 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3540 3541 case strings.EqualFold("WAFNonEmptyEntityException", errorCode): 3542 return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody) 3543 3544 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3545 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3546 3547 case strings.EqualFold("WAFReferencedItemException", errorCode): 3548 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 3549 3550 case strings.EqualFold("WAFStaleDataException", errorCode): 3551 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 3552 3553 default: 3554 genericError := &smithy.GenericAPIError{ 3555 Code: errorCode, 3556 Message: errorMessage, 3557 } 3558 return genericError 3559 3560 } 3561} 3562 3563type awsAwsjson11_deserializeOpDisassociateWebACL struct { 3564} 3565 3566func (*awsAwsjson11_deserializeOpDisassociateWebACL) ID() string { 3567 return "OperationDeserializer" 3568} 3569 3570func (m *awsAwsjson11_deserializeOpDisassociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3571 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3572) { 3573 out, metadata, err = next.HandleDeserialize(ctx, in) 3574 if err != nil { 3575 return out, metadata, err 3576 } 3577 3578 response, ok := out.RawResponse.(*smithyhttp.Response) 3579 if !ok { 3580 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3581 } 3582 3583 if response.StatusCode < 200 || response.StatusCode >= 300 { 3584 return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateWebACL(response, &metadata) 3585 } 3586 output := &DisassociateWebACLOutput{} 3587 out.Result = output 3588 3589 var buff [1024]byte 3590 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3591 3592 body := io.TeeReader(response.Body, ringBuffer) 3593 decoder := json.NewDecoder(body) 3594 decoder.UseNumber() 3595 var shape interface{} 3596 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3597 var snapshot bytes.Buffer 3598 io.Copy(&snapshot, ringBuffer) 3599 err = &smithy.DeserializationError{ 3600 Err: fmt.Errorf("failed to decode response body, %w", err), 3601 Snapshot: snapshot.Bytes(), 3602 } 3603 return out, metadata, err 3604 } 3605 3606 err = awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(&output, shape) 3607 if err != nil { 3608 var snapshot bytes.Buffer 3609 io.Copy(&snapshot, ringBuffer) 3610 err = &smithy.DeserializationError{ 3611 Err: fmt.Errorf("failed to decode response body, %w", err), 3612 Snapshot: snapshot.Bytes(), 3613 } 3614 return out, metadata, err 3615 } 3616 3617 return out, metadata, err 3618} 3619 3620func awsAwsjson11_deserializeOpErrorDisassociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3621 var errorBuffer bytes.Buffer 3622 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3623 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3624 } 3625 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3626 3627 errorCode := "UnknownError" 3628 errorMessage := errorCode 3629 3630 code := response.Header.Get("X-Amzn-ErrorType") 3631 if len(code) != 0 { 3632 errorCode = restjson.SanitizeErrorCode(code) 3633 } 3634 3635 var buff [1024]byte 3636 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3637 3638 body := io.TeeReader(errorBody, ringBuffer) 3639 decoder := json.NewDecoder(body) 3640 decoder.UseNumber() 3641 code, message, err := restjson.GetErrorInfo(decoder) 3642 if err != nil { 3643 var snapshot bytes.Buffer 3644 io.Copy(&snapshot, ringBuffer) 3645 err = &smithy.DeserializationError{ 3646 Err: fmt.Errorf("failed to decode response body, %w", err), 3647 Snapshot: snapshot.Bytes(), 3648 } 3649 return err 3650 } 3651 3652 errorBody.Seek(0, io.SeekStart) 3653 if len(code) != 0 { 3654 errorCode = restjson.SanitizeErrorCode(code) 3655 } 3656 if len(message) != 0 { 3657 errorMessage = message 3658 } 3659 3660 switch { 3661 case strings.EqualFold("WAFInternalErrorException", errorCode): 3662 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3663 3664 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3665 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3666 3667 case strings.EqualFold("WAFInvalidParameterException", errorCode): 3668 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 3669 3670 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3671 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3672 3673 default: 3674 genericError := &smithy.GenericAPIError{ 3675 Code: errorCode, 3676 Message: errorMessage, 3677 } 3678 return genericError 3679 3680 } 3681} 3682 3683type awsAwsjson11_deserializeOpGetByteMatchSet struct { 3684} 3685 3686func (*awsAwsjson11_deserializeOpGetByteMatchSet) ID() string { 3687 return "OperationDeserializer" 3688} 3689 3690func (m *awsAwsjson11_deserializeOpGetByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3691 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3692) { 3693 out, metadata, err = next.HandleDeserialize(ctx, in) 3694 if err != nil { 3695 return out, metadata, err 3696 } 3697 3698 response, ok := out.RawResponse.(*smithyhttp.Response) 3699 if !ok { 3700 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3701 } 3702 3703 if response.StatusCode < 200 || response.StatusCode >= 300 { 3704 return out, metadata, awsAwsjson11_deserializeOpErrorGetByteMatchSet(response, &metadata) 3705 } 3706 output := &GetByteMatchSetOutput{} 3707 out.Result = output 3708 3709 var buff [1024]byte 3710 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3711 3712 body := io.TeeReader(response.Body, ringBuffer) 3713 decoder := json.NewDecoder(body) 3714 decoder.UseNumber() 3715 var shape interface{} 3716 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3717 var snapshot bytes.Buffer 3718 io.Copy(&snapshot, ringBuffer) 3719 err = &smithy.DeserializationError{ 3720 Err: fmt.Errorf("failed to decode response body, %w", err), 3721 Snapshot: snapshot.Bytes(), 3722 } 3723 return out, metadata, err 3724 } 3725 3726 err = awsAwsjson11_deserializeOpDocumentGetByteMatchSetOutput(&output, shape) 3727 if err != nil { 3728 var snapshot bytes.Buffer 3729 io.Copy(&snapshot, ringBuffer) 3730 err = &smithy.DeserializationError{ 3731 Err: fmt.Errorf("failed to decode response body, %w", err), 3732 Snapshot: snapshot.Bytes(), 3733 } 3734 return out, metadata, err 3735 } 3736 3737 return out, metadata, err 3738} 3739 3740func awsAwsjson11_deserializeOpErrorGetByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3741 var errorBuffer bytes.Buffer 3742 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3743 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3744 } 3745 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3746 3747 errorCode := "UnknownError" 3748 errorMessage := errorCode 3749 3750 code := response.Header.Get("X-Amzn-ErrorType") 3751 if len(code) != 0 { 3752 errorCode = restjson.SanitizeErrorCode(code) 3753 } 3754 3755 var buff [1024]byte 3756 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3757 3758 body := io.TeeReader(errorBody, ringBuffer) 3759 decoder := json.NewDecoder(body) 3760 decoder.UseNumber() 3761 code, message, err := restjson.GetErrorInfo(decoder) 3762 if err != nil { 3763 var snapshot bytes.Buffer 3764 io.Copy(&snapshot, ringBuffer) 3765 err = &smithy.DeserializationError{ 3766 Err: fmt.Errorf("failed to decode response body, %w", err), 3767 Snapshot: snapshot.Bytes(), 3768 } 3769 return err 3770 } 3771 3772 errorBody.Seek(0, io.SeekStart) 3773 if len(code) != 0 { 3774 errorCode = restjson.SanitizeErrorCode(code) 3775 } 3776 if len(message) != 0 { 3777 errorMessage = message 3778 } 3779 3780 switch { 3781 case strings.EqualFold("WAFInternalErrorException", errorCode): 3782 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3783 3784 case strings.EqualFold("WAFInvalidAccountException", errorCode): 3785 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 3786 3787 case strings.EqualFold("WAFNonexistentItemException", errorCode): 3788 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 3789 3790 default: 3791 genericError := &smithy.GenericAPIError{ 3792 Code: errorCode, 3793 Message: errorMessage, 3794 } 3795 return genericError 3796 3797 } 3798} 3799 3800type awsAwsjson11_deserializeOpGetChangeToken struct { 3801} 3802 3803func (*awsAwsjson11_deserializeOpGetChangeToken) ID() string { 3804 return "OperationDeserializer" 3805} 3806 3807func (m *awsAwsjson11_deserializeOpGetChangeToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3808 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3809) { 3810 out, metadata, err = next.HandleDeserialize(ctx, in) 3811 if err != nil { 3812 return out, metadata, err 3813 } 3814 3815 response, ok := out.RawResponse.(*smithyhttp.Response) 3816 if !ok { 3817 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3818 } 3819 3820 if response.StatusCode < 200 || response.StatusCode >= 300 { 3821 return out, metadata, awsAwsjson11_deserializeOpErrorGetChangeToken(response, &metadata) 3822 } 3823 output := &GetChangeTokenOutput{} 3824 out.Result = output 3825 3826 var buff [1024]byte 3827 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3828 3829 body := io.TeeReader(response.Body, ringBuffer) 3830 decoder := json.NewDecoder(body) 3831 decoder.UseNumber() 3832 var shape interface{} 3833 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3834 var snapshot bytes.Buffer 3835 io.Copy(&snapshot, ringBuffer) 3836 err = &smithy.DeserializationError{ 3837 Err: fmt.Errorf("failed to decode response body, %w", err), 3838 Snapshot: snapshot.Bytes(), 3839 } 3840 return out, metadata, err 3841 } 3842 3843 err = awsAwsjson11_deserializeOpDocumentGetChangeTokenOutput(&output, shape) 3844 if err != nil { 3845 var snapshot bytes.Buffer 3846 io.Copy(&snapshot, ringBuffer) 3847 err = &smithy.DeserializationError{ 3848 Err: fmt.Errorf("failed to decode response body, %w", err), 3849 Snapshot: snapshot.Bytes(), 3850 } 3851 return out, metadata, err 3852 } 3853 3854 return out, metadata, err 3855} 3856 3857func awsAwsjson11_deserializeOpErrorGetChangeToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3858 var errorBuffer bytes.Buffer 3859 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3860 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3861 } 3862 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3863 3864 errorCode := "UnknownError" 3865 errorMessage := errorCode 3866 3867 code := response.Header.Get("X-Amzn-ErrorType") 3868 if len(code) != 0 { 3869 errorCode = restjson.SanitizeErrorCode(code) 3870 } 3871 3872 var buff [1024]byte 3873 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3874 3875 body := io.TeeReader(errorBody, ringBuffer) 3876 decoder := json.NewDecoder(body) 3877 decoder.UseNumber() 3878 code, message, err := restjson.GetErrorInfo(decoder) 3879 if err != nil { 3880 var snapshot bytes.Buffer 3881 io.Copy(&snapshot, ringBuffer) 3882 err = &smithy.DeserializationError{ 3883 Err: fmt.Errorf("failed to decode response body, %w", err), 3884 Snapshot: snapshot.Bytes(), 3885 } 3886 return err 3887 } 3888 3889 errorBody.Seek(0, io.SeekStart) 3890 if len(code) != 0 { 3891 errorCode = restjson.SanitizeErrorCode(code) 3892 } 3893 if len(message) != 0 { 3894 errorMessage = message 3895 } 3896 3897 switch { 3898 case strings.EqualFold("WAFInternalErrorException", errorCode): 3899 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 3900 3901 default: 3902 genericError := &smithy.GenericAPIError{ 3903 Code: errorCode, 3904 Message: errorMessage, 3905 } 3906 return genericError 3907 3908 } 3909} 3910 3911type awsAwsjson11_deserializeOpGetChangeTokenStatus struct { 3912} 3913 3914func (*awsAwsjson11_deserializeOpGetChangeTokenStatus) ID() string { 3915 return "OperationDeserializer" 3916} 3917 3918func (m *awsAwsjson11_deserializeOpGetChangeTokenStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3919 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3920) { 3921 out, metadata, err = next.HandleDeserialize(ctx, in) 3922 if err != nil { 3923 return out, metadata, err 3924 } 3925 3926 response, ok := out.RawResponse.(*smithyhttp.Response) 3927 if !ok { 3928 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3929 } 3930 3931 if response.StatusCode < 200 || response.StatusCode >= 300 { 3932 return out, metadata, awsAwsjson11_deserializeOpErrorGetChangeTokenStatus(response, &metadata) 3933 } 3934 output := &GetChangeTokenStatusOutput{} 3935 out.Result = output 3936 3937 var buff [1024]byte 3938 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3939 3940 body := io.TeeReader(response.Body, ringBuffer) 3941 decoder := json.NewDecoder(body) 3942 decoder.UseNumber() 3943 var shape interface{} 3944 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3945 var snapshot bytes.Buffer 3946 io.Copy(&snapshot, ringBuffer) 3947 err = &smithy.DeserializationError{ 3948 Err: fmt.Errorf("failed to decode response body, %w", err), 3949 Snapshot: snapshot.Bytes(), 3950 } 3951 return out, metadata, err 3952 } 3953 3954 err = awsAwsjson11_deserializeOpDocumentGetChangeTokenStatusOutput(&output, shape) 3955 if err != nil { 3956 var snapshot bytes.Buffer 3957 io.Copy(&snapshot, ringBuffer) 3958 err = &smithy.DeserializationError{ 3959 Err: fmt.Errorf("failed to decode response body, %w", err), 3960 Snapshot: snapshot.Bytes(), 3961 } 3962 return out, metadata, err 3963 } 3964 3965 return out, metadata, err 3966} 3967 3968func awsAwsjson11_deserializeOpErrorGetChangeTokenStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3969 var errorBuffer bytes.Buffer 3970 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3971 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3972 } 3973 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3974 3975 errorCode := "UnknownError" 3976 errorMessage := errorCode 3977 3978 code := response.Header.Get("X-Amzn-ErrorType") 3979 if len(code) != 0 { 3980 errorCode = restjson.SanitizeErrorCode(code) 3981 } 3982 3983 var buff [1024]byte 3984 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3985 3986 body := io.TeeReader(errorBody, ringBuffer) 3987 decoder := json.NewDecoder(body) 3988 decoder.UseNumber() 3989 code, message, err := restjson.GetErrorInfo(decoder) 3990 if err != nil { 3991 var snapshot bytes.Buffer 3992 io.Copy(&snapshot, ringBuffer) 3993 err = &smithy.DeserializationError{ 3994 Err: fmt.Errorf("failed to decode response body, %w", err), 3995 Snapshot: snapshot.Bytes(), 3996 } 3997 return err 3998 } 3999 4000 errorBody.Seek(0, io.SeekStart) 4001 if len(code) != 0 { 4002 errorCode = restjson.SanitizeErrorCode(code) 4003 } 4004 if len(message) != 0 { 4005 errorMessage = message 4006 } 4007 4008 switch { 4009 case strings.EqualFold("WAFInternalErrorException", errorCode): 4010 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4011 4012 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4013 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4014 4015 default: 4016 genericError := &smithy.GenericAPIError{ 4017 Code: errorCode, 4018 Message: errorMessage, 4019 } 4020 return genericError 4021 4022 } 4023} 4024 4025type awsAwsjson11_deserializeOpGetGeoMatchSet struct { 4026} 4027 4028func (*awsAwsjson11_deserializeOpGetGeoMatchSet) ID() string { 4029 return "OperationDeserializer" 4030} 4031 4032func (m *awsAwsjson11_deserializeOpGetGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4033 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4034) { 4035 out, metadata, err = next.HandleDeserialize(ctx, in) 4036 if err != nil { 4037 return out, metadata, err 4038 } 4039 4040 response, ok := out.RawResponse.(*smithyhttp.Response) 4041 if !ok { 4042 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4043 } 4044 4045 if response.StatusCode < 200 || response.StatusCode >= 300 { 4046 return out, metadata, awsAwsjson11_deserializeOpErrorGetGeoMatchSet(response, &metadata) 4047 } 4048 output := &GetGeoMatchSetOutput{} 4049 out.Result = output 4050 4051 var buff [1024]byte 4052 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4053 4054 body := io.TeeReader(response.Body, ringBuffer) 4055 decoder := json.NewDecoder(body) 4056 decoder.UseNumber() 4057 var shape interface{} 4058 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4059 var snapshot bytes.Buffer 4060 io.Copy(&snapshot, ringBuffer) 4061 err = &smithy.DeserializationError{ 4062 Err: fmt.Errorf("failed to decode response body, %w", err), 4063 Snapshot: snapshot.Bytes(), 4064 } 4065 return out, metadata, err 4066 } 4067 4068 err = awsAwsjson11_deserializeOpDocumentGetGeoMatchSetOutput(&output, shape) 4069 if err != nil { 4070 var snapshot bytes.Buffer 4071 io.Copy(&snapshot, ringBuffer) 4072 err = &smithy.DeserializationError{ 4073 Err: fmt.Errorf("failed to decode response body, %w", err), 4074 Snapshot: snapshot.Bytes(), 4075 } 4076 return out, metadata, err 4077 } 4078 4079 return out, metadata, err 4080} 4081 4082func awsAwsjson11_deserializeOpErrorGetGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4083 var errorBuffer bytes.Buffer 4084 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4085 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4086 } 4087 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4088 4089 errorCode := "UnknownError" 4090 errorMessage := errorCode 4091 4092 code := response.Header.Get("X-Amzn-ErrorType") 4093 if len(code) != 0 { 4094 errorCode = restjson.SanitizeErrorCode(code) 4095 } 4096 4097 var buff [1024]byte 4098 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4099 4100 body := io.TeeReader(errorBody, ringBuffer) 4101 decoder := json.NewDecoder(body) 4102 decoder.UseNumber() 4103 code, message, err := restjson.GetErrorInfo(decoder) 4104 if err != nil { 4105 var snapshot bytes.Buffer 4106 io.Copy(&snapshot, ringBuffer) 4107 err = &smithy.DeserializationError{ 4108 Err: fmt.Errorf("failed to decode response body, %w", err), 4109 Snapshot: snapshot.Bytes(), 4110 } 4111 return err 4112 } 4113 4114 errorBody.Seek(0, io.SeekStart) 4115 if len(code) != 0 { 4116 errorCode = restjson.SanitizeErrorCode(code) 4117 } 4118 if len(message) != 0 { 4119 errorMessage = message 4120 } 4121 4122 switch { 4123 case strings.EqualFold("WAFInternalErrorException", errorCode): 4124 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4125 4126 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4127 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4128 4129 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4130 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4131 4132 default: 4133 genericError := &smithy.GenericAPIError{ 4134 Code: errorCode, 4135 Message: errorMessage, 4136 } 4137 return genericError 4138 4139 } 4140} 4141 4142type awsAwsjson11_deserializeOpGetIPSet struct { 4143} 4144 4145func (*awsAwsjson11_deserializeOpGetIPSet) ID() string { 4146 return "OperationDeserializer" 4147} 4148 4149func (m *awsAwsjson11_deserializeOpGetIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4150 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4151) { 4152 out, metadata, err = next.HandleDeserialize(ctx, in) 4153 if err != nil { 4154 return out, metadata, err 4155 } 4156 4157 response, ok := out.RawResponse.(*smithyhttp.Response) 4158 if !ok { 4159 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4160 } 4161 4162 if response.StatusCode < 200 || response.StatusCode >= 300 { 4163 return out, metadata, awsAwsjson11_deserializeOpErrorGetIPSet(response, &metadata) 4164 } 4165 output := &GetIPSetOutput{} 4166 out.Result = output 4167 4168 var buff [1024]byte 4169 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4170 4171 body := io.TeeReader(response.Body, ringBuffer) 4172 decoder := json.NewDecoder(body) 4173 decoder.UseNumber() 4174 var shape interface{} 4175 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4176 var snapshot bytes.Buffer 4177 io.Copy(&snapshot, ringBuffer) 4178 err = &smithy.DeserializationError{ 4179 Err: fmt.Errorf("failed to decode response body, %w", err), 4180 Snapshot: snapshot.Bytes(), 4181 } 4182 return out, metadata, err 4183 } 4184 4185 err = awsAwsjson11_deserializeOpDocumentGetIPSetOutput(&output, shape) 4186 if err != nil { 4187 var snapshot bytes.Buffer 4188 io.Copy(&snapshot, ringBuffer) 4189 err = &smithy.DeserializationError{ 4190 Err: fmt.Errorf("failed to decode response body, %w", err), 4191 Snapshot: snapshot.Bytes(), 4192 } 4193 return out, metadata, err 4194 } 4195 4196 return out, metadata, err 4197} 4198 4199func awsAwsjson11_deserializeOpErrorGetIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4200 var errorBuffer bytes.Buffer 4201 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4202 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4203 } 4204 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4205 4206 errorCode := "UnknownError" 4207 errorMessage := errorCode 4208 4209 code := response.Header.Get("X-Amzn-ErrorType") 4210 if len(code) != 0 { 4211 errorCode = restjson.SanitizeErrorCode(code) 4212 } 4213 4214 var buff [1024]byte 4215 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4216 4217 body := io.TeeReader(errorBody, ringBuffer) 4218 decoder := json.NewDecoder(body) 4219 decoder.UseNumber() 4220 code, message, err := restjson.GetErrorInfo(decoder) 4221 if err != nil { 4222 var snapshot bytes.Buffer 4223 io.Copy(&snapshot, ringBuffer) 4224 err = &smithy.DeserializationError{ 4225 Err: fmt.Errorf("failed to decode response body, %w", err), 4226 Snapshot: snapshot.Bytes(), 4227 } 4228 return err 4229 } 4230 4231 errorBody.Seek(0, io.SeekStart) 4232 if len(code) != 0 { 4233 errorCode = restjson.SanitizeErrorCode(code) 4234 } 4235 if len(message) != 0 { 4236 errorMessage = message 4237 } 4238 4239 switch { 4240 case strings.EqualFold("WAFInternalErrorException", errorCode): 4241 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4242 4243 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4244 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4245 4246 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4247 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4248 4249 default: 4250 genericError := &smithy.GenericAPIError{ 4251 Code: errorCode, 4252 Message: errorMessage, 4253 } 4254 return genericError 4255 4256 } 4257} 4258 4259type awsAwsjson11_deserializeOpGetLoggingConfiguration struct { 4260} 4261 4262func (*awsAwsjson11_deserializeOpGetLoggingConfiguration) ID() string { 4263 return "OperationDeserializer" 4264} 4265 4266func (m *awsAwsjson11_deserializeOpGetLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4267 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4268) { 4269 out, metadata, err = next.HandleDeserialize(ctx, in) 4270 if err != nil { 4271 return out, metadata, err 4272 } 4273 4274 response, ok := out.RawResponse.(*smithyhttp.Response) 4275 if !ok { 4276 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4277 } 4278 4279 if response.StatusCode < 200 || response.StatusCode >= 300 { 4280 return out, metadata, awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response, &metadata) 4281 } 4282 output := &GetLoggingConfigurationOutput{} 4283 out.Result = output 4284 4285 var buff [1024]byte 4286 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4287 4288 body := io.TeeReader(response.Body, ringBuffer) 4289 decoder := json.NewDecoder(body) 4290 decoder.UseNumber() 4291 var shape interface{} 4292 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4293 var snapshot bytes.Buffer 4294 io.Copy(&snapshot, ringBuffer) 4295 err = &smithy.DeserializationError{ 4296 Err: fmt.Errorf("failed to decode response body, %w", err), 4297 Snapshot: snapshot.Bytes(), 4298 } 4299 return out, metadata, err 4300 } 4301 4302 err = awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(&output, shape) 4303 if err != nil { 4304 var snapshot bytes.Buffer 4305 io.Copy(&snapshot, ringBuffer) 4306 err = &smithy.DeserializationError{ 4307 Err: fmt.Errorf("failed to decode response body, %w", err), 4308 Snapshot: snapshot.Bytes(), 4309 } 4310 return out, metadata, err 4311 } 4312 4313 return out, metadata, err 4314} 4315 4316func awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4317 var errorBuffer bytes.Buffer 4318 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4319 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4320 } 4321 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4322 4323 errorCode := "UnknownError" 4324 errorMessage := errorCode 4325 4326 code := response.Header.Get("X-Amzn-ErrorType") 4327 if len(code) != 0 { 4328 errorCode = restjson.SanitizeErrorCode(code) 4329 } 4330 4331 var buff [1024]byte 4332 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4333 4334 body := io.TeeReader(errorBody, ringBuffer) 4335 decoder := json.NewDecoder(body) 4336 decoder.UseNumber() 4337 code, message, err := restjson.GetErrorInfo(decoder) 4338 if err != nil { 4339 var snapshot bytes.Buffer 4340 io.Copy(&snapshot, ringBuffer) 4341 err = &smithy.DeserializationError{ 4342 Err: fmt.Errorf("failed to decode response body, %w", err), 4343 Snapshot: snapshot.Bytes(), 4344 } 4345 return err 4346 } 4347 4348 errorBody.Seek(0, io.SeekStart) 4349 if len(code) != 0 { 4350 errorCode = restjson.SanitizeErrorCode(code) 4351 } 4352 if len(message) != 0 { 4353 errorMessage = message 4354 } 4355 4356 switch { 4357 case strings.EqualFold("WAFInternalErrorException", errorCode): 4358 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4359 4360 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4361 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4362 4363 default: 4364 genericError := &smithy.GenericAPIError{ 4365 Code: errorCode, 4366 Message: errorMessage, 4367 } 4368 return genericError 4369 4370 } 4371} 4372 4373type awsAwsjson11_deserializeOpGetPermissionPolicy struct { 4374} 4375 4376func (*awsAwsjson11_deserializeOpGetPermissionPolicy) ID() string { 4377 return "OperationDeserializer" 4378} 4379 4380func (m *awsAwsjson11_deserializeOpGetPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4381 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4382) { 4383 out, metadata, err = next.HandleDeserialize(ctx, in) 4384 if err != nil { 4385 return out, metadata, err 4386 } 4387 4388 response, ok := out.RawResponse.(*smithyhttp.Response) 4389 if !ok { 4390 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4391 } 4392 4393 if response.StatusCode < 200 || response.StatusCode >= 300 { 4394 return out, metadata, awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response, &metadata) 4395 } 4396 output := &GetPermissionPolicyOutput{} 4397 out.Result = output 4398 4399 var buff [1024]byte 4400 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4401 4402 body := io.TeeReader(response.Body, ringBuffer) 4403 decoder := json.NewDecoder(body) 4404 decoder.UseNumber() 4405 var shape interface{} 4406 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4407 var snapshot bytes.Buffer 4408 io.Copy(&snapshot, ringBuffer) 4409 err = &smithy.DeserializationError{ 4410 Err: fmt.Errorf("failed to decode response body, %w", err), 4411 Snapshot: snapshot.Bytes(), 4412 } 4413 return out, metadata, err 4414 } 4415 4416 err = awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(&output, shape) 4417 if err != nil { 4418 var snapshot bytes.Buffer 4419 io.Copy(&snapshot, ringBuffer) 4420 err = &smithy.DeserializationError{ 4421 Err: fmt.Errorf("failed to decode response body, %w", err), 4422 Snapshot: snapshot.Bytes(), 4423 } 4424 return out, metadata, err 4425 } 4426 4427 return out, metadata, err 4428} 4429 4430func awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4431 var errorBuffer bytes.Buffer 4432 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4433 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4434 } 4435 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4436 4437 errorCode := "UnknownError" 4438 errorMessage := errorCode 4439 4440 code := response.Header.Get("X-Amzn-ErrorType") 4441 if len(code) != 0 { 4442 errorCode = restjson.SanitizeErrorCode(code) 4443 } 4444 4445 var buff [1024]byte 4446 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4447 4448 body := io.TeeReader(errorBody, ringBuffer) 4449 decoder := json.NewDecoder(body) 4450 decoder.UseNumber() 4451 code, message, err := restjson.GetErrorInfo(decoder) 4452 if err != nil { 4453 var snapshot bytes.Buffer 4454 io.Copy(&snapshot, ringBuffer) 4455 err = &smithy.DeserializationError{ 4456 Err: fmt.Errorf("failed to decode response body, %w", err), 4457 Snapshot: snapshot.Bytes(), 4458 } 4459 return err 4460 } 4461 4462 errorBody.Seek(0, io.SeekStart) 4463 if len(code) != 0 { 4464 errorCode = restjson.SanitizeErrorCode(code) 4465 } 4466 if len(message) != 0 { 4467 errorMessage = message 4468 } 4469 4470 switch { 4471 case strings.EqualFold("WAFInternalErrorException", errorCode): 4472 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4473 4474 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4475 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4476 4477 default: 4478 genericError := &smithy.GenericAPIError{ 4479 Code: errorCode, 4480 Message: errorMessage, 4481 } 4482 return genericError 4483 4484 } 4485} 4486 4487type awsAwsjson11_deserializeOpGetRateBasedRule struct { 4488} 4489 4490func (*awsAwsjson11_deserializeOpGetRateBasedRule) ID() string { 4491 return "OperationDeserializer" 4492} 4493 4494func (m *awsAwsjson11_deserializeOpGetRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4495 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4496) { 4497 out, metadata, err = next.HandleDeserialize(ctx, in) 4498 if err != nil { 4499 return out, metadata, err 4500 } 4501 4502 response, ok := out.RawResponse.(*smithyhttp.Response) 4503 if !ok { 4504 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4505 } 4506 4507 if response.StatusCode < 200 || response.StatusCode >= 300 { 4508 return out, metadata, awsAwsjson11_deserializeOpErrorGetRateBasedRule(response, &metadata) 4509 } 4510 output := &GetRateBasedRuleOutput{} 4511 out.Result = output 4512 4513 var buff [1024]byte 4514 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4515 4516 body := io.TeeReader(response.Body, ringBuffer) 4517 decoder := json.NewDecoder(body) 4518 decoder.UseNumber() 4519 var shape interface{} 4520 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4521 var snapshot bytes.Buffer 4522 io.Copy(&snapshot, ringBuffer) 4523 err = &smithy.DeserializationError{ 4524 Err: fmt.Errorf("failed to decode response body, %w", err), 4525 Snapshot: snapshot.Bytes(), 4526 } 4527 return out, metadata, err 4528 } 4529 4530 err = awsAwsjson11_deserializeOpDocumentGetRateBasedRuleOutput(&output, shape) 4531 if err != nil { 4532 var snapshot bytes.Buffer 4533 io.Copy(&snapshot, ringBuffer) 4534 err = &smithy.DeserializationError{ 4535 Err: fmt.Errorf("failed to decode response body, %w", err), 4536 Snapshot: snapshot.Bytes(), 4537 } 4538 return out, metadata, err 4539 } 4540 4541 return out, metadata, err 4542} 4543 4544func awsAwsjson11_deserializeOpErrorGetRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4545 var errorBuffer bytes.Buffer 4546 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4547 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4548 } 4549 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4550 4551 errorCode := "UnknownError" 4552 errorMessage := errorCode 4553 4554 code := response.Header.Get("X-Amzn-ErrorType") 4555 if len(code) != 0 { 4556 errorCode = restjson.SanitizeErrorCode(code) 4557 } 4558 4559 var buff [1024]byte 4560 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4561 4562 body := io.TeeReader(errorBody, ringBuffer) 4563 decoder := json.NewDecoder(body) 4564 decoder.UseNumber() 4565 code, message, err := restjson.GetErrorInfo(decoder) 4566 if err != nil { 4567 var snapshot bytes.Buffer 4568 io.Copy(&snapshot, ringBuffer) 4569 err = &smithy.DeserializationError{ 4570 Err: fmt.Errorf("failed to decode response body, %w", err), 4571 Snapshot: snapshot.Bytes(), 4572 } 4573 return err 4574 } 4575 4576 errorBody.Seek(0, io.SeekStart) 4577 if len(code) != 0 { 4578 errorCode = restjson.SanitizeErrorCode(code) 4579 } 4580 if len(message) != 0 { 4581 errorMessage = message 4582 } 4583 4584 switch { 4585 case strings.EqualFold("WAFInternalErrorException", errorCode): 4586 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4587 4588 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4589 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4590 4591 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4592 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4593 4594 default: 4595 genericError := &smithy.GenericAPIError{ 4596 Code: errorCode, 4597 Message: errorMessage, 4598 } 4599 return genericError 4600 4601 } 4602} 4603 4604type awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys struct { 4605} 4606 4607func (*awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys) ID() string { 4608 return "OperationDeserializer" 4609} 4610 4611func (m *awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4612 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4613) { 4614 out, metadata, err = next.HandleDeserialize(ctx, in) 4615 if err != nil { 4616 return out, metadata, err 4617 } 4618 4619 response, ok := out.RawResponse.(*smithyhttp.Response) 4620 if !ok { 4621 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4622 } 4623 4624 if response.StatusCode < 200 || response.StatusCode >= 300 { 4625 return out, metadata, awsAwsjson11_deserializeOpErrorGetRateBasedRuleManagedKeys(response, &metadata) 4626 } 4627 output := &GetRateBasedRuleManagedKeysOutput{} 4628 out.Result = output 4629 4630 var buff [1024]byte 4631 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4632 4633 body := io.TeeReader(response.Body, ringBuffer) 4634 decoder := json.NewDecoder(body) 4635 decoder.UseNumber() 4636 var shape interface{} 4637 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4638 var snapshot bytes.Buffer 4639 io.Copy(&snapshot, ringBuffer) 4640 err = &smithy.DeserializationError{ 4641 Err: fmt.Errorf("failed to decode response body, %w", err), 4642 Snapshot: snapshot.Bytes(), 4643 } 4644 return out, metadata, err 4645 } 4646 4647 err = awsAwsjson11_deserializeOpDocumentGetRateBasedRuleManagedKeysOutput(&output, shape) 4648 if err != nil { 4649 var snapshot bytes.Buffer 4650 io.Copy(&snapshot, ringBuffer) 4651 err = &smithy.DeserializationError{ 4652 Err: fmt.Errorf("failed to decode response body, %w", err), 4653 Snapshot: snapshot.Bytes(), 4654 } 4655 return out, metadata, err 4656 } 4657 4658 return out, metadata, err 4659} 4660 4661func awsAwsjson11_deserializeOpErrorGetRateBasedRuleManagedKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4662 var errorBuffer bytes.Buffer 4663 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4664 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4665 } 4666 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4667 4668 errorCode := "UnknownError" 4669 errorMessage := errorCode 4670 4671 code := response.Header.Get("X-Amzn-ErrorType") 4672 if len(code) != 0 { 4673 errorCode = restjson.SanitizeErrorCode(code) 4674 } 4675 4676 var buff [1024]byte 4677 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4678 4679 body := io.TeeReader(errorBody, ringBuffer) 4680 decoder := json.NewDecoder(body) 4681 decoder.UseNumber() 4682 code, message, err := restjson.GetErrorInfo(decoder) 4683 if err != nil { 4684 var snapshot bytes.Buffer 4685 io.Copy(&snapshot, ringBuffer) 4686 err = &smithy.DeserializationError{ 4687 Err: fmt.Errorf("failed to decode response body, %w", err), 4688 Snapshot: snapshot.Bytes(), 4689 } 4690 return err 4691 } 4692 4693 errorBody.Seek(0, io.SeekStart) 4694 if len(code) != 0 { 4695 errorCode = restjson.SanitizeErrorCode(code) 4696 } 4697 if len(message) != 0 { 4698 errorMessage = message 4699 } 4700 4701 switch { 4702 case strings.EqualFold("WAFInternalErrorException", errorCode): 4703 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4704 4705 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4706 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4707 4708 case strings.EqualFold("WAFInvalidParameterException", errorCode): 4709 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 4710 4711 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4712 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4713 4714 default: 4715 genericError := &smithy.GenericAPIError{ 4716 Code: errorCode, 4717 Message: errorMessage, 4718 } 4719 return genericError 4720 4721 } 4722} 4723 4724type awsAwsjson11_deserializeOpGetRegexMatchSet struct { 4725} 4726 4727func (*awsAwsjson11_deserializeOpGetRegexMatchSet) ID() string { 4728 return "OperationDeserializer" 4729} 4730 4731func (m *awsAwsjson11_deserializeOpGetRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4732 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4733) { 4734 out, metadata, err = next.HandleDeserialize(ctx, in) 4735 if err != nil { 4736 return out, metadata, err 4737 } 4738 4739 response, ok := out.RawResponse.(*smithyhttp.Response) 4740 if !ok { 4741 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4742 } 4743 4744 if response.StatusCode < 200 || response.StatusCode >= 300 { 4745 return out, metadata, awsAwsjson11_deserializeOpErrorGetRegexMatchSet(response, &metadata) 4746 } 4747 output := &GetRegexMatchSetOutput{} 4748 out.Result = output 4749 4750 var buff [1024]byte 4751 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4752 4753 body := io.TeeReader(response.Body, ringBuffer) 4754 decoder := json.NewDecoder(body) 4755 decoder.UseNumber() 4756 var shape interface{} 4757 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4758 var snapshot bytes.Buffer 4759 io.Copy(&snapshot, ringBuffer) 4760 err = &smithy.DeserializationError{ 4761 Err: fmt.Errorf("failed to decode response body, %w", err), 4762 Snapshot: snapshot.Bytes(), 4763 } 4764 return out, metadata, err 4765 } 4766 4767 err = awsAwsjson11_deserializeOpDocumentGetRegexMatchSetOutput(&output, shape) 4768 if err != nil { 4769 var snapshot bytes.Buffer 4770 io.Copy(&snapshot, ringBuffer) 4771 err = &smithy.DeserializationError{ 4772 Err: fmt.Errorf("failed to decode response body, %w", err), 4773 Snapshot: snapshot.Bytes(), 4774 } 4775 return out, metadata, err 4776 } 4777 4778 return out, metadata, err 4779} 4780 4781func awsAwsjson11_deserializeOpErrorGetRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4782 var errorBuffer bytes.Buffer 4783 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4784 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4785 } 4786 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4787 4788 errorCode := "UnknownError" 4789 errorMessage := errorCode 4790 4791 code := response.Header.Get("X-Amzn-ErrorType") 4792 if len(code) != 0 { 4793 errorCode = restjson.SanitizeErrorCode(code) 4794 } 4795 4796 var buff [1024]byte 4797 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4798 4799 body := io.TeeReader(errorBody, ringBuffer) 4800 decoder := json.NewDecoder(body) 4801 decoder.UseNumber() 4802 code, message, err := restjson.GetErrorInfo(decoder) 4803 if err != nil { 4804 var snapshot bytes.Buffer 4805 io.Copy(&snapshot, ringBuffer) 4806 err = &smithy.DeserializationError{ 4807 Err: fmt.Errorf("failed to decode response body, %w", err), 4808 Snapshot: snapshot.Bytes(), 4809 } 4810 return err 4811 } 4812 4813 errorBody.Seek(0, io.SeekStart) 4814 if len(code) != 0 { 4815 errorCode = restjson.SanitizeErrorCode(code) 4816 } 4817 if len(message) != 0 { 4818 errorMessage = message 4819 } 4820 4821 switch { 4822 case strings.EqualFold("WAFInternalErrorException", errorCode): 4823 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4824 4825 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4826 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4827 4828 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4829 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4830 4831 default: 4832 genericError := &smithy.GenericAPIError{ 4833 Code: errorCode, 4834 Message: errorMessage, 4835 } 4836 return genericError 4837 4838 } 4839} 4840 4841type awsAwsjson11_deserializeOpGetRegexPatternSet struct { 4842} 4843 4844func (*awsAwsjson11_deserializeOpGetRegexPatternSet) ID() string { 4845 return "OperationDeserializer" 4846} 4847 4848func (m *awsAwsjson11_deserializeOpGetRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4849 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4850) { 4851 out, metadata, err = next.HandleDeserialize(ctx, in) 4852 if err != nil { 4853 return out, metadata, err 4854 } 4855 4856 response, ok := out.RawResponse.(*smithyhttp.Response) 4857 if !ok { 4858 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4859 } 4860 4861 if response.StatusCode < 200 || response.StatusCode >= 300 { 4862 return out, metadata, awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response, &metadata) 4863 } 4864 output := &GetRegexPatternSetOutput{} 4865 out.Result = output 4866 4867 var buff [1024]byte 4868 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4869 4870 body := io.TeeReader(response.Body, ringBuffer) 4871 decoder := json.NewDecoder(body) 4872 decoder.UseNumber() 4873 var shape interface{} 4874 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4875 var snapshot bytes.Buffer 4876 io.Copy(&snapshot, ringBuffer) 4877 err = &smithy.DeserializationError{ 4878 Err: fmt.Errorf("failed to decode response body, %w", err), 4879 Snapshot: snapshot.Bytes(), 4880 } 4881 return out, metadata, err 4882 } 4883 4884 err = awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(&output, shape) 4885 if err != nil { 4886 var snapshot bytes.Buffer 4887 io.Copy(&snapshot, ringBuffer) 4888 err = &smithy.DeserializationError{ 4889 Err: fmt.Errorf("failed to decode response body, %w", err), 4890 Snapshot: snapshot.Bytes(), 4891 } 4892 return out, metadata, err 4893 } 4894 4895 return out, metadata, err 4896} 4897 4898func awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4899 var errorBuffer bytes.Buffer 4900 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4901 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4902 } 4903 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4904 4905 errorCode := "UnknownError" 4906 errorMessage := errorCode 4907 4908 code := response.Header.Get("X-Amzn-ErrorType") 4909 if len(code) != 0 { 4910 errorCode = restjson.SanitizeErrorCode(code) 4911 } 4912 4913 var buff [1024]byte 4914 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4915 4916 body := io.TeeReader(errorBody, ringBuffer) 4917 decoder := json.NewDecoder(body) 4918 decoder.UseNumber() 4919 code, message, err := restjson.GetErrorInfo(decoder) 4920 if err != nil { 4921 var snapshot bytes.Buffer 4922 io.Copy(&snapshot, ringBuffer) 4923 err = &smithy.DeserializationError{ 4924 Err: fmt.Errorf("failed to decode response body, %w", err), 4925 Snapshot: snapshot.Bytes(), 4926 } 4927 return err 4928 } 4929 4930 errorBody.Seek(0, io.SeekStart) 4931 if len(code) != 0 { 4932 errorCode = restjson.SanitizeErrorCode(code) 4933 } 4934 if len(message) != 0 { 4935 errorMessage = message 4936 } 4937 4938 switch { 4939 case strings.EqualFold("WAFInternalErrorException", errorCode): 4940 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 4941 4942 case strings.EqualFold("WAFInvalidAccountException", errorCode): 4943 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 4944 4945 case strings.EqualFold("WAFNonexistentItemException", errorCode): 4946 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 4947 4948 default: 4949 genericError := &smithy.GenericAPIError{ 4950 Code: errorCode, 4951 Message: errorMessage, 4952 } 4953 return genericError 4954 4955 } 4956} 4957 4958type awsAwsjson11_deserializeOpGetRule struct { 4959} 4960 4961func (*awsAwsjson11_deserializeOpGetRule) ID() string { 4962 return "OperationDeserializer" 4963} 4964 4965func (m *awsAwsjson11_deserializeOpGetRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4966 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4967) { 4968 out, metadata, err = next.HandleDeserialize(ctx, in) 4969 if err != nil { 4970 return out, metadata, err 4971 } 4972 4973 response, ok := out.RawResponse.(*smithyhttp.Response) 4974 if !ok { 4975 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4976 } 4977 4978 if response.StatusCode < 200 || response.StatusCode >= 300 { 4979 return out, metadata, awsAwsjson11_deserializeOpErrorGetRule(response, &metadata) 4980 } 4981 output := &GetRuleOutput{} 4982 out.Result = output 4983 4984 var buff [1024]byte 4985 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4986 4987 body := io.TeeReader(response.Body, ringBuffer) 4988 decoder := json.NewDecoder(body) 4989 decoder.UseNumber() 4990 var shape interface{} 4991 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4992 var snapshot bytes.Buffer 4993 io.Copy(&snapshot, ringBuffer) 4994 err = &smithy.DeserializationError{ 4995 Err: fmt.Errorf("failed to decode response body, %w", err), 4996 Snapshot: snapshot.Bytes(), 4997 } 4998 return out, metadata, err 4999 } 5000 5001 err = awsAwsjson11_deserializeOpDocumentGetRuleOutput(&output, shape) 5002 if err != nil { 5003 var snapshot bytes.Buffer 5004 io.Copy(&snapshot, ringBuffer) 5005 err = &smithy.DeserializationError{ 5006 Err: fmt.Errorf("failed to decode response body, %w", err), 5007 Snapshot: snapshot.Bytes(), 5008 } 5009 return out, metadata, err 5010 } 5011 5012 return out, metadata, err 5013} 5014 5015func awsAwsjson11_deserializeOpErrorGetRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5016 var errorBuffer bytes.Buffer 5017 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5018 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5019 } 5020 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5021 5022 errorCode := "UnknownError" 5023 errorMessage := errorCode 5024 5025 code := response.Header.Get("X-Amzn-ErrorType") 5026 if len(code) != 0 { 5027 errorCode = restjson.SanitizeErrorCode(code) 5028 } 5029 5030 var buff [1024]byte 5031 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5032 5033 body := io.TeeReader(errorBody, ringBuffer) 5034 decoder := json.NewDecoder(body) 5035 decoder.UseNumber() 5036 code, message, err := restjson.GetErrorInfo(decoder) 5037 if err != nil { 5038 var snapshot bytes.Buffer 5039 io.Copy(&snapshot, ringBuffer) 5040 err = &smithy.DeserializationError{ 5041 Err: fmt.Errorf("failed to decode response body, %w", err), 5042 Snapshot: snapshot.Bytes(), 5043 } 5044 return err 5045 } 5046 5047 errorBody.Seek(0, io.SeekStart) 5048 if len(code) != 0 { 5049 errorCode = restjson.SanitizeErrorCode(code) 5050 } 5051 if len(message) != 0 { 5052 errorMessage = message 5053 } 5054 5055 switch { 5056 case strings.EqualFold("WAFInternalErrorException", errorCode): 5057 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5058 5059 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5060 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5061 5062 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5063 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5064 5065 default: 5066 genericError := &smithy.GenericAPIError{ 5067 Code: errorCode, 5068 Message: errorMessage, 5069 } 5070 return genericError 5071 5072 } 5073} 5074 5075type awsAwsjson11_deserializeOpGetRuleGroup struct { 5076} 5077 5078func (*awsAwsjson11_deserializeOpGetRuleGroup) ID() string { 5079 return "OperationDeserializer" 5080} 5081 5082func (m *awsAwsjson11_deserializeOpGetRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5083 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5084) { 5085 out, metadata, err = next.HandleDeserialize(ctx, in) 5086 if err != nil { 5087 return out, metadata, err 5088 } 5089 5090 response, ok := out.RawResponse.(*smithyhttp.Response) 5091 if !ok { 5092 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5093 } 5094 5095 if response.StatusCode < 200 || response.StatusCode >= 300 { 5096 return out, metadata, awsAwsjson11_deserializeOpErrorGetRuleGroup(response, &metadata) 5097 } 5098 output := &GetRuleGroupOutput{} 5099 out.Result = output 5100 5101 var buff [1024]byte 5102 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5103 5104 body := io.TeeReader(response.Body, ringBuffer) 5105 decoder := json.NewDecoder(body) 5106 decoder.UseNumber() 5107 var shape interface{} 5108 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5109 var snapshot bytes.Buffer 5110 io.Copy(&snapshot, ringBuffer) 5111 err = &smithy.DeserializationError{ 5112 Err: fmt.Errorf("failed to decode response body, %w", err), 5113 Snapshot: snapshot.Bytes(), 5114 } 5115 return out, metadata, err 5116 } 5117 5118 err = awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(&output, shape) 5119 if err != nil { 5120 var snapshot bytes.Buffer 5121 io.Copy(&snapshot, ringBuffer) 5122 err = &smithy.DeserializationError{ 5123 Err: fmt.Errorf("failed to decode response body, %w", err), 5124 Snapshot: snapshot.Bytes(), 5125 } 5126 return out, metadata, err 5127 } 5128 5129 return out, metadata, err 5130} 5131 5132func awsAwsjson11_deserializeOpErrorGetRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5133 var errorBuffer bytes.Buffer 5134 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5135 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5136 } 5137 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5138 5139 errorCode := "UnknownError" 5140 errorMessage := errorCode 5141 5142 code := response.Header.Get("X-Amzn-ErrorType") 5143 if len(code) != 0 { 5144 errorCode = restjson.SanitizeErrorCode(code) 5145 } 5146 5147 var buff [1024]byte 5148 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5149 5150 body := io.TeeReader(errorBody, ringBuffer) 5151 decoder := json.NewDecoder(body) 5152 decoder.UseNumber() 5153 code, message, err := restjson.GetErrorInfo(decoder) 5154 if err != nil { 5155 var snapshot bytes.Buffer 5156 io.Copy(&snapshot, ringBuffer) 5157 err = &smithy.DeserializationError{ 5158 Err: fmt.Errorf("failed to decode response body, %w", err), 5159 Snapshot: snapshot.Bytes(), 5160 } 5161 return err 5162 } 5163 5164 errorBody.Seek(0, io.SeekStart) 5165 if len(code) != 0 { 5166 errorCode = restjson.SanitizeErrorCode(code) 5167 } 5168 if len(message) != 0 { 5169 errorMessage = message 5170 } 5171 5172 switch { 5173 case strings.EqualFold("WAFInternalErrorException", errorCode): 5174 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5175 5176 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5177 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5178 5179 default: 5180 genericError := &smithy.GenericAPIError{ 5181 Code: errorCode, 5182 Message: errorMessage, 5183 } 5184 return genericError 5185 5186 } 5187} 5188 5189type awsAwsjson11_deserializeOpGetSampledRequests struct { 5190} 5191 5192func (*awsAwsjson11_deserializeOpGetSampledRequests) ID() string { 5193 return "OperationDeserializer" 5194} 5195 5196func (m *awsAwsjson11_deserializeOpGetSampledRequests) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5197 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5198) { 5199 out, metadata, err = next.HandleDeserialize(ctx, in) 5200 if err != nil { 5201 return out, metadata, err 5202 } 5203 5204 response, ok := out.RawResponse.(*smithyhttp.Response) 5205 if !ok { 5206 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5207 } 5208 5209 if response.StatusCode < 200 || response.StatusCode >= 300 { 5210 return out, metadata, awsAwsjson11_deserializeOpErrorGetSampledRequests(response, &metadata) 5211 } 5212 output := &GetSampledRequestsOutput{} 5213 out.Result = output 5214 5215 var buff [1024]byte 5216 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5217 5218 body := io.TeeReader(response.Body, ringBuffer) 5219 decoder := json.NewDecoder(body) 5220 decoder.UseNumber() 5221 var shape interface{} 5222 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5223 var snapshot bytes.Buffer 5224 io.Copy(&snapshot, ringBuffer) 5225 err = &smithy.DeserializationError{ 5226 Err: fmt.Errorf("failed to decode response body, %w", err), 5227 Snapshot: snapshot.Bytes(), 5228 } 5229 return out, metadata, err 5230 } 5231 5232 err = awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(&output, shape) 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 out, metadata, err 5241 } 5242 5243 return out, metadata, err 5244} 5245 5246func awsAwsjson11_deserializeOpErrorGetSampledRequests(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5247 var errorBuffer bytes.Buffer 5248 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5249 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5250 } 5251 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5252 5253 errorCode := "UnknownError" 5254 errorMessage := errorCode 5255 5256 code := response.Header.Get("X-Amzn-ErrorType") 5257 if len(code) != 0 { 5258 errorCode = restjson.SanitizeErrorCode(code) 5259 } 5260 5261 var buff [1024]byte 5262 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5263 5264 body := io.TeeReader(errorBody, ringBuffer) 5265 decoder := json.NewDecoder(body) 5266 decoder.UseNumber() 5267 code, message, err := restjson.GetErrorInfo(decoder) 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 if len(code) != 0 { 5280 errorCode = restjson.SanitizeErrorCode(code) 5281 } 5282 if len(message) != 0 { 5283 errorMessage = message 5284 } 5285 5286 switch { 5287 case strings.EqualFold("WAFInternalErrorException", errorCode): 5288 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5289 5290 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5291 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5292 5293 default: 5294 genericError := &smithy.GenericAPIError{ 5295 Code: errorCode, 5296 Message: errorMessage, 5297 } 5298 return genericError 5299 5300 } 5301} 5302 5303type awsAwsjson11_deserializeOpGetSizeConstraintSet struct { 5304} 5305 5306func (*awsAwsjson11_deserializeOpGetSizeConstraintSet) ID() string { 5307 return "OperationDeserializer" 5308} 5309 5310func (m *awsAwsjson11_deserializeOpGetSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5311 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5312) { 5313 out, metadata, err = next.HandleDeserialize(ctx, in) 5314 if err != nil { 5315 return out, metadata, err 5316 } 5317 5318 response, ok := out.RawResponse.(*smithyhttp.Response) 5319 if !ok { 5320 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5321 } 5322 5323 if response.StatusCode < 200 || response.StatusCode >= 300 { 5324 return out, metadata, awsAwsjson11_deserializeOpErrorGetSizeConstraintSet(response, &metadata) 5325 } 5326 output := &GetSizeConstraintSetOutput{} 5327 out.Result = output 5328 5329 var buff [1024]byte 5330 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5331 5332 body := io.TeeReader(response.Body, ringBuffer) 5333 decoder := json.NewDecoder(body) 5334 decoder.UseNumber() 5335 var shape interface{} 5336 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5337 var snapshot bytes.Buffer 5338 io.Copy(&snapshot, ringBuffer) 5339 err = &smithy.DeserializationError{ 5340 Err: fmt.Errorf("failed to decode response body, %w", err), 5341 Snapshot: snapshot.Bytes(), 5342 } 5343 return out, metadata, err 5344 } 5345 5346 err = awsAwsjson11_deserializeOpDocumentGetSizeConstraintSetOutput(&output, shape) 5347 if err != nil { 5348 var snapshot bytes.Buffer 5349 io.Copy(&snapshot, ringBuffer) 5350 err = &smithy.DeserializationError{ 5351 Err: fmt.Errorf("failed to decode response body, %w", err), 5352 Snapshot: snapshot.Bytes(), 5353 } 5354 return out, metadata, err 5355 } 5356 5357 return out, metadata, err 5358} 5359 5360func awsAwsjson11_deserializeOpErrorGetSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5361 var errorBuffer bytes.Buffer 5362 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5363 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5364 } 5365 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5366 5367 errorCode := "UnknownError" 5368 errorMessage := errorCode 5369 5370 code := response.Header.Get("X-Amzn-ErrorType") 5371 if len(code) != 0 { 5372 errorCode = restjson.SanitizeErrorCode(code) 5373 } 5374 5375 var buff [1024]byte 5376 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5377 5378 body := io.TeeReader(errorBody, ringBuffer) 5379 decoder := json.NewDecoder(body) 5380 decoder.UseNumber() 5381 code, message, err := restjson.GetErrorInfo(decoder) 5382 if err != nil { 5383 var snapshot bytes.Buffer 5384 io.Copy(&snapshot, ringBuffer) 5385 err = &smithy.DeserializationError{ 5386 Err: fmt.Errorf("failed to decode response body, %w", err), 5387 Snapshot: snapshot.Bytes(), 5388 } 5389 return err 5390 } 5391 5392 errorBody.Seek(0, io.SeekStart) 5393 if len(code) != 0 { 5394 errorCode = restjson.SanitizeErrorCode(code) 5395 } 5396 if len(message) != 0 { 5397 errorMessage = message 5398 } 5399 5400 switch { 5401 case strings.EqualFold("WAFInternalErrorException", errorCode): 5402 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5403 5404 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5405 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5406 5407 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5408 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5409 5410 default: 5411 genericError := &smithy.GenericAPIError{ 5412 Code: errorCode, 5413 Message: errorMessage, 5414 } 5415 return genericError 5416 5417 } 5418} 5419 5420type awsAwsjson11_deserializeOpGetSqlInjectionMatchSet struct { 5421} 5422 5423func (*awsAwsjson11_deserializeOpGetSqlInjectionMatchSet) ID() string { 5424 return "OperationDeserializer" 5425} 5426 5427func (m *awsAwsjson11_deserializeOpGetSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5428 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5429) { 5430 out, metadata, err = next.HandleDeserialize(ctx, in) 5431 if err != nil { 5432 return out, metadata, err 5433 } 5434 5435 response, ok := out.RawResponse.(*smithyhttp.Response) 5436 if !ok { 5437 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5438 } 5439 5440 if response.StatusCode < 200 || response.StatusCode >= 300 { 5441 return out, metadata, awsAwsjson11_deserializeOpErrorGetSqlInjectionMatchSet(response, &metadata) 5442 } 5443 output := &GetSqlInjectionMatchSetOutput{} 5444 out.Result = output 5445 5446 var buff [1024]byte 5447 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5448 5449 body := io.TeeReader(response.Body, ringBuffer) 5450 decoder := json.NewDecoder(body) 5451 decoder.UseNumber() 5452 var shape interface{} 5453 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5454 var snapshot bytes.Buffer 5455 io.Copy(&snapshot, ringBuffer) 5456 err = &smithy.DeserializationError{ 5457 Err: fmt.Errorf("failed to decode response body, %w", err), 5458 Snapshot: snapshot.Bytes(), 5459 } 5460 return out, metadata, err 5461 } 5462 5463 err = awsAwsjson11_deserializeOpDocumentGetSqlInjectionMatchSetOutput(&output, shape) 5464 if err != nil { 5465 var snapshot bytes.Buffer 5466 io.Copy(&snapshot, ringBuffer) 5467 err = &smithy.DeserializationError{ 5468 Err: fmt.Errorf("failed to decode response body, %w", err), 5469 Snapshot: snapshot.Bytes(), 5470 } 5471 return out, metadata, err 5472 } 5473 5474 return out, metadata, err 5475} 5476 5477func awsAwsjson11_deserializeOpErrorGetSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5478 var errorBuffer bytes.Buffer 5479 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5480 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5481 } 5482 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5483 5484 errorCode := "UnknownError" 5485 errorMessage := errorCode 5486 5487 code := response.Header.Get("X-Amzn-ErrorType") 5488 if len(code) != 0 { 5489 errorCode = restjson.SanitizeErrorCode(code) 5490 } 5491 5492 var buff [1024]byte 5493 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5494 5495 body := io.TeeReader(errorBody, ringBuffer) 5496 decoder := json.NewDecoder(body) 5497 decoder.UseNumber() 5498 code, message, err := restjson.GetErrorInfo(decoder) 5499 if err != nil { 5500 var snapshot bytes.Buffer 5501 io.Copy(&snapshot, ringBuffer) 5502 err = &smithy.DeserializationError{ 5503 Err: fmt.Errorf("failed to decode response body, %w", err), 5504 Snapshot: snapshot.Bytes(), 5505 } 5506 return err 5507 } 5508 5509 errorBody.Seek(0, io.SeekStart) 5510 if len(code) != 0 { 5511 errorCode = restjson.SanitizeErrorCode(code) 5512 } 5513 if len(message) != 0 { 5514 errorMessage = message 5515 } 5516 5517 switch { 5518 case strings.EqualFold("WAFInternalErrorException", errorCode): 5519 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5520 5521 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5522 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5523 5524 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5525 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5526 5527 default: 5528 genericError := &smithy.GenericAPIError{ 5529 Code: errorCode, 5530 Message: errorMessage, 5531 } 5532 return genericError 5533 5534 } 5535} 5536 5537type awsAwsjson11_deserializeOpGetWebACL struct { 5538} 5539 5540func (*awsAwsjson11_deserializeOpGetWebACL) ID() string { 5541 return "OperationDeserializer" 5542} 5543 5544func (m *awsAwsjson11_deserializeOpGetWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5545 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5546) { 5547 out, metadata, err = next.HandleDeserialize(ctx, in) 5548 if err != nil { 5549 return out, metadata, err 5550 } 5551 5552 response, ok := out.RawResponse.(*smithyhttp.Response) 5553 if !ok { 5554 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5555 } 5556 5557 if response.StatusCode < 200 || response.StatusCode >= 300 { 5558 return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACL(response, &metadata) 5559 } 5560 output := &GetWebACLOutput{} 5561 out.Result = output 5562 5563 var buff [1024]byte 5564 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5565 5566 body := io.TeeReader(response.Body, 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 out, metadata, err 5578 } 5579 5580 err = awsAwsjson11_deserializeOpDocumentGetWebACLOutput(&output, shape) 5581 if err != nil { 5582 var snapshot bytes.Buffer 5583 io.Copy(&snapshot, ringBuffer) 5584 err = &smithy.DeserializationError{ 5585 Err: fmt.Errorf("failed to decode response body, %w", err), 5586 Snapshot: snapshot.Bytes(), 5587 } 5588 return out, metadata, err 5589 } 5590 5591 return out, metadata, err 5592} 5593 5594func awsAwsjson11_deserializeOpErrorGetWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5595 var errorBuffer bytes.Buffer 5596 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5597 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5598 } 5599 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5600 5601 errorCode := "UnknownError" 5602 errorMessage := errorCode 5603 5604 code := response.Header.Get("X-Amzn-ErrorType") 5605 if len(code) != 0 { 5606 errorCode = restjson.SanitizeErrorCode(code) 5607 } 5608 5609 var buff [1024]byte 5610 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5611 5612 body := io.TeeReader(errorBody, ringBuffer) 5613 decoder := json.NewDecoder(body) 5614 decoder.UseNumber() 5615 code, message, err := restjson.GetErrorInfo(decoder) 5616 if err != nil { 5617 var snapshot bytes.Buffer 5618 io.Copy(&snapshot, ringBuffer) 5619 err = &smithy.DeserializationError{ 5620 Err: fmt.Errorf("failed to decode response body, %w", err), 5621 Snapshot: snapshot.Bytes(), 5622 } 5623 return err 5624 } 5625 5626 errorBody.Seek(0, io.SeekStart) 5627 if len(code) != 0 { 5628 errorCode = restjson.SanitizeErrorCode(code) 5629 } 5630 if len(message) != 0 { 5631 errorMessage = message 5632 } 5633 5634 switch { 5635 case strings.EqualFold("WAFInternalErrorException", errorCode): 5636 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5637 5638 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5639 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5640 5641 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5642 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5643 5644 default: 5645 genericError := &smithy.GenericAPIError{ 5646 Code: errorCode, 5647 Message: errorMessage, 5648 } 5649 return genericError 5650 5651 } 5652} 5653 5654type awsAwsjson11_deserializeOpGetWebACLForResource struct { 5655} 5656 5657func (*awsAwsjson11_deserializeOpGetWebACLForResource) ID() string { 5658 return "OperationDeserializer" 5659} 5660 5661func (m *awsAwsjson11_deserializeOpGetWebACLForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5662 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5663) { 5664 out, metadata, err = next.HandleDeserialize(ctx, in) 5665 if err != nil { 5666 return out, metadata, err 5667 } 5668 5669 response, ok := out.RawResponse.(*smithyhttp.Response) 5670 if !ok { 5671 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5672 } 5673 5674 if response.StatusCode < 200 || response.StatusCode >= 300 { 5675 return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACLForResource(response, &metadata) 5676 } 5677 output := &GetWebACLForResourceOutput{} 5678 out.Result = output 5679 5680 var buff [1024]byte 5681 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5682 5683 body := io.TeeReader(response.Body, ringBuffer) 5684 decoder := json.NewDecoder(body) 5685 decoder.UseNumber() 5686 var shape interface{} 5687 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5688 var snapshot bytes.Buffer 5689 io.Copy(&snapshot, ringBuffer) 5690 err = &smithy.DeserializationError{ 5691 Err: fmt.Errorf("failed to decode response body, %w", err), 5692 Snapshot: snapshot.Bytes(), 5693 } 5694 return out, metadata, err 5695 } 5696 5697 err = awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(&output, shape) 5698 if err != nil { 5699 var snapshot bytes.Buffer 5700 io.Copy(&snapshot, ringBuffer) 5701 err = &smithy.DeserializationError{ 5702 Err: fmt.Errorf("failed to decode response body, %w", err), 5703 Snapshot: snapshot.Bytes(), 5704 } 5705 return out, metadata, err 5706 } 5707 5708 return out, metadata, err 5709} 5710 5711func awsAwsjson11_deserializeOpErrorGetWebACLForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5712 var errorBuffer bytes.Buffer 5713 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5714 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5715 } 5716 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5717 5718 errorCode := "UnknownError" 5719 errorMessage := errorCode 5720 5721 code := response.Header.Get("X-Amzn-ErrorType") 5722 if len(code) != 0 { 5723 errorCode = restjson.SanitizeErrorCode(code) 5724 } 5725 5726 var buff [1024]byte 5727 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5728 5729 body := io.TeeReader(errorBody, ringBuffer) 5730 decoder := json.NewDecoder(body) 5731 decoder.UseNumber() 5732 code, message, err := restjson.GetErrorInfo(decoder) 5733 if err != nil { 5734 var snapshot bytes.Buffer 5735 io.Copy(&snapshot, ringBuffer) 5736 err = &smithy.DeserializationError{ 5737 Err: fmt.Errorf("failed to decode response body, %w", err), 5738 Snapshot: snapshot.Bytes(), 5739 } 5740 return err 5741 } 5742 5743 errorBody.Seek(0, io.SeekStart) 5744 if len(code) != 0 { 5745 errorCode = restjson.SanitizeErrorCode(code) 5746 } 5747 if len(message) != 0 { 5748 errorMessage = message 5749 } 5750 5751 switch { 5752 case strings.EqualFold("WAFInternalErrorException", errorCode): 5753 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5754 5755 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5756 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5757 5758 case strings.EqualFold("WAFInvalidParameterException", errorCode): 5759 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 5760 5761 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5762 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5763 5764 case strings.EqualFold("WAFUnavailableEntityException", errorCode): 5765 return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody) 5766 5767 default: 5768 genericError := &smithy.GenericAPIError{ 5769 Code: errorCode, 5770 Message: errorMessage, 5771 } 5772 return genericError 5773 5774 } 5775} 5776 5777type awsAwsjson11_deserializeOpGetXssMatchSet struct { 5778} 5779 5780func (*awsAwsjson11_deserializeOpGetXssMatchSet) ID() string { 5781 return "OperationDeserializer" 5782} 5783 5784func (m *awsAwsjson11_deserializeOpGetXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5785 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5786) { 5787 out, metadata, err = next.HandleDeserialize(ctx, in) 5788 if err != nil { 5789 return out, metadata, err 5790 } 5791 5792 response, ok := out.RawResponse.(*smithyhttp.Response) 5793 if !ok { 5794 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5795 } 5796 5797 if response.StatusCode < 200 || response.StatusCode >= 300 { 5798 return out, metadata, awsAwsjson11_deserializeOpErrorGetXssMatchSet(response, &metadata) 5799 } 5800 output := &GetXssMatchSetOutput{} 5801 out.Result = output 5802 5803 var buff [1024]byte 5804 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5805 5806 body := io.TeeReader(response.Body, ringBuffer) 5807 decoder := json.NewDecoder(body) 5808 decoder.UseNumber() 5809 var shape interface{} 5810 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5811 var snapshot bytes.Buffer 5812 io.Copy(&snapshot, ringBuffer) 5813 err = &smithy.DeserializationError{ 5814 Err: fmt.Errorf("failed to decode response body, %w", err), 5815 Snapshot: snapshot.Bytes(), 5816 } 5817 return out, metadata, err 5818 } 5819 5820 err = awsAwsjson11_deserializeOpDocumentGetXssMatchSetOutput(&output, shape) 5821 if err != nil { 5822 var snapshot bytes.Buffer 5823 io.Copy(&snapshot, ringBuffer) 5824 err = &smithy.DeserializationError{ 5825 Err: fmt.Errorf("failed to decode response body, %w", err), 5826 Snapshot: snapshot.Bytes(), 5827 } 5828 return out, metadata, err 5829 } 5830 5831 return out, metadata, err 5832} 5833 5834func awsAwsjson11_deserializeOpErrorGetXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5835 var errorBuffer bytes.Buffer 5836 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5837 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5838 } 5839 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5840 5841 errorCode := "UnknownError" 5842 errorMessage := errorCode 5843 5844 code := response.Header.Get("X-Amzn-ErrorType") 5845 if len(code) != 0 { 5846 errorCode = restjson.SanitizeErrorCode(code) 5847 } 5848 5849 var buff [1024]byte 5850 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5851 5852 body := io.TeeReader(errorBody, ringBuffer) 5853 decoder := json.NewDecoder(body) 5854 decoder.UseNumber() 5855 code, message, err := restjson.GetErrorInfo(decoder) 5856 if err != nil { 5857 var snapshot bytes.Buffer 5858 io.Copy(&snapshot, ringBuffer) 5859 err = &smithy.DeserializationError{ 5860 Err: fmt.Errorf("failed to decode response body, %w", err), 5861 Snapshot: snapshot.Bytes(), 5862 } 5863 return err 5864 } 5865 5866 errorBody.Seek(0, io.SeekStart) 5867 if len(code) != 0 { 5868 errorCode = restjson.SanitizeErrorCode(code) 5869 } 5870 if len(message) != 0 { 5871 errorMessage = message 5872 } 5873 5874 switch { 5875 case strings.EqualFold("WAFInternalErrorException", errorCode): 5876 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5877 5878 case strings.EqualFold("WAFInvalidAccountException", errorCode): 5879 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 5880 5881 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5882 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 5883 5884 default: 5885 genericError := &smithy.GenericAPIError{ 5886 Code: errorCode, 5887 Message: errorMessage, 5888 } 5889 return genericError 5890 5891 } 5892} 5893 5894type awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup struct { 5895} 5896 5897func (*awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup) ID() string { 5898 return "OperationDeserializer" 5899} 5900 5901func (m *awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5902 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5903) { 5904 out, metadata, err = next.HandleDeserialize(ctx, in) 5905 if err != nil { 5906 return out, metadata, err 5907 } 5908 5909 response, ok := out.RawResponse.(*smithyhttp.Response) 5910 if !ok { 5911 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5912 } 5913 5914 if response.StatusCode < 200 || response.StatusCode >= 300 { 5915 return out, metadata, awsAwsjson11_deserializeOpErrorListActivatedRulesInRuleGroup(response, &metadata) 5916 } 5917 output := &ListActivatedRulesInRuleGroupOutput{} 5918 out.Result = output 5919 5920 var buff [1024]byte 5921 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5922 5923 body := io.TeeReader(response.Body, ringBuffer) 5924 decoder := json.NewDecoder(body) 5925 decoder.UseNumber() 5926 var shape interface{} 5927 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5928 var snapshot bytes.Buffer 5929 io.Copy(&snapshot, ringBuffer) 5930 err = &smithy.DeserializationError{ 5931 Err: fmt.Errorf("failed to decode response body, %w", err), 5932 Snapshot: snapshot.Bytes(), 5933 } 5934 return out, metadata, err 5935 } 5936 5937 err = awsAwsjson11_deserializeOpDocumentListActivatedRulesInRuleGroupOutput(&output, shape) 5938 if err != nil { 5939 var snapshot bytes.Buffer 5940 io.Copy(&snapshot, ringBuffer) 5941 err = &smithy.DeserializationError{ 5942 Err: fmt.Errorf("failed to decode response body, %w", err), 5943 Snapshot: snapshot.Bytes(), 5944 } 5945 return out, metadata, err 5946 } 5947 5948 return out, metadata, err 5949} 5950 5951func awsAwsjson11_deserializeOpErrorListActivatedRulesInRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5952 var errorBuffer bytes.Buffer 5953 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5954 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5955 } 5956 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5957 5958 errorCode := "UnknownError" 5959 errorMessage := errorCode 5960 5961 code := response.Header.Get("X-Amzn-ErrorType") 5962 if len(code) != 0 { 5963 errorCode = restjson.SanitizeErrorCode(code) 5964 } 5965 5966 var buff [1024]byte 5967 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5968 5969 body := io.TeeReader(errorBody, ringBuffer) 5970 decoder := json.NewDecoder(body) 5971 decoder.UseNumber() 5972 code, message, err := restjson.GetErrorInfo(decoder) 5973 if err != nil { 5974 var snapshot bytes.Buffer 5975 io.Copy(&snapshot, ringBuffer) 5976 err = &smithy.DeserializationError{ 5977 Err: fmt.Errorf("failed to decode response body, %w", err), 5978 Snapshot: snapshot.Bytes(), 5979 } 5980 return err 5981 } 5982 5983 errorBody.Seek(0, io.SeekStart) 5984 if len(code) != 0 { 5985 errorCode = restjson.SanitizeErrorCode(code) 5986 } 5987 if len(message) != 0 { 5988 errorMessage = message 5989 } 5990 5991 switch { 5992 case strings.EqualFold("WAFInternalErrorException", errorCode): 5993 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 5994 5995 case strings.EqualFold("WAFInvalidParameterException", errorCode): 5996 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 5997 5998 case strings.EqualFold("WAFNonexistentItemException", errorCode): 5999 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 6000 6001 default: 6002 genericError := &smithy.GenericAPIError{ 6003 Code: errorCode, 6004 Message: errorMessage, 6005 } 6006 return genericError 6007 6008 } 6009} 6010 6011type awsAwsjson11_deserializeOpListByteMatchSets struct { 6012} 6013 6014func (*awsAwsjson11_deserializeOpListByteMatchSets) ID() string { 6015 return "OperationDeserializer" 6016} 6017 6018func (m *awsAwsjson11_deserializeOpListByteMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6019 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6020) { 6021 out, metadata, err = next.HandleDeserialize(ctx, in) 6022 if err != nil { 6023 return out, metadata, err 6024 } 6025 6026 response, ok := out.RawResponse.(*smithyhttp.Response) 6027 if !ok { 6028 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6029 } 6030 6031 if response.StatusCode < 200 || response.StatusCode >= 300 { 6032 return out, metadata, awsAwsjson11_deserializeOpErrorListByteMatchSets(response, &metadata) 6033 } 6034 output := &ListByteMatchSetsOutput{} 6035 out.Result = output 6036 6037 var buff [1024]byte 6038 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6039 6040 body := io.TeeReader(response.Body, ringBuffer) 6041 decoder := json.NewDecoder(body) 6042 decoder.UseNumber() 6043 var shape interface{} 6044 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6045 var snapshot bytes.Buffer 6046 io.Copy(&snapshot, ringBuffer) 6047 err = &smithy.DeserializationError{ 6048 Err: fmt.Errorf("failed to decode response body, %w", err), 6049 Snapshot: snapshot.Bytes(), 6050 } 6051 return out, metadata, err 6052 } 6053 6054 err = awsAwsjson11_deserializeOpDocumentListByteMatchSetsOutput(&output, shape) 6055 if err != nil { 6056 var snapshot bytes.Buffer 6057 io.Copy(&snapshot, ringBuffer) 6058 err = &smithy.DeserializationError{ 6059 Err: fmt.Errorf("failed to decode response body, %w", err), 6060 Snapshot: snapshot.Bytes(), 6061 } 6062 return out, metadata, err 6063 } 6064 6065 return out, metadata, err 6066} 6067 6068func awsAwsjson11_deserializeOpErrorListByteMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6069 var errorBuffer bytes.Buffer 6070 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6071 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6072 } 6073 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6074 6075 errorCode := "UnknownError" 6076 errorMessage := errorCode 6077 6078 code := response.Header.Get("X-Amzn-ErrorType") 6079 if len(code) != 0 { 6080 errorCode = restjson.SanitizeErrorCode(code) 6081 } 6082 6083 var buff [1024]byte 6084 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6085 6086 body := io.TeeReader(errorBody, ringBuffer) 6087 decoder := json.NewDecoder(body) 6088 decoder.UseNumber() 6089 code, message, err := restjson.GetErrorInfo(decoder) 6090 if err != nil { 6091 var snapshot bytes.Buffer 6092 io.Copy(&snapshot, ringBuffer) 6093 err = &smithy.DeserializationError{ 6094 Err: fmt.Errorf("failed to decode response body, %w", err), 6095 Snapshot: snapshot.Bytes(), 6096 } 6097 return err 6098 } 6099 6100 errorBody.Seek(0, io.SeekStart) 6101 if len(code) != 0 { 6102 errorCode = restjson.SanitizeErrorCode(code) 6103 } 6104 if len(message) != 0 { 6105 errorMessage = message 6106 } 6107 6108 switch { 6109 case strings.EqualFold("WAFInternalErrorException", errorCode): 6110 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6111 6112 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6113 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6114 6115 default: 6116 genericError := &smithy.GenericAPIError{ 6117 Code: errorCode, 6118 Message: errorMessage, 6119 } 6120 return genericError 6121 6122 } 6123} 6124 6125type awsAwsjson11_deserializeOpListGeoMatchSets struct { 6126} 6127 6128func (*awsAwsjson11_deserializeOpListGeoMatchSets) ID() string { 6129 return "OperationDeserializer" 6130} 6131 6132func (m *awsAwsjson11_deserializeOpListGeoMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6133 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6134) { 6135 out, metadata, err = next.HandleDeserialize(ctx, in) 6136 if err != nil { 6137 return out, metadata, err 6138 } 6139 6140 response, ok := out.RawResponse.(*smithyhttp.Response) 6141 if !ok { 6142 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6143 } 6144 6145 if response.StatusCode < 200 || response.StatusCode >= 300 { 6146 return out, metadata, awsAwsjson11_deserializeOpErrorListGeoMatchSets(response, &metadata) 6147 } 6148 output := &ListGeoMatchSetsOutput{} 6149 out.Result = output 6150 6151 var buff [1024]byte 6152 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6153 6154 body := io.TeeReader(response.Body, ringBuffer) 6155 decoder := json.NewDecoder(body) 6156 decoder.UseNumber() 6157 var shape interface{} 6158 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6159 var snapshot bytes.Buffer 6160 io.Copy(&snapshot, ringBuffer) 6161 err = &smithy.DeserializationError{ 6162 Err: fmt.Errorf("failed to decode response body, %w", err), 6163 Snapshot: snapshot.Bytes(), 6164 } 6165 return out, metadata, err 6166 } 6167 6168 err = awsAwsjson11_deserializeOpDocumentListGeoMatchSetsOutput(&output, shape) 6169 if err != nil { 6170 var snapshot bytes.Buffer 6171 io.Copy(&snapshot, ringBuffer) 6172 err = &smithy.DeserializationError{ 6173 Err: fmt.Errorf("failed to decode response body, %w", err), 6174 Snapshot: snapshot.Bytes(), 6175 } 6176 return out, metadata, err 6177 } 6178 6179 return out, metadata, err 6180} 6181 6182func awsAwsjson11_deserializeOpErrorListGeoMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6183 var errorBuffer bytes.Buffer 6184 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6185 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6186 } 6187 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6188 6189 errorCode := "UnknownError" 6190 errorMessage := errorCode 6191 6192 code := response.Header.Get("X-Amzn-ErrorType") 6193 if len(code) != 0 { 6194 errorCode = restjson.SanitizeErrorCode(code) 6195 } 6196 6197 var buff [1024]byte 6198 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6199 6200 body := io.TeeReader(errorBody, ringBuffer) 6201 decoder := json.NewDecoder(body) 6202 decoder.UseNumber() 6203 code, message, err := restjson.GetErrorInfo(decoder) 6204 if err != nil { 6205 var snapshot bytes.Buffer 6206 io.Copy(&snapshot, ringBuffer) 6207 err = &smithy.DeserializationError{ 6208 Err: fmt.Errorf("failed to decode response body, %w", err), 6209 Snapshot: snapshot.Bytes(), 6210 } 6211 return err 6212 } 6213 6214 errorBody.Seek(0, io.SeekStart) 6215 if len(code) != 0 { 6216 errorCode = restjson.SanitizeErrorCode(code) 6217 } 6218 if len(message) != 0 { 6219 errorMessage = message 6220 } 6221 6222 switch { 6223 case strings.EqualFold("WAFInternalErrorException", errorCode): 6224 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6225 6226 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6227 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6228 6229 default: 6230 genericError := &smithy.GenericAPIError{ 6231 Code: errorCode, 6232 Message: errorMessage, 6233 } 6234 return genericError 6235 6236 } 6237} 6238 6239type awsAwsjson11_deserializeOpListIPSets struct { 6240} 6241 6242func (*awsAwsjson11_deserializeOpListIPSets) ID() string { 6243 return "OperationDeserializer" 6244} 6245 6246func (m *awsAwsjson11_deserializeOpListIPSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6247 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6248) { 6249 out, metadata, err = next.HandleDeserialize(ctx, in) 6250 if err != nil { 6251 return out, metadata, err 6252 } 6253 6254 response, ok := out.RawResponse.(*smithyhttp.Response) 6255 if !ok { 6256 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6257 } 6258 6259 if response.StatusCode < 200 || response.StatusCode >= 300 { 6260 return out, metadata, awsAwsjson11_deserializeOpErrorListIPSets(response, &metadata) 6261 } 6262 output := &ListIPSetsOutput{} 6263 out.Result = output 6264 6265 var buff [1024]byte 6266 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6267 6268 body := io.TeeReader(response.Body, ringBuffer) 6269 decoder := json.NewDecoder(body) 6270 decoder.UseNumber() 6271 var shape interface{} 6272 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6273 var snapshot bytes.Buffer 6274 io.Copy(&snapshot, ringBuffer) 6275 err = &smithy.DeserializationError{ 6276 Err: fmt.Errorf("failed to decode response body, %w", err), 6277 Snapshot: snapshot.Bytes(), 6278 } 6279 return out, metadata, err 6280 } 6281 6282 err = awsAwsjson11_deserializeOpDocumentListIPSetsOutput(&output, shape) 6283 if err != nil { 6284 var snapshot bytes.Buffer 6285 io.Copy(&snapshot, ringBuffer) 6286 err = &smithy.DeserializationError{ 6287 Err: fmt.Errorf("failed to decode response body, %w", err), 6288 Snapshot: snapshot.Bytes(), 6289 } 6290 return out, metadata, err 6291 } 6292 6293 return out, metadata, err 6294} 6295 6296func awsAwsjson11_deserializeOpErrorListIPSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6297 var errorBuffer bytes.Buffer 6298 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6299 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6300 } 6301 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6302 6303 errorCode := "UnknownError" 6304 errorMessage := errorCode 6305 6306 code := response.Header.Get("X-Amzn-ErrorType") 6307 if len(code) != 0 { 6308 errorCode = restjson.SanitizeErrorCode(code) 6309 } 6310 6311 var buff [1024]byte 6312 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6313 6314 body := io.TeeReader(errorBody, ringBuffer) 6315 decoder := json.NewDecoder(body) 6316 decoder.UseNumber() 6317 code, message, err := restjson.GetErrorInfo(decoder) 6318 if err != nil { 6319 var snapshot bytes.Buffer 6320 io.Copy(&snapshot, ringBuffer) 6321 err = &smithy.DeserializationError{ 6322 Err: fmt.Errorf("failed to decode response body, %w", err), 6323 Snapshot: snapshot.Bytes(), 6324 } 6325 return err 6326 } 6327 6328 errorBody.Seek(0, io.SeekStart) 6329 if len(code) != 0 { 6330 errorCode = restjson.SanitizeErrorCode(code) 6331 } 6332 if len(message) != 0 { 6333 errorMessage = message 6334 } 6335 6336 switch { 6337 case strings.EqualFold("WAFInternalErrorException", errorCode): 6338 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6339 6340 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6341 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6342 6343 default: 6344 genericError := &smithy.GenericAPIError{ 6345 Code: errorCode, 6346 Message: errorMessage, 6347 } 6348 return genericError 6349 6350 } 6351} 6352 6353type awsAwsjson11_deserializeOpListLoggingConfigurations struct { 6354} 6355 6356func (*awsAwsjson11_deserializeOpListLoggingConfigurations) ID() string { 6357 return "OperationDeserializer" 6358} 6359 6360func (m *awsAwsjson11_deserializeOpListLoggingConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6361 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6362) { 6363 out, metadata, err = next.HandleDeserialize(ctx, in) 6364 if err != nil { 6365 return out, metadata, err 6366 } 6367 6368 response, ok := out.RawResponse.(*smithyhttp.Response) 6369 if !ok { 6370 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6371 } 6372 6373 if response.StatusCode < 200 || response.StatusCode >= 300 { 6374 return out, metadata, awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response, &metadata) 6375 } 6376 output := &ListLoggingConfigurationsOutput{} 6377 out.Result = output 6378 6379 var buff [1024]byte 6380 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6381 6382 body := io.TeeReader(response.Body, ringBuffer) 6383 decoder := json.NewDecoder(body) 6384 decoder.UseNumber() 6385 var shape interface{} 6386 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6387 var snapshot bytes.Buffer 6388 io.Copy(&snapshot, ringBuffer) 6389 err = &smithy.DeserializationError{ 6390 Err: fmt.Errorf("failed to decode response body, %w", err), 6391 Snapshot: snapshot.Bytes(), 6392 } 6393 return out, metadata, err 6394 } 6395 6396 err = awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(&output, shape) 6397 if err != nil { 6398 var snapshot bytes.Buffer 6399 io.Copy(&snapshot, ringBuffer) 6400 err = &smithy.DeserializationError{ 6401 Err: fmt.Errorf("failed to decode response body, %w", err), 6402 Snapshot: snapshot.Bytes(), 6403 } 6404 return out, metadata, err 6405 } 6406 6407 return out, metadata, err 6408} 6409 6410func awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6411 var errorBuffer bytes.Buffer 6412 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6413 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6414 } 6415 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6416 6417 errorCode := "UnknownError" 6418 errorMessage := errorCode 6419 6420 code := response.Header.Get("X-Amzn-ErrorType") 6421 if len(code) != 0 { 6422 errorCode = restjson.SanitizeErrorCode(code) 6423 } 6424 6425 var buff [1024]byte 6426 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6427 6428 body := io.TeeReader(errorBody, ringBuffer) 6429 decoder := json.NewDecoder(body) 6430 decoder.UseNumber() 6431 code, message, err := restjson.GetErrorInfo(decoder) 6432 if err != nil { 6433 var snapshot bytes.Buffer 6434 io.Copy(&snapshot, ringBuffer) 6435 err = &smithy.DeserializationError{ 6436 Err: fmt.Errorf("failed to decode response body, %w", err), 6437 Snapshot: snapshot.Bytes(), 6438 } 6439 return err 6440 } 6441 6442 errorBody.Seek(0, io.SeekStart) 6443 if len(code) != 0 { 6444 errorCode = restjson.SanitizeErrorCode(code) 6445 } 6446 if len(message) != 0 { 6447 errorMessage = message 6448 } 6449 6450 switch { 6451 case strings.EqualFold("WAFInternalErrorException", errorCode): 6452 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6453 6454 case strings.EqualFold("WAFInvalidParameterException", errorCode): 6455 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 6456 6457 case strings.EqualFold("WAFNonexistentItemException", errorCode): 6458 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 6459 6460 default: 6461 genericError := &smithy.GenericAPIError{ 6462 Code: errorCode, 6463 Message: errorMessage, 6464 } 6465 return genericError 6466 6467 } 6468} 6469 6470type awsAwsjson11_deserializeOpListRateBasedRules struct { 6471} 6472 6473func (*awsAwsjson11_deserializeOpListRateBasedRules) ID() string { 6474 return "OperationDeserializer" 6475} 6476 6477func (m *awsAwsjson11_deserializeOpListRateBasedRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6478 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6479) { 6480 out, metadata, err = next.HandleDeserialize(ctx, in) 6481 if err != nil { 6482 return out, metadata, err 6483 } 6484 6485 response, ok := out.RawResponse.(*smithyhttp.Response) 6486 if !ok { 6487 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6488 } 6489 6490 if response.StatusCode < 200 || response.StatusCode >= 300 { 6491 return out, metadata, awsAwsjson11_deserializeOpErrorListRateBasedRules(response, &metadata) 6492 } 6493 output := &ListRateBasedRulesOutput{} 6494 out.Result = output 6495 6496 var buff [1024]byte 6497 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6498 6499 body := io.TeeReader(response.Body, ringBuffer) 6500 decoder := json.NewDecoder(body) 6501 decoder.UseNumber() 6502 var shape interface{} 6503 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6504 var snapshot bytes.Buffer 6505 io.Copy(&snapshot, ringBuffer) 6506 err = &smithy.DeserializationError{ 6507 Err: fmt.Errorf("failed to decode response body, %w", err), 6508 Snapshot: snapshot.Bytes(), 6509 } 6510 return out, metadata, err 6511 } 6512 6513 err = awsAwsjson11_deserializeOpDocumentListRateBasedRulesOutput(&output, shape) 6514 if err != nil { 6515 var snapshot bytes.Buffer 6516 io.Copy(&snapshot, ringBuffer) 6517 err = &smithy.DeserializationError{ 6518 Err: fmt.Errorf("failed to decode response body, %w", err), 6519 Snapshot: snapshot.Bytes(), 6520 } 6521 return out, metadata, err 6522 } 6523 6524 return out, metadata, err 6525} 6526 6527func awsAwsjson11_deserializeOpErrorListRateBasedRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6528 var errorBuffer bytes.Buffer 6529 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6530 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6531 } 6532 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6533 6534 errorCode := "UnknownError" 6535 errorMessage := errorCode 6536 6537 code := response.Header.Get("X-Amzn-ErrorType") 6538 if len(code) != 0 { 6539 errorCode = restjson.SanitizeErrorCode(code) 6540 } 6541 6542 var buff [1024]byte 6543 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6544 6545 body := io.TeeReader(errorBody, ringBuffer) 6546 decoder := json.NewDecoder(body) 6547 decoder.UseNumber() 6548 code, message, err := restjson.GetErrorInfo(decoder) 6549 if err != nil { 6550 var snapshot bytes.Buffer 6551 io.Copy(&snapshot, ringBuffer) 6552 err = &smithy.DeserializationError{ 6553 Err: fmt.Errorf("failed to decode response body, %w", err), 6554 Snapshot: snapshot.Bytes(), 6555 } 6556 return err 6557 } 6558 6559 errorBody.Seek(0, io.SeekStart) 6560 if len(code) != 0 { 6561 errorCode = restjson.SanitizeErrorCode(code) 6562 } 6563 if len(message) != 0 { 6564 errorMessage = message 6565 } 6566 6567 switch { 6568 case strings.EqualFold("WAFInternalErrorException", errorCode): 6569 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6570 6571 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6572 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6573 6574 default: 6575 genericError := &smithy.GenericAPIError{ 6576 Code: errorCode, 6577 Message: errorMessage, 6578 } 6579 return genericError 6580 6581 } 6582} 6583 6584type awsAwsjson11_deserializeOpListRegexMatchSets struct { 6585} 6586 6587func (*awsAwsjson11_deserializeOpListRegexMatchSets) ID() string { 6588 return "OperationDeserializer" 6589} 6590 6591func (m *awsAwsjson11_deserializeOpListRegexMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6592 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6593) { 6594 out, metadata, err = next.HandleDeserialize(ctx, in) 6595 if err != nil { 6596 return out, metadata, err 6597 } 6598 6599 response, ok := out.RawResponse.(*smithyhttp.Response) 6600 if !ok { 6601 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6602 } 6603 6604 if response.StatusCode < 200 || response.StatusCode >= 300 { 6605 return out, metadata, awsAwsjson11_deserializeOpErrorListRegexMatchSets(response, &metadata) 6606 } 6607 output := &ListRegexMatchSetsOutput{} 6608 out.Result = output 6609 6610 var buff [1024]byte 6611 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6612 6613 body := io.TeeReader(response.Body, ringBuffer) 6614 decoder := json.NewDecoder(body) 6615 decoder.UseNumber() 6616 var shape interface{} 6617 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6618 var snapshot bytes.Buffer 6619 io.Copy(&snapshot, ringBuffer) 6620 err = &smithy.DeserializationError{ 6621 Err: fmt.Errorf("failed to decode response body, %w", err), 6622 Snapshot: snapshot.Bytes(), 6623 } 6624 return out, metadata, err 6625 } 6626 6627 err = awsAwsjson11_deserializeOpDocumentListRegexMatchSetsOutput(&output, shape) 6628 if err != nil { 6629 var snapshot bytes.Buffer 6630 io.Copy(&snapshot, ringBuffer) 6631 err = &smithy.DeserializationError{ 6632 Err: fmt.Errorf("failed to decode response body, %w", err), 6633 Snapshot: snapshot.Bytes(), 6634 } 6635 return out, metadata, err 6636 } 6637 6638 return out, metadata, err 6639} 6640 6641func awsAwsjson11_deserializeOpErrorListRegexMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6642 var errorBuffer bytes.Buffer 6643 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6644 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6645 } 6646 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6647 6648 errorCode := "UnknownError" 6649 errorMessage := errorCode 6650 6651 code := response.Header.Get("X-Amzn-ErrorType") 6652 if len(code) != 0 { 6653 errorCode = restjson.SanitizeErrorCode(code) 6654 } 6655 6656 var buff [1024]byte 6657 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6658 6659 body := io.TeeReader(errorBody, ringBuffer) 6660 decoder := json.NewDecoder(body) 6661 decoder.UseNumber() 6662 code, message, err := restjson.GetErrorInfo(decoder) 6663 if err != nil { 6664 var snapshot bytes.Buffer 6665 io.Copy(&snapshot, ringBuffer) 6666 err = &smithy.DeserializationError{ 6667 Err: fmt.Errorf("failed to decode response body, %w", err), 6668 Snapshot: snapshot.Bytes(), 6669 } 6670 return err 6671 } 6672 6673 errorBody.Seek(0, io.SeekStart) 6674 if len(code) != 0 { 6675 errorCode = restjson.SanitizeErrorCode(code) 6676 } 6677 if len(message) != 0 { 6678 errorMessage = message 6679 } 6680 6681 switch { 6682 case strings.EqualFold("WAFInternalErrorException", errorCode): 6683 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6684 6685 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6686 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6687 6688 default: 6689 genericError := &smithy.GenericAPIError{ 6690 Code: errorCode, 6691 Message: errorMessage, 6692 } 6693 return genericError 6694 6695 } 6696} 6697 6698type awsAwsjson11_deserializeOpListRegexPatternSets struct { 6699} 6700 6701func (*awsAwsjson11_deserializeOpListRegexPatternSets) ID() string { 6702 return "OperationDeserializer" 6703} 6704 6705func (m *awsAwsjson11_deserializeOpListRegexPatternSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6706 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6707) { 6708 out, metadata, err = next.HandleDeserialize(ctx, in) 6709 if err != nil { 6710 return out, metadata, err 6711 } 6712 6713 response, ok := out.RawResponse.(*smithyhttp.Response) 6714 if !ok { 6715 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6716 } 6717 6718 if response.StatusCode < 200 || response.StatusCode >= 300 { 6719 return out, metadata, awsAwsjson11_deserializeOpErrorListRegexPatternSets(response, &metadata) 6720 } 6721 output := &ListRegexPatternSetsOutput{} 6722 out.Result = output 6723 6724 var buff [1024]byte 6725 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6726 6727 body := io.TeeReader(response.Body, ringBuffer) 6728 decoder := json.NewDecoder(body) 6729 decoder.UseNumber() 6730 var shape interface{} 6731 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6732 var snapshot bytes.Buffer 6733 io.Copy(&snapshot, ringBuffer) 6734 err = &smithy.DeserializationError{ 6735 Err: fmt.Errorf("failed to decode response body, %w", err), 6736 Snapshot: snapshot.Bytes(), 6737 } 6738 return out, metadata, err 6739 } 6740 6741 err = awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(&output, shape) 6742 if err != nil { 6743 var snapshot bytes.Buffer 6744 io.Copy(&snapshot, ringBuffer) 6745 err = &smithy.DeserializationError{ 6746 Err: fmt.Errorf("failed to decode response body, %w", err), 6747 Snapshot: snapshot.Bytes(), 6748 } 6749 return out, metadata, err 6750 } 6751 6752 return out, metadata, err 6753} 6754 6755func awsAwsjson11_deserializeOpErrorListRegexPatternSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6756 var errorBuffer bytes.Buffer 6757 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6758 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6759 } 6760 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6761 6762 errorCode := "UnknownError" 6763 errorMessage := errorCode 6764 6765 code := response.Header.Get("X-Amzn-ErrorType") 6766 if len(code) != 0 { 6767 errorCode = restjson.SanitizeErrorCode(code) 6768 } 6769 6770 var buff [1024]byte 6771 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6772 6773 body := io.TeeReader(errorBody, ringBuffer) 6774 decoder := json.NewDecoder(body) 6775 decoder.UseNumber() 6776 code, message, err := restjson.GetErrorInfo(decoder) 6777 if err != nil { 6778 var snapshot bytes.Buffer 6779 io.Copy(&snapshot, ringBuffer) 6780 err = &smithy.DeserializationError{ 6781 Err: fmt.Errorf("failed to decode response body, %w", err), 6782 Snapshot: snapshot.Bytes(), 6783 } 6784 return err 6785 } 6786 6787 errorBody.Seek(0, io.SeekStart) 6788 if len(code) != 0 { 6789 errorCode = restjson.SanitizeErrorCode(code) 6790 } 6791 if len(message) != 0 { 6792 errorMessage = message 6793 } 6794 6795 switch { 6796 case strings.EqualFold("WAFInternalErrorException", errorCode): 6797 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6798 6799 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6800 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6801 6802 default: 6803 genericError := &smithy.GenericAPIError{ 6804 Code: errorCode, 6805 Message: errorMessage, 6806 } 6807 return genericError 6808 6809 } 6810} 6811 6812type awsAwsjson11_deserializeOpListResourcesForWebACL struct { 6813} 6814 6815func (*awsAwsjson11_deserializeOpListResourcesForWebACL) ID() string { 6816 return "OperationDeserializer" 6817} 6818 6819func (m *awsAwsjson11_deserializeOpListResourcesForWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6820 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6821) { 6822 out, metadata, err = next.HandleDeserialize(ctx, in) 6823 if err != nil { 6824 return out, metadata, err 6825 } 6826 6827 response, ok := out.RawResponse.(*smithyhttp.Response) 6828 if !ok { 6829 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6830 } 6831 6832 if response.StatusCode < 200 || response.StatusCode >= 300 { 6833 return out, metadata, awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response, &metadata) 6834 } 6835 output := &ListResourcesForWebACLOutput{} 6836 out.Result = output 6837 6838 var buff [1024]byte 6839 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6840 6841 body := io.TeeReader(response.Body, ringBuffer) 6842 decoder := json.NewDecoder(body) 6843 decoder.UseNumber() 6844 var shape interface{} 6845 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6846 var snapshot bytes.Buffer 6847 io.Copy(&snapshot, ringBuffer) 6848 err = &smithy.DeserializationError{ 6849 Err: fmt.Errorf("failed to decode response body, %w", err), 6850 Snapshot: snapshot.Bytes(), 6851 } 6852 return out, metadata, err 6853 } 6854 6855 err = awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(&output, shape) 6856 if err != nil { 6857 var snapshot bytes.Buffer 6858 io.Copy(&snapshot, ringBuffer) 6859 err = &smithy.DeserializationError{ 6860 Err: fmt.Errorf("failed to decode response body, %w", err), 6861 Snapshot: snapshot.Bytes(), 6862 } 6863 return out, metadata, err 6864 } 6865 6866 return out, metadata, err 6867} 6868 6869func awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6870 var errorBuffer bytes.Buffer 6871 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6872 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6873 } 6874 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6875 6876 errorCode := "UnknownError" 6877 errorMessage := errorCode 6878 6879 code := response.Header.Get("X-Amzn-ErrorType") 6880 if len(code) != 0 { 6881 errorCode = restjson.SanitizeErrorCode(code) 6882 } 6883 6884 var buff [1024]byte 6885 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6886 6887 body := io.TeeReader(errorBody, ringBuffer) 6888 decoder := json.NewDecoder(body) 6889 decoder.UseNumber() 6890 code, message, err := restjson.GetErrorInfo(decoder) 6891 if err != nil { 6892 var snapshot bytes.Buffer 6893 io.Copy(&snapshot, ringBuffer) 6894 err = &smithy.DeserializationError{ 6895 Err: fmt.Errorf("failed to decode response body, %w", err), 6896 Snapshot: snapshot.Bytes(), 6897 } 6898 return err 6899 } 6900 6901 errorBody.Seek(0, io.SeekStart) 6902 if len(code) != 0 { 6903 errorCode = restjson.SanitizeErrorCode(code) 6904 } 6905 if len(message) != 0 { 6906 errorMessage = message 6907 } 6908 6909 switch { 6910 case strings.EqualFold("WAFInternalErrorException", errorCode): 6911 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 6912 6913 case strings.EqualFold("WAFInvalidAccountException", errorCode): 6914 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 6915 6916 case strings.EqualFold("WAFInvalidParameterException", errorCode): 6917 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 6918 6919 case strings.EqualFold("WAFNonexistentItemException", errorCode): 6920 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 6921 6922 default: 6923 genericError := &smithy.GenericAPIError{ 6924 Code: errorCode, 6925 Message: errorMessage, 6926 } 6927 return genericError 6928 6929 } 6930} 6931 6932type awsAwsjson11_deserializeOpListRuleGroups struct { 6933} 6934 6935func (*awsAwsjson11_deserializeOpListRuleGroups) ID() string { 6936 return "OperationDeserializer" 6937} 6938 6939func (m *awsAwsjson11_deserializeOpListRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6940 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6941) { 6942 out, metadata, err = next.HandleDeserialize(ctx, in) 6943 if err != nil { 6944 return out, metadata, err 6945 } 6946 6947 response, ok := out.RawResponse.(*smithyhttp.Response) 6948 if !ok { 6949 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6950 } 6951 6952 if response.StatusCode < 200 || response.StatusCode >= 300 { 6953 return out, metadata, awsAwsjson11_deserializeOpErrorListRuleGroups(response, &metadata) 6954 } 6955 output := &ListRuleGroupsOutput{} 6956 out.Result = output 6957 6958 var buff [1024]byte 6959 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6960 6961 body := io.TeeReader(response.Body, ringBuffer) 6962 decoder := json.NewDecoder(body) 6963 decoder.UseNumber() 6964 var shape interface{} 6965 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6966 var snapshot bytes.Buffer 6967 io.Copy(&snapshot, ringBuffer) 6968 err = &smithy.DeserializationError{ 6969 Err: fmt.Errorf("failed to decode response body, %w", err), 6970 Snapshot: snapshot.Bytes(), 6971 } 6972 return out, metadata, err 6973 } 6974 6975 err = awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(&output, shape) 6976 if err != nil { 6977 var snapshot bytes.Buffer 6978 io.Copy(&snapshot, ringBuffer) 6979 err = &smithy.DeserializationError{ 6980 Err: fmt.Errorf("failed to decode response body, %w", err), 6981 Snapshot: snapshot.Bytes(), 6982 } 6983 return out, metadata, err 6984 } 6985 6986 return out, metadata, err 6987} 6988 6989func awsAwsjson11_deserializeOpErrorListRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6990 var errorBuffer bytes.Buffer 6991 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6992 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6993 } 6994 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6995 6996 errorCode := "UnknownError" 6997 errorMessage := errorCode 6998 6999 code := response.Header.Get("X-Amzn-ErrorType") 7000 if len(code) != 0 { 7001 errorCode = restjson.SanitizeErrorCode(code) 7002 } 7003 7004 var buff [1024]byte 7005 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7006 7007 body := io.TeeReader(errorBody, ringBuffer) 7008 decoder := json.NewDecoder(body) 7009 decoder.UseNumber() 7010 code, message, err := restjson.GetErrorInfo(decoder) 7011 if err != nil { 7012 var snapshot bytes.Buffer 7013 io.Copy(&snapshot, ringBuffer) 7014 err = &smithy.DeserializationError{ 7015 Err: fmt.Errorf("failed to decode response body, %w", err), 7016 Snapshot: snapshot.Bytes(), 7017 } 7018 return err 7019 } 7020 7021 errorBody.Seek(0, io.SeekStart) 7022 if len(code) != 0 { 7023 errorCode = restjson.SanitizeErrorCode(code) 7024 } 7025 if len(message) != 0 { 7026 errorMessage = message 7027 } 7028 7029 switch { 7030 case strings.EqualFold("WAFInternalErrorException", errorCode): 7031 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7032 7033 default: 7034 genericError := &smithy.GenericAPIError{ 7035 Code: errorCode, 7036 Message: errorMessage, 7037 } 7038 return genericError 7039 7040 } 7041} 7042 7043type awsAwsjson11_deserializeOpListRules struct { 7044} 7045 7046func (*awsAwsjson11_deserializeOpListRules) ID() string { 7047 return "OperationDeserializer" 7048} 7049 7050func (m *awsAwsjson11_deserializeOpListRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7051 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7052) { 7053 out, metadata, err = next.HandleDeserialize(ctx, in) 7054 if err != nil { 7055 return out, metadata, err 7056 } 7057 7058 response, ok := out.RawResponse.(*smithyhttp.Response) 7059 if !ok { 7060 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7061 } 7062 7063 if response.StatusCode < 200 || response.StatusCode >= 300 { 7064 return out, metadata, awsAwsjson11_deserializeOpErrorListRules(response, &metadata) 7065 } 7066 output := &ListRulesOutput{} 7067 out.Result = output 7068 7069 var buff [1024]byte 7070 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7071 7072 body := io.TeeReader(response.Body, ringBuffer) 7073 decoder := json.NewDecoder(body) 7074 decoder.UseNumber() 7075 var shape interface{} 7076 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7077 var snapshot bytes.Buffer 7078 io.Copy(&snapshot, ringBuffer) 7079 err = &smithy.DeserializationError{ 7080 Err: fmt.Errorf("failed to decode response body, %w", err), 7081 Snapshot: snapshot.Bytes(), 7082 } 7083 return out, metadata, err 7084 } 7085 7086 err = awsAwsjson11_deserializeOpDocumentListRulesOutput(&output, shape) 7087 if err != nil { 7088 var snapshot bytes.Buffer 7089 io.Copy(&snapshot, ringBuffer) 7090 err = &smithy.DeserializationError{ 7091 Err: fmt.Errorf("failed to decode response body, %w", err), 7092 Snapshot: snapshot.Bytes(), 7093 } 7094 return out, metadata, err 7095 } 7096 7097 return out, metadata, err 7098} 7099 7100func awsAwsjson11_deserializeOpErrorListRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7101 var errorBuffer bytes.Buffer 7102 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7103 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7104 } 7105 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7106 7107 errorCode := "UnknownError" 7108 errorMessage := errorCode 7109 7110 code := response.Header.Get("X-Amzn-ErrorType") 7111 if len(code) != 0 { 7112 errorCode = restjson.SanitizeErrorCode(code) 7113 } 7114 7115 var buff [1024]byte 7116 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7117 7118 body := io.TeeReader(errorBody, ringBuffer) 7119 decoder := json.NewDecoder(body) 7120 decoder.UseNumber() 7121 code, message, err := restjson.GetErrorInfo(decoder) 7122 if err != nil { 7123 var snapshot bytes.Buffer 7124 io.Copy(&snapshot, ringBuffer) 7125 err = &smithy.DeserializationError{ 7126 Err: fmt.Errorf("failed to decode response body, %w", err), 7127 Snapshot: snapshot.Bytes(), 7128 } 7129 return err 7130 } 7131 7132 errorBody.Seek(0, io.SeekStart) 7133 if len(code) != 0 { 7134 errorCode = restjson.SanitizeErrorCode(code) 7135 } 7136 if len(message) != 0 { 7137 errorMessage = message 7138 } 7139 7140 switch { 7141 case strings.EqualFold("WAFInternalErrorException", errorCode): 7142 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7143 7144 case strings.EqualFold("WAFInvalidAccountException", errorCode): 7145 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 7146 7147 default: 7148 genericError := &smithy.GenericAPIError{ 7149 Code: errorCode, 7150 Message: errorMessage, 7151 } 7152 return genericError 7153 7154 } 7155} 7156 7157type awsAwsjson11_deserializeOpListSizeConstraintSets struct { 7158} 7159 7160func (*awsAwsjson11_deserializeOpListSizeConstraintSets) ID() string { 7161 return "OperationDeserializer" 7162} 7163 7164func (m *awsAwsjson11_deserializeOpListSizeConstraintSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7165 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7166) { 7167 out, metadata, err = next.HandleDeserialize(ctx, in) 7168 if err != nil { 7169 return out, metadata, err 7170 } 7171 7172 response, ok := out.RawResponse.(*smithyhttp.Response) 7173 if !ok { 7174 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7175 } 7176 7177 if response.StatusCode < 200 || response.StatusCode >= 300 { 7178 return out, metadata, awsAwsjson11_deserializeOpErrorListSizeConstraintSets(response, &metadata) 7179 } 7180 output := &ListSizeConstraintSetsOutput{} 7181 out.Result = output 7182 7183 var buff [1024]byte 7184 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7185 7186 body := io.TeeReader(response.Body, ringBuffer) 7187 decoder := json.NewDecoder(body) 7188 decoder.UseNumber() 7189 var shape interface{} 7190 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7191 var snapshot bytes.Buffer 7192 io.Copy(&snapshot, ringBuffer) 7193 err = &smithy.DeserializationError{ 7194 Err: fmt.Errorf("failed to decode response body, %w", err), 7195 Snapshot: snapshot.Bytes(), 7196 } 7197 return out, metadata, err 7198 } 7199 7200 err = awsAwsjson11_deserializeOpDocumentListSizeConstraintSetsOutput(&output, shape) 7201 if err != nil { 7202 var snapshot bytes.Buffer 7203 io.Copy(&snapshot, ringBuffer) 7204 err = &smithy.DeserializationError{ 7205 Err: fmt.Errorf("failed to decode response body, %w", err), 7206 Snapshot: snapshot.Bytes(), 7207 } 7208 return out, metadata, err 7209 } 7210 7211 return out, metadata, err 7212} 7213 7214func awsAwsjson11_deserializeOpErrorListSizeConstraintSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7215 var errorBuffer bytes.Buffer 7216 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7217 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7218 } 7219 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7220 7221 errorCode := "UnknownError" 7222 errorMessage := errorCode 7223 7224 code := response.Header.Get("X-Amzn-ErrorType") 7225 if len(code) != 0 { 7226 errorCode = restjson.SanitizeErrorCode(code) 7227 } 7228 7229 var buff [1024]byte 7230 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7231 7232 body := io.TeeReader(errorBody, ringBuffer) 7233 decoder := json.NewDecoder(body) 7234 decoder.UseNumber() 7235 code, message, err := restjson.GetErrorInfo(decoder) 7236 if err != nil { 7237 var snapshot bytes.Buffer 7238 io.Copy(&snapshot, ringBuffer) 7239 err = &smithy.DeserializationError{ 7240 Err: fmt.Errorf("failed to decode response body, %w", err), 7241 Snapshot: snapshot.Bytes(), 7242 } 7243 return err 7244 } 7245 7246 errorBody.Seek(0, io.SeekStart) 7247 if len(code) != 0 { 7248 errorCode = restjson.SanitizeErrorCode(code) 7249 } 7250 if len(message) != 0 { 7251 errorMessage = message 7252 } 7253 7254 switch { 7255 case strings.EqualFold("WAFInternalErrorException", errorCode): 7256 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7257 7258 case strings.EqualFold("WAFInvalidAccountException", errorCode): 7259 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 7260 7261 default: 7262 genericError := &smithy.GenericAPIError{ 7263 Code: errorCode, 7264 Message: errorMessage, 7265 } 7266 return genericError 7267 7268 } 7269} 7270 7271type awsAwsjson11_deserializeOpListSqlInjectionMatchSets struct { 7272} 7273 7274func (*awsAwsjson11_deserializeOpListSqlInjectionMatchSets) ID() string { 7275 return "OperationDeserializer" 7276} 7277 7278func (m *awsAwsjson11_deserializeOpListSqlInjectionMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7279 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7280) { 7281 out, metadata, err = next.HandleDeserialize(ctx, in) 7282 if err != nil { 7283 return out, metadata, err 7284 } 7285 7286 response, ok := out.RawResponse.(*smithyhttp.Response) 7287 if !ok { 7288 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7289 } 7290 7291 if response.StatusCode < 200 || response.StatusCode >= 300 { 7292 return out, metadata, awsAwsjson11_deserializeOpErrorListSqlInjectionMatchSets(response, &metadata) 7293 } 7294 output := &ListSqlInjectionMatchSetsOutput{} 7295 out.Result = output 7296 7297 var buff [1024]byte 7298 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7299 7300 body := io.TeeReader(response.Body, ringBuffer) 7301 decoder := json.NewDecoder(body) 7302 decoder.UseNumber() 7303 var shape interface{} 7304 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7305 var snapshot bytes.Buffer 7306 io.Copy(&snapshot, ringBuffer) 7307 err = &smithy.DeserializationError{ 7308 Err: fmt.Errorf("failed to decode response body, %w", err), 7309 Snapshot: snapshot.Bytes(), 7310 } 7311 return out, metadata, err 7312 } 7313 7314 err = awsAwsjson11_deserializeOpDocumentListSqlInjectionMatchSetsOutput(&output, shape) 7315 if err != nil { 7316 var snapshot bytes.Buffer 7317 io.Copy(&snapshot, ringBuffer) 7318 err = &smithy.DeserializationError{ 7319 Err: fmt.Errorf("failed to decode response body, %w", err), 7320 Snapshot: snapshot.Bytes(), 7321 } 7322 return out, metadata, err 7323 } 7324 7325 return out, metadata, err 7326} 7327 7328func awsAwsjson11_deserializeOpErrorListSqlInjectionMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7329 var errorBuffer bytes.Buffer 7330 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7331 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7332 } 7333 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7334 7335 errorCode := "UnknownError" 7336 errorMessage := errorCode 7337 7338 code := response.Header.Get("X-Amzn-ErrorType") 7339 if len(code) != 0 { 7340 errorCode = restjson.SanitizeErrorCode(code) 7341 } 7342 7343 var buff [1024]byte 7344 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7345 7346 body := io.TeeReader(errorBody, ringBuffer) 7347 decoder := json.NewDecoder(body) 7348 decoder.UseNumber() 7349 code, message, err := restjson.GetErrorInfo(decoder) 7350 if err != nil { 7351 var snapshot bytes.Buffer 7352 io.Copy(&snapshot, ringBuffer) 7353 err = &smithy.DeserializationError{ 7354 Err: fmt.Errorf("failed to decode response body, %w", err), 7355 Snapshot: snapshot.Bytes(), 7356 } 7357 return err 7358 } 7359 7360 errorBody.Seek(0, io.SeekStart) 7361 if len(code) != 0 { 7362 errorCode = restjson.SanitizeErrorCode(code) 7363 } 7364 if len(message) != 0 { 7365 errorMessage = message 7366 } 7367 7368 switch { 7369 case strings.EqualFold("WAFInternalErrorException", errorCode): 7370 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7371 7372 case strings.EqualFold("WAFInvalidAccountException", errorCode): 7373 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 7374 7375 default: 7376 genericError := &smithy.GenericAPIError{ 7377 Code: errorCode, 7378 Message: errorMessage, 7379 } 7380 return genericError 7381 7382 } 7383} 7384 7385type awsAwsjson11_deserializeOpListSubscribedRuleGroups struct { 7386} 7387 7388func (*awsAwsjson11_deserializeOpListSubscribedRuleGroups) ID() string { 7389 return "OperationDeserializer" 7390} 7391 7392func (m *awsAwsjson11_deserializeOpListSubscribedRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7393 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7394) { 7395 out, metadata, err = next.HandleDeserialize(ctx, in) 7396 if err != nil { 7397 return out, metadata, err 7398 } 7399 7400 response, ok := out.RawResponse.(*smithyhttp.Response) 7401 if !ok { 7402 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7403 } 7404 7405 if response.StatusCode < 200 || response.StatusCode >= 300 { 7406 return out, metadata, awsAwsjson11_deserializeOpErrorListSubscribedRuleGroups(response, &metadata) 7407 } 7408 output := &ListSubscribedRuleGroupsOutput{} 7409 out.Result = output 7410 7411 var buff [1024]byte 7412 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7413 7414 body := io.TeeReader(response.Body, ringBuffer) 7415 decoder := json.NewDecoder(body) 7416 decoder.UseNumber() 7417 var shape interface{} 7418 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7419 var snapshot bytes.Buffer 7420 io.Copy(&snapshot, ringBuffer) 7421 err = &smithy.DeserializationError{ 7422 Err: fmt.Errorf("failed to decode response body, %w", err), 7423 Snapshot: snapshot.Bytes(), 7424 } 7425 return out, metadata, err 7426 } 7427 7428 err = awsAwsjson11_deserializeOpDocumentListSubscribedRuleGroupsOutput(&output, shape) 7429 if err != nil { 7430 var snapshot bytes.Buffer 7431 io.Copy(&snapshot, ringBuffer) 7432 err = &smithy.DeserializationError{ 7433 Err: fmt.Errorf("failed to decode response body, %w", err), 7434 Snapshot: snapshot.Bytes(), 7435 } 7436 return out, metadata, err 7437 } 7438 7439 return out, metadata, err 7440} 7441 7442func awsAwsjson11_deserializeOpErrorListSubscribedRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7443 var errorBuffer bytes.Buffer 7444 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7445 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7446 } 7447 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7448 7449 errorCode := "UnknownError" 7450 errorMessage := errorCode 7451 7452 code := response.Header.Get("X-Amzn-ErrorType") 7453 if len(code) != 0 { 7454 errorCode = restjson.SanitizeErrorCode(code) 7455 } 7456 7457 var buff [1024]byte 7458 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7459 7460 body := io.TeeReader(errorBody, ringBuffer) 7461 decoder := json.NewDecoder(body) 7462 decoder.UseNumber() 7463 code, message, err := restjson.GetErrorInfo(decoder) 7464 if err != nil { 7465 var snapshot bytes.Buffer 7466 io.Copy(&snapshot, ringBuffer) 7467 err = &smithy.DeserializationError{ 7468 Err: fmt.Errorf("failed to decode response body, %w", err), 7469 Snapshot: snapshot.Bytes(), 7470 } 7471 return err 7472 } 7473 7474 errorBody.Seek(0, io.SeekStart) 7475 if len(code) != 0 { 7476 errorCode = restjson.SanitizeErrorCode(code) 7477 } 7478 if len(message) != 0 { 7479 errorMessage = message 7480 } 7481 7482 switch { 7483 case strings.EqualFold("WAFInternalErrorException", errorCode): 7484 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7485 7486 case strings.EqualFold("WAFNonexistentItemException", errorCode): 7487 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 7488 7489 default: 7490 genericError := &smithy.GenericAPIError{ 7491 Code: errorCode, 7492 Message: errorMessage, 7493 } 7494 return genericError 7495 7496 } 7497} 7498 7499type awsAwsjson11_deserializeOpListTagsForResource struct { 7500} 7501 7502func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { 7503 return "OperationDeserializer" 7504} 7505 7506func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7507 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7508) { 7509 out, metadata, err = next.HandleDeserialize(ctx, in) 7510 if err != nil { 7511 return out, metadata, err 7512 } 7513 7514 response, ok := out.RawResponse.(*smithyhttp.Response) 7515 if !ok { 7516 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7517 } 7518 7519 if response.StatusCode < 200 || response.StatusCode >= 300 { 7520 return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) 7521 } 7522 output := &ListTagsForResourceOutput{} 7523 out.Result = output 7524 7525 var buff [1024]byte 7526 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7527 7528 body := io.TeeReader(response.Body, ringBuffer) 7529 decoder := json.NewDecoder(body) 7530 decoder.UseNumber() 7531 var shape interface{} 7532 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7533 var snapshot bytes.Buffer 7534 io.Copy(&snapshot, ringBuffer) 7535 err = &smithy.DeserializationError{ 7536 Err: fmt.Errorf("failed to decode response body, %w", err), 7537 Snapshot: snapshot.Bytes(), 7538 } 7539 return out, metadata, err 7540 } 7541 7542 err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 7543 if err != nil { 7544 var snapshot bytes.Buffer 7545 io.Copy(&snapshot, ringBuffer) 7546 err = &smithy.DeserializationError{ 7547 Err: fmt.Errorf("failed to decode response body, %w", err), 7548 Snapshot: snapshot.Bytes(), 7549 } 7550 return out, metadata, err 7551 } 7552 7553 return out, metadata, err 7554} 7555 7556func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7557 var errorBuffer bytes.Buffer 7558 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7559 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7560 } 7561 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7562 7563 errorCode := "UnknownError" 7564 errorMessage := errorCode 7565 7566 code := response.Header.Get("X-Amzn-ErrorType") 7567 if len(code) != 0 { 7568 errorCode = restjson.SanitizeErrorCode(code) 7569 } 7570 7571 var buff [1024]byte 7572 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7573 7574 body := io.TeeReader(errorBody, ringBuffer) 7575 decoder := json.NewDecoder(body) 7576 decoder.UseNumber() 7577 code, message, err := restjson.GetErrorInfo(decoder) 7578 if err != nil { 7579 var snapshot bytes.Buffer 7580 io.Copy(&snapshot, ringBuffer) 7581 err = &smithy.DeserializationError{ 7582 Err: fmt.Errorf("failed to decode response body, %w", err), 7583 Snapshot: snapshot.Bytes(), 7584 } 7585 return err 7586 } 7587 7588 errorBody.Seek(0, io.SeekStart) 7589 if len(code) != 0 { 7590 errorCode = restjson.SanitizeErrorCode(code) 7591 } 7592 if len(message) != 0 { 7593 errorMessage = message 7594 } 7595 7596 switch { 7597 case strings.EqualFold("WAFBadRequestException", errorCode): 7598 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 7599 7600 case strings.EqualFold("WAFInternalErrorException", errorCode): 7601 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7602 7603 case strings.EqualFold("WAFInvalidParameterException", errorCode): 7604 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 7605 7606 case strings.EqualFold("WAFNonexistentItemException", errorCode): 7607 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 7608 7609 case strings.EqualFold("WAFTagOperationException", errorCode): 7610 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 7611 7612 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 7613 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 7614 7615 default: 7616 genericError := &smithy.GenericAPIError{ 7617 Code: errorCode, 7618 Message: errorMessage, 7619 } 7620 return genericError 7621 7622 } 7623} 7624 7625type awsAwsjson11_deserializeOpListWebACLs struct { 7626} 7627 7628func (*awsAwsjson11_deserializeOpListWebACLs) ID() string { 7629 return "OperationDeserializer" 7630} 7631 7632func (m *awsAwsjson11_deserializeOpListWebACLs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7633 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7634) { 7635 out, metadata, err = next.HandleDeserialize(ctx, in) 7636 if err != nil { 7637 return out, metadata, err 7638 } 7639 7640 response, ok := out.RawResponse.(*smithyhttp.Response) 7641 if !ok { 7642 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7643 } 7644 7645 if response.StatusCode < 200 || response.StatusCode >= 300 { 7646 return out, metadata, awsAwsjson11_deserializeOpErrorListWebACLs(response, &metadata) 7647 } 7648 output := &ListWebACLsOutput{} 7649 out.Result = output 7650 7651 var buff [1024]byte 7652 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7653 7654 body := io.TeeReader(response.Body, ringBuffer) 7655 decoder := json.NewDecoder(body) 7656 decoder.UseNumber() 7657 var shape interface{} 7658 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7659 var snapshot bytes.Buffer 7660 io.Copy(&snapshot, ringBuffer) 7661 err = &smithy.DeserializationError{ 7662 Err: fmt.Errorf("failed to decode response body, %w", err), 7663 Snapshot: snapshot.Bytes(), 7664 } 7665 return out, metadata, err 7666 } 7667 7668 err = awsAwsjson11_deserializeOpDocumentListWebACLsOutput(&output, shape) 7669 if err != nil { 7670 var snapshot bytes.Buffer 7671 io.Copy(&snapshot, ringBuffer) 7672 err = &smithy.DeserializationError{ 7673 Err: fmt.Errorf("failed to decode response body, %w", err), 7674 Snapshot: snapshot.Bytes(), 7675 } 7676 return out, metadata, err 7677 } 7678 7679 return out, metadata, err 7680} 7681 7682func awsAwsjson11_deserializeOpErrorListWebACLs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7683 var errorBuffer bytes.Buffer 7684 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7685 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7686 } 7687 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7688 7689 errorCode := "UnknownError" 7690 errorMessage := errorCode 7691 7692 code := response.Header.Get("X-Amzn-ErrorType") 7693 if len(code) != 0 { 7694 errorCode = restjson.SanitizeErrorCode(code) 7695 } 7696 7697 var buff [1024]byte 7698 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7699 7700 body := io.TeeReader(errorBody, ringBuffer) 7701 decoder := json.NewDecoder(body) 7702 decoder.UseNumber() 7703 code, message, err := restjson.GetErrorInfo(decoder) 7704 if err != nil { 7705 var snapshot bytes.Buffer 7706 io.Copy(&snapshot, ringBuffer) 7707 err = &smithy.DeserializationError{ 7708 Err: fmt.Errorf("failed to decode response body, %w", err), 7709 Snapshot: snapshot.Bytes(), 7710 } 7711 return err 7712 } 7713 7714 errorBody.Seek(0, io.SeekStart) 7715 if len(code) != 0 { 7716 errorCode = restjson.SanitizeErrorCode(code) 7717 } 7718 if len(message) != 0 { 7719 errorMessage = message 7720 } 7721 7722 switch { 7723 case strings.EqualFold("WAFInternalErrorException", errorCode): 7724 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7725 7726 case strings.EqualFold("WAFInvalidAccountException", errorCode): 7727 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 7728 7729 default: 7730 genericError := &smithy.GenericAPIError{ 7731 Code: errorCode, 7732 Message: errorMessage, 7733 } 7734 return genericError 7735 7736 } 7737} 7738 7739type awsAwsjson11_deserializeOpListXssMatchSets struct { 7740} 7741 7742func (*awsAwsjson11_deserializeOpListXssMatchSets) ID() string { 7743 return "OperationDeserializer" 7744} 7745 7746func (m *awsAwsjson11_deserializeOpListXssMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7747 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7748) { 7749 out, metadata, err = next.HandleDeserialize(ctx, in) 7750 if err != nil { 7751 return out, metadata, err 7752 } 7753 7754 response, ok := out.RawResponse.(*smithyhttp.Response) 7755 if !ok { 7756 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7757 } 7758 7759 if response.StatusCode < 200 || response.StatusCode >= 300 { 7760 return out, metadata, awsAwsjson11_deserializeOpErrorListXssMatchSets(response, &metadata) 7761 } 7762 output := &ListXssMatchSetsOutput{} 7763 out.Result = output 7764 7765 var buff [1024]byte 7766 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7767 7768 body := io.TeeReader(response.Body, ringBuffer) 7769 decoder := json.NewDecoder(body) 7770 decoder.UseNumber() 7771 var shape interface{} 7772 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7773 var snapshot bytes.Buffer 7774 io.Copy(&snapshot, ringBuffer) 7775 err = &smithy.DeserializationError{ 7776 Err: fmt.Errorf("failed to decode response body, %w", err), 7777 Snapshot: snapshot.Bytes(), 7778 } 7779 return out, metadata, err 7780 } 7781 7782 err = awsAwsjson11_deserializeOpDocumentListXssMatchSetsOutput(&output, shape) 7783 if err != nil { 7784 var snapshot bytes.Buffer 7785 io.Copy(&snapshot, ringBuffer) 7786 err = &smithy.DeserializationError{ 7787 Err: fmt.Errorf("failed to decode response body, %w", err), 7788 Snapshot: snapshot.Bytes(), 7789 } 7790 return out, metadata, err 7791 } 7792 7793 return out, metadata, err 7794} 7795 7796func awsAwsjson11_deserializeOpErrorListXssMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7797 var errorBuffer bytes.Buffer 7798 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7799 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7800 } 7801 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7802 7803 errorCode := "UnknownError" 7804 errorMessage := errorCode 7805 7806 code := response.Header.Get("X-Amzn-ErrorType") 7807 if len(code) != 0 { 7808 errorCode = restjson.SanitizeErrorCode(code) 7809 } 7810 7811 var buff [1024]byte 7812 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7813 7814 body := io.TeeReader(errorBody, ringBuffer) 7815 decoder := json.NewDecoder(body) 7816 decoder.UseNumber() 7817 code, message, err := restjson.GetErrorInfo(decoder) 7818 if err != nil { 7819 var snapshot bytes.Buffer 7820 io.Copy(&snapshot, ringBuffer) 7821 err = &smithy.DeserializationError{ 7822 Err: fmt.Errorf("failed to decode response body, %w", err), 7823 Snapshot: snapshot.Bytes(), 7824 } 7825 return err 7826 } 7827 7828 errorBody.Seek(0, io.SeekStart) 7829 if len(code) != 0 { 7830 errorCode = restjson.SanitizeErrorCode(code) 7831 } 7832 if len(message) != 0 { 7833 errorMessage = message 7834 } 7835 7836 switch { 7837 case strings.EqualFold("WAFInternalErrorException", errorCode): 7838 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7839 7840 case strings.EqualFold("WAFInvalidAccountException", errorCode): 7841 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 7842 7843 default: 7844 genericError := &smithy.GenericAPIError{ 7845 Code: errorCode, 7846 Message: errorMessage, 7847 } 7848 return genericError 7849 7850 } 7851} 7852 7853type awsAwsjson11_deserializeOpPutLoggingConfiguration struct { 7854} 7855 7856func (*awsAwsjson11_deserializeOpPutLoggingConfiguration) ID() string { 7857 return "OperationDeserializer" 7858} 7859 7860func (m *awsAwsjson11_deserializeOpPutLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7861 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7862) { 7863 out, metadata, err = next.HandleDeserialize(ctx, in) 7864 if err != nil { 7865 return out, metadata, err 7866 } 7867 7868 response, ok := out.RawResponse.(*smithyhttp.Response) 7869 if !ok { 7870 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7871 } 7872 7873 if response.StatusCode < 200 || response.StatusCode >= 300 { 7874 return out, metadata, awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response, &metadata) 7875 } 7876 output := &PutLoggingConfigurationOutput{} 7877 out.Result = output 7878 7879 var buff [1024]byte 7880 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7881 7882 body := io.TeeReader(response.Body, ringBuffer) 7883 decoder := json.NewDecoder(body) 7884 decoder.UseNumber() 7885 var shape interface{} 7886 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7887 var snapshot bytes.Buffer 7888 io.Copy(&snapshot, ringBuffer) 7889 err = &smithy.DeserializationError{ 7890 Err: fmt.Errorf("failed to decode response body, %w", err), 7891 Snapshot: snapshot.Bytes(), 7892 } 7893 return out, metadata, err 7894 } 7895 7896 err = awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(&output, shape) 7897 if err != nil { 7898 var snapshot bytes.Buffer 7899 io.Copy(&snapshot, ringBuffer) 7900 err = &smithy.DeserializationError{ 7901 Err: fmt.Errorf("failed to decode response body, %w", err), 7902 Snapshot: snapshot.Bytes(), 7903 } 7904 return out, metadata, err 7905 } 7906 7907 return out, metadata, err 7908} 7909 7910func awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7911 var errorBuffer bytes.Buffer 7912 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7913 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7914 } 7915 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7916 7917 errorCode := "UnknownError" 7918 errorMessage := errorCode 7919 7920 code := response.Header.Get("X-Amzn-ErrorType") 7921 if len(code) != 0 { 7922 errorCode = restjson.SanitizeErrorCode(code) 7923 } 7924 7925 var buff [1024]byte 7926 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7927 7928 body := io.TeeReader(errorBody, ringBuffer) 7929 decoder := json.NewDecoder(body) 7930 decoder.UseNumber() 7931 code, message, err := restjson.GetErrorInfo(decoder) 7932 if err != nil { 7933 var snapshot bytes.Buffer 7934 io.Copy(&snapshot, ringBuffer) 7935 err = &smithy.DeserializationError{ 7936 Err: fmt.Errorf("failed to decode response body, %w", err), 7937 Snapshot: snapshot.Bytes(), 7938 } 7939 return err 7940 } 7941 7942 errorBody.Seek(0, io.SeekStart) 7943 if len(code) != 0 { 7944 errorCode = restjson.SanitizeErrorCode(code) 7945 } 7946 if len(message) != 0 { 7947 errorMessage = message 7948 } 7949 7950 switch { 7951 case strings.EqualFold("WAFInternalErrorException", errorCode): 7952 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 7953 7954 case strings.EqualFold("WAFNonexistentItemException", errorCode): 7955 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 7956 7957 case strings.EqualFold("WAFServiceLinkedRoleErrorException", errorCode): 7958 return awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response, errorBody) 7959 7960 case strings.EqualFold("WAFStaleDataException", errorCode): 7961 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 7962 7963 default: 7964 genericError := &smithy.GenericAPIError{ 7965 Code: errorCode, 7966 Message: errorMessage, 7967 } 7968 return genericError 7969 7970 } 7971} 7972 7973type awsAwsjson11_deserializeOpPutPermissionPolicy struct { 7974} 7975 7976func (*awsAwsjson11_deserializeOpPutPermissionPolicy) ID() string { 7977 return "OperationDeserializer" 7978} 7979 7980func (m *awsAwsjson11_deserializeOpPutPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7981 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7982) { 7983 out, metadata, err = next.HandleDeserialize(ctx, in) 7984 if err != nil { 7985 return out, metadata, err 7986 } 7987 7988 response, ok := out.RawResponse.(*smithyhttp.Response) 7989 if !ok { 7990 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7991 } 7992 7993 if response.StatusCode < 200 || response.StatusCode >= 300 { 7994 return out, metadata, awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response, &metadata) 7995 } 7996 output := &PutPermissionPolicyOutput{} 7997 out.Result = output 7998 7999 var buff [1024]byte 8000 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8001 8002 body := io.TeeReader(response.Body, ringBuffer) 8003 decoder := json.NewDecoder(body) 8004 decoder.UseNumber() 8005 var shape interface{} 8006 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8007 var snapshot bytes.Buffer 8008 io.Copy(&snapshot, ringBuffer) 8009 err = &smithy.DeserializationError{ 8010 Err: fmt.Errorf("failed to decode response body, %w", err), 8011 Snapshot: snapshot.Bytes(), 8012 } 8013 return out, metadata, err 8014 } 8015 8016 err = awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(&output, shape) 8017 if err != nil { 8018 var snapshot bytes.Buffer 8019 io.Copy(&snapshot, ringBuffer) 8020 err = &smithy.DeserializationError{ 8021 Err: fmt.Errorf("failed to decode response body, %w", err), 8022 Snapshot: snapshot.Bytes(), 8023 } 8024 return out, metadata, err 8025 } 8026 8027 return out, metadata, err 8028} 8029 8030func awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8031 var errorBuffer bytes.Buffer 8032 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8033 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8034 } 8035 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8036 8037 errorCode := "UnknownError" 8038 errorMessage := errorCode 8039 8040 code := response.Header.Get("X-Amzn-ErrorType") 8041 if len(code) != 0 { 8042 errorCode = restjson.SanitizeErrorCode(code) 8043 } 8044 8045 var buff [1024]byte 8046 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8047 8048 body := io.TeeReader(errorBody, ringBuffer) 8049 decoder := json.NewDecoder(body) 8050 decoder.UseNumber() 8051 code, message, err := restjson.GetErrorInfo(decoder) 8052 if err != nil { 8053 var snapshot bytes.Buffer 8054 io.Copy(&snapshot, ringBuffer) 8055 err = &smithy.DeserializationError{ 8056 Err: fmt.Errorf("failed to decode response body, %w", err), 8057 Snapshot: snapshot.Bytes(), 8058 } 8059 return err 8060 } 8061 8062 errorBody.Seek(0, io.SeekStart) 8063 if len(code) != 0 { 8064 errorCode = restjson.SanitizeErrorCode(code) 8065 } 8066 if len(message) != 0 { 8067 errorMessage = message 8068 } 8069 8070 switch { 8071 case strings.EqualFold("WAFInternalErrorException", errorCode): 8072 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8073 8074 case strings.EqualFold("WAFInvalidPermissionPolicyException", errorCode): 8075 return awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response, errorBody) 8076 8077 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8078 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8079 8080 case strings.EqualFold("WAFStaleDataException", errorCode): 8081 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 8082 8083 default: 8084 genericError := &smithy.GenericAPIError{ 8085 Code: errorCode, 8086 Message: errorMessage, 8087 } 8088 return genericError 8089 8090 } 8091} 8092 8093type awsAwsjson11_deserializeOpTagResource struct { 8094} 8095 8096func (*awsAwsjson11_deserializeOpTagResource) ID() string { 8097 return "OperationDeserializer" 8098} 8099 8100func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8101 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8102) { 8103 out, metadata, err = next.HandleDeserialize(ctx, in) 8104 if err != nil { 8105 return out, metadata, err 8106 } 8107 8108 response, ok := out.RawResponse.(*smithyhttp.Response) 8109 if !ok { 8110 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8111 } 8112 8113 if response.StatusCode < 200 || response.StatusCode >= 300 { 8114 return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) 8115 } 8116 output := &TagResourceOutput{} 8117 out.Result = output 8118 8119 var buff [1024]byte 8120 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8121 8122 body := io.TeeReader(response.Body, ringBuffer) 8123 decoder := json.NewDecoder(body) 8124 decoder.UseNumber() 8125 var shape interface{} 8126 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8127 var snapshot bytes.Buffer 8128 io.Copy(&snapshot, ringBuffer) 8129 err = &smithy.DeserializationError{ 8130 Err: fmt.Errorf("failed to decode response body, %w", err), 8131 Snapshot: snapshot.Bytes(), 8132 } 8133 return out, metadata, err 8134 } 8135 8136 err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) 8137 if err != nil { 8138 var snapshot bytes.Buffer 8139 io.Copy(&snapshot, ringBuffer) 8140 err = &smithy.DeserializationError{ 8141 Err: fmt.Errorf("failed to decode response body, %w", err), 8142 Snapshot: snapshot.Bytes(), 8143 } 8144 return out, metadata, err 8145 } 8146 8147 return out, metadata, err 8148} 8149 8150func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8151 var errorBuffer bytes.Buffer 8152 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8153 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8154 } 8155 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8156 8157 errorCode := "UnknownError" 8158 errorMessage := errorCode 8159 8160 code := response.Header.Get("X-Amzn-ErrorType") 8161 if len(code) != 0 { 8162 errorCode = restjson.SanitizeErrorCode(code) 8163 } 8164 8165 var buff [1024]byte 8166 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8167 8168 body := io.TeeReader(errorBody, ringBuffer) 8169 decoder := json.NewDecoder(body) 8170 decoder.UseNumber() 8171 code, message, err := restjson.GetErrorInfo(decoder) 8172 if err != nil { 8173 var snapshot bytes.Buffer 8174 io.Copy(&snapshot, ringBuffer) 8175 err = &smithy.DeserializationError{ 8176 Err: fmt.Errorf("failed to decode response body, %w", err), 8177 Snapshot: snapshot.Bytes(), 8178 } 8179 return err 8180 } 8181 8182 errorBody.Seek(0, io.SeekStart) 8183 if len(code) != 0 { 8184 errorCode = restjson.SanitizeErrorCode(code) 8185 } 8186 if len(message) != 0 { 8187 errorMessage = message 8188 } 8189 8190 switch { 8191 case strings.EqualFold("WAFBadRequestException", errorCode): 8192 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 8193 8194 case strings.EqualFold("WAFInternalErrorException", errorCode): 8195 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8196 8197 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8198 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8199 8200 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8201 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8202 8203 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8204 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8205 8206 case strings.EqualFold("WAFTagOperationException", errorCode): 8207 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 8208 8209 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 8210 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 8211 8212 default: 8213 genericError := &smithy.GenericAPIError{ 8214 Code: errorCode, 8215 Message: errorMessage, 8216 } 8217 return genericError 8218 8219 } 8220} 8221 8222type awsAwsjson11_deserializeOpUntagResource struct { 8223} 8224 8225func (*awsAwsjson11_deserializeOpUntagResource) ID() string { 8226 return "OperationDeserializer" 8227} 8228 8229func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8230 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8231) { 8232 out, metadata, err = next.HandleDeserialize(ctx, in) 8233 if err != nil { 8234 return out, metadata, err 8235 } 8236 8237 response, ok := out.RawResponse.(*smithyhttp.Response) 8238 if !ok { 8239 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8240 } 8241 8242 if response.StatusCode < 200 || response.StatusCode >= 300 { 8243 return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) 8244 } 8245 output := &UntagResourceOutput{} 8246 out.Result = output 8247 8248 var buff [1024]byte 8249 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8250 8251 body := io.TeeReader(response.Body, ringBuffer) 8252 decoder := json.NewDecoder(body) 8253 decoder.UseNumber() 8254 var shape interface{} 8255 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8256 var snapshot bytes.Buffer 8257 io.Copy(&snapshot, ringBuffer) 8258 err = &smithy.DeserializationError{ 8259 Err: fmt.Errorf("failed to decode response body, %w", err), 8260 Snapshot: snapshot.Bytes(), 8261 } 8262 return out, metadata, err 8263 } 8264 8265 err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) 8266 if err != nil { 8267 var snapshot bytes.Buffer 8268 io.Copy(&snapshot, ringBuffer) 8269 err = &smithy.DeserializationError{ 8270 Err: fmt.Errorf("failed to decode response body, %w", err), 8271 Snapshot: snapshot.Bytes(), 8272 } 8273 return out, metadata, err 8274 } 8275 8276 return out, metadata, err 8277} 8278 8279func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8280 var errorBuffer bytes.Buffer 8281 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8282 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8283 } 8284 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8285 8286 errorCode := "UnknownError" 8287 errorMessage := errorCode 8288 8289 code := response.Header.Get("X-Amzn-ErrorType") 8290 if len(code) != 0 { 8291 errorCode = restjson.SanitizeErrorCode(code) 8292 } 8293 8294 var buff [1024]byte 8295 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8296 8297 body := io.TeeReader(errorBody, ringBuffer) 8298 decoder := json.NewDecoder(body) 8299 decoder.UseNumber() 8300 code, message, err := restjson.GetErrorInfo(decoder) 8301 if err != nil { 8302 var snapshot bytes.Buffer 8303 io.Copy(&snapshot, ringBuffer) 8304 err = &smithy.DeserializationError{ 8305 Err: fmt.Errorf("failed to decode response body, %w", err), 8306 Snapshot: snapshot.Bytes(), 8307 } 8308 return err 8309 } 8310 8311 errorBody.Seek(0, io.SeekStart) 8312 if len(code) != 0 { 8313 errorCode = restjson.SanitizeErrorCode(code) 8314 } 8315 if len(message) != 0 { 8316 errorMessage = message 8317 } 8318 8319 switch { 8320 case strings.EqualFold("WAFBadRequestException", errorCode): 8321 return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody) 8322 8323 case strings.EqualFold("WAFInternalErrorException", errorCode): 8324 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8325 8326 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8327 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8328 8329 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8330 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8331 8332 case strings.EqualFold("WAFTagOperationException", errorCode): 8333 return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody) 8334 8335 case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode): 8336 return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody) 8337 8338 default: 8339 genericError := &smithy.GenericAPIError{ 8340 Code: errorCode, 8341 Message: errorMessage, 8342 } 8343 return genericError 8344 8345 } 8346} 8347 8348type awsAwsjson11_deserializeOpUpdateByteMatchSet struct { 8349} 8350 8351func (*awsAwsjson11_deserializeOpUpdateByteMatchSet) ID() string { 8352 return "OperationDeserializer" 8353} 8354 8355func (m *awsAwsjson11_deserializeOpUpdateByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8356 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8357) { 8358 out, metadata, err = next.HandleDeserialize(ctx, in) 8359 if err != nil { 8360 return out, metadata, err 8361 } 8362 8363 response, ok := out.RawResponse.(*smithyhttp.Response) 8364 if !ok { 8365 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8366 } 8367 8368 if response.StatusCode < 200 || response.StatusCode >= 300 { 8369 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateByteMatchSet(response, &metadata) 8370 } 8371 output := &UpdateByteMatchSetOutput{} 8372 out.Result = output 8373 8374 var buff [1024]byte 8375 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8376 8377 body := io.TeeReader(response.Body, ringBuffer) 8378 decoder := json.NewDecoder(body) 8379 decoder.UseNumber() 8380 var shape interface{} 8381 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8382 var snapshot bytes.Buffer 8383 io.Copy(&snapshot, ringBuffer) 8384 err = &smithy.DeserializationError{ 8385 Err: fmt.Errorf("failed to decode response body, %w", err), 8386 Snapshot: snapshot.Bytes(), 8387 } 8388 return out, metadata, err 8389 } 8390 8391 err = awsAwsjson11_deserializeOpDocumentUpdateByteMatchSetOutput(&output, shape) 8392 if err != nil { 8393 var snapshot bytes.Buffer 8394 io.Copy(&snapshot, ringBuffer) 8395 err = &smithy.DeserializationError{ 8396 Err: fmt.Errorf("failed to decode response body, %w", err), 8397 Snapshot: snapshot.Bytes(), 8398 } 8399 return out, metadata, err 8400 } 8401 8402 return out, metadata, err 8403} 8404 8405func awsAwsjson11_deserializeOpErrorUpdateByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8406 var errorBuffer bytes.Buffer 8407 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8408 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8409 } 8410 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8411 8412 errorCode := "UnknownError" 8413 errorMessage := errorCode 8414 8415 code := response.Header.Get("X-Amzn-ErrorType") 8416 if len(code) != 0 { 8417 errorCode = restjson.SanitizeErrorCode(code) 8418 } 8419 8420 var buff [1024]byte 8421 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8422 8423 body := io.TeeReader(errorBody, ringBuffer) 8424 decoder := json.NewDecoder(body) 8425 decoder.UseNumber() 8426 code, message, err := restjson.GetErrorInfo(decoder) 8427 if err != nil { 8428 var snapshot bytes.Buffer 8429 io.Copy(&snapshot, ringBuffer) 8430 err = &smithy.DeserializationError{ 8431 Err: fmt.Errorf("failed to decode response body, %w", err), 8432 Snapshot: snapshot.Bytes(), 8433 } 8434 return err 8435 } 8436 8437 errorBody.Seek(0, io.SeekStart) 8438 if len(code) != 0 { 8439 errorCode = restjson.SanitizeErrorCode(code) 8440 } 8441 if len(message) != 0 { 8442 errorMessage = message 8443 } 8444 8445 switch { 8446 case strings.EqualFold("WAFInternalErrorException", errorCode): 8447 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8448 8449 case strings.EqualFold("WAFInvalidAccountException", errorCode): 8450 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 8451 8452 case strings.EqualFold("WAFInvalidOperationException", errorCode): 8453 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 8454 8455 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8456 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8457 8458 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8459 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8460 8461 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 8462 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 8463 8464 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8465 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8466 8467 case strings.EqualFold("WAFStaleDataException", errorCode): 8468 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 8469 8470 default: 8471 genericError := &smithy.GenericAPIError{ 8472 Code: errorCode, 8473 Message: errorMessage, 8474 } 8475 return genericError 8476 8477 } 8478} 8479 8480type awsAwsjson11_deserializeOpUpdateGeoMatchSet struct { 8481} 8482 8483func (*awsAwsjson11_deserializeOpUpdateGeoMatchSet) ID() string { 8484 return "OperationDeserializer" 8485} 8486 8487func (m *awsAwsjson11_deserializeOpUpdateGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8488 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8489) { 8490 out, metadata, err = next.HandleDeserialize(ctx, in) 8491 if err != nil { 8492 return out, metadata, err 8493 } 8494 8495 response, ok := out.RawResponse.(*smithyhttp.Response) 8496 if !ok { 8497 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8498 } 8499 8500 if response.StatusCode < 200 || response.StatusCode >= 300 { 8501 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateGeoMatchSet(response, &metadata) 8502 } 8503 output := &UpdateGeoMatchSetOutput{} 8504 out.Result = output 8505 8506 var buff [1024]byte 8507 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8508 8509 body := io.TeeReader(response.Body, ringBuffer) 8510 decoder := json.NewDecoder(body) 8511 decoder.UseNumber() 8512 var shape interface{} 8513 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8514 var snapshot bytes.Buffer 8515 io.Copy(&snapshot, ringBuffer) 8516 err = &smithy.DeserializationError{ 8517 Err: fmt.Errorf("failed to decode response body, %w", err), 8518 Snapshot: snapshot.Bytes(), 8519 } 8520 return out, metadata, err 8521 } 8522 8523 err = awsAwsjson11_deserializeOpDocumentUpdateGeoMatchSetOutput(&output, shape) 8524 if err != nil { 8525 var snapshot bytes.Buffer 8526 io.Copy(&snapshot, ringBuffer) 8527 err = &smithy.DeserializationError{ 8528 Err: fmt.Errorf("failed to decode response body, %w", err), 8529 Snapshot: snapshot.Bytes(), 8530 } 8531 return out, metadata, err 8532 } 8533 8534 return out, metadata, err 8535} 8536 8537func awsAwsjson11_deserializeOpErrorUpdateGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8538 var errorBuffer bytes.Buffer 8539 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8540 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8541 } 8542 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8543 8544 errorCode := "UnknownError" 8545 errorMessage := errorCode 8546 8547 code := response.Header.Get("X-Amzn-ErrorType") 8548 if len(code) != 0 { 8549 errorCode = restjson.SanitizeErrorCode(code) 8550 } 8551 8552 var buff [1024]byte 8553 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8554 8555 body := io.TeeReader(errorBody, ringBuffer) 8556 decoder := json.NewDecoder(body) 8557 decoder.UseNumber() 8558 code, message, err := restjson.GetErrorInfo(decoder) 8559 if err != nil { 8560 var snapshot bytes.Buffer 8561 io.Copy(&snapshot, ringBuffer) 8562 err = &smithy.DeserializationError{ 8563 Err: fmt.Errorf("failed to decode response body, %w", err), 8564 Snapshot: snapshot.Bytes(), 8565 } 8566 return err 8567 } 8568 8569 errorBody.Seek(0, io.SeekStart) 8570 if len(code) != 0 { 8571 errorCode = restjson.SanitizeErrorCode(code) 8572 } 8573 if len(message) != 0 { 8574 errorMessage = message 8575 } 8576 8577 switch { 8578 case strings.EqualFold("WAFInternalErrorException", errorCode): 8579 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8580 8581 case strings.EqualFold("WAFInvalidAccountException", errorCode): 8582 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 8583 8584 case strings.EqualFold("WAFInvalidOperationException", errorCode): 8585 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 8586 8587 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8588 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8589 8590 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8591 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8592 8593 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 8594 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 8595 8596 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8597 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8598 8599 case strings.EqualFold("WAFReferencedItemException", errorCode): 8600 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 8601 8602 case strings.EqualFold("WAFStaleDataException", errorCode): 8603 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 8604 8605 default: 8606 genericError := &smithy.GenericAPIError{ 8607 Code: errorCode, 8608 Message: errorMessage, 8609 } 8610 return genericError 8611 8612 } 8613} 8614 8615type awsAwsjson11_deserializeOpUpdateIPSet struct { 8616} 8617 8618func (*awsAwsjson11_deserializeOpUpdateIPSet) ID() string { 8619 return "OperationDeserializer" 8620} 8621 8622func (m *awsAwsjson11_deserializeOpUpdateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8623 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8624) { 8625 out, metadata, err = next.HandleDeserialize(ctx, in) 8626 if err != nil { 8627 return out, metadata, err 8628 } 8629 8630 response, ok := out.RawResponse.(*smithyhttp.Response) 8631 if !ok { 8632 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8633 } 8634 8635 if response.StatusCode < 200 || response.StatusCode >= 300 { 8636 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateIPSet(response, &metadata) 8637 } 8638 output := &UpdateIPSetOutput{} 8639 out.Result = output 8640 8641 var buff [1024]byte 8642 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8643 8644 body := io.TeeReader(response.Body, ringBuffer) 8645 decoder := json.NewDecoder(body) 8646 decoder.UseNumber() 8647 var shape interface{} 8648 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8649 var snapshot bytes.Buffer 8650 io.Copy(&snapshot, ringBuffer) 8651 err = &smithy.DeserializationError{ 8652 Err: fmt.Errorf("failed to decode response body, %w", err), 8653 Snapshot: snapshot.Bytes(), 8654 } 8655 return out, metadata, err 8656 } 8657 8658 err = awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(&output, shape) 8659 if err != nil { 8660 var snapshot bytes.Buffer 8661 io.Copy(&snapshot, ringBuffer) 8662 err = &smithy.DeserializationError{ 8663 Err: fmt.Errorf("failed to decode response body, %w", err), 8664 Snapshot: snapshot.Bytes(), 8665 } 8666 return out, metadata, err 8667 } 8668 8669 return out, metadata, err 8670} 8671 8672func awsAwsjson11_deserializeOpErrorUpdateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8673 var errorBuffer bytes.Buffer 8674 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8675 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8676 } 8677 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8678 8679 errorCode := "UnknownError" 8680 errorMessage := errorCode 8681 8682 code := response.Header.Get("X-Amzn-ErrorType") 8683 if len(code) != 0 { 8684 errorCode = restjson.SanitizeErrorCode(code) 8685 } 8686 8687 var buff [1024]byte 8688 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8689 8690 body := io.TeeReader(errorBody, ringBuffer) 8691 decoder := json.NewDecoder(body) 8692 decoder.UseNumber() 8693 code, message, err := restjson.GetErrorInfo(decoder) 8694 if err != nil { 8695 var snapshot bytes.Buffer 8696 io.Copy(&snapshot, ringBuffer) 8697 err = &smithy.DeserializationError{ 8698 Err: fmt.Errorf("failed to decode response body, %w", err), 8699 Snapshot: snapshot.Bytes(), 8700 } 8701 return err 8702 } 8703 8704 errorBody.Seek(0, io.SeekStart) 8705 if len(code) != 0 { 8706 errorCode = restjson.SanitizeErrorCode(code) 8707 } 8708 if len(message) != 0 { 8709 errorMessage = message 8710 } 8711 8712 switch { 8713 case strings.EqualFold("WAFInternalErrorException", errorCode): 8714 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8715 8716 case strings.EqualFold("WAFInvalidAccountException", errorCode): 8717 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 8718 8719 case strings.EqualFold("WAFInvalidOperationException", errorCode): 8720 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 8721 8722 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8723 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8724 8725 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8726 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8727 8728 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 8729 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 8730 8731 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8732 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8733 8734 case strings.EqualFold("WAFReferencedItemException", errorCode): 8735 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 8736 8737 case strings.EqualFold("WAFStaleDataException", errorCode): 8738 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 8739 8740 default: 8741 genericError := &smithy.GenericAPIError{ 8742 Code: errorCode, 8743 Message: errorMessage, 8744 } 8745 return genericError 8746 8747 } 8748} 8749 8750type awsAwsjson11_deserializeOpUpdateRateBasedRule struct { 8751} 8752 8753func (*awsAwsjson11_deserializeOpUpdateRateBasedRule) ID() string { 8754 return "OperationDeserializer" 8755} 8756 8757func (m *awsAwsjson11_deserializeOpUpdateRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8758 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8759) { 8760 out, metadata, err = next.HandleDeserialize(ctx, in) 8761 if err != nil { 8762 return out, metadata, err 8763 } 8764 8765 response, ok := out.RawResponse.(*smithyhttp.Response) 8766 if !ok { 8767 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8768 } 8769 8770 if response.StatusCode < 200 || response.StatusCode >= 300 { 8771 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRateBasedRule(response, &metadata) 8772 } 8773 output := &UpdateRateBasedRuleOutput{} 8774 out.Result = output 8775 8776 var buff [1024]byte 8777 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8778 8779 body := io.TeeReader(response.Body, ringBuffer) 8780 decoder := json.NewDecoder(body) 8781 decoder.UseNumber() 8782 var shape interface{} 8783 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8784 var snapshot bytes.Buffer 8785 io.Copy(&snapshot, ringBuffer) 8786 err = &smithy.DeserializationError{ 8787 Err: fmt.Errorf("failed to decode response body, %w", err), 8788 Snapshot: snapshot.Bytes(), 8789 } 8790 return out, metadata, err 8791 } 8792 8793 err = awsAwsjson11_deserializeOpDocumentUpdateRateBasedRuleOutput(&output, shape) 8794 if err != nil { 8795 var snapshot bytes.Buffer 8796 io.Copy(&snapshot, ringBuffer) 8797 err = &smithy.DeserializationError{ 8798 Err: fmt.Errorf("failed to decode response body, %w", err), 8799 Snapshot: snapshot.Bytes(), 8800 } 8801 return out, metadata, err 8802 } 8803 8804 return out, metadata, err 8805} 8806 8807func awsAwsjson11_deserializeOpErrorUpdateRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8808 var errorBuffer bytes.Buffer 8809 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8810 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8811 } 8812 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8813 8814 errorCode := "UnknownError" 8815 errorMessage := errorCode 8816 8817 code := response.Header.Get("X-Amzn-ErrorType") 8818 if len(code) != 0 { 8819 errorCode = restjson.SanitizeErrorCode(code) 8820 } 8821 8822 var buff [1024]byte 8823 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8824 8825 body := io.TeeReader(errorBody, ringBuffer) 8826 decoder := json.NewDecoder(body) 8827 decoder.UseNumber() 8828 code, message, err := restjson.GetErrorInfo(decoder) 8829 if err != nil { 8830 var snapshot bytes.Buffer 8831 io.Copy(&snapshot, ringBuffer) 8832 err = &smithy.DeserializationError{ 8833 Err: fmt.Errorf("failed to decode response body, %w", err), 8834 Snapshot: snapshot.Bytes(), 8835 } 8836 return err 8837 } 8838 8839 errorBody.Seek(0, io.SeekStart) 8840 if len(code) != 0 { 8841 errorCode = restjson.SanitizeErrorCode(code) 8842 } 8843 if len(message) != 0 { 8844 errorMessage = message 8845 } 8846 8847 switch { 8848 case strings.EqualFold("WAFInternalErrorException", errorCode): 8849 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8850 8851 case strings.EqualFold("WAFInvalidAccountException", errorCode): 8852 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 8853 8854 case strings.EqualFold("WAFInvalidOperationException", errorCode): 8855 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 8856 8857 case strings.EqualFold("WAFInvalidParameterException", errorCode): 8858 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 8859 8860 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8861 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8862 8863 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 8864 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 8865 8866 case strings.EqualFold("WAFNonexistentItemException", errorCode): 8867 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 8868 8869 case strings.EqualFold("WAFReferencedItemException", errorCode): 8870 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 8871 8872 case strings.EqualFold("WAFStaleDataException", errorCode): 8873 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 8874 8875 default: 8876 genericError := &smithy.GenericAPIError{ 8877 Code: errorCode, 8878 Message: errorMessage, 8879 } 8880 return genericError 8881 8882 } 8883} 8884 8885type awsAwsjson11_deserializeOpUpdateRegexMatchSet struct { 8886} 8887 8888func (*awsAwsjson11_deserializeOpUpdateRegexMatchSet) ID() string { 8889 return "OperationDeserializer" 8890} 8891 8892func (m *awsAwsjson11_deserializeOpUpdateRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8893 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8894) { 8895 out, metadata, err = next.HandleDeserialize(ctx, in) 8896 if err != nil { 8897 return out, metadata, err 8898 } 8899 8900 response, ok := out.RawResponse.(*smithyhttp.Response) 8901 if !ok { 8902 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8903 } 8904 8905 if response.StatusCode < 200 || response.StatusCode >= 300 { 8906 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRegexMatchSet(response, &metadata) 8907 } 8908 output := &UpdateRegexMatchSetOutput{} 8909 out.Result = output 8910 8911 var buff [1024]byte 8912 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8913 8914 body := io.TeeReader(response.Body, ringBuffer) 8915 decoder := json.NewDecoder(body) 8916 decoder.UseNumber() 8917 var shape interface{} 8918 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8919 var snapshot bytes.Buffer 8920 io.Copy(&snapshot, ringBuffer) 8921 err = &smithy.DeserializationError{ 8922 Err: fmt.Errorf("failed to decode response body, %w", err), 8923 Snapshot: snapshot.Bytes(), 8924 } 8925 return out, metadata, err 8926 } 8927 8928 err = awsAwsjson11_deserializeOpDocumentUpdateRegexMatchSetOutput(&output, shape) 8929 if err != nil { 8930 var snapshot bytes.Buffer 8931 io.Copy(&snapshot, ringBuffer) 8932 err = &smithy.DeserializationError{ 8933 Err: fmt.Errorf("failed to decode response body, %w", err), 8934 Snapshot: snapshot.Bytes(), 8935 } 8936 return out, metadata, err 8937 } 8938 8939 return out, metadata, err 8940} 8941 8942func awsAwsjson11_deserializeOpErrorUpdateRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8943 var errorBuffer bytes.Buffer 8944 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8945 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8946 } 8947 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8948 8949 errorCode := "UnknownError" 8950 errorMessage := errorCode 8951 8952 code := response.Header.Get("X-Amzn-ErrorType") 8953 if len(code) != 0 { 8954 errorCode = restjson.SanitizeErrorCode(code) 8955 } 8956 8957 var buff [1024]byte 8958 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8959 8960 body := io.TeeReader(errorBody, ringBuffer) 8961 decoder := json.NewDecoder(body) 8962 decoder.UseNumber() 8963 code, message, err := restjson.GetErrorInfo(decoder) 8964 if err != nil { 8965 var snapshot bytes.Buffer 8966 io.Copy(&snapshot, ringBuffer) 8967 err = &smithy.DeserializationError{ 8968 Err: fmt.Errorf("failed to decode response body, %w", err), 8969 Snapshot: snapshot.Bytes(), 8970 } 8971 return err 8972 } 8973 8974 errorBody.Seek(0, io.SeekStart) 8975 if len(code) != 0 { 8976 errorCode = restjson.SanitizeErrorCode(code) 8977 } 8978 if len(message) != 0 { 8979 errorMessage = message 8980 } 8981 8982 switch { 8983 case strings.EqualFold("WAFDisallowedNameException", errorCode): 8984 return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody) 8985 8986 case strings.EqualFold("WAFInternalErrorException", errorCode): 8987 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 8988 8989 case strings.EqualFold("WAFInvalidAccountException", errorCode): 8990 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 8991 8992 case strings.EqualFold("WAFInvalidOperationException", errorCode): 8993 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 8994 8995 case strings.EqualFold("WAFLimitsExceededException", errorCode): 8996 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 8997 8998 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 8999 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9000 9001 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9002 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9003 9004 case strings.EqualFold("WAFStaleDataException", errorCode): 9005 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9006 9007 default: 9008 genericError := &smithy.GenericAPIError{ 9009 Code: errorCode, 9010 Message: errorMessage, 9011 } 9012 return genericError 9013 9014 } 9015} 9016 9017type awsAwsjson11_deserializeOpUpdateRegexPatternSet struct { 9018} 9019 9020func (*awsAwsjson11_deserializeOpUpdateRegexPatternSet) ID() string { 9021 return "OperationDeserializer" 9022} 9023 9024func (m *awsAwsjson11_deserializeOpUpdateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9025 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9026) { 9027 out, metadata, err = next.HandleDeserialize(ctx, in) 9028 if err != nil { 9029 return out, metadata, err 9030 } 9031 9032 response, ok := out.RawResponse.(*smithyhttp.Response) 9033 if !ok { 9034 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9035 } 9036 9037 if response.StatusCode < 200 || response.StatusCode >= 300 { 9038 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response, &metadata) 9039 } 9040 output := &UpdateRegexPatternSetOutput{} 9041 out.Result = output 9042 9043 var buff [1024]byte 9044 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9045 9046 body := io.TeeReader(response.Body, ringBuffer) 9047 decoder := json.NewDecoder(body) 9048 decoder.UseNumber() 9049 var shape interface{} 9050 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9051 var snapshot bytes.Buffer 9052 io.Copy(&snapshot, ringBuffer) 9053 err = &smithy.DeserializationError{ 9054 Err: fmt.Errorf("failed to decode response body, %w", err), 9055 Snapshot: snapshot.Bytes(), 9056 } 9057 return out, metadata, err 9058 } 9059 9060 err = awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(&output, shape) 9061 if err != nil { 9062 var snapshot bytes.Buffer 9063 io.Copy(&snapshot, ringBuffer) 9064 err = &smithy.DeserializationError{ 9065 Err: fmt.Errorf("failed to decode response body, %w", err), 9066 Snapshot: snapshot.Bytes(), 9067 } 9068 return out, metadata, err 9069 } 9070 9071 return out, metadata, err 9072} 9073 9074func awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9075 var errorBuffer bytes.Buffer 9076 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9077 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9078 } 9079 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9080 9081 errorCode := "UnknownError" 9082 errorMessage := errorCode 9083 9084 code := response.Header.Get("X-Amzn-ErrorType") 9085 if len(code) != 0 { 9086 errorCode = restjson.SanitizeErrorCode(code) 9087 } 9088 9089 var buff [1024]byte 9090 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9091 9092 body := io.TeeReader(errorBody, ringBuffer) 9093 decoder := json.NewDecoder(body) 9094 decoder.UseNumber() 9095 code, message, err := restjson.GetErrorInfo(decoder) 9096 if err != nil { 9097 var snapshot bytes.Buffer 9098 io.Copy(&snapshot, ringBuffer) 9099 err = &smithy.DeserializationError{ 9100 Err: fmt.Errorf("failed to decode response body, %w", err), 9101 Snapshot: snapshot.Bytes(), 9102 } 9103 return err 9104 } 9105 9106 errorBody.Seek(0, io.SeekStart) 9107 if len(code) != 0 { 9108 errorCode = restjson.SanitizeErrorCode(code) 9109 } 9110 if len(message) != 0 { 9111 errorMessage = message 9112 } 9113 9114 switch { 9115 case strings.EqualFold("WAFInternalErrorException", errorCode): 9116 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9117 9118 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9119 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9120 9121 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9122 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9123 9124 case strings.EqualFold("WAFInvalidRegexPatternException", errorCode): 9125 return awsAwsjson11_deserializeErrorWAFInvalidRegexPatternException(response, errorBody) 9126 9127 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9128 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9129 9130 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9131 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9132 9133 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9134 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9135 9136 case strings.EqualFold("WAFStaleDataException", errorCode): 9137 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9138 9139 default: 9140 genericError := &smithy.GenericAPIError{ 9141 Code: errorCode, 9142 Message: errorMessage, 9143 } 9144 return genericError 9145 9146 } 9147} 9148 9149type awsAwsjson11_deserializeOpUpdateRule struct { 9150} 9151 9152func (*awsAwsjson11_deserializeOpUpdateRule) ID() string { 9153 return "OperationDeserializer" 9154} 9155 9156func (m *awsAwsjson11_deserializeOpUpdateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9157 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9158) { 9159 out, metadata, err = next.HandleDeserialize(ctx, in) 9160 if err != nil { 9161 return out, metadata, err 9162 } 9163 9164 response, ok := out.RawResponse.(*smithyhttp.Response) 9165 if !ok { 9166 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9167 } 9168 9169 if response.StatusCode < 200 || response.StatusCode >= 300 { 9170 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRule(response, &metadata) 9171 } 9172 output := &UpdateRuleOutput{} 9173 out.Result = output 9174 9175 var buff [1024]byte 9176 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9177 9178 body := io.TeeReader(response.Body, ringBuffer) 9179 decoder := json.NewDecoder(body) 9180 decoder.UseNumber() 9181 var shape interface{} 9182 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9183 var snapshot bytes.Buffer 9184 io.Copy(&snapshot, ringBuffer) 9185 err = &smithy.DeserializationError{ 9186 Err: fmt.Errorf("failed to decode response body, %w", err), 9187 Snapshot: snapshot.Bytes(), 9188 } 9189 return out, metadata, err 9190 } 9191 9192 err = awsAwsjson11_deserializeOpDocumentUpdateRuleOutput(&output, shape) 9193 if err != nil { 9194 var snapshot bytes.Buffer 9195 io.Copy(&snapshot, ringBuffer) 9196 err = &smithy.DeserializationError{ 9197 Err: fmt.Errorf("failed to decode response body, %w", err), 9198 Snapshot: snapshot.Bytes(), 9199 } 9200 return out, metadata, err 9201 } 9202 9203 return out, metadata, err 9204} 9205 9206func awsAwsjson11_deserializeOpErrorUpdateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9207 var errorBuffer bytes.Buffer 9208 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9209 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9210 } 9211 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9212 9213 errorCode := "UnknownError" 9214 errorMessage := errorCode 9215 9216 code := response.Header.Get("X-Amzn-ErrorType") 9217 if len(code) != 0 { 9218 errorCode = restjson.SanitizeErrorCode(code) 9219 } 9220 9221 var buff [1024]byte 9222 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9223 9224 body := io.TeeReader(errorBody, ringBuffer) 9225 decoder := json.NewDecoder(body) 9226 decoder.UseNumber() 9227 code, message, err := restjson.GetErrorInfo(decoder) 9228 if err != nil { 9229 var snapshot bytes.Buffer 9230 io.Copy(&snapshot, ringBuffer) 9231 err = &smithy.DeserializationError{ 9232 Err: fmt.Errorf("failed to decode response body, %w", err), 9233 Snapshot: snapshot.Bytes(), 9234 } 9235 return err 9236 } 9237 9238 errorBody.Seek(0, io.SeekStart) 9239 if len(code) != 0 { 9240 errorCode = restjson.SanitizeErrorCode(code) 9241 } 9242 if len(message) != 0 { 9243 errorMessage = message 9244 } 9245 9246 switch { 9247 case strings.EqualFold("WAFInternalErrorException", errorCode): 9248 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9249 9250 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9251 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9252 9253 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9254 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9255 9256 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9257 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9258 9259 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9260 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9261 9262 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9263 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9264 9265 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9266 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9267 9268 case strings.EqualFold("WAFReferencedItemException", errorCode): 9269 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 9270 9271 case strings.EqualFold("WAFStaleDataException", errorCode): 9272 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9273 9274 default: 9275 genericError := &smithy.GenericAPIError{ 9276 Code: errorCode, 9277 Message: errorMessage, 9278 } 9279 return genericError 9280 9281 } 9282} 9283 9284type awsAwsjson11_deserializeOpUpdateRuleGroup struct { 9285} 9286 9287func (*awsAwsjson11_deserializeOpUpdateRuleGroup) ID() string { 9288 return "OperationDeserializer" 9289} 9290 9291func (m *awsAwsjson11_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9292 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9293) { 9294 out, metadata, err = next.HandleDeserialize(ctx, in) 9295 if err != nil { 9296 return out, metadata, err 9297 } 9298 9299 response, ok := out.RawResponse.(*smithyhttp.Response) 9300 if !ok { 9301 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9302 } 9303 9304 if response.StatusCode < 200 || response.StatusCode >= 300 { 9305 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response, &metadata) 9306 } 9307 output := &UpdateRuleGroupOutput{} 9308 out.Result = output 9309 9310 var buff [1024]byte 9311 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9312 9313 body := io.TeeReader(response.Body, ringBuffer) 9314 decoder := json.NewDecoder(body) 9315 decoder.UseNumber() 9316 var shape interface{} 9317 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9318 var snapshot bytes.Buffer 9319 io.Copy(&snapshot, ringBuffer) 9320 err = &smithy.DeserializationError{ 9321 Err: fmt.Errorf("failed to decode response body, %w", err), 9322 Snapshot: snapshot.Bytes(), 9323 } 9324 return out, metadata, err 9325 } 9326 9327 err = awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(&output, shape) 9328 if err != nil { 9329 var snapshot bytes.Buffer 9330 io.Copy(&snapshot, ringBuffer) 9331 err = &smithy.DeserializationError{ 9332 Err: fmt.Errorf("failed to decode response body, %w", err), 9333 Snapshot: snapshot.Bytes(), 9334 } 9335 return out, metadata, err 9336 } 9337 9338 return out, metadata, err 9339} 9340 9341func awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9342 var errorBuffer bytes.Buffer 9343 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9344 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9345 } 9346 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9347 9348 errorCode := "UnknownError" 9349 errorMessage := errorCode 9350 9351 code := response.Header.Get("X-Amzn-ErrorType") 9352 if len(code) != 0 { 9353 errorCode = restjson.SanitizeErrorCode(code) 9354 } 9355 9356 var buff [1024]byte 9357 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9358 9359 body := io.TeeReader(errorBody, ringBuffer) 9360 decoder := json.NewDecoder(body) 9361 decoder.UseNumber() 9362 code, message, err := restjson.GetErrorInfo(decoder) 9363 if err != nil { 9364 var snapshot bytes.Buffer 9365 io.Copy(&snapshot, ringBuffer) 9366 err = &smithy.DeserializationError{ 9367 Err: fmt.Errorf("failed to decode response body, %w", err), 9368 Snapshot: snapshot.Bytes(), 9369 } 9370 return err 9371 } 9372 9373 errorBody.Seek(0, io.SeekStart) 9374 if len(code) != 0 { 9375 errorCode = restjson.SanitizeErrorCode(code) 9376 } 9377 if len(message) != 0 { 9378 errorMessage = message 9379 } 9380 9381 switch { 9382 case strings.EqualFold("WAFInternalErrorException", errorCode): 9383 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9384 9385 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9386 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9387 9388 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9389 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9390 9391 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9392 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9393 9394 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9395 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9396 9397 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9398 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9399 9400 case strings.EqualFold("WAFStaleDataException", errorCode): 9401 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9402 9403 default: 9404 genericError := &smithy.GenericAPIError{ 9405 Code: errorCode, 9406 Message: errorMessage, 9407 } 9408 return genericError 9409 9410 } 9411} 9412 9413type awsAwsjson11_deserializeOpUpdateSizeConstraintSet struct { 9414} 9415 9416func (*awsAwsjson11_deserializeOpUpdateSizeConstraintSet) ID() string { 9417 return "OperationDeserializer" 9418} 9419 9420func (m *awsAwsjson11_deserializeOpUpdateSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9421 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9422) { 9423 out, metadata, err = next.HandleDeserialize(ctx, in) 9424 if err != nil { 9425 return out, metadata, err 9426 } 9427 9428 response, ok := out.RawResponse.(*smithyhttp.Response) 9429 if !ok { 9430 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9431 } 9432 9433 if response.StatusCode < 200 || response.StatusCode >= 300 { 9434 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSizeConstraintSet(response, &metadata) 9435 } 9436 output := &UpdateSizeConstraintSetOutput{} 9437 out.Result = output 9438 9439 var buff [1024]byte 9440 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9441 9442 body := io.TeeReader(response.Body, ringBuffer) 9443 decoder := json.NewDecoder(body) 9444 decoder.UseNumber() 9445 var shape interface{} 9446 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9447 var snapshot bytes.Buffer 9448 io.Copy(&snapshot, ringBuffer) 9449 err = &smithy.DeserializationError{ 9450 Err: fmt.Errorf("failed to decode response body, %w", err), 9451 Snapshot: snapshot.Bytes(), 9452 } 9453 return out, metadata, err 9454 } 9455 9456 err = awsAwsjson11_deserializeOpDocumentUpdateSizeConstraintSetOutput(&output, shape) 9457 if err != nil { 9458 var snapshot bytes.Buffer 9459 io.Copy(&snapshot, ringBuffer) 9460 err = &smithy.DeserializationError{ 9461 Err: fmt.Errorf("failed to decode response body, %w", err), 9462 Snapshot: snapshot.Bytes(), 9463 } 9464 return out, metadata, err 9465 } 9466 9467 return out, metadata, err 9468} 9469 9470func awsAwsjson11_deserializeOpErrorUpdateSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9471 var errorBuffer bytes.Buffer 9472 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9473 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9474 } 9475 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9476 9477 errorCode := "UnknownError" 9478 errorMessage := errorCode 9479 9480 code := response.Header.Get("X-Amzn-ErrorType") 9481 if len(code) != 0 { 9482 errorCode = restjson.SanitizeErrorCode(code) 9483 } 9484 9485 var buff [1024]byte 9486 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9487 9488 body := io.TeeReader(errorBody, ringBuffer) 9489 decoder := json.NewDecoder(body) 9490 decoder.UseNumber() 9491 code, message, err := restjson.GetErrorInfo(decoder) 9492 if err != nil { 9493 var snapshot bytes.Buffer 9494 io.Copy(&snapshot, ringBuffer) 9495 err = &smithy.DeserializationError{ 9496 Err: fmt.Errorf("failed to decode response body, %w", err), 9497 Snapshot: snapshot.Bytes(), 9498 } 9499 return err 9500 } 9501 9502 errorBody.Seek(0, io.SeekStart) 9503 if len(code) != 0 { 9504 errorCode = restjson.SanitizeErrorCode(code) 9505 } 9506 if len(message) != 0 { 9507 errorMessage = message 9508 } 9509 9510 switch { 9511 case strings.EqualFold("WAFInternalErrorException", errorCode): 9512 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9513 9514 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9515 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9516 9517 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9518 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9519 9520 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9521 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9522 9523 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9524 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9525 9526 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9527 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9528 9529 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9530 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9531 9532 case strings.EqualFold("WAFReferencedItemException", errorCode): 9533 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 9534 9535 case strings.EqualFold("WAFStaleDataException", errorCode): 9536 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9537 9538 default: 9539 genericError := &smithy.GenericAPIError{ 9540 Code: errorCode, 9541 Message: errorMessage, 9542 } 9543 return genericError 9544 9545 } 9546} 9547 9548type awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet struct { 9549} 9550 9551func (*awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet) ID() string { 9552 return "OperationDeserializer" 9553} 9554 9555func (m *awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9556 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9557) { 9558 out, metadata, err = next.HandleDeserialize(ctx, in) 9559 if err != nil { 9560 return out, metadata, err 9561 } 9562 9563 response, ok := out.RawResponse.(*smithyhttp.Response) 9564 if !ok { 9565 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9566 } 9567 9568 if response.StatusCode < 200 || response.StatusCode >= 300 { 9569 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSqlInjectionMatchSet(response, &metadata) 9570 } 9571 output := &UpdateSqlInjectionMatchSetOutput{} 9572 out.Result = output 9573 9574 var buff [1024]byte 9575 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9576 9577 body := io.TeeReader(response.Body, ringBuffer) 9578 decoder := json.NewDecoder(body) 9579 decoder.UseNumber() 9580 var shape interface{} 9581 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9582 var snapshot bytes.Buffer 9583 io.Copy(&snapshot, ringBuffer) 9584 err = &smithy.DeserializationError{ 9585 Err: fmt.Errorf("failed to decode response body, %w", err), 9586 Snapshot: snapshot.Bytes(), 9587 } 9588 return out, metadata, err 9589 } 9590 9591 err = awsAwsjson11_deserializeOpDocumentUpdateSqlInjectionMatchSetOutput(&output, shape) 9592 if err != nil { 9593 var snapshot bytes.Buffer 9594 io.Copy(&snapshot, ringBuffer) 9595 err = &smithy.DeserializationError{ 9596 Err: fmt.Errorf("failed to decode response body, %w", err), 9597 Snapshot: snapshot.Bytes(), 9598 } 9599 return out, metadata, err 9600 } 9601 9602 return out, metadata, err 9603} 9604 9605func awsAwsjson11_deserializeOpErrorUpdateSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9606 var errorBuffer bytes.Buffer 9607 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9608 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9609 } 9610 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9611 9612 errorCode := "UnknownError" 9613 errorMessage := errorCode 9614 9615 code := response.Header.Get("X-Amzn-ErrorType") 9616 if len(code) != 0 { 9617 errorCode = restjson.SanitizeErrorCode(code) 9618 } 9619 9620 var buff [1024]byte 9621 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9622 9623 body := io.TeeReader(errorBody, ringBuffer) 9624 decoder := json.NewDecoder(body) 9625 decoder.UseNumber() 9626 code, message, err := restjson.GetErrorInfo(decoder) 9627 if err != nil { 9628 var snapshot bytes.Buffer 9629 io.Copy(&snapshot, ringBuffer) 9630 err = &smithy.DeserializationError{ 9631 Err: fmt.Errorf("failed to decode response body, %w", err), 9632 Snapshot: snapshot.Bytes(), 9633 } 9634 return err 9635 } 9636 9637 errorBody.Seek(0, io.SeekStart) 9638 if len(code) != 0 { 9639 errorCode = restjson.SanitizeErrorCode(code) 9640 } 9641 if len(message) != 0 { 9642 errorMessage = message 9643 } 9644 9645 switch { 9646 case strings.EqualFold("WAFInternalErrorException", errorCode): 9647 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9648 9649 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9650 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9651 9652 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9653 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9654 9655 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9656 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9657 9658 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9659 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9660 9661 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9662 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9663 9664 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9665 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9666 9667 case strings.EqualFold("WAFStaleDataException", errorCode): 9668 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9669 9670 default: 9671 genericError := &smithy.GenericAPIError{ 9672 Code: errorCode, 9673 Message: errorMessage, 9674 } 9675 return genericError 9676 9677 } 9678} 9679 9680type awsAwsjson11_deserializeOpUpdateWebACL struct { 9681} 9682 9683func (*awsAwsjson11_deserializeOpUpdateWebACL) ID() string { 9684 return "OperationDeserializer" 9685} 9686 9687func (m *awsAwsjson11_deserializeOpUpdateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9688 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9689) { 9690 out, metadata, err = next.HandleDeserialize(ctx, in) 9691 if err != nil { 9692 return out, metadata, err 9693 } 9694 9695 response, ok := out.RawResponse.(*smithyhttp.Response) 9696 if !ok { 9697 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9698 } 9699 9700 if response.StatusCode < 200 || response.StatusCode >= 300 { 9701 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateWebACL(response, &metadata) 9702 } 9703 output := &UpdateWebACLOutput{} 9704 out.Result = output 9705 9706 var buff [1024]byte 9707 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9708 9709 body := io.TeeReader(response.Body, ringBuffer) 9710 decoder := json.NewDecoder(body) 9711 decoder.UseNumber() 9712 var shape interface{} 9713 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9714 var snapshot bytes.Buffer 9715 io.Copy(&snapshot, ringBuffer) 9716 err = &smithy.DeserializationError{ 9717 Err: fmt.Errorf("failed to decode response body, %w", err), 9718 Snapshot: snapshot.Bytes(), 9719 } 9720 return out, metadata, err 9721 } 9722 9723 err = awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(&output, shape) 9724 if err != nil { 9725 var snapshot bytes.Buffer 9726 io.Copy(&snapshot, ringBuffer) 9727 err = &smithy.DeserializationError{ 9728 Err: fmt.Errorf("failed to decode response body, %w", err), 9729 Snapshot: snapshot.Bytes(), 9730 } 9731 return out, metadata, err 9732 } 9733 9734 return out, metadata, err 9735} 9736 9737func awsAwsjson11_deserializeOpErrorUpdateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9738 var errorBuffer bytes.Buffer 9739 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9740 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9741 } 9742 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9743 9744 errorCode := "UnknownError" 9745 errorMessage := errorCode 9746 9747 code := response.Header.Get("X-Amzn-ErrorType") 9748 if len(code) != 0 { 9749 errorCode = restjson.SanitizeErrorCode(code) 9750 } 9751 9752 var buff [1024]byte 9753 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9754 9755 body := io.TeeReader(errorBody, ringBuffer) 9756 decoder := json.NewDecoder(body) 9757 decoder.UseNumber() 9758 code, message, err := restjson.GetErrorInfo(decoder) 9759 if err != nil { 9760 var snapshot bytes.Buffer 9761 io.Copy(&snapshot, ringBuffer) 9762 err = &smithy.DeserializationError{ 9763 Err: fmt.Errorf("failed to decode response body, %w", err), 9764 Snapshot: snapshot.Bytes(), 9765 } 9766 return err 9767 } 9768 9769 errorBody.Seek(0, io.SeekStart) 9770 if len(code) != 0 { 9771 errorCode = restjson.SanitizeErrorCode(code) 9772 } 9773 if len(message) != 0 { 9774 errorMessage = message 9775 } 9776 9777 switch { 9778 case strings.EqualFold("WAFInternalErrorException", errorCode): 9779 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9780 9781 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9782 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9783 9784 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9785 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9786 9787 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9788 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9789 9790 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9791 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9792 9793 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9794 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9795 9796 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9797 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9798 9799 case strings.EqualFold("WAFReferencedItemException", errorCode): 9800 return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody) 9801 9802 case strings.EqualFold("WAFStaleDataException", errorCode): 9803 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9804 9805 case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode): 9806 return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody) 9807 9808 default: 9809 genericError := &smithy.GenericAPIError{ 9810 Code: errorCode, 9811 Message: errorMessage, 9812 } 9813 return genericError 9814 9815 } 9816} 9817 9818type awsAwsjson11_deserializeOpUpdateXssMatchSet struct { 9819} 9820 9821func (*awsAwsjson11_deserializeOpUpdateXssMatchSet) ID() string { 9822 return "OperationDeserializer" 9823} 9824 9825func (m *awsAwsjson11_deserializeOpUpdateXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9826 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9827) { 9828 out, metadata, err = next.HandleDeserialize(ctx, in) 9829 if err != nil { 9830 return out, metadata, err 9831 } 9832 9833 response, ok := out.RawResponse.(*smithyhttp.Response) 9834 if !ok { 9835 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9836 } 9837 9838 if response.StatusCode < 200 || response.StatusCode >= 300 { 9839 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateXssMatchSet(response, &metadata) 9840 } 9841 output := &UpdateXssMatchSetOutput{} 9842 out.Result = output 9843 9844 var buff [1024]byte 9845 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9846 9847 body := io.TeeReader(response.Body, ringBuffer) 9848 decoder := json.NewDecoder(body) 9849 decoder.UseNumber() 9850 var shape interface{} 9851 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9852 var snapshot bytes.Buffer 9853 io.Copy(&snapshot, ringBuffer) 9854 err = &smithy.DeserializationError{ 9855 Err: fmt.Errorf("failed to decode response body, %w", err), 9856 Snapshot: snapshot.Bytes(), 9857 } 9858 return out, metadata, err 9859 } 9860 9861 err = awsAwsjson11_deserializeOpDocumentUpdateXssMatchSetOutput(&output, shape) 9862 if err != nil { 9863 var snapshot bytes.Buffer 9864 io.Copy(&snapshot, ringBuffer) 9865 err = &smithy.DeserializationError{ 9866 Err: fmt.Errorf("failed to decode response body, %w", err), 9867 Snapshot: snapshot.Bytes(), 9868 } 9869 return out, metadata, err 9870 } 9871 9872 return out, metadata, err 9873} 9874 9875func awsAwsjson11_deserializeOpErrorUpdateXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9876 var errorBuffer bytes.Buffer 9877 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9878 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9879 } 9880 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9881 9882 errorCode := "UnknownError" 9883 errorMessage := errorCode 9884 9885 code := response.Header.Get("X-Amzn-ErrorType") 9886 if len(code) != 0 { 9887 errorCode = restjson.SanitizeErrorCode(code) 9888 } 9889 9890 var buff [1024]byte 9891 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9892 9893 body := io.TeeReader(errorBody, ringBuffer) 9894 decoder := json.NewDecoder(body) 9895 decoder.UseNumber() 9896 code, message, err := restjson.GetErrorInfo(decoder) 9897 if err != nil { 9898 var snapshot bytes.Buffer 9899 io.Copy(&snapshot, ringBuffer) 9900 err = &smithy.DeserializationError{ 9901 Err: fmt.Errorf("failed to decode response body, %w", err), 9902 Snapshot: snapshot.Bytes(), 9903 } 9904 return err 9905 } 9906 9907 errorBody.Seek(0, io.SeekStart) 9908 if len(code) != 0 { 9909 errorCode = restjson.SanitizeErrorCode(code) 9910 } 9911 if len(message) != 0 { 9912 errorMessage = message 9913 } 9914 9915 switch { 9916 case strings.EqualFold("WAFInternalErrorException", errorCode): 9917 return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody) 9918 9919 case strings.EqualFold("WAFInvalidAccountException", errorCode): 9920 return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody) 9921 9922 case strings.EqualFold("WAFInvalidOperationException", errorCode): 9923 return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody) 9924 9925 case strings.EqualFold("WAFInvalidParameterException", errorCode): 9926 return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody) 9927 9928 case strings.EqualFold("WAFLimitsExceededException", errorCode): 9929 return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody) 9930 9931 case strings.EqualFold("WAFNonexistentContainerException", errorCode): 9932 return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody) 9933 9934 case strings.EqualFold("WAFNonexistentItemException", errorCode): 9935 return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody) 9936 9937 case strings.EqualFold("WAFStaleDataException", errorCode): 9938 return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody) 9939 9940 default: 9941 genericError := &smithy.GenericAPIError{ 9942 Code: errorCode, 9943 Message: errorMessage, 9944 } 9945 return genericError 9946 9947 } 9948} 9949 9950func awsAwsjson11_deserializeErrorWAFBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 9951 var buff [1024]byte 9952 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9953 9954 body := io.TeeReader(errorBody, ringBuffer) 9955 decoder := json.NewDecoder(body) 9956 decoder.UseNumber() 9957 var shape interface{} 9958 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9959 var snapshot bytes.Buffer 9960 io.Copy(&snapshot, ringBuffer) 9961 err = &smithy.DeserializationError{ 9962 Err: fmt.Errorf("failed to decode response body, %w", err), 9963 Snapshot: snapshot.Bytes(), 9964 } 9965 return err 9966 } 9967 9968 output := &types.WAFBadRequestException{} 9969 err := awsAwsjson11_deserializeDocumentWAFBadRequestException(&output, shape) 9970 9971 if err != nil { 9972 var snapshot bytes.Buffer 9973 io.Copy(&snapshot, ringBuffer) 9974 err = &smithy.DeserializationError{ 9975 Err: fmt.Errorf("failed to decode response body, %w", err), 9976 Snapshot: snapshot.Bytes(), 9977 } 9978 return err 9979 } 9980 9981 errorBody.Seek(0, io.SeekStart) 9982 return output 9983} 9984 9985func awsAwsjson11_deserializeErrorWAFDisallowedNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 9986 var buff [1024]byte 9987 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9988 9989 body := io.TeeReader(errorBody, ringBuffer) 9990 decoder := json.NewDecoder(body) 9991 decoder.UseNumber() 9992 var shape interface{} 9993 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9994 var snapshot bytes.Buffer 9995 io.Copy(&snapshot, ringBuffer) 9996 err = &smithy.DeserializationError{ 9997 Err: fmt.Errorf("failed to decode response body, %w", err), 9998 Snapshot: snapshot.Bytes(), 9999 } 10000 return err 10001 } 10002 10003 output := &types.WAFDisallowedNameException{} 10004 err := awsAwsjson11_deserializeDocumentWAFDisallowedNameException(&output, shape) 10005 10006 if err != nil { 10007 var snapshot bytes.Buffer 10008 io.Copy(&snapshot, ringBuffer) 10009 err = &smithy.DeserializationError{ 10010 Err: fmt.Errorf("failed to decode response body, %w", err), 10011 Snapshot: snapshot.Bytes(), 10012 } 10013 return err 10014 } 10015 10016 errorBody.Seek(0, io.SeekStart) 10017 return output 10018} 10019 10020func awsAwsjson11_deserializeErrorWAFEntityMigrationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10021 var buff [1024]byte 10022 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10023 10024 body := io.TeeReader(errorBody, ringBuffer) 10025 decoder := json.NewDecoder(body) 10026 decoder.UseNumber() 10027 var shape interface{} 10028 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10029 var snapshot bytes.Buffer 10030 io.Copy(&snapshot, ringBuffer) 10031 err = &smithy.DeserializationError{ 10032 Err: fmt.Errorf("failed to decode response body, %w", err), 10033 Snapshot: snapshot.Bytes(), 10034 } 10035 return err 10036 } 10037 10038 output := &types.WAFEntityMigrationException{} 10039 err := awsAwsjson11_deserializeDocumentWAFEntityMigrationException(&output, shape) 10040 10041 if err != nil { 10042 var snapshot bytes.Buffer 10043 io.Copy(&snapshot, ringBuffer) 10044 err = &smithy.DeserializationError{ 10045 Err: fmt.Errorf("failed to decode response body, %w", err), 10046 Snapshot: snapshot.Bytes(), 10047 } 10048 return err 10049 } 10050 10051 errorBody.Seek(0, io.SeekStart) 10052 return output 10053} 10054 10055func awsAwsjson11_deserializeErrorWAFInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10056 var buff [1024]byte 10057 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10058 10059 body := io.TeeReader(errorBody, ringBuffer) 10060 decoder := json.NewDecoder(body) 10061 decoder.UseNumber() 10062 var shape interface{} 10063 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10064 var snapshot bytes.Buffer 10065 io.Copy(&snapshot, ringBuffer) 10066 err = &smithy.DeserializationError{ 10067 Err: fmt.Errorf("failed to decode response body, %w", err), 10068 Snapshot: snapshot.Bytes(), 10069 } 10070 return err 10071 } 10072 10073 output := &types.WAFInternalErrorException{} 10074 err := awsAwsjson11_deserializeDocumentWAFInternalErrorException(&output, shape) 10075 10076 if err != nil { 10077 var snapshot bytes.Buffer 10078 io.Copy(&snapshot, ringBuffer) 10079 err = &smithy.DeserializationError{ 10080 Err: fmt.Errorf("failed to decode response body, %w", err), 10081 Snapshot: snapshot.Bytes(), 10082 } 10083 return err 10084 } 10085 10086 errorBody.Seek(0, io.SeekStart) 10087 return output 10088} 10089 10090func awsAwsjson11_deserializeErrorWAFInvalidAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10091 var buff [1024]byte 10092 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10093 10094 body := io.TeeReader(errorBody, ringBuffer) 10095 decoder := json.NewDecoder(body) 10096 decoder.UseNumber() 10097 var shape interface{} 10098 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10099 var snapshot bytes.Buffer 10100 io.Copy(&snapshot, ringBuffer) 10101 err = &smithy.DeserializationError{ 10102 Err: fmt.Errorf("failed to decode response body, %w", err), 10103 Snapshot: snapshot.Bytes(), 10104 } 10105 return err 10106 } 10107 10108 output := &types.WAFInvalidAccountException{} 10109 err := awsAwsjson11_deserializeDocumentWAFInvalidAccountException(&output, shape) 10110 10111 if err != nil { 10112 var snapshot bytes.Buffer 10113 io.Copy(&snapshot, ringBuffer) 10114 err = &smithy.DeserializationError{ 10115 Err: fmt.Errorf("failed to decode response body, %w", err), 10116 Snapshot: snapshot.Bytes(), 10117 } 10118 return err 10119 } 10120 10121 errorBody.Seek(0, io.SeekStart) 10122 return output 10123} 10124 10125func awsAwsjson11_deserializeErrorWAFInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10126 var buff [1024]byte 10127 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10128 10129 body := io.TeeReader(errorBody, ringBuffer) 10130 decoder := json.NewDecoder(body) 10131 decoder.UseNumber() 10132 var shape interface{} 10133 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10134 var snapshot bytes.Buffer 10135 io.Copy(&snapshot, ringBuffer) 10136 err = &smithy.DeserializationError{ 10137 Err: fmt.Errorf("failed to decode response body, %w", err), 10138 Snapshot: snapshot.Bytes(), 10139 } 10140 return err 10141 } 10142 10143 output := &types.WAFInvalidOperationException{} 10144 err := awsAwsjson11_deserializeDocumentWAFInvalidOperationException(&output, shape) 10145 10146 if err != nil { 10147 var snapshot bytes.Buffer 10148 io.Copy(&snapshot, ringBuffer) 10149 err = &smithy.DeserializationError{ 10150 Err: fmt.Errorf("failed to decode response body, %w", err), 10151 Snapshot: snapshot.Bytes(), 10152 } 10153 return err 10154 } 10155 10156 errorBody.Seek(0, io.SeekStart) 10157 return output 10158} 10159 10160func awsAwsjson11_deserializeErrorWAFInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10161 var buff [1024]byte 10162 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10163 10164 body := io.TeeReader(errorBody, ringBuffer) 10165 decoder := json.NewDecoder(body) 10166 decoder.UseNumber() 10167 var shape interface{} 10168 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10169 var snapshot bytes.Buffer 10170 io.Copy(&snapshot, ringBuffer) 10171 err = &smithy.DeserializationError{ 10172 Err: fmt.Errorf("failed to decode response body, %w", err), 10173 Snapshot: snapshot.Bytes(), 10174 } 10175 return err 10176 } 10177 10178 output := &types.WAFInvalidParameterException{} 10179 err := awsAwsjson11_deserializeDocumentWAFInvalidParameterException(&output, shape) 10180 10181 if err != nil { 10182 var snapshot bytes.Buffer 10183 io.Copy(&snapshot, ringBuffer) 10184 err = &smithy.DeserializationError{ 10185 Err: fmt.Errorf("failed to decode response body, %w", err), 10186 Snapshot: snapshot.Bytes(), 10187 } 10188 return err 10189 } 10190 10191 errorBody.Seek(0, io.SeekStart) 10192 return output 10193} 10194 10195func awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10196 var buff [1024]byte 10197 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10198 10199 body := io.TeeReader(errorBody, ringBuffer) 10200 decoder := json.NewDecoder(body) 10201 decoder.UseNumber() 10202 var shape interface{} 10203 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10204 var snapshot bytes.Buffer 10205 io.Copy(&snapshot, ringBuffer) 10206 err = &smithy.DeserializationError{ 10207 Err: fmt.Errorf("failed to decode response body, %w", err), 10208 Snapshot: snapshot.Bytes(), 10209 } 10210 return err 10211 } 10212 10213 output := &types.WAFInvalidPermissionPolicyException{} 10214 err := awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(&output, shape) 10215 10216 if err != nil { 10217 var snapshot bytes.Buffer 10218 io.Copy(&snapshot, ringBuffer) 10219 err = &smithy.DeserializationError{ 10220 Err: fmt.Errorf("failed to decode response body, %w", err), 10221 Snapshot: snapshot.Bytes(), 10222 } 10223 return err 10224 } 10225 10226 errorBody.Seek(0, io.SeekStart) 10227 return output 10228} 10229 10230func awsAwsjson11_deserializeErrorWAFInvalidRegexPatternException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10231 var buff [1024]byte 10232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10233 10234 body := io.TeeReader(errorBody, ringBuffer) 10235 decoder := json.NewDecoder(body) 10236 decoder.UseNumber() 10237 var shape interface{} 10238 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10239 var snapshot bytes.Buffer 10240 io.Copy(&snapshot, ringBuffer) 10241 err = &smithy.DeserializationError{ 10242 Err: fmt.Errorf("failed to decode response body, %w", err), 10243 Snapshot: snapshot.Bytes(), 10244 } 10245 return err 10246 } 10247 10248 output := &types.WAFInvalidRegexPatternException{} 10249 err := awsAwsjson11_deserializeDocumentWAFInvalidRegexPatternException(&output, shape) 10250 10251 if err != nil { 10252 var snapshot bytes.Buffer 10253 io.Copy(&snapshot, ringBuffer) 10254 err = &smithy.DeserializationError{ 10255 Err: fmt.Errorf("failed to decode response body, %w", err), 10256 Snapshot: snapshot.Bytes(), 10257 } 10258 return err 10259 } 10260 10261 errorBody.Seek(0, io.SeekStart) 10262 return output 10263} 10264 10265func awsAwsjson11_deserializeErrorWAFLimitsExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10266 var buff [1024]byte 10267 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10268 10269 body := io.TeeReader(errorBody, ringBuffer) 10270 decoder := json.NewDecoder(body) 10271 decoder.UseNumber() 10272 var shape interface{} 10273 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10274 var snapshot bytes.Buffer 10275 io.Copy(&snapshot, ringBuffer) 10276 err = &smithy.DeserializationError{ 10277 Err: fmt.Errorf("failed to decode response body, %w", err), 10278 Snapshot: snapshot.Bytes(), 10279 } 10280 return err 10281 } 10282 10283 output := &types.WAFLimitsExceededException{} 10284 err := awsAwsjson11_deserializeDocumentWAFLimitsExceededException(&output, shape) 10285 10286 if err != nil { 10287 var snapshot bytes.Buffer 10288 io.Copy(&snapshot, ringBuffer) 10289 err = &smithy.DeserializationError{ 10290 Err: fmt.Errorf("failed to decode response body, %w", err), 10291 Snapshot: snapshot.Bytes(), 10292 } 10293 return err 10294 } 10295 10296 errorBody.Seek(0, io.SeekStart) 10297 return output 10298} 10299 10300func awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10301 var buff [1024]byte 10302 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10303 10304 body := io.TeeReader(errorBody, ringBuffer) 10305 decoder := json.NewDecoder(body) 10306 decoder.UseNumber() 10307 var shape interface{} 10308 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10309 var snapshot bytes.Buffer 10310 io.Copy(&snapshot, ringBuffer) 10311 err = &smithy.DeserializationError{ 10312 Err: fmt.Errorf("failed to decode response body, %w", err), 10313 Snapshot: snapshot.Bytes(), 10314 } 10315 return err 10316 } 10317 10318 output := &types.WAFNonEmptyEntityException{} 10319 err := awsAwsjson11_deserializeDocumentWAFNonEmptyEntityException(&output, shape) 10320 10321 if err != nil { 10322 var snapshot bytes.Buffer 10323 io.Copy(&snapshot, ringBuffer) 10324 err = &smithy.DeserializationError{ 10325 Err: fmt.Errorf("failed to decode response body, %w", err), 10326 Snapshot: snapshot.Bytes(), 10327 } 10328 return err 10329 } 10330 10331 errorBody.Seek(0, io.SeekStart) 10332 return output 10333} 10334 10335func awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10336 var buff [1024]byte 10337 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10338 10339 body := io.TeeReader(errorBody, ringBuffer) 10340 decoder := json.NewDecoder(body) 10341 decoder.UseNumber() 10342 var shape interface{} 10343 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10344 var snapshot bytes.Buffer 10345 io.Copy(&snapshot, ringBuffer) 10346 err = &smithy.DeserializationError{ 10347 Err: fmt.Errorf("failed to decode response body, %w", err), 10348 Snapshot: snapshot.Bytes(), 10349 } 10350 return err 10351 } 10352 10353 output := &types.WAFNonexistentContainerException{} 10354 err := awsAwsjson11_deserializeDocumentWAFNonexistentContainerException(&output, shape) 10355 10356 if err != nil { 10357 var snapshot bytes.Buffer 10358 io.Copy(&snapshot, ringBuffer) 10359 err = &smithy.DeserializationError{ 10360 Err: fmt.Errorf("failed to decode response body, %w", err), 10361 Snapshot: snapshot.Bytes(), 10362 } 10363 return err 10364 } 10365 10366 errorBody.Seek(0, io.SeekStart) 10367 return output 10368} 10369 10370func awsAwsjson11_deserializeErrorWAFNonexistentItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10371 var buff [1024]byte 10372 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10373 10374 body := io.TeeReader(errorBody, ringBuffer) 10375 decoder := json.NewDecoder(body) 10376 decoder.UseNumber() 10377 var shape interface{} 10378 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10379 var snapshot bytes.Buffer 10380 io.Copy(&snapshot, ringBuffer) 10381 err = &smithy.DeserializationError{ 10382 Err: fmt.Errorf("failed to decode response body, %w", err), 10383 Snapshot: snapshot.Bytes(), 10384 } 10385 return err 10386 } 10387 10388 output := &types.WAFNonexistentItemException{} 10389 err := awsAwsjson11_deserializeDocumentWAFNonexistentItemException(&output, shape) 10390 10391 if err != nil { 10392 var snapshot bytes.Buffer 10393 io.Copy(&snapshot, ringBuffer) 10394 err = &smithy.DeserializationError{ 10395 Err: fmt.Errorf("failed to decode response body, %w", err), 10396 Snapshot: snapshot.Bytes(), 10397 } 10398 return err 10399 } 10400 10401 errorBody.Seek(0, io.SeekStart) 10402 return output 10403} 10404 10405func awsAwsjson11_deserializeErrorWAFReferencedItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10406 var buff [1024]byte 10407 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10408 10409 body := io.TeeReader(errorBody, ringBuffer) 10410 decoder := json.NewDecoder(body) 10411 decoder.UseNumber() 10412 var shape interface{} 10413 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10414 var snapshot bytes.Buffer 10415 io.Copy(&snapshot, ringBuffer) 10416 err = &smithy.DeserializationError{ 10417 Err: fmt.Errorf("failed to decode response body, %w", err), 10418 Snapshot: snapshot.Bytes(), 10419 } 10420 return err 10421 } 10422 10423 output := &types.WAFReferencedItemException{} 10424 err := awsAwsjson11_deserializeDocumentWAFReferencedItemException(&output, shape) 10425 10426 if err != nil { 10427 var snapshot bytes.Buffer 10428 io.Copy(&snapshot, ringBuffer) 10429 err = &smithy.DeserializationError{ 10430 Err: fmt.Errorf("failed to decode response body, %w", err), 10431 Snapshot: snapshot.Bytes(), 10432 } 10433 return err 10434 } 10435 10436 errorBody.Seek(0, io.SeekStart) 10437 return output 10438} 10439 10440func awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10441 var buff [1024]byte 10442 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10443 10444 body := io.TeeReader(errorBody, ringBuffer) 10445 decoder := json.NewDecoder(body) 10446 decoder.UseNumber() 10447 var shape interface{} 10448 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10449 var snapshot bytes.Buffer 10450 io.Copy(&snapshot, ringBuffer) 10451 err = &smithy.DeserializationError{ 10452 Err: fmt.Errorf("failed to decode response body, %w", err), 10453 Snapshot: snapshot.Bytes(), 10454 } 10455 return err 10456 } 10457 10458 output := &types.WAFServiceLinkedRoleErrorException{} 10459 err := awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(&output, shape) 10460 10461 if err != nil { 10462 var snapshot bytes.Buffer 10463 io.Copy(&snapshot, ringBuffer) 10464 err = &smithy.DeserializationError{ 10465 Err: fmt.Errorf("failed to decode response body, %w", err), 10466 Snapshot: snapshot.Bytes(), 10467 } 10468 return err 10469 } 10470 10471 errorBody.Seek(0, io.SeekStart) 10472 return output 10473} 10474 10475func awsAwsjson11_deserializeErrorWAFStaleDataException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10476 var buff [1024]byte 10477 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10478 10479 body := io.TeeReader(errorBody, ringBuffer) 10480 decoder := json.NewDecoder(body) 10481 decoder.UseNumber() 10482 var shape interface{} 10483 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10484 var snapshot bytes.Buffer 10485 io.Copy(&snapshot, ringBuffer) 10486 err = &smithy.DeserializationError{ 10487 Err: fmt.Errorf("failed to decode response body, %w", err), 10488 Snapshot: snapshot.Bytes(), 10489 } 10490 return err 10491 } 10492 10493 output := &types.WAFStaleDataException{} 10494 err := awsAwsjson11_deserializeDocumentWAFStaleDataException(&output, shape) 10495 10496 if err != nil { 10497 var snapshot bytes.Buffer 10498 io.Copy(&snapshot, ringBuffer) 10499 err = &smithy.DeserializationError{ 10500 Err: fmt.Errorf("failed to decode response body, %w", err), 10501 Snapshot: snapshot.Bytes(), 10502 } 10503 return err 10504 } 10505 10506 errorBody.Seek(0, io.SeekStart) 10507 return output 10508} 10509 10510func awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10511 var buff [1024]byte 10512 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10513 10514 body := io.TeeReader(errorBody, ringBuffer) 10515 decoder := json.NewDecoder(body) 10516 decoder.UseNumber() 10517 var shape interface{} 10518 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10519 var snapshot bytes.Buffer 10520 io.Copy(&snapshot, ringBuffer) 10521 err = &smithy.DeserializationError{ 10522 Err: fmt.Errorf("failed to decode response body, %w", err), 10523 Snapshot: snapshot.Bytes(), 10524 } 10525 return err 10526 } 10527 10528 output := &types.WAFSubscriptionNotFoundException{} 10529 err := awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(&output, shape) 10530 10531 if err != nil { 10532 var snapshot bytes.Buffer 10533 io.Copy(&snapshot, ringBuffer) 10534 err = &smithy.DeserializationError{ 10535 Err: fmt.Errorf("failed to decode response body, %w", err), 10536 Snapshot: snapshot.Bytes(), 10537 } 10538 return err 10539 } 10540 10541 errorBody.Seek(0, io.SeekStart) 10542 return output 10543} 10544 10545func awsAwsjson11_deserializeErrorWAFTagOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10546 var buff [1024]byte 10547 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10548 10549 body := io.TeeReader(errorBody, ringBuffer) 10550 decoder := json.NewDecoder(body) 10551 decoder.UseNumber() 10552 var shape interface{} 10553 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10554 var snapshot bytes.Buffer 10555 io.Copy(&snapshot, ringBuffer) 10556 err = &smithy.DeserializationError{ 10557 Err: fmt.Errorf("failed to decode response body, %w", err), 10558 Snapshot: snapshot.Bytes(), 10559 } 10560 return err 10561 } 10562 10563 output := &types.WAFTagOperationException{} 10564 err := awsAwsjson11_deserializeDocumentWAFTagOperationException(&output, shape) 10565 10566 if err != nil { 10567 var snapshot bytes.Buffer 10568 io.Copy(&snapshot, ringBuffer) 10569 err = &smithy.DeserializationError{ 10570 Err: fmt.Errorf("failed to decode response body, %w", err), 10571 Snapshot: snapshot.Bytes(), 10572 } 10573 return err 10574 } 10575 10576 errorBody.Seek(0, io.SeekStart) 10577 return output 10578} 10579 10580func awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10581 var buff [1024]byte 10582 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10583 10584 body := io.TeeReader(errorBody, ringBuffer) 10585 decoder := json.NewDecoder(body) 10586 decoder.UseNumber() 10587 var shape interface{} 10588 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10589 var snapshot bytes.Buffer 10590 io.Copy(&snapshot, ringBuffer) 10591 err = &smithy.DeserializationError{ 10592 Err: fmt.Errorf("failed to decode response body, %w", err), 10593 Snapshot: snapshot.Bytes(), 10594 } 10595 return err 10596 } 10597 10598 output := &types.WAFTagOperationInternalErrorException{} 10599 err := awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(&output, shape) 10600 10601 if err != nil { 10602 var snapshot bytes.Buffer 10603 io.Copy(&snapshot, ringBuffer) 10604 err = &smithy.DeserializationError{ 10605 Err: fmt.Errorf("failed to decode response body, %w", err), 10606 Snapshot: snapshot.Bytes(), 10607 } 10608 return err 10609 } 10610 10611 errorBody.Seek(0, io.SeekStart) 10612 return output 10613} 10614 10615func awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10616 var buff [1024]byte 10617 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10618 10619 body := io.TeeReader(errorBody, ringBuffer) 10620 decoder := json.NewDecoder(body) 10621 decoder.UseNumber() 10622 var shape interface{} 10623 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10624 var snapshot bytes.Buffer 10625 io.Copy(&snapshot, ringBuffer) 10626 err = &smithy.DeserializationError{ 10627 Err: fmt.Errorf("failed to decode response body, %w", err), 10628 Snapshot: snapshot.Bytes(), 10629 } 10630 return err 10631 } 10632 10633 output := &types.WAFUnavailableEntityException{} 10634 err := awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(&output, shape) 10635 10636 if err != nil { 10637 var snapshot bytes.Buffer 10638 io.Copy(&snapshot, ringBuffer) 10639 err = &smithy.DeserializationError{ 10640 Err: fmt.Errorf("failed to decode response body, %w", err), 10641 Snapshot: snapshot.Bytes(), 10642 } 10643 return err 10644 } 10645 10646 errorBody.Seek(0, io.SeekStart) 10647 return output 10648} 10649 10650func awsAwsjson11_deserializeDocumentActivatedRule(v **types.ActivatedRule, value interface{}) error { 10651 if v == nil { 10652 return fmt.Errorf("unexpected nil of type %T", v) 10653 } 10654 if value == nil { 10655 return nil 10656 } 10657 10658 shape, ok := value.(map[string]interface{}) 10659 if !ok { 10660 return fmt.Errorf("unexpected JSON type %v", value) 10661 } 10662 10663 var sv *types.ActivatedRule 10664 if *v == nil { 10665 sv = &types.ActivatedRule{} 10666 } else { 10667 sv = *v 10668 } 10669 10670 for key, value := range shape { 10671 switch key { 10672 case "Action": 10673 if err := awsAwsjson11_deserializeDocumentWafAction(&sv.Action, value); err != nil { 10674 return err 10675 } 10676 10677 case "ExcludedRules": 10678 if err := awsAwsjson11_deserializeDocumentExcludedRules(&sv.ExcludedRules, value); err != nil { 10679 return err 10680 } 10681 10682 case "OverrideAction": 10683 if err := awsAwsjson11_deserializeDocumentWafOverrideAction(&sv.OverrideAction, value); err != nil { 10684 return err 10685 } 10686 10687 case "Priority": 10688 if value != nil { 10689 jtv, ok := value.(json.Number) 10690 if !ok { 10691 return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) 10692 } 10693 i64, err := jtv.Int64() 10694 if err != nil { 10695 return err 10696 } 10697 sv.Priority = ptr.Int32(int32(i64)) 10698 } 10699 10700 case "RuleId": 10701 if value != nil { 10702 jtv, ok := value.(string) 10703 if !ok { 10704 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 10705 } 10706 sv.RuleId = ptr.String(jtv) 10707 } 10708 10709 case "Type": 10710 if value != nil { 10711 jtv, ok := value.(string) 10712 if !ok { 10713 return fmt.Errorf("expected WafRuleType to be of type string, got %T instead", value) 10714 } 10715 sv.Type = types.WafRuleType(jtv) 10716 } 10717 10718 default: 10719 _, _ = key, value 10720 10721 } 10722 } 10723 *v = sv 10724 return nil 10725} 10726 10727func awsAwsjson11_deserializeDocumentActivatedRules(v *[]types.ActivatedRule, value interface{}) error { 10728 if v == nil { 10729 return fmt.Errorf("unexpected nil of type %T", v) 10730 } 10731 if value == nil { 10732 return nil 10733 } 10734 10735 shape, ok := value.([]interface{}) 10736 if !ok { 10737 return fmt.Errorf("unexpected JSON type %v", value) 10738 } 10739 10740 var cv []types.ActivatedRule 10741 if *v == nil { 10742 cv = []types.ActivatedRule{} 10743 } else { 10744 cv = *v 10745 } 10746 10747 for _, value := range shape { 10748 var col types.ActivatedRule 10749 destAddr := &col 10750 if err := awsAwsjson11_deserializeDocumentActivatedRule(&destAddr, value); err != nil { 10751 return err 10752 } 10753 col = *destAddr 10754 cv = append(cv, col) 10755 10756 } 10757 *v = cv 10758 return nil 10759} 10760 10761func awsAwsjson11_deserializeDocumentByteMatchSet(v **types.ByteMatchSet, value interface{}) error { 10762 if v == nil { 10763 return fmt.Errorf("unexpected nil of type %T", v) 10764 } 10765 if value == nil { 10766 return nil 10767 } 10768 10769 shape, ok := value.(map[string]interface{}) 10770 if !ok { 10771 return fmt.Errorf("unexpected JSON type %v", value) 10772 } 10773 10774 var sv *types.ByteMatchSet 10775 if *v == nil { 10776 sv = &types.ByteMatchSet{} 10777 } else { 10778 sv = *v 10779 } 10780 10781 for key, value := range shape { 10782 switch key { 10783 case "ByteMatchSetId": 10784 if value != nil { 10785 jtv, ok := value.(string) 10786 if !ok { 10787 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 10788 } 10789 sv.ByteMatchSetId = ptr.String(jtv) 10790 } 10791 10792 case "ByteMatchTuples": 10793 if err := awsAwsjson11_deserializeDocumentByteMatchTuples(&sv.ByteMatchTuples, value); err != nil { 10794 return err 10795 } 10796 10797 case "Name": 10798 if value != nil { 10799 jtv, ok := value.(string) 10800 if !ok { 10801 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 10802 } 10803 sv.Name = ptr.String(jtv) 10804 } 10805 10806 default: 10807 _, _ = key, value 10808 10809 } 10810 } 10811 *v = sv 10812 return nil 10813} 10814 10815func awsAwsjson11_deserializeDocumentByteMatchSetSummaries(v *[]types.ByteMatchSetSummary, value interface{}) error { 10816 if v == nil { 10817 return fmt.Errorf("unexpected nil of type %T", v) 10818 } 10819 if value == nil { 10820 return nil 10821 } 10822 10823 shape, ok := value.([]interface{}) 10824 if !ok { 10825 return fmt.Errorf("unexpected JSON type %v", value) 10826 } 10827 10828 var cv []types.ByteMatchSetSummary 10829 if *v == nil { 10830 cv = []types.ByteMatchSetSummary{} 10831 } else { 10832 cv = *v 10833 } 10834 10835 for _, value := range shape { 10836 var col types.ByteMatchSetSummary 10837 destAddr := &col 10838 if err := awsAwsjson11_deserializeDocumentByteMatchSetSummary(&destAddr, value); err != nil { 10839 return err 10840 } 10841 col = *destAddr 10842 cv = append(cv, col) 10843 10844 } 10845 *v = cv 10846 return nil 10847} 10848 10849func awsAwsjson11_deserializeDocumentByteMatchSetSummary(v **types.ByteMatchSetSummary, value interface{}) error { 10850 if v == nil { 10851 return fmt.Errorf("unexpected nil of type %T", v) 10852 } 10853 if value == nil { 10854 return nil 10855 } 10856 10857 shape, ok := value.(map[string]interface{}) 10858 if !ok { 10859 return fmt.Errorf("unexpected JSON type %v", value) 10860 } 10861 10862 var sv *types.ByteMatchSetSummary 10863 if *v == nil { 10864 sv = &types.ByteMatchSetSummary{} 10865 } else { 10866 sv = *v 10867 } 10868 10869 for key, value := range shape { 10870 switch key { 10871 case "ByteMatchSetId": 10872 if value != nil { 10873 jtv, ok := value.(string) 10874 if !ok { 10875 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 10876 } 10877 sv.ByteMatchSetId = ptr.String(jtv) 10878 } 10879 10880 case "Name": 10881 if value != nil { 10882 jtv, ok := value.(string) 10883 if !ok { 10884 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 10885 } 10886 sv.Name = ptr.String(jtv) 10887 } 10888 10889 default: 10890 _, _ = key, value 10891 10892 } 10893 } 10894 *v = sv 10895 return nil 10896} 10897 10898func awsAwsjson11_deserializeDocumentByteMatchTuple(v **types.ByteMatchTuple, value interface{}) error { 10899 if v == nil { 10900 return fmt.Errorf("unexpected nil of type %T", v) 10901 } 10902 if value == nil { 10903 return nil 10904 } 10905 10906 shape, ok := value.(map[string]interface{}) 10907 if !ok { 10908 return fmt.Errorf("unexpected JSON type %v", value) 10909 } 10910 10911 var sv *types.ByteMatchTuple 10912 if *v == nil { 10913 sv = &types.ByteMatchTuple{} 10914 } else { 10915 sv = *v 10916 } 10917 10918 for key, value := range shape { 10919 switch key { 10920 case "FieldToMatch": 10921 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil { 10922 return err 10923 } 10924 10925 case "PositionalConstraint": 10926 if value != nil { 10927 jtv, ok := value.(string) 10928 if !ok { 10929 return fmt.Errorf("expected PositionalConstraint to be of type string, got %T instead", value) 10930 } 10931 sv.PositionalConstraint = types.PositionalConstraint(jtv) 10932 } 10933 10934 case "TargetString": 10935 if value != nil { 10936 jtv, ok := value.(string) 10937 if !ok { 10938 return fmt.Errorf("expected ByteMatchTargetString to be []byte, got %T instead", value) 10939 } 10940 dv, err := base64.StdEncoding.DecodeString(jtv) 10941 if err != nil { 10942 return fmt.Errorf("failed to base64 decode ByteMatchTargetString, %w", err) 10943 } 10944 sv.TargetString = dv 10945 } 10946 10947 case "TextTransformation": 10948 if value != nil { 10949 jtv, ok := value.(string) 10950 if !ok { 10951 return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value) 10952 } 10953 sv.TextTransformation = types.TextTransformation(jtv) 10954 } 10955 10956 default: 10957 _, _ = key, value 10958 10959 } 10960 } 10961 *v = sv 10962 return nil 10963} 10964 10965func awsAwsjson11_deserializeDocumentByteMatchTuples(v *[]types.ByteMatchTuple, value interface{}) error { 10966 if v == nil { 10967 return fmt.Errorf("unexpected nil of type %T", v) 10968 } 10969 if value == nil { 10970 return nil 10971 } 10972 10973 shape, ok := value.([]interface{}) 10974 if !ok { 10975 return fmt.Errorf("unexpected JSON type %v", value) 10976 } 10977 10978 var cv []types.ByteMatchTuple 10979 if *v == nil { 10980 cv = []types.ByteMatchTuple{} 10981 } else { 10982 cv = *v 10983 } 10984 10985 for _, value := range shape { 10986 var col types.ByteMatchTuple 10987 destAddr := &col 10988 if err := awsAwsjson11_deserializeDocumentByteMatchTuple(&destAddr, value); err != nil { 10989 return err 10990 } 10991 col = *destAddr 10992 cv = append(cv, col) 10993 10994 } 10995 *v = cv 10996 return nil 10997} 10998 10999func awsAwsjson11_deserializeDocumentExcludedRule(v **types.ExcludedRule, value interface{}) error { 11000 if v == nil { 11001 return fmt.Errorf("unexpected nil of type %T", v) 11002 } 11003 if value == nil { 11004 return nil 11005 } 11006 11007 shape, ok := value.(map[string]interface{}) 11008 if !ok { 11009 return fmt.Errorf("unexpected JSON type %v", value) 11010 } 11011 11012 var sv *types.ExcludedRule 11013 if *v == nil { 11014 sv = &types.ExcludedRule{} 11015 } else { 11016 sv = *v 11017 } 11018 11019 for key, value := range shape { 11020 switch key { 11021 case "RuleId": 11022 if value != nil { 11023 jtv, ok := value.(string) 11024 if !ok { 11025 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11026 } 11027 sv.RuleId = ptr.String(jtv) 11028 } 11029 11030 default: 11031 _, _ = key, value 11032 11033 } 11034 } 11035 *v = sv 11036 return nil 11037} 11038 11039func awsAwsjson11_deserializeDocumentExcludedRules(v *[]types.ExcludedRule, value interface{}) error { 11040 if v == nil { 11041 return fmt.Errorf("unexpected nil of type %T", v) 11042 } 11043 if value == nil { 11044 return nil 11045 } 11046 11047 shape, ok := value.([]interface{}) 11048 if !ok { 11049 return fmt.Errorf("unexpected JSON type %v", value) 11050 } 11051 11052 var cv []types.ExcludedRule 11053 if *v == nil { 11054 cv = []types.ExcludedRule{} 11055 } else { 11056 cv = *v 11057 } 11058 11059 for _, value := range shape { 11060 var col types.ExcludedRule 11061 destAddr := &col 11062 if err := awsAwsjson11_deserializeDocumentExcludedRule(&destAddr, value); err != nil { 11063 return err 11064 } 11065 col = *destAddr 11066 cv = append(cv, col) 11067 11068 } 11069 *v = cv 11070 return nil 11071} 11072 11073func awsAwsjson11_deserializeDocumentFieldToMatch(v **types.FieldToMatch, value interface{}) error { 11074 if v == nil { 11075 return fmt.Errorf("unexpected nil of type %T", v) 11076 } 11077 if value == nil { 11078 return nil 11079 } 11080 11081 shape, ok := value.(map[string]interface{}) 11082 if !ok { 11083 return fmt.Errorf("unexpected JSON type %v", value) 11084 } 11085 11086 var sv *types.FieldToMatch 11087 if *v == nil { 11088 sv = &types.FieldToMatch{} 11089 } else { 11090 sv = *v 11091 } 11092 11093 for key, value := range shape { 11094 switch key { 11095 case "Data": 11096 if value != nil { 11097 jtv, ok := value.(string) 11098 if !ok { 11099 return fmt.Errorf("expected MatchFieldData to be of type string, got %T instead", value) 11100 } 11101 sv.Data = ptr.String(jtv) 11102 } 11103 11104 case "Type": 11105 if value != nil { 11106 jtv, ok := value.(string) 11107 if !ok { 11108 return fmt.Errorf("expected MatchFieldType to be of type string, got %T instead", value) 11109 } 11110 sv.Type = types.MatchFieldType(jtv) 11111 } 11112 11113 default: 11114 _, _ = key, value 11115 11116 } 11117 } 11118 *v = sv 11119 return nil 11120} 11121 11122func awsAwsjson11_deserializeDocumentGeoMatchConstraint(v **types.GeoMatchConstraint, value interface{}) error { 11123 if v == nil { 11124 return fmt.Errorf("unexpected nil of type %T", v) 11125 } 11126 if value == nil { 11127 return nil 11128 } 11129 11130 shape, ok := value.(map[string]interface{}) 11131 if !ok { 11132 return fmt.Errorf("unexpected JSON type %v", value) 11133 } 11134 11135 var sv *types.GeoMatchConstraint 11136 if *v == nil { 11137 sv = &types.GeoMatchConstraint{} 11138 } else { 11139 sv = *v 11140 } 11141 11142 for key, value := range shape { 11143 switch key { 11144 case "Type": 11145 if value != nil { 11146 jtv, ok := value.(string) 11147 if !ok { 11148 return fmt.Errorf("expected GeoMatchConstraintType to be of type string, got %T instead", value) 11149 } 11150 sv.Type = types.GeoMatchConstraintType(jtv) 11151 } 11152 11153 case "Value": 11154 if value != nil { 11155 jtv, ok := value.(string) 11156 if !ok { 11157 return fmt.Errorf("expected GeoMatchConstraintValue to be of type string, got %T instead", value) 11158 } 11159 sv.Value = types.GeoMatchConstraintValue(jtv) 11160 } 11161 11162 default: 11163 _, _ = key, value 11164 11165 } 11166 } 11167 *v = sv 11168 return nil 11169} 11170 11171func awsAwsjson11_deserializeDocumentGeoMatchConstraints(v *[]types.GeoMatchConstraint, value interface{}) error { 11172 if v == nil { 11173 return fmt.Errorf("unexpected nil of type %T", v) 11174 } 11175 if value == nil { 11176 return nil 11177 } 11178 11179 shape, ok := value.([]interface{}) 11180 if !ok { 11181 return fmt.Errorf("unexpected JSON type %v", value) 11182 } 11183 11184 var cv []types.GeoMatchConstraint 11185 if *v == nil { 11186 cv = []types.GeoMatchConstraint{} 11187 } else { 11188 cv = *v 11189 } 11190 11191 for _, value := range shape { 11192 var col types.GeoMatchConstraint 11193 destAddr := &col 11194 if err := awsAwsjson11_deserializeDocumentGeoMatchConstraint(&destAddr, value); err != nil { 11195 return err 11196 } 11197 col = *destAddr 11198 cv = append(cv, col) 11199 11200 } 11201 *v = cv 11202 return nil 11203} 11204 11205func awsAwsjson11_deserializeDocumentGeoMatchSet(v **types.GeoMatchSet, value interface{}) error { 11206 if v == nil { 11207 return fmt.Errorf("unexpected nil of type %T", v) 11208 } 11209 if value == nil { 11210 return nil 11211 } 11212 11213 shape, ok := value.(map[string]interface{}) 11214 if !ok { 11215 return fmt.Errorf("unexpected JSON type %v", value) 11216 } 11217 11218 var sv *types.GeoMatchSet 11219 if *v == nil { 11220 sv = &types.GeoMatchSet{} 11221 } else { 11222 sv = *v 11223 } 11224 11225 for key, value := range shape { 11226 switch key { 11227 case "GeoMatchConstraints": 11228 if err := awsAwsjson11_deserializeDocumentGeoMatchConstraints(&sv.GeoMatchConstraints, value); err != nil { 11229 return err 11230 } 11231 11232 case "GeoMatchSetId": 11233 if value != nil { 11234 jtv, ok := value.(string) 11235 if !ok { 11236 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11237 } 11238 sv.GeoMatchSetId = ptr.String(jtv) 11239 } 11240 11241 case "Name": 11242 if value != nil { 11243 jtv, ok := value.(string) 11244 if !ok { 11245 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 11246 } 11247 sv.Name = ptr.String(jtv) 11248 } 11249 11250 default: 11251 _, _ = key, value 11252 11253 } 11254 } 11255 *v = sv 11256 return nil 11257} 11258 11259func awsAwsjson11_deserializeDocumentGeoMatchSetSummaries(v *[]types.GeoMatchSetSummary, value interface{}) error { 11260 if v == nil { 11261 return fmt.Errorf("unexpected nil of type %T", v) 11262 } 11263 if value == nil { 11264 return nil 11265 } 11266 11267 shape, ok := value.([]interface{}) 11268 if !ok { 11269 return fmt.Errorf("unexpected JSON type %v", value) 11270 } 11271 11272 var cv []types.GeoMatchSetSummary 11273 if *v == nil { 11274 cv = []types.GeoMatchSetSummary{} 11275 } else { 11276 cv = *v 11277 } 11278 11279 for _, value := range shape { 11280 var col types.GeoMatchSetSummary 11281 destAddr := &col 11282 if err := awsAwsjson11_deserializeDocumentGeoMatchSetSummary(&destAddr, value); err != nil { 11283 return err 11284 } 11285 col = *destAddr 11286 cv = append(cv, col) 11287 11288 } 11289 *v = cv 11290 return nil 11291} 11292 11293func awsAwsjson11_deserializeDocumentGeoMatchSetSummary(v **types.GeoMatchSetSummary, value interface{}) error { 11294 if v == nil { 11295 return fmt.Errorf("unexpected nil of type %T", v) 11296 } 11297 if value == nil { 11298 return nil 11299 } 11300 11301 shape, ok := value.(map[string]interface{}) 11302 if !ok { 11303 return fmt.Errorf("unexpected JSON type %v", value) 11304 } 11305 11306 var sv *types.GeoMatchSetSummary 11307 if *v == nil { 11308 sv = &types.GeoMatchSetSummary{} 11309 } else { 11310 sv = *v 11311 } 11312 11313 for key, value := range shape { 11314 switch key { 11315 case "GeoMatchSetId": 11316 if value != nil { 11317 jtv, ok := value.(string) 11318 if !ok { 11319 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11320 } 11321 sv.GeoMatchSetId = ptr.String(jtv) 11322 } 11323 11324 case "Name": 11325 if value != nil { 11326 jtv, ok := value.(string) 11327 if !ok { 11328 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 11329 } 11330 sv.Name = ptr.String(jtv) 11331 } 11332 11333 default: 11334 _, _ = key, value 11335 11336 } 11337 } 11338 *v = sv 11339 return nil 11340} 11341 11342func awsAwsjson11_deserializeDocumentHTTPHeader(v **types.HTTPHeader, value interface{}) error { 11343 if v == nil { 11344 return fmt.Errorf("unexpected nil of type %T", v) 11345 } 11346 if value == nil { 11347 return nil 11348 } 11349 11350 shape, ok := value.(map[string]interface{}) 11351 if !ok { 11352 return fmt.Errorf("unexpected JSON type %v", value) 11353 } 11354 11355 var sv *types.HTTPHeader 11356 if *v == nil { 11357 sv = &types.HTTPHeader{} 11358 } else { 11359 sv = *v 11360 } 11361 11362 for key, value := range shape { 11363 switch key { 11364 case "Name": 11365 if value != nil { 11366 jtv, ok := value.(string) 11367 if !ok { 11368 return fmt.Errorf("expected HeaderName to be of type string, got %T instead", value) 11369 } 11370 sv.Name = ptr.String(jtv) 11371 } 11372 11373 case "Value": 11374 if value != nil { 11375 jtv, ok := value.(string) 11376 if !ok { 11377 return fmt.Errorf("expected HeaderValue to be of type string, got %T instead", value) 11378 } 11379 sv.Value = ptr.String(jtv) 11380 } 11381 11382 default: 11383 _, _ = key, value 11384 11385 } 11386 } 11387 *v = sv 11388 return nil 11389} 11390 11391func awsAwsjson11_deserializeDocumentHTTPHeaders(v *[]types.HTTPHeader, value interface{}) error { 11392 if v == nil { 11393 return fmt.Errorf("unexpected nil of type %T", v) 11394 } 11395 if value == nil { 11396 return nil 11397 } 11398 11399 shape, ok := value.([]interface{}) 11400 if !ok { 11401 return fmt.Errorf("unexpected JSON type %v", value) 11402 } 11403 11404 var cv []types.HTTPHeader 11405 if *v == nil { 11406 cv = []types.HTTPHeader{} 11407 } else { 11408 cv = *v 11409 } 11410 11411 for _, value := range shape { 11412 var col types.HTTPHeader 11413 destAddr := &col 11414 if err := awsAwsjson11_deserializeDocumentHTTPHeader(&destAddr, value); err != nil { 11415 return err 11416 } 11417 col = *destAddr 11418 cv = append(cv, col) 11419 11420 } 11421 *v = cv 11422 return nil 11423} 11424 11425func awsAwsjson11_deserializeDocumentHTTPRequest(v **types.HTTPRequest, value interface{}) error { 11426 if v == nil { 11427 return fmt.Errorf("unexpected nil of type %T", v) 11428 } 11429 if value == nil { 11430 return nil 11431 } 11432 11433 shape, ok := value.(map[string]interface{}) 11434 if !ok { 11435 return fmt.Errorf("unexpected JSON type %v", value) 11436 } 11437 11438 var sv *types.HTTPRequest 11439 if *v == nil { 11440 sv = &types.HTTPRequest{} 11441 } else { 11442 sv = *v 11443 } 11444 11445 for key, value := range shape { 11446 switch key { 11447 case "ClientIP": 11448 if value != nil { 11449 jtv, ok := value.(string) 11450 if !ok { 11451 return fmt.Errorf("expected IPString to be of type string, got %T instead", value) 11452 } 11453 sv.ClientIP = ptr.String(jtv) 11454 } 11455 11456 case "Country": 11457 if value != nil { 11458 jtv, ok := value.(string) 11459 if !ok { 11460 return fmt.Errorf("expected Country to be of type string, got %T instead", value) 11461 } 11462 sv.Country = ptr.String(jtv) 11463 } 11464 11465 case "Headers": 11466 if err := awsAwsjson11_deserializeDocumentHTTPHeaders(&sv.Headers, value); err != nil { 11467 return err 11468 } 11469 11470 case "HTTPVersion": 11471 if value != nil { 11472 jtv, ok := value.(string) 11473 if !ok { 11474 return fmt.Errorf("expected HTTPVersion to be of type string, got %T instead", value) 11475 } 11476 sv.HTTPVersion = ptr.String(jtv) 11477 } 11478 11479 case "Method": 11480 if value != nil { 11481 jtv, ok := value.(string) 11482 if !ok { 11483 return fmt.Errorf("expected HTTPMethod to be of type string, got %T instead", value) 11484 } 11485 sv.Method = ptr.String(jtv) 11486 } 11487 11488 case "URI": 11489 if value != nil { 11490 jtv, ok := value.(string) 11491 if !ok { 11492 return fmt.Errorf("expected URIString to be of type string, got %T instead", value) 11493 } 11494 sv.URI = ptr.String(jtv) 11495 } 11496 11497 default: 11498 _, _ = key, value 11499 11500 } 11501 } 11502 *v = sv 11503 return nil 11504} 11505 11506func awsAwsjson11_deserializeDocumentIPSet(v **types.IPSet, value interface{}) error { 11507 if v == nil { 11508 return fmt.Errorf("unexpected nil of type %T", v) 11509 } 11510 if value == nil { 11511 return nil 11512 } 11513 11514 shape, ok := value.(map[string]interface{}) 11515 if !ok { 11516 return fmt.Errorf("unexpected JSON type %v", value) 11517 } 11518 11519 var sv *types.IPSet 11520 if *v == nil { 11521 sv = &types.IPSet{} 11522 } else { 11523 sv = *v 11524 } 11525 11526 for key, value := range shape { 11527 switch key { 11528 case "IPSetDescriptors": 11529 if err := awsAwsjson11_deserializeDocumentIPSetDescriptors(&sv.IPSetDescriptors, value); err != nil { 11530 return err 11531 } 11532 11533 case "IPSetId": 11534 if value != nil { 11535 jtv, ok := value.(string) 11536 if !ok { 11537 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11538 } 11539 sv.IPSetId = ptr.String(jtv) 11540 } 11541 11542 case "Name": 11543 if value != nil { 11544 jtv, ok := value.(string) 11545 if !ok { 11546 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 11547 } 11548 sv.Name = ptr.String(jtv) 11549 } 11550 11551 default: 11552 _, _ = key, value 11553 11554 } 11555 } 11556 *v = sv 11557 return nil 11558} 11559 11560func awsAwsjson11_deserializeDocumentIPSetDescriptor(v **types.IPSetDescriptor, value interface{}) error { 11561 if v == nil { 11562 return fmt.Errorf("unexpected nil of type %T", v) 11563 } 11564 if value == nil { 11565 return nil 11566 } 11567 11568 shape, ok := value.(map[string]interface{}) 11569 if !ok { 11570 return fmt.Errorf("unexpected JSON type %v", value) 11571 } 11572 11573 var sv *types.IPSetDescriptor 11574 if *v == nil { 11575 sv = &types.IPSetDescriptor{} 11576 } else { 11577 sv = *v 11578 } 11579 11580 for key, value := range shape { 11581 switch key { 11582 case "Type": 11583 if value != nil { 11584 jtv, ok := value.(string) 11585 if !ok { 11586 return fmt.Errorf("expected IPSetDescriptorType to be of type string, got %T instead", value) 11587 } 11588 sv.Type = types.IPSetDescriptorType(jtv) 11589 } 11590 11591 case "Value": 11592 if value != nil { 11593 jtv, ok := value.(string) 11594 if !ok { 11595 return fmt.Errorf("expected IPSetDescriptorValue to be of type string, got %T instead", value) 11596 } 11597 sv.Value = ptr.String(jtv) 11598 } 11599 11600 default: 11601 _, _ = key, value 11602 11603 } 11604 } 11605 *v = sv 11606 return nil 11607} 11608 11609func awsAwsjson11_deserializeDocumentIPSetDescriptors(v *[]types.IPSetDescriptor, value interface{}) error { 11610 if v == nil { 11611 return fmt.Errorf("unexpected nil of type %T", v) 11612 } 11613 if value == nil { 11614 return nil 11615 } 11616 11617 shape, ok := value.([]interface{}) 11618 if !ok { 11619 return fmt.Errorf("unexpected JSON type %v", value) 11620 } 11621 11622 var cv []types.IPSetDescriptor 11623 if *v == nil { 11624 cv = []types.IPSetDescriptor{} 11625 } else { 11626 cv = *v 11627 } 11628 11629 for _, value := range shape { 11630 var col types.IPSetDescriptor 11631 destAddr := &col 11632 if err := awsAwsjson11_deserializeDocumentIPSetDescriptor(&destAddr, value); err != nil { 11633 return err 11634 } 11635 col = *destAddr 11636 cv = append(cv, col) 11637 11638 } 11639 *v = cv 11640 return nil 11641} 11642 11643func awsAwsjson11_deserializeDocumentIPSetSummaries(v *[]types.IPSetSummary, value interface{}) error { 11644 if v == nil { 11645 return fmt.Errorf("unexpected nil of type %T", v) 11646 } 11647 if value == nil { 11648 return nil 11649 } 11650 11651 shape, ok := value.([]interface{}) 11652 if !ok { 11653 return fmt.Errorf("unexpected JSON type %v", value) 11654 } 11655 11656 var cv []types.IPSetSummary 11657 if *v == nil { 11658 cv = []types.IPSetSummary{} 11659 } else { 11660 cv = *v 11661 } 11662 11663 for _, value := range shape { 11664 var col types.IPSetSummary 11665 destAddr := &col 11666 if err := awsAwsjson11_deserializeDocumentIPSetSummary(&destAddr, value); err != nil { 11667 return err 11668 } 11669 col = *destAddr 11670 cv = append(cv, col) 11671 11672 } 11673 *v = cv 11674 return nil 11675} 11676 11677func awsAwsjson11_deserializeDocumentIPSetSummary(v **types.IPSetSummary, value interface{}) error { 11678 if v == nil { 11679 return fmt.Errorf("unexpected nil of type %T", v) 11680 } 11681 if value == nil { 11682 return nil 11683 } 11684 11685 shape, ok := value.(map[string]interface{}) 11686 if !ok { 11687 return fmt.Errorf("unexpected JSON type %v", value) 11688 } 11689 11690 var sv *types.IPSetSummary 11691 if *v == nil { 11692 sv = &types.IPSetSummary{} 11693 } else { 11694 sv = *v 11695 } 11696 11697 for key, value := range shape { 11698 switch key { 11699 case "IPSetId": 11700 if value != nil { 11701 jtv, ok := value.(string) 11702 if !ok { 11703 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11704 } 11705 sv.IPSetId = ptr.String(jtv) 11706 } 11707 11708 case "Name": 11709 if value != nil { 11710 jtv, ok := value.(string) 11711 if !ok { 11712 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 11713 } 11714 sv.Name = ptr.String(jtv) 11715 } 11716 11717 default: 11718 _, _ = key, value 11719 11720 } 11721 } 11722 *v = sv 11723 return nil 11724} 11725 11726func awsAwsjson11_deserializeDocumentLogDestinationConfigs(v *[]string, value interface{}) error { 11727 if v == nil { 11728 return fmt.Errorf("unexpected nil of type %T", v) 11729 } 11730 if value == nil { 11731 return nil 11732 } 11733 11734 shape, ok := value.([]interface{}) 11735 if !ok { 11736 return fmt.Errorf("unexpected JSON type %v", value) 11737 } 11738 11739 var cv []string 11740 if *v == nil { 11741 cv = []string{} 11742 } else { 11743 cv = *v 11744 } 11745 11746 for _, value := range shape { 11747 var col string 11748 if value != nil { 11749 jtv, ok := value.(string) 11750 if !ok { 11751 return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) 11752 } 11753 col = jtv 11754 } 11755 cv = append(cv, col) 11756 11757 } 11758 *v = cv 11759 return nil 11760} 11761 11762func awsAwsjson11_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error { 11763 if v == nil { 11764 return fmt.Errorf("unexpected nil of type %T", v) 11765 } 11766 if value == nil { 11767 return nil 11768 } 11769 11770 shape, ok := value.(map[string]interface{}) 11771 if !ok { 11772 return fmt.Errorf("unexpected JSON type %v", value) 11773 } 11774 11775 var sv *types.LoggingConfiguration 11776 if *v == nil { 11777 sv = &types.LoggingConfiguration{} 11778 } else { 11779 sv = *v 11780 } 11781 11782 for key, value := range shape { 11783 switch key { 11784 case "LogDestinationConfigs": 11785 if err := awsAwsjson11_deserializeDocumentLogDestinationConfigs(&sv.LogDestinationConfigs, value); err != nil { 11786 return err 11787 } 11788 11789 case "RedactedFields": 11790 if err := awsAwsjson11_deserializeDocumentRedactedFields(&sv.RedactedFields, value); err != nil { 11791 return err 11792 } 11793 11794 case "ResourceArn": 11795 if value != nil { 11796 jtv, ok := value.(string) 11797 if !ok { 11798 return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) 11799 } 11800 sv.ResourceArn = ptr.String(jtv) 11801 } 11802 11803 default: 11804 _, _ = key, value 11805 11806 } 11807 } 11808 *v = sv 11809 return nil 11810} 11811 11812func awsAwsjson11_deserializeDocumentLoggingConfigurations(v *[]types.LoggingConfiguration, value interface{}) error { 11813 if v == nil { 11814 return fmt.Errorf("unexpected nil of type %T", v) 11815 } 11816 if value == nil { 11817 return nil 11818 } 11819 11820 shape, ok := value.([]interface{}) 11821 if !ok { 11822 return fmt.Errorf("unexpected JSON type %v", value) 11823 } 11824 11825 var cv []types.LoggingConfiguration 11826 if *v == nil { 11827 cv = []types.LoggingConfiguration{} 11828 } else { 11829 cv = *v 11830 } 11831 11832 for _, value := range shape { 11833 var col types.LoggingConfiguration 11834 destAddr := &col 11835 if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&destAddr, value); err != nil { 11836 return err 11837 } 11838 col = *destAddr 11839 cv = append(cv, col) 11840 11841 } 11842 *v = cv 11843 return nil 11844} 11845 11846func awsAwsjson11_deserializeDocumentManagedKeys(v *[]string, value interface{}) error { 11847 if v == nil { 11848 return fmt.Errorf("unexpected nil of type %T", v) 11849 } 11850 if value == nil { 11851 return nil 11852 } 11853 11854 shape, ok := value.([]interface{}) 11855 if !ok { 11856 return fmt.Errorf("unexpected JSON type %v", value) 11857 } 11858 11859 var cv []string 11860 if *v == nil { 11861 cv = []string{} 11862 } else { 11863 cv = *v 11864 } 11865 11866 for _, value := range shape { 11867 var col string 11868 if value != nil { 11869 jtv, ok := value.(string) 11870 if !ok { 11871 return fmt.Errorf("expected ManagedKey to be of type string, got %T instead", value) 11872 } 11873 col = jtv 11874 } 11875 cv = append(cv, col) 11876 11877 } 11878 *v = cv 11879 return nil 11880} 11881 11882func awsAwsjson11_deserializeDocumentPredicate(v **types.Predicate, value interface{}) error { 11883 if v == nil { 11884 return fmt.Errorf("unexpected nil of type %T", v) 11885 } 11886 if value == nil { 11887 return nil 11888 } 11889 11890 shape, ok := value.(map[string]interface{}) 11891 if !ok { 11892 return fmt.Errorf("unexpected JSON type %v", value) 11893 } 11894 11895 var sv *types.Predicate 11896 if *v == nil { 11897 sv = &types.Predicate{} 11898 } else { 11899 sv = *v 11900 } 11901 11902 for key, value := range shape { 11903 switch key { 11904 case "DataId": 11905 if value != nil { 11906 jtv, ok := value.(string) 11907 if !ok { 11908 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 11909 } 11910 sv.DataId = ptr.String(jtv) 11911 } 11912 11913 case "Negated": 11914 if value != nil { 11915 jtv, ok := value.(bool) 11916 if !ok { 11917 return fmt.Errorf("expected Negated to be of type *bool, got %T instead", value) 11918 } 11919 sv.Negated = ptr.Bool(jtv) 11920 } 11921 11922 case "Type": 11923 if value != nil { 11924 jtv, ok := value.(string) 11925 if !ok { 11926 return fmt.Errorf("expected PredicateType to be of type string, got %T instead", value) 11927 } 11928 sv.Type = types.PredicateType(jtv) 11929 } 11930 11931 default: 11932 _, _ = key, value 11933 11934 } 11935 } 11936 *v = sv 11937 return nil 11938} 11939 11940func awsAwsjson11_deserializeDocumentPredicates(v *[]types.Predicate, value interface{}) error { 11941 if v == nil { 11942 return fmt.Errorf("unexpected nil of type %T", v) 11943 } 11944 if value == nil { 11945 return nil 11946 } 11947 11948 shape, ok := value.([]interface{}) 11949 if !ok { 11950 return fmt.Errorf("unexpected JSON type %v", value) 11951 } 11952 11953 var cv []types.Predicate 11954 if *v == nil { 11955 cv = []types.Predicate{} 11956 } else { 11957 cv = *v 11958 } 11959 11960 for _, value := range shape { 11961 var col types.Predicate 11962 destAddr := &col 11963 if err := awsAwsjson11_deserializeDocumentPredicate(&destAddr, value); err != nil { 11964 return err 11965 } 11966 col = *destAddr 11967 cv = append(cv, col) 11968 11969 } 11970 *v = cv 11971 return nil 11972} 11973 11974func awsAwsjson11_deserializeDocumentRateBasedRule(v **types.RateBasedRule, value interface{}) error { 11975 if v == nil { 11976 return fmt.Errorf("unexpected nil of type %T", v) 11977 } 11978 if value == nil { 11979 return nil 11980 } 11981 11982 shape, ok := value.(map[string]interface{}) 11983 if !ok { 11984 return fmt.Errorf("unexpected JSON type %v", value) 11985 } 11986 11987 var sv *types.RateBasedRule 11988 if *v == nil { 11989 sv = &types.RateBasedRule{} 11990 } else { 11991 sv = *v 11992 } 11993 11994 for key, value := range shape { 11995 switch key { 11996 case "MatchPredicates": 11997 if err := awsAwsjson11_deserializeDocumentPredicates(&sv.MatchPredicates, value); err != nil { 11998 return err 11999 } 12000 12001 case "MetricName": 12002 if value != nil { 12003 jtv, ok := value.(string) 12004 if !ok { 12005 return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) 12006 } 12007 sv.MetricName = ptr.String(jtv) 12008 } 12009 12010 case "Name": 12011 if value != nil { 12012 jtv, ok := value.(string) 12013 if !ok { 12014 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12015 } 12016 sv.Name = ptr.String(jtv) 12017 } 12018 12019 case "RateKey": 12020 if value != nil { 12021 jtv, ok := value.(string) 12022 if !ok { 12023 return fmt.Errorf("expected RateKey to be of type string, got %T instead", value) 12024 } 12025 sv.RateKey = types.RateKey(jtv) 12026 } 12027 12028 case "RateLimit": 12029 if value != nil { 12030 jtv, ok := value.(json.Number) 12031 if !ok { 12032 return fmt.Errorf("expected RateLimit to be json.Number, got %T instead", value) 12033 } 12034 i64, err := jtv.Int64() 12035 if err != nil { 12036 return err 12037 } 12038 sv.RateLimit = i64 12039 } 12040 12041 case "RuleId": 12042 if value != nil { 12043 jtv, ok := value.(string) 12044 if !ok { 12045 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12046 } 12047 sv.RuleId = ptr.String(jtv) 12048 } 12049 12050 default: 12051 _, _ = key, value 12052 12053 } 12054 } 12055 *v = sv 12056 return nil 12057} 12058 12059func awsAwsjson11_deserializeDocumentRedactedFields(v *[]types.FieldToMatch, value interface{}) error { 12060 if v == nil { 12061 return fmt.Errorf("unexpected nil of type %T", v) 12062 } 12063 if value == nil { 12064 return nil 12065 } 12066 12067 shape, ok := value.([]interface{}) 12068 if !ok { 12069 return fmt.Errorf("unexpected JSON type %v", value) 12070 } 12071 12072 var cv []types.FieldToMatch 12073 if *v == nil { 12074 cv = []types.FieldToMatch{} 12075 } else { 12076 cv = *v 12077 } 12078 12079 for _, value := range shape { 12080 var col types.FieldToMatch 12081 destAddr := &col 12082 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&destAddr, value); err != nil { 12083 return err 12084 } 12085 col = *destAddr 12086 cv = append(cv, col) 12087 12088 } 12089 *v = cv 12090 return nil 12091} 12092 12093func awsAwsjson11_deserializeDocumentRegexMatchSet(v **types.RegexMatchSet, value interface{}) error { 12094 if v == nil { 12095 return fmt.Errorf("unexpected nil of type %T", v) 12096 } 12097 if value == nil { 12098 return nil 12099 } 12100 12101 shape, ok := value.(map[string]interface{}) 12102 if !ok { 12103 return fmt.Errorf("unexpected JSON type %v", value) 12104 } 12105 12106 var sv *types.RegexMatchSet 12107 if *v == nil { 12108 sv = &types.RegexMatchSet{} 12109 } else { 12110 sv = *v 12111 } 12112 12113 for key, value := range shape { 12114 switch key { 12115 case "Name": 12116 if value != nil { 12117 jtv, ok := value.(string) 12118 if !ok { 12119 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12120 } 12121 sv.Name = ptr.String(jtv) 12122 } 12123 12124 case "RegexMatchSetId": 12125 if value != nil { 12126 jtv, ok := value.(string) 12127 if !ok { 12128 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12129 } 12130 sv.RegexMatchSetId = ptr.String(jtv) 12131 } 12132 12133 case "RegexMatchTuples": 12134 if err := awsAwsjson11_deserializeDocumentRegexMatchTuples(&sv.RegexMatchTuples, value); err != nil { 12135 return err 12136 } 12137 12138 default: 12139 _, _ = key, value 12140 12141 } 12142 } 12143 *v = sv 12144 return nil 12145} 12146 12147func awsAwsjson11_deserializeDocumentRegexMatchSetSummaries(v *[]types.RegexMatchSetSummary, value interface{}) error { 12148 if v == nil { 12149 return fmt.Errorf("unexpected nil of type %T", v) 12150 } 12151 if value == nil { 12152 return nil 12153 } 12154 12155 shape, ok := value.([]interface{}) 12156 if !ok { 12157 return fmt.Errorf("unexpected JSON type %v", value) 12158 } 12159 12160 var cv []types.RegexMatchSetSummary 12161 if *v == nil { 12162 cv = []types.RegexMatchSetSummary{} 12163 } else { 12164 cv = *v 12165 } 12166 12167 for _, value := range shape { 12168 var col types.RegexMatchSetSummary 12169 destAddr := &col 12170 if err := awsAwsjson11_deserializeDocumentRegexMatchSetSummary(&destAddr, value); err != nil { 12171 return err 12172 } 12173 col = *destAddr 12174 cv = append(cv, col) 12175 12176 } 12177 *v = cv 12178 return nil 12179} 12180 12181func awsAwsjson11_deserializeDocumentRegexMatchSetSummary(v **types.RegexMatchSetSummary, value interface{}) error { 12182 if v == nil { 12183 return fmt.Errorf("unexpected nil of type %T", v) 12184 } 12185 if value == nil { 12186 return nil 12187 } 12188 12189 shape, ok := value.(map[string]interface{}) 12190 if !ok { 12191 return fmt.Errorf("unexpected JSON type %v", value) 12192 } 12193 12194 var sv *types.RegexMatchSetSummary 12195 if *v == nil { 12196 sv = &types.RegexMatchSetSummary{} 12197 } else { 12198 sv = *v 12199 } 12200 12201 for key, value := range shape { 12202 switch key { 12203 case "Name": 12204 if value != nil { 12205 jtv, ok := value.(string) 12206 if !ok { 12207 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12208 } 12209 sv.Name = ptr.String(jtv) 12210 } 12211 12212 case "RegexMatchSetId": 12213 if value != nil { 12214 jtv, ok := value.(string) 12215 if !ok { 12216 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12217 } 12218 sv.RegexMatchSetId = ptr.String(jtv) 12219 } 12220 12221 default: 12222 _, _ = key, value 12223 12224 } 12225 } 12226 *v = sv 12227 return nil 12228} 12229 12230func awsAwsjson11_deserializeDocumentRegexMatchTuple(v **types.RegexMatchTuple, value interface{}) error { 12231 if v == nil { 12232 return fmt.Errorf("unexpected nil of type %T", v) 12233 } 12234 if value == nil { 12235 return nil 12236 } 12237 12238 shape, ok := value.(map[string]interface{}) 12239 if !ok { 12240 return fmt.Errorf("unexpected JSON type %v", value) 12241 } 12242 12243 var sv *types.RegexMatchTuple 12244 if *v == nil { 12245 sv = &types.RegexMatchTuple{} 12246 } else { 12247 sv = *v 12248 } 12249 12250 for key, value := range shape { 12251 switch key { 12252 case "FieldToMatch": 12253 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil { 12254 return err 12255 } 12256 12257 case "RegexPatternSetId": 12258 if value != nil { 12259 jtv, ok := value.(string) 12260 if !ok { 12261 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12262 } 12263 sv.RegexPatternSetId = ptr.String(jtv) 12264 } 12265 12266 case "TextTransformation": 12267 if value != nil { 12268 jtv, ok := value.(string) 12269 if !ok { 12270 return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value) 12271 } 12272 sv.TextTransformation = types.TextTransformation(jtv) 12273 } 12274 12275 default: 12276 _, _ = key, value 12277 12278 } 12279 } 12280 *v = sv 12281 return nil 12282} 12283 12284func awsAwsjson11_deserializeDocumentRegexMatchTuples(v *[]types.RegexMatchTuple, value interface{}) error { 12285 if v == nil { 12286 return fmt.Errorf("unexpected nil of type %T", v) 12287 } 12288 if value == nil { 12289 return nil 12290 } 12291 12292 shape, ok := value.([]interface{}) 12293 if !ok { 12294 return fmt.Errorf("unexpected JSON type %v", value) 12295 } 12296 12297 var cv []types.RegexMatchTuple 12298 if *v == nil { 12299 cv = []types.RegexMatchTuple{} 12300 } else { 12301 cv = *v 12302 } 12303 12304 for _, value := range shape { 12305 var col types.RegexMatchTuple 12306 destAddr := &col 12307 if err := awsAwsjson11_deserializeDocumentRegexMatchTuple(&destAddr, value); err != nil { 12308 return err 12309 } 12310 col = *destAddr 12311 cv = append(cv, col) 12312 12313 } 12314 *v = cv 12315 return nil 12316} 12317 12318func awsAwsjson11_deserializeDocumentRegexPatternSet(v **types.RegexPatternSet, value interface{}) error { 12319 if v == nil { 12320 return fmt.Errorf("unexpected nil of type %T", v) 12321 } 12322 if value == nil { 12323 return nil 12324 } 12325 12326 shape, ok := value.(map[string]interface{}) 12327 if !ok { 12328 return fmt.Errorf("unexpected JSON type %v", value) 12329 } 12330 12331 var sv *types.RegexPatternSet 12332 if *v == nil { 12333 sv = &types.RegexPatternSet{} 12334 } else { 12335 sv = *v 12336 } 12337 12338 for key, value := range shape { 12339 switch key { 12340 case "Name": 12341 if value != nil { 12342 jtv, ok := value.(string) 12343 if !ok { 12344 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12345 } 12346 sv.Name = ptr.String(jtv) 12347 } 12348 12349 case "RegexPatternSetId": 12350 if value != nil { 12351 jtv, ok := value.(string) 12352 if !ok { 12353 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12354 } 12355 sv.RegexPatternSetId = ptr.String(jtv) 12356 } 12357 12358 case "RegexPatternStrings": 12359 if err := awsAwsjson11_deserializeDocumentRegexPatternStrings(&sv.RegexPatternStrings, value); err != nil { 12360 return err 12361 } 12362 12363 default: 12364 _, _ = key, value 12365 12366 } 12367 } 12368 *v = sv 12369 return nil 12370} 12371 12372func awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(v *[]types.RegexPatternSetSummary, value interface{}) error { 12373 if v == nil { 12374 return fmt.Errorf("unexpected nil of type %T", v) 12375 } 12376 if value == nil { 12377 return nil 12378 } 12379 12380 shape, ok := value.([]interface{}) 12381 if !ok { 12382 return fmt.Errorf("unexpected JSON type %v", value) 12383 } 12384 12385 var cv []types.RegexPatternSetSummary 12386 if *v == nil { 12387 cv = []types.RegexPatternSetSummary{} 12388 } else { 12389 cv = *v 12390 } 12391 12392 for _, value := range shape { 12393 var col types.RegexPatternSetSummary 12394 destAddr := &col 12395 if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummary(&destAddr, value); err != nil { 12396 return err 12397 } 12398 col = *destAddr 12399 cv = append(cv, col) 12400 12401 } 12402 *v = cv 12403 return nil 12404} 12405 12406func awsAwsjson11_deserializeDocumentRegexPatternSetSummary(v **types.RegexPatternSetSummary, value interface{}) error { 12407 if v == nil { 12408 return fmt.Errorf("unexpected nil of type %T", v) 12409 } 12410 if value == nil { 12411 return nil 12412 } 12413 12414 shape, ok := value.(map[string]interface{}) 12415 if !ok { 12416 return fmt.Errorf("unexpected JSON type %v", value) 12417 } 12418 12419 var sv *types.RegexPatternSetSummary 12420 if *v == nil { 12421 sv = &types.RegexPatternSetSummary{} 12422 } else { 12423 sv = *v 12424 } 12425 12426 for key, value := range shape { 12427 switch key { 12428 case "Name": 12429 if value != nil { 12430 jtv, ok := value.(string) 12431 if !ok { 12432 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12433 } 12434 sv.Name = ptr.String(jtv) 12435 } 12436 12437 case "RegexPatternSetId": 12438 if value != nil { 12439 jtv, ok := value.(string) 12440 if !ok { 12441 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12442 } 12443 sv.RegexPatternSetId = ptr.String(jtv) 12444 } 12445 12446 default: 12447 _, _ = key, value 12448 12449 } 12450 } 12451 *v = sv 12452 return nil 12453} 12454 12455func awsAwsjson11_deserializeDocumentRegexPatternStrings(v *[]string, value interface{}) error { 12456 if v == nil { 12457 return fmt.Errorf("unexpected nil of type %T", v) 12458 } 12459 if value == nil { 12460 return nil 12461 } 12462 12463 shape, ok := value.([]interface{}) 12464 if !ok { 12465 return fmt.Errorf("unexpected JSON type %v", value) 12466 } 12467 12468 var cv []string 12469 if *v == nil { 12470 cv = []string{} 12471 } else { 12472 cv = *v 12473 } 12474 12475 for _, value := range shape { 12476 var col string 12477 if value != nil { 12478 jtv, ok := value.(string) 12479 if !ok { 12480 return fmt.Errorf("expected RegexPatternString to be of type string, got %T instead", value) 12481 } 12482 col = jtv 12483 } 12484 cv = append(cv, col) 12485 12486 } 12487 *v = cv 12488 return nil 12489} 12490 12491func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error { 12492 if v == nil { 12493 return fmt.Errorf("unexpected nil of type %T", v) 12494 } 12495 if value == nil { 12496 return nil 12497 } 12498 12499 shape, ok := value.([]interface{}) 12500 if !ok { 12501 return fmt.Errorf("unexpected JSON type %v", value) 12502 } 12503 12504 var cv []string 12505 if *v == nil { 12506 cv = []string{} 12507 } else { 12508 cv = *v 12509 } 12510 12511 for _, value := range shape { 12512 var col string 12513 if value != nil { 12514 jtv, ok := value.(string) 12515 if !ok { 12516 return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) 12517 } 12518 col = jtv 12519 } 12520 cv = append(cv, col) 12521 12522 } 12523 *v = cv 12524 return nil 12525} 12526 12527func awsAwsjson11_deserializeDocumentRule(v **types.Rule, value interface{}) error { 12528 if v == nil { 12529 return fmt.Errorf("unexpected nil of type %T", v) 12530 } 12531 if value == nil { 12532 return nil 12533 } 12534 12535 shape, ok := value.(map[string]interface{}) 12536 if !ok { 12537 return fmt.Errorf("unexpected JSON type %v", value) 12538 } 12539 12540 var sv *types.Rule 12541 if *v == nil { 12542 sv = &types.Rule{} 12543 } else { 12544 sv = *v 12545 } 12546 12547 for key, value := range shape { 12548 switch key { 12549 case "MetricName": 12550 if value != nil { 12551 jtv, ok := value.(string) 12552 if !ok { 12553 return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) 12554 } 12555 sv.MetricName = ptr.String(jtv) 12556 } 12557 12558 case "Name": 12559 if value != nil { 12560 jtv, ok := value.(string) 12561 if !ok { 12562 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12563 } 12564 sv.Name = ptr.String(jtv) 12565 } 12566 12567 case "Predicates": 12568 if err := awsAwsjson11_deserializeDocumentPredicates(&sv.Predicates, value); err != nil { 12569 return err 12570 } 12571 12572 case "RuleId": 12573 if value != nil { 12574 jtv, ok := value.(string) 12575 if !ok { 12576 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12577 } 12578 sv.RuleId = ptr.String(jtv) 12579 } 12580 12581 default: 12582 _, _ = key, value 12583 12584 } 12585 } 12586 *v = sv 12587 return nil 12588} 12589 12590func awsAwsjson11_deserializeDocumentRuleGroup(v **types.RuleGroup, value interface{}) error { 12591 if v == nil { 12592 return fmt.Errorf("unexpected nil of type %T", v) 12593 } 12594 if value == nil { 12595 return nil 12596 } 12597 12598 shape, ok := value.(map[string]interface{}) 12599 if !ok { 12600 return fmt.Errorf("unexpected JSON type %v", value) 12601 } 12602 12603 var sv *types.RuleGroup 12604 if *v == nil { 12605 sv = &types.RuleGroup{} 12606 } else { 12607 sv = *v 12608 } 12609 12610 for key, value := range shape { 12611 switch key { 12612 case "MetricName": 12613 if value != nil { 12614 jtv, ok := value.(string) 12615 if !ok { 12616 return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) 12617 } 12618 sv.MetricName = ptr.String(jtv) 12619 } 12620 12621 case "Name": 12622 if value != nil { 12623 jtv, ok := value.(string) 12624 if !ok { 12625 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12626 } 12627 sv.Name = ptr.String(jtv) 12628 } 12629 12630 case "RuleGroupId": 12631 if value != nil { 12632 jtv, ok := value.(string) 12633 if !ok { 12634 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12635 } 12636 sv.RuleGroupId = ptr.String(jtv) 12637 } 12638 12639 default: 12640 _, _ = key, value 12641 12642 } 12643 } 12644 *v = sv 12645 return nil 12646} 12647 12648func awsAwsjson11_deserializeDocumentRuleGroupSummaries(v *[]types.RuleGroupSummary, value interface{}) error { 12649 if v == nil { 12650 return fmt.Errorf("unexpected nil of type %T", v) 12651 } 12652 if value == nil { 12653 return nil 12654 } 12655 12656 shape, ok := value.([]interface{}) 12657 if !ok { 12658 return fmt.Errorf("unexpected JSON type %v", value) 12659 } 12660 12661 var cv []types.RuleGroupSummary 12662 if *v == nil { 12663 cv = []types.RuleGroupSummary{} 12664 } else { 12665 cv = *v 12666 } 12667 12668 for _, value := range shape { 12669 var col types.RuleGroupSummary 12670 destAddr := &col 12671 if err := awsAwsjson11_deserializeDocumentRuleGroupSummary(&destAddr, value); err != nil { 12672 return err 12673 } 12674 col = *destAddr 12675 cv = append(cv, col) 12676 12677 } 12678 *v = cv 12679 return nil 12680} 12681 12682func awsAwsjson11_deserializeDocumentRuleGroupSummary(v **types.RuleGroupSummary, value interface{}) error { 12683 if v == nil { 12684 return fmt.Errorf("unexpected nil of type %T", v) 12685 } 12686 if value == nil { 12687 return nil 12688 } 12689 12690 shape, ok := value.(map[string]interface{}) 12691 if !ok { 12692 return fmt.Errorf("unexpected JSON type %v", value) 12693 } 12694 12695 var sv *types.RuleGroupSummary 12696 if *v == nil { 12697 sv = &types.RuleGroupSummary{} 12698 } else { 12699 sv = *v 12700 } 12701 12702 for key, value := range shape { 12703 switch key { 12704 case "Name": 12705 if value != nil { 12706 jtv, ok := value.(string) 12707 if !ok { 12708 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12709 } 12710 sv.Name = ptr.String(jtv) 12711 } 12712 12713 case "RuleGroupId": 12714 if value != nil { 12715 jtv, ok := value.(string) 12716 if !ok { 12717 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12718 } 12719 sv.RuleGroupId = ptr.String(jtv) 12720 } 12721 12722 default: 12723 _, _ = key, value 12724 12725 } 12726 } 12727 *v = sv 12728 return nil 12729} 12730 12731func awsAwsjson11_deserializeDocumentRuleSummaries(v *[]types.RuleSummary, value interface{}) error { 12732 if v == nil { 12733 return fmt.Errorf("unexpected nil of type %T", v) 12734 } 12735 if value == nil { 12736 return nil 12737 } 12738 12739 shape, ok := value.([]interface{}) 12740 if !ok { 12741 return fmt.Errorf("unexpected JSON type %v", value) 12742 } 12743 12744 var cv []types.RuleSummary 12745 if *v == nil { 12746 cv = []types.RuleSummary{} 12747 } else { 12748 cv = *v 12749 } 12750 12751 for _, value := range shape { 12752 var col types.RuleSummary 12753 destAddr := &col 12754 if err := awsAwsjson11_deserializeDocumentRuleSummary(&destAddr, value); err != nil { 12755 return err 12756 } 12757 col = *destAddr 12758 cv = append(cv, col) 12759 12760 } 12761 *v = cv 12762 return nil 12763} 12764 12765func awsAwsjson11_deserializeDocumentRuleSummary(v **types.RuleSummary, value interface{}) error { 12766 if v == nil { 12767 return fmt.Errorf("unexpected nil of type %T", v) 12768 } 12769 if value == nil { 12770 return nil 12771 } 12772 12773 shape, ok := value.(map[string]interface{}) 12774 if !ok { 12775 return fmt.Errorf("unexpected JSON type %v", value) 12776 } 12777 12778 var sv *types.RuleSummary 12779 if *v == nil { 12780 sv = &types.RuleSummary{} 12781 } else { 12782 sv = *v 12783 } 12784 12785 for key, value := range shape { 12786 switch key { 12787 case "Name": 12788 if value != nil { 12789 jtv, ok := value.(string) 12790 if !ok { 12791 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 12792 } 12793 sv.Name = ptr.String(jtv) 12794 } 12795 12796 case "RuleId": 12797 if value != nil { 12798 jtv, ok := value.(string) 12799 if !ok { 12800 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12801 } 12802 sv.RuleId = ptr.String(jtv) 12803 } 12804 12805 default: 12806 _, _ = key, value 12807 12808 } 12809 } 12810 *v = sv 12811 return nil 12812} 12813 12814func awsAwsjson11_deserializeDocumentSampledHTTPRequest(v **types.SampledHTTPRequest, value interface{}) error { 12815 if v == nil { 12816 return fmt.Errorf("unexpected nil of type %T", v) 12817 } 12818 if value == nil { 12819 return nil 12820 } 12821 12822 shape, ok := value.(map[string]interface{}) 12823 if !ok { 12824 return fmt.Errorf("unexpected JSON type %v", value) 12825 } 12826 12827 var sv *types.SampledHTTPRequest 12828 if *v == nil { 12829 sv = &types.SampledHTTPRequest{} 12830 } else { 12831 sv = *v 12832 } 12833 12834 for key, value := range shape { 12835 switch key { 12836 case "Action": 12837 if value != nil { 12838 jtv, ok := value.(string) 12839 if !ok { 12840 return fmt.Errorf("expected Action to be of type string, got %T instead", value) 12841 } 12842 sv.Action = ptr.String(jtv) 12843 } 12844 12845 case "Request": 12846 if err := awsAwsjson11_deserializeDocumentHTTPRequest(&sv.Request, value); err != nil { 12847 return err 12848 } 12849 12850 case "RuleWithinRuleGroup": 12851 if value != nil { 12852 jtv, ok := value.(string) 12853 if !ok { 12854 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 12855 } 12856 sv.RuleWithinRuleGroup = ptr.String(jtv) 12857 } 12858 12859 case "Timestamp": 12860 if value != nil { 12861 jtv, ok := value.(json.Number) 12862 if !ok { 12863 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12864 } 12865 f64, err := jtv.Float64() 12866 if err != nil { 12867 return err 12868 } 12869 sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12870 } 12871 12872 case "Weight": 12873 if value != nil { 12874 jtv, ok := value.(json.Number) 12875 if !ok { 12876 return fmt.Errorf("expected SampleWeight to be json.Number, got %T instead", value) 12877 } 12878 i64, err := jtv.Int64() 12879 if err != nil { 12880 return err 12881 } 12882 sv.Weight = i64 12883 } 12884 12885 default: 12886 _, _ = key, value 12887 12888 } 12889 } 12890 *v = sv 12891 return nil 12892} 12893 12894func awsAwsjson11_deserializeDocumentSampledHTTPRequests(v *[]types.SampledHTTPRequest, value interface{}) error { 12895 if v == nil { 12896 return fmt.Errorf("unexpected nil of type %T", v) 12897 } 12898 if value == nil { 12899 return nil 12900 } 12901 12902 shape, ok := value.([]interface{}) 12903 if !ok { 12904 return fmt.Errorf("unexpected JSON type %v", value) 12905 } 12906 12907 var cv []types.SampledHTTPRequest 12908 if *v == nil { 12909 cv = []types.SampledHTTPRequest{} 12910 } else { 12911 cv = *v 12912 } 12913 12914 for _, value := range shape { 12915 var col types.SampledHTTPRequest 12916 destAddr := &col 12917 if err := awsAwsjson11_deserializeDocumentSampledHTTPRequest(&destAddr, value); err != nil { 12918 return err 12919 } 12920 col = *destAddr 12921 cv = append(cv, col) 12922 12923 } 12924 *v = cv 12925 return nil 12926} 12927 12928func awsAwsjson11_deserializeDocumentSizeConstraint(v **types.SizeConstraint, value interface{}) error { 12929 if v == nil { 12930 return fmt.Errorf("unexpected nil of type %T", v) 12931 } 12932 if value == nil { 12933 return nil 12934 } 12935 12936 shape, ok := value.(map[string]interface{}) 12937 if !ok { 12938 return fmt.Errorf("unexpected JSON type %v", value) 12939 } 12940 12941 var sv *types.SizeConstraint 12942 if *v == nil { 12943 sv = &types.SizeConstraint{} 12944 } else { 12945 sv = *v 12946 } 12947 12948 for key, value := range shape { 12949 switch key { 12950 case "ComparisonOperator": 12951 if value != nil { 12952 jtv, ok := value.(string) 12953 if !ok { 12954 return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value) 12955 } 12956 sv.ComparisonOperator = types.ComparisonOperator(jtv) 12957 } 12958 12959 case "FieldToMatch": 12960 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil { 12961 return err 12962 } 12963 12964 case "Size": 12965 if value != nil { 12966 jtv, ok := value.(json.Number) 12967 if !ok { 12968 return fmt.Errorf("expected Size to be json.Number, got %T instead", value) 12969 } 12970 i64, err := jtv.Int64() 12971 if err != nil { 12972 return err 12973 } 12974 sv.Size = i64 12975 } 12976 12977 case "TextTransformation": 12978 if value != nil { 12979 jtv, ok := value.(string) 12980 if !ok { 12981 return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value) 12982 } 12983 sv.TextTransformation = types.TextTransformation(jtv) 12984 } 12985 12986 default: 12987 _, _ = key, value 12988 12989 } 12990 } 12991 *v = sv 12992 return nil 12993} 12994 12995func awsAwsjson11_deserializeDocumentSizeConstraints(v *[]types.SizeConstraint, value interface{}) error { 12996 if v == nil { 12997 return fmt.Errorf("unexpected nil of type %T", v) 12998 } 12999 if value == nil { 13000 return nil 13001 } 13002 13003 shape, ok := value.([]interface{}) 13004 if !ok { 13005 return fmt.Errorf("unexpected JSON type %v", value) 13006 } 13007 13008 var cv []types.SizeConstraint 13009 if *v == nil { 13010 cv = []types.SizeConstraint{} 13011 } else { 13012 cv = *v 13013 } 13014 13015 for _, value := range shape { 13016 var col types.SizeConstraint 13017 destAddr := &col 13018 if err := awsAwsjson11_deserializeDocumentSizeConstraint(&destAddr, value); err != nil { 13019 return err 13020 } 13021 col = *destAddr 13022 cv = append(cv, col) 13023 13024 } 13025 *v = cv 13026 return nil 13027} 13028 13029func awsAwsjson11_deserializeDocumentSizeConstraintSet(v **types.SizeConstraintSet, value interface{}) error { 13030 if v == nil { 13031 return fmt.Errorf("unexpected nil of type %T", v) 13032 } 13033 if value == nil { 13034 return nil 13035 } 13036 13037 shape, ok := value.(map[string]interface{}) 13038 if !ok { 13039 return fmt.Errorf("unexpected JSON type %v", value) 13040 } 13041 13042 var sv *types.SizeConstraintSet 13043 if *v == nil { 13044 sv = &types.SizeConstraintSet{} 13045 } else { 13046 sv = *v 13047 } 13048 13049 for key, value := range shape { 13050 switch key { 13051 case "Name": 13052 if value != nil { 13053 jtv, ok := value.(string) 13054 if !ok { 13055 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 13056 } 13057 sv.Name = ptr.String(jtv) 13058 } 13059 13060 case "SizeConstraints": 13061 if err := awsAwsjson11_deserializeDocumentSizeConstraints(&sv.SizeConstraints, value); err != nil { 13062 return err 13063 } 13064 13065 case "SizeConstraintSetId": 13066 if value != nil { 13067 jtv, ok := value.(string) 13068 if !ok { 13069 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 13070 } 13071 sv.SizeConstraintSetId = ptr.String(jtv) 13072 } 13073 13074 default: 13075 _, _ = key, value 13076 13077 } 13078 } 13079 *v = sv 13080 return nil 13081} 13082 13083func awsAwsjson11_deserializeDocumentSizeConstraintSetSummaries(v *[]types.SizeConstraintSetSummary, value interface{}) error { 13084 if v == nil { 13085 return fmt.Errorf("unexpected nil of type %T", v) 13086 } 13087 if value == nil { 13088 return nil 13089 } 13090 13091 shape, ok := value.([]interface{}) 13092 if !ok { 13093 return fmt.Errorf("unexpected JSON type %v", value) 13094 } 13095 13096 var cv []types.SizeConstraintSetSummary 13097 if *v == nil { 13098 cv = []types.SizeConstraintSetSummary{} 13099 } else { 13100 cv = *v 13101 } 13102 13103 for _, value := range shape { 13104 var col types.SizeConstraintSetSummary 13105 destAddr := &col 13106 if err := awsAwsjson11_deserializeDocumentSizeConstraintSetSummary(&destAddr, value); err != nil { 13107 return err 13108 } 13109 col = *destAddr 13110 cv = append(cv, col) 13111 13112 } 13113 *v = cv 13114 return nil 13115} 13116 13117func awsAwsjson11_deserializeDocumentSizeConstraintSetSummary(v **types.SizeConstraintSetSummary, value interface{}) error { 13118 if v == nil { 13119 return fmt.Errorf("unexpected nil of type %T", v) 13120 } 13121 if value == nil { 13122 return nil 13123 } 13124 13125 shape, ok := value.(map[string]interface{}) 13126 if !ok { 13127 return fmt.Errorf("unexpected JSON type %v", value) 13128 } 13129 13130 var sv *types.SizeConstraintSetSummary 13131 if *v == nil { 13132 sv = &types.SizeConstraintSetSummary{} 13133 } else { 13134 sv = *v 13135 } 13136 13137 for key, value := range shape { 13138 switch key { 13139 case "Name": 13140 if value != nil { 13141 jtv, ok := value.(string) 13142 if !ok { 13143 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 13144 } 13145 sv.Name = ptr.String(jtv) 13146 } 13147 13148 case "SizeConstraintSetId": 13149 if value != nil { 13150 jtv, ok := value.(string) 13151 if !ok { 13152 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 13153 } 13154 sv.SizeConstraintSetId = ptr.String(jtv) 13155 } 13156 13157 default: 13158 _, _ = key, value 13159 13160 } 13161 } 13162 *v = sv 13163 return nil 13164} 13165 13166func awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(v **types.SqlInjectionMatchSet, value interface{}) error { 13167 if v == nil { 13168 return fmt.Errorf("unexpected nil of type %T", v) 13169 } 13170 if value == nil { 13171 return nil 13172 } 13173 13174 shape, ok := value.(map[string]interface{}) 13175 if !ok { 13176 return fmt.Errorf("unexpected JSON type %v", value) 13177 } 13178 13179 var sv *types.SqlInjectionMatchSet 13180 if *v == nil { 13181 sv = &types.SqlInjectionMatchSet{} 13182 } else { 13183 sv = *v 13184 } 13185 13186 for key, value := range shape { 13187 switch key { 13188 case "Name": 13189 if value != nil { 13190 jtv, ok := value.(string) 13191 if !ok { 13192 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 13193 } 13194 sv.Name = ptr.String(jtv) 13195 } 13196 13197 case "SqlInjectionMatchSetId": 13198 if value != nil { 13199 jtv, ok := value.(string) 13200 if !ok { 13201 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 13202 } 13203 sv.SqlInjectionMatchSetId = ptr.String(jtv) 13204 } 13205 13206 case "SqlInjectionMatchTuples": 13207 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchTuples(&sv.SqlInjectionMatchTuples, value); err != nil { 13208 return err 13209 } 13210 13211 default: 13212 _, _ = key, value 13213 13214 } 13215 } 13216 *v = sv 13217 return nil 13218} 13219 13220func awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummaries(v *[]types.SqlInjectionMatchSetSummary, value interface{}) error { 13221 if v == nil { 13222 return fmt.Errorf("unexpected nil of type %T", v) 13223 } 13224 if value == nil { 13225 return nil 13226 } 13227 13228 shape, ok := value.([]interface{}) 13229 if !ok { 13230 return fmt.Errorf("unexpected JSON type %v", value) 13231 } 13232 13233 var cv []types.SqlInjectionMatchSetSummary 13234 if *v == nil { 13235 cv = []types.SqlInjectionMatchSetSummary{} 13236 } else { 13237 cv = *v 13238 } 13239 13240 for _, value := range shape { 13241 var col types.SqlInjectionMatchSetSummary 13242 destAddr := &col 13243 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummary(&destAddr, value); err != nil { 13244 return err 13245 } 13246 col = *destAddr 13247 cv = append(cv, col) 13248 13249 } 13250 *v = cv 13251 return nil 13252} 13253 13254func awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummary(v **types.SqlInjectionMatchSetSummary, value interface{}) error { 13255 if v == nil { 13256 return fmt.Errorf("unexpected nil of type %T", v) 13257 } 13258 if value == nil { 13259 return nil 13260 } 13261 13262 shape, ok := value.(map[string]interface{}) 13263 if !ok { 13264 return fmt.Errorf("unexpected JSON type %v", value) 13265 } 13266 13267 var sv *types.SqlInjectionMatchSetSummary 13268 if *v == nil { 13269 sv = &types.SqlInjectionMatchSetSummary{} 13270 } else { 13271 sv = *v 13272 } 13273 13274 for key, value := range shape { 13275 switch key { 13276 case "Name": 13277 if value != nil { 13278 jtv, ok := value.(string) 13279 if !ok { 13280 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 13281 } 13282 sv.Name = ptr.String(jtv) 13283 } 13284 13285 case "SqlInjectionMatchSetId": 13286 if value != nil { 13287 jtv, ok := value.(string) 13288 if !ok { 13289 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 13290 } 13291 sv.SqlInjectionMatchSetId = ptr.String(jtv) 13292 } 13293 13294 default: 13295 _, _ = key, value 13296 13297 } 13298 } 13299 *v = sv 13300 return nil 13301} 13302 13303func awsAwsjson11_deserializeDocumentSqlInjectionMatchTuple(v **types.SqlInjectionMatchTuple, value interface{}) error { 13304 if v == nil { 13305 return fmt.Errorf("unexpected nil of type %T", v) 13306 } 13307 if value == nil { 13308 return nil 13309 } 13310 13311 shape, ok := value.(map[string]interface{}) 13312 if !ok { 13313 return fmt.Errorf("unexpected JSON type %v", value) 13314 } 13315 13316 var sv *types.SqlInjectionMatchTuple 13317 if *v == nil { 13318 sv = &types.SqlInjectionMatchTuple{} 13319 } else { 13320 sv = *v 13321 } 13322 13323 for key, value := range shape { 13324 switch key { 13325 case "FieldToMatch": 13326 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil { 13327 return err 13328 } 13329 13330 case "TextTransformation": 13331 if value != nil { 13332 jtv, ok := value.(string) 13333 if !ok { 13334 return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value) 13335 } 13336 sv.TextTransformation = types.TextTransformation(jtv) 13337 } 13338 13339 default: 13340 _, _ = key, value 13341 13342 } 13343 } 13344 *v = sv 13345 return nil 13346} 13347 13348func awsAwsjson11_deserializeDocumentSqlInjectionMatchTuples(v *[]types.SqlInjectionMatchTuple, value interface{}) error { 13349 if v == nil { 13350 return fmt.Errorf("unexpected nil of type %T", v) 13351 } 13352 if value == nil { 13353 return nil 13354 } 13355 13356 shape, ok := value.([]interface{}) 13357 if !ok { 13358 return fmt.Errorf("unexpected JSON type %v", value) 13359 } 13360 13361 var cv []types.SqlInjectionMatchTuple 13362 if *v == nil { 13363 cv = []types.SqlInjectionMatchTuple{} 13364 } else { 13365 cv = *v 13366 } 13367 13368 for _, value := range shape { 13369 var col types.SqlInjectionMatchTuple 13370 destAddr := &col 13371 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchTuple(&destAddr, value); err != nil { 13372 return err 13373 } 13374 col = *destAddr 13375 cv = append(cv, col) 13376 13377 } 13378 *v = cv 13379 return nil 13380} 13381 13382func awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummaries(v *[]types.SubscribedRuleGroupSummary, value interface{}) error { 13383 if v == nil { 13384 return fmt.Errorf("unexpected nil of type %T", v) 13385 } 13386 if value == nil { 13387 return nil 13388 } 13389 13390 shape, ok := value.([]interface{}) 13391 if !ok { 13392 return fmt.Errorf("unexpected JSON type %v", value) 13393 } 13394 13395 var cv []types.SubscribedRuleGroupSummary 13396 if *v == nil { 13397 cv = []types.SubscribedRuleGroupSummary{} 13398 } else { 13399 cv = *v 13400 } 13401 13402 for _, value := range shape { 13403 var col types.SubscribedRuleGroupSummary 13404 destAddr := &col 13405 if err := awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummary(&destAddr, value); err != nil { 13406 return err 13407 } 13408 col = *destAddr 13409 cv = append(cv, col) 13410 13411 } 13412 *v = cv 13413 return nil 13414} 13415 13416func awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummary(v **types.SubscribedRuleGroupSummary, value interface{}) error { 13417 if v == nil { 13418 return fmt.Errorf("unexpected nil of type %T", v) 13419 } 13420 if value == nil { 13421 return nil 13422 } 13423 13424 shape, ok := value.(map[string]interface{}) 13425 if !ok { 13426 return fmt.Errorf("unexpected JSON type %v", value) 13427 } 13428 13429 var sv *types.SubscribedRuleGroupSummary 13430 if *v == nil { 13431 sv = &types.SubscribedRuleGroupSummary{} 13432 } else { 13433 sv = *v 13434 } 13435 13436 for key, value := range shape { 13437 switch key { 13438 case "MetricName": 13439 if value != nil { 13440 jtv, ok := value.(string) 13441 if !ok { 13442 return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) 13443 } 13444 sv.MetricName = ptr.String(jtv) 13445 } 13446 13447 case "Name": 13448 if value != nil { 13449 jtv, ok := value.(string) 13450 if !ok { 13451 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 13452 } 13453 sv.Name = ptr.String(jtv) 13454 } 13455 13456 case "RuleGroupId": 13457 if value != nil { 13458 jtv, ok := value.(string) 13459 if !ok { 13460 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 13461 } 13462 sv.RuleGroupId = ptr.String(jtv) 13463 } 13464 13465 default: 13466 _, _ = key, value 13467 13468 } 13469 } 13470 *v = sv 13471 return nil 13472} 13473 13474func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { 13475 if v == nil { 13476 return fmt.Errorf("unexpected nil of type %T", v) 13477 } 13478 if value == nil { 13479 return nil 13480 } 13481 13482 shape, ok := value.(map[string]interface{}) 13483 if !ok { 13484 return fmt.Errorf("unexpected JSON type %v", value) 13485 } 13486 13487 var sv *types.Tag 13488 if *v == nil { 13489 sv = &types.Tag{} 13490 } else { 13491 sv = *v 13492 } 13493 13494 for key, value := range shape { 13495 switch key { 13496 case "Key": 13497 if value != nil { 13498 jtv, ok := value.(string) 13499 if !ok { 13500 return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) 13501 } 13502 sv.Key = ptr.String(jtv) 13503 } 13504 13505 case "Value": 13506 if value != nil { 13507 jtv, ok := value.(string) 13508 if !ok { 13509 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 13510 } 13511 sv.Value = ptr.String(jtv) 13512 } 13513 13514 default: 13515 _, _ = key, value 13516 13517 } 13518 } 13519 *v = sv 13520 return nil 13521} 13522 13523func awsAwsjson11_deserializeDocumentTagInfoForResource(v **types.TagInfoForResource, value interface{}) error { 13524 if v == nil { 13525 return fmt.Errorf("unexpected nil of type %T", v) 13526 } 13527 if value == nil { 13528 return nil 13529 } 13530 13531 shape, ok := value.(map[string]interface{}) 13532 if !ok { 13533 return fmt.Errorf("unexpected JSON type %v", value) 13534 } 13535 13536 var sv *types.TagInfoForResource 13537 if *v == nil { 13538 sv = &types.TagInfoForResource{} 13539 } else { 13540 sv = *v 13541 } 13542 13543 for key, value := range shape { 13544 switch key { 13545 case "ResourceARN": 13546 if value != nil { 13547 jtv, ok := value.(string) 13548 if !ok { 13549 return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) 13550 } 13551 sv.ResourceARN = ptr.String(jtv) 13552 } 13553 13554 case "TagList": 13555 if err := awsAwsjson11_deserializeDocumentTagList(&sv.TagList, value); err != nil { 13556 return err 13557 } 13558 13559 default: 13560 _, _ = key, value 13561 13562 } 13563 } 13564 *v = sv 13565 return nil 13566} 13567 13568func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { 13569 if v == nil { 13570 return fmt.Errorf("unexpected nil of type %T", v) 13571 } 13572 if value == nil { 13573 return nil 13574 } 13575 13576 shape, ok := value.([]interface{}) 13577 if !ok { 13578 return fmt.Errorf("unexpected JSON type %v", value) 13579 } 13580 13581 var cv []types.Tag 13582 if *v == nil { 13583 cv = []types.Tag{} 13584 } else { 13585 cv = *v 13586 } 13587 13588 for _, value := range shape { 13589 var col types.Tag 13590 destAddr := &col 13591 if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { 13592 return err 13593 } 13594 col = *destAddr 13595 cv = append(cv, col) 13596 13597 } 13598 *v = cv 13599 return nil 13600} 13601 13602func awsAwsjson11_deserializeDocumentTimeWindow(v **types.TimeWindow, value interface{}) error { 13603 if v == nil { 13604 return fmt.Errorf("unexpected nil of type %T", v) 13605 } 13606 if value == nil { 13607 return nil 13608 } 13609 13610 shape, ok := value.(map[string]interface{}) 13611 if !ok { 13612 return fmt.Errorf("unexpected JSON type %v", value) 13613 } 13614 13615 var sv *types.TimeWindow 13616 if *v == nil { 13617 sv = &types.TimeWindow{} 13618 } else { 13619 sv = *v 13620 } 13621 13622 for key, value := range shape { 13623 switch key { 13624 case "EndTime": 13625 if value != nil { 13626 jtv, ok := value.(json.Number) 13627 if !ok { 13628 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 13629 } 13630 f64, err := jtv.Float64() 13631 if err != nil { 13632 return err 13633 } 13634 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 13635 } 13636 13637 case "StartTime": 13638 if value != nil { 13639 jtv, ok := value.(json.Number) 13640 if !ok { 13641 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 13642 } 13643 f64, err := jtv.Float64() 13644 if err != nil { 13645 return err 13646 } 13647 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 13648 } 13649 13650 default: 13651 _, _ = key, value 13652 13653 } 13654 } 13655 *v = sv 13656 return nil 13657} 13658 13659func awsAwsjson11_deserializeDocumentWafAction(v **types.WafAction, value interface{}) error { 13660 if v == nil { 13661 return fmt.Errorf("unexpected nil of type %T", v) 13662 } 13663 if value == nil { 13664 return nil 13665 } 13666 13667 shape, ok := value.(map[string]interface{}) 13668 if !ok { 13669 return fmt.Errorf("unexpected JSON type %v", value) 13670 } 13671 13672 var sv *types.WafAction 13673 if *v == nil { 13674 sv = &types.WafAction{} 13675 } else { 13676 sv = *v 13677 } 13678 13679 for key, value := range shape { 13680 switch key { 13681 case "Type": 13682 if value != nil { 13683 jtv, ok := value.(string) 13684 if !ok { 13685 return fmt.Errorf("expected WafActionType to be of type string, got %T instead", value) 13686 } 13687 sv.Type = types.WafActionType(jtv) 13688 } 13689 13690 default: 13691 _, _ = key, value 13692 13693 } 13694 } 13695 *v = sv 13696 return nil 13697} 13698 13699func awsAwsjson11_deserializeDocumentWAFBadRequestException(v **types.WAFBadRequestException, value interface{}) error { 13700 if v == nil { 13701 return fmt.Errorf("unexpected nil of type %T", v) 13702 } 13703 if value == nil { 13704 return nil 13705 } 13706 13707 shape, ok := value.(map[string]interface{}) 13708 if !ok { 13709 return fmt.Errorf("unexpected JSON type %v", value) 13710 } 13711 13712 var sv *types.WAFBadRequestException 13713 if *v == nil { 13714 sv = &types.WAFBadRequestException{} 13715 } else { 13716 sv = *v 13717 } 13718 13719 for key, value := range shape { 13720 switch key { 13721 case "message": 13722 if value != nil { 13723 jtv, ok := value.(string) 13724 if !ok { 13725 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 13726 } 13727 sv.Message = ptr.String(jtv) 13728 } 13729 13730 default: 13731 _, _ = key, value 13732 13733 } 13734 } 13735 *v = sv 13736 return nil 13737} 13738 13739func awsAwsjson11_deserializeDocumentWAFDisallowedNameException(v **types.WAFDisallowedNameException, value interface{}) error { 13740 if v == nil { 13741 return fmt.Errorf("unexpected nil of type %T", v) 13742 } 13743 if value == nil { 13744 return nil 13745 } 13746 13747 shape, ok := value.(map[string]interface{}) 13748 if !ok { 13749 return fmt.Errorf("unexpected JSON type %v", value) 13750 } 13751 13752 var sv *types.WAFDisallowedNameException 13753 if *v == nil { 13754 sv = &types.WAFDisallowedNameException{} 13755 } else { 13756 sv = *v 13757 } 13758 13759 for key, value := range shape { 13760 switch key { 13761 case "message": 13762 if value != nil { 13763 jtv, ok := value.(string) 13764 if !ok { 13765 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 13766 } 13767 sv.Message = ptr.String(jtv) 13768 } 13769 13770 default: 13771 _, _ = key, value 13772 13773 } 13774 } 13775 *v = sv 13776 return nil 13777} 13778 13779func awsAwsjson11_deserializeDocumentWAFEntityMigrationException(v **types.WAFEntityMigrationException, value interface{}) error { 13780 if v == nil { 13781 return fmt.Errorf("unexpected nil of type %T", v) 13782 } 13783 if value == nil { 13784 return nil 13785 } 13786 13787 shape, ok := value.(map[string]interface{}) 13788 if !ok { 13789 return fmt.Errorf("unexpected JSON type %v", value) 13790 } 13791 13792 var sv *types.WAFEntityMigrationException 13793 if *v == nil { 13794 sv = &types.WAFEntityMigrationException{} 13795 } else { 13796 sv = *v 13797 } 13798 13799 for key, value := range shape { 13800 switch key { 13801 case "message": 13802 if value != nil { 13803 jtv, ok := value.(string) 13804 if !ok { 13805 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 13806 } 13807 sv.Message = ptr.String(jtv) 13808 } 13809 13810 case "MigrationErrorReason": 13811 if value != nil { 13812 jtv, ok := value.(string) 13813 if !ok { 13814 return fmt.Errorf("expected ErrorReason to be of type string, got %T instead", value) 13815 } 13816 sv.MigrationErrorReason = ptr.String(jtv) 13817 } 13818 13819 case "MigrationErrorType": 13820 if value != nil { 13821 jtv, ok := value.(string) 13822 if !ok { 13823 return fmt.Errorf("expected MigrationErrorType to be of type string, got %T instead", value) 13824 } 13825 sv.MigrationErrorType = types.MigrationErrorType(jtv) 13826 } 13827 13828 default: 13829 _, _ = key, value 13830 13831 } 13832 } 13833 *v = sv 13834 return nil 13835} 13836 13837func awsAwsjson11_deserializeDocumentWAFInternalErrorException(v **types.WAFInternalErrorException, value interface{}) error { 13838 if v == nil { 13839 return fmt.Errorf("unexpected nil of type %T", v) 13840 } 13841 if value == nil { 13842 return nil 13843 } 13844 13845 shape, ok := value.(map[string]interface{}) 13846 if !ok { 13847 return fmt.Errorf("unexpected JSON type %v", value) 13848 } 13849 13850 var sv *types.WAFInternalErrorException 13851 if *v == nil { 13852 sv = &types.WAFInternalErrorException{} 13853 } else { 13854 sv = *v 13855 } 13856 13857 for key, value := range shape { 13858 switch key { 13859 case "message": 13860 if value != nil { 13861 jtv, ok := value.(string) 13862 if !ok { 13863 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 13864 } 13865 sv.Message = ptr.String(jtv) 13866 } 13867 13868 default: 13869 _, _ = key, value 13870 13871 } 13872 } 13873 *v = sv 13874 return nil 13875} 13876 13877func awsAwsjson11_deserializeDocumentWAFInvalidAccountException(v **types.WAFInvalidAccountException, value interface{}) error { 13878 if v == nil { 13879 return fmt.Errorf("unexpected nil of type %T", v) 13880 } 13881 if value == nil { 13882 return nil 13883 } 13884 13885 shape, ok := value.(map[string]interface{}) 13886 if !ok { 13887 return fmt.Errorf("unexpected JSON type %v", value) 13888 } 13889 13890 var sv *types.WAFInvalidAccountException 13891 if *v == nil { 13892 sv = &types.WAFInvalidAccountException{} 13893 } else { 13894 sv = *v 13895 } 13896 13897 for key, value := range shape { 13898 switch key { 13899 default: 13900 _, _ = key, value 13901 13902 } 13903 } 13904 *v = sv 13905 return nil 13906} 13907 13908func awsAwsjson11_deserializeDocumentWAFInvalidOperationException(v **types.WAFInvalidOperationException, value interface{}) error { 13909 if v == nil { 13910 return fmt.Errorf("unexpected nil of type %T", v) 13911 } 13912 if value == nil { 13913 return nil 13914 } 13915 13916 shape, ok := value.(map[string]interface{}) 13917 if !ok { 13918 return fmt.Errorf("unexpected JSON type %v", value) 13919 } 13920 13921 var sv *types.WAFInvalidOperationException 13922 if *v == nil { 13923 sv = &types.WAFInvalidOperationException{} 13924 } else { 13925 sv = *v 13926 } 13927 13928 for key, value := range shape { 13929 switch key { 13930 case "message": 13931 if value != nil { 13932 jtv, ok := value.(string) 13933 if !ok { 13934 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 13935 } 13936 sv.Message = ptr.String(jtv) 13937 } 13938 13939 default: 13940 _, _ = key, value 13941 13942 } 13943 } 13944 *v = sv 13945 return nil 13946} 13947 13948func awsAwsjson11_deserializeDocumentWAFInvalidParameterException(v **types.WAFInvalidParameterException, value interface{}) error { 13949 if v == nil { 13950 return fmt.Errorf("unexpected nil of type %T", v) 13951 } 13952 if value == nil { 13953 return nil 13954 } 13955 13956 shape, ok := value.(map[string]interface{}) 13957 if !ok { 13958 return fmt.Errorf("unexpected JSON type %v", value) 13959 } 13960 13961 var sv *types.WAFInvalidParameterException 13962 if *v == nil { 13963 sv = &types.WAFInvalidParameterException{} 13964 } else { 13965 sv = *v 13966 } 13967 13968 for key, value := range shape { 13969 switch key { 13970 case "field": 13971 if value != nil { 13972 jtv, ok := value.(string) 13973 if !ok { 13974 return fmt.Errorf("expected ParameterExceptionField to be of type string, got %T instead", value) 13975 } 13976 sv.Field = types.ParameterExceptionField(jtv) 13977 } 13978 13979 case "parameter": 13980 if value != nil { 13981 jtv, ok := value.(string) 13982 if !ok { 13983 return fmt.Errorf("expected ParameterExceptionParameter to be of type string, got %T instead", value) 13984 } 13985 sv.Parameter = ptr.String(jtv) 13986 } 13987 13988 case "reason": 13989 if value != nil { 13990 jtv, ok := value.(string) 13991 if !ok { 13992 return fmt.Errorf("expected ParameterExceptionReason to be of type string, got %T instead", value) 13993 } 13994 sv.Reason = types.ParameterExceptionReason(jtv) 13995 } 13996 13997 default: 13998 _, _ = key, value 13999 14000 } 14001 } 14002 *v = sv 14003 return nil 14004} 14005 14006func awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(v **types.WAFInvalidPermissionPolicyException, value interface{}) error { 14007 if v == nil { 14008 return fmt.Errorf("unexpected nil of type %T", v) 14009 } 14010 if value == nil { 14011 return nil 14012 } 14013 14014 shape, ok := value.(map[string]interface{}) 14015 if !ok { 14016 return fmt.Errorf("unexpected JSON type %v", value) 14017 } 14018 14019 var sv *types.WAFInvalidPermissionPolicyException 14020 if *v == nil { 14021 sv = &types.WAFInvalidPermissionPolicyException{} 14022 } else { 14023 sv = *v 14024 } 14025 14026 for key, value := range shape { 14027 switch key { 14028 case "message": 14029 if value != nil { 14030 jtv, ok := value.(string) 14031 if !ok { 14032 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14033 } 14034 sv.Message = ptr.String(jtv) 14035 } 14036 14037 default: 14038 _, _ = key, value 14039 14040 } 14041 } 14042 *v = sv 14043 return nil 14044} 14045 14046func awsAwsjson11_deserializeDocumentWAFInvalidRegexPatternException(v **types.WAFInvalidRegexPatternException, value interface{}) error { 14047 if v == nil { 14048 return fmt.Errorf("unexpected nil of type %T", v) 14049 } 14050 if value == nil { 14051 return nil 14052 } 14053 14054 shape, ok := value.(map[string]interface{}) 14055 if !ok { 14056 return fmt.Errorf("unexpected JSON type %v", value) 14057 } 14058 14059 var sv *types.WAFInvalidRegexPatternException 14060 if *v == nil { 14061 sv = &types.WAFInvalidRegexPatternException{} 14062 } else { 14063 sv = *v 14064 } 14065 14066 for key, value := range shape { 14067 switch key { 14068 case "message": 14069 if value != nil { 14070 jtv, ok := value.(string) 14071 if !ok { 14072 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14073 } 14074 sv.Message = ptr.String(jtv) 14075 } 14076 14077 default: 14078 _, _ = key, value 14079 14080 } 14081 } 14082 *v = sv 14083 return nil 14084} 14085 14086func awsAwsjson11_deserializeDocumentWAFLimitsExceededException(v **types.WAFLimitsExceededException, value interface{}) error { 14087 if v == nil { 14088 return fmt.Errorf("unexpected nil of type %T", v) 14089 } 14090 if value == nil { 14091 return nil 14092 } 14093 14094 shape, ok := value.(map[string]interface{}) 14095 if !ok { 14096 return fmt.Errorf("unexpected JSON type %v", value) 14097 } 14098 14099 var sv *types.WAFLimitsExceededException 14100 if *v == nil { 14101 sv = &types.WAFLimitsExceededException{} 14102 } else { 14103 sv = *v 14104 } 14105 14106 for key, value := range shape { 14107 switch key { 14108 case "message": 14109 if value != nil { 14110 jtv, ok := value.(string) 14111 if !ok { 14112 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14113 } 14114 sv.Message = ptr.String(jtv) 14115 } 14116 14117 default: 14118 _, _ = key, value 14119 14120 } 14121 } 14122 *v = sv 14123 return nil 14124} 14125 14126func awsAwsjson11_deserializeDocumentWAFNonEmptyEntityException(v **types.WAFNonEmptyEntityException, value interface{}) error { 14127 if v == nil { 14128 return fmt.Errorf("unexpected nil of type %T", v) 14129 } 14130 if value == nil { 14131 return nil 14132 } 14133 14134 shape, ok := value.(map[string]interface{}) 14135 if !ok { 14136 return fmt.Errorf("unexpected JSON type %v", value) 14137 } 14138 14139 var sv *types.WAFNonEmptyEntityException 14140 if *v == nil { 14141 sv = &types.WAFNonEmptyEntityException{} 14142 } else { 14143 sv = *v 14144 } 14145 14146 for key, value := range shape { 14147 switch key { 14148 case "message": 14149 if value != nil { 14150 jtv, ok := value.(string) 14151 if !ok { 14152 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14153 } 14154 sv.Message = ptr.String(jtv) 14155 } 14156 14157 default: 14158 _, _ = key, value 14159 14160 } 14161 } 14162 *v = sv 14163 return nil 14164} 14165 14166func awsAwsjson11_deserializeDocumentWAFNonexistentContainerException(v **types.WAFNonexistentContainerException, value interface{}) error { 14167 if v == nil { 14168 return fmt.Errorf("unexpected nil of type %T", v) 14169 } 14170 if value == nil { 14171 return nil 14172 } 14173 14174 shape, ok := value.(map[string]interface{}) 14175 if !ok { 14176 return fmt.Errorf("unexpected JSON type %v", value) 14177 } 14178 14179 var sv *types.WAFNonexistentContainerException 14180 if *v == nil { 14181 sv = &types.WAFNonexistentContainerException{} 14182 } else { 14183 sv = *v 14184 } 14185 14186 for key, value := range shape { 14187 switch key { 14188 case "message": 14189 if value != nil { 14190 jtv, ok := value.(string) 14191 if !ok { 14192 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14193 } 14194 sv.Message = ptr.String(jtv) 14195 } 14196 14197 default: 14198 _, _ = key, value 14199 14200 } 14201 } 14202 *v = sv 14203 return nil 14204} 14205 14206func awsAwsjson11_deserializeDocumentWAFNonexistentItemException(v **types.WAFNonexistentItemException, value interface{}) error { 14207 if v == nil { 14208 return fmt.Errorf("unexpected nil of type %T", v) 14209 } 14210 if value == nil { 14211 return nil 14212 } 14213 14214 shape, ok := value.(map[string]interface{}) 14215 if !ok { 14216 return fmt.Errorf("unexpected JSON type %v", value) 14217 } 14218 14219 var sv *types.WAFNonexistentItemException 14220 if *v == nil { 14221 sv = &types.WAFNonexistentItemException{} 14222 } else { 14223 sv = *v 14224 } 14225 14226 for key, value := range shape { 14227 switch key { 14228 case "message": 14229 if value != nil { 14230 jtv, ok := value.(string) 14231 if !ok { 14232 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14233 } 14234 sv.Message = ptr.String(jtv) 14235 } 14236 14237 default: 14238 _, _ = key, value 14239 14240 } 14241 } 14242 *v = sv 14243 return nil 14244} 14245 14246func awsAwsjson11_deserializeDocumentWafOverrideAction(v **types.WafOverrideAction, value interface{}) error { 14247 if v == nil { 14248 return fmt.Errorf("unexpected nil of type %T", v) 14249 } 14250 if value == nil { 14251 return nil 14252 } 14253 14254 shape, ok := value.(map[string]interface{}) 14255 if !ok { 14256 return fmt.Errorf("unexpected JSON type %v", value) 14257 } 14258 14259 var sv *types.WafOverrideAction 14260 if *v == nil { 14261 sv = &types.WafOverrideAction{} 14262 } else { 14263 sv = *v 14264 } 14265 14266 for key, value := range shape { 14267 switch key { 14268 case "Type": 14269 if value != nil { 14270 jtv, ok := value.(string) 14271 if !ok { 14272 return fmt.Errorf("expected WafOverrideActionType to be of type string, got %T instead", value) 14273 } 14274 sv.Type = types.WafOverrideActionType(jtv) 14275 } 14276 14277 default: 14278 _, _ = key, value 14279 14280 } 14281 } 14282 *v = sv 14283 return nil 14284} 14285 14286func awsAwsjson11_deserializeDocumentWAFReferencedItemException(v **types.WAFReferencedItemException, value interface{}) error { 14287 if v == nil { 14288 return fmt.Errorf("unexpected nil of type %T", v) 14289 } 14290 if value == nil { 14291 return nil 14292 } 14293 14294 shape, ok := value.(map[string]interface{}) 14295 if !ok { 14296 return fmt.Errorf("unexpected JSON type %v", value) 14297 } 14298 14299 var sv *types.WAFReferencedItemException 14300 if *v == nil { 14301 sv = &types.WAFReferencedItemException{} 14302 } else { 14303 sv = *v 14304 } 14305 14306 for key, value := range shape { 14307 switch key { 14308 case "message": 14309 if value != nil { 14310 jtv, ok := value.(string) 14311 if !ok { 14312 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14313 } 14314 sv.Message = ptr.String(jtv) 14315 } 14316 14317 default: 14318 _, _ = key, value 14319 14320 } 14321 } 14322 *v = sv 14323 return nil 14324} 14325 14326func awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(v **types.WAFServiceLinkedRoleErrorException, value interface{}) error { 14327 if v == nil { 14328 return fmt.Errorf("unexpected nil of type %T", v) 14329 } 14330 if value == nil { 14331 return nil 14332 } 14333 14334 shape, ok := value.(map[string]interface{}) 14335 if !ok { 14336 return fmt.Errorf("unexpected JSON type %v", value) 14337 } 14338 14339 var sv *types.WAFServiceLinkedRoleErrorException 14340 if *v == nil { 14341 sv = &types.WAFServiceLinkedRoleErrorException{} 14342 } else { 14343 sv = *v 14344 } 14345 14346 for key, value := range shape { 14347 switch key { 14348 case "message": 14349 if value != nil { 14350 jtv, ok := value.(string) 14351 if !ok { 14352 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14353 } 14354 sv.Message = ptr.String(jtv) 14355 } 14356 14357 default: 14358 _, _ = key, value 14359 14360 } 14361 } 14362 *v = sv 14363 return nil 14364} 14365 14366func awsAwsjson11_deserializeDocumentWAFStaleDataException(v **types.WAFStaleDataException, value interface{}) error { 14367 if v == nil { 14368 return fmt.Errorf("unexpected nil of type %T", v) 14369 } 14370 if value == nil { 14371 return nil 14372 } 14373 14374 shape, ok := value.(map[string]interface{}) 14375 if !ok { 14376 return fmt.Errorf("unexpected JSON type %v", value) 14377 } 14378 14379 var sv *types.WAFStaleDataException 14380 if *v == nil { 14381 sv = &types.WAFStaleDataException{} 14382 } else { 14383 sv = *v 14384 } 14385 14386 for key, value := range shape { 14387 switch key { 14388 case "message": 14389 if value != nil { 14390 jtv, ok := value.(string) 14391 if !ok { 14392 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14393 } 14394 sv.Message = ptr.String(jtv) 14395 } 14396 14397 default: 14398 _, _ = key, value 14399 14400 } 14401 } 14402 *v = sv 14403 return nil 14404} 14405 14406func awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(v **types.WAFSubscriptionNotFoundException, value interface{}) error { 14407 if v == nil { 14408 return fmt.Errorf("unexpected nil of type %T", v) 14409 } 14410 if value == nil { 14411 return nil 14412 } 14413 14414 shape, ok := value.(map[string]interface{}) 14415 if !ok { 14416 return fmt.Errorf("unexpected JSON type %v", value) 14417 } 14418 14419 var sv *types.WAFSubscriptionNotFoundException 14420 if *v == nil { 14421 sv = &types.WAFSubscriptionNotFoundException{} 14422 } else { 14423 sv = *v 14424 } 14425 14426 for key, value := range shape { 14427 switch key { 14428 case "message": 14429 if value != nil { 14430 jtv, ok := value.(string) 14431 if !ok { 14432 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14433 } 14434 sv.Message = ptr.String(jtv) 14435 } 14436 14437 default: 14438 _, _ = key, value 14439 14440 } 14441 } 14442 *v = sv 14443 return nil 14444} 14445 14446func awsAwsjson11_deserializeDocumentWAFTagOperationException(v **types.WAFTagOperationException, value interface{}) error { 14447 if v == nil { 14448 return fmt.Errorf("unexpected nil of type %T", v) 14449 } 14450 if value == nil { 14451 return nil 14452 } 14453 14454 shape, ok := value.(map[string]interface{}) 14455 if !ok { 14456 return fmt.Errorf("unexpected JSON type %v", value) 14457 } 14458 14459 var sv *types.WAFTagOperationException 14460 if *v == nil { 14461 sv = &types.WAFTagOperationException{} 14462 } else { 14463 sv = *v 14464 } 14465 14466 for key, value := range shape { 14467 switch key { 14468 case "message": 14469 if value != nil { 14470 jtv, ok := value.(string) 14471 if !ok { 14472 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14473 } 14474 sv.Message = ptr.String(jtv) 14475 } 14476 14477 default: 14478 _, _ = key, value 14479 14480 } 14481 } 14482 *v = sv 14483 return nil 14484} 14485 14486func awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(v **types.WAFTagOperationInternalErrorException, value interface{}) error { 14487 if v == nil { 14488 return fmt.Errorf("unexpected nil of type %T", v) 14489 } 14490 if value == nil { 14491 return nil 14492 } 14493 14494 shape, ok := value.(map[string]interface{}) 14495 if !ok { 14496 return fmt.Errorf("unexpected JSON type %v", value) 14497 } 14498 14499 var sv *types.WAFTagOperationInternalErrorException 14500 if *v == nil { 14501 sv = &types.WAFTagOperationInternalErrorException{} 14502 } else { 14503 sv = *v 14504 } 14505 14506 for key, value := range shape { 14507 switch key { 14508 case "message": 14509 if value != nil { 14510 jtv, ok := value.(string) 14511 if !ok { 14512 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14513 } 14514 sv.Message = ptr.String(jtv) 14515 } 14516 14517 default: 14518 _, _ = key, value 14519 14520 } 14521 } 14522 *v = sv 14523 return nil 14524} 14525 14526func awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(v **types.WAFUnavailableEntityException, value interface{}) error { 14527 if v == nil { 14528 return fmt.Errorf("unexpected nil of type %T", v) 14529 } 14530 if value == nil { 14531 return nil 14532 } 14533 14534 shape, ok := value.(map[string]interface{}) 14535 if !ok { 14536 return fmt.Errorf("unexpected JSON type %v", value) 14537 } 14538 14539 var sv *types.WAFUnavailableEntityException 14540 if *v == nil { 14541 sv = &types.WAFUnavailableEntityException{} 14542 } else { 14543 sv = *v 14544 } 14545 14546 for key, value := range shape { 14547 switch key { 14548 case "message": 14549 if value != nil { 14550 jtv, ok := value.(string) 14551 if !ok { 14552 return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) 14553 } 14554 sv.Message = ptr.String(jtv) 14555 } 14556 14557 default: 14558 _, _ = key, value 14559 14560 } 14561 } 14562 *v = sv 14563 return nil 14564} 14565 14566func awsAwsjson11_deserializeDocumentWebACL(v **types.WebACL, value interface{}) error { 14567 if v == nil { 14568 return fmt.Errorf("unexpected nil of type %T", v) 14569 } 14570 if value == nil { 14571 return nil 14572 } 14573 14574 shape, ok := value.(map[string]interface{}) 14575 if !ok { 14576 return fmt.Errorf("unexpected JSON type %v", value) 14577 } 14578 14579 var sv *types.WebACL 14580 if *v == nil { 14581 sv = &types.WebACL{} 14582 } else { 14583 sv = *v 14584 } 14585 14586 for key, value := range shape { 14587 switch key { 14588 case "DefaultAction": 14589 if err := awsAwsjson11_deserializeDocumentWafAction(&sv.DefaultAction, value); err != nil { 14590 return err 14591 } 14592 14593 case "MetricName": 14594 if value != nil { 14595 jtv, ok := value.(string) 14596 if !ok { 14597 return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) 14598 } 14599 sv.MetricName = ptr.String(jtv) 14600 } 14601 14602 case "Name": 14603 if value != nil { 14604 jtv, ok := value.(string) 14605 if !ok { 14606 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 14607 } 14608 sv.Name = ptr.String(jtv) 14609 } 14610 14611 case "Rules": 14612 if err := awsAwsjson11_deserializeDocumentActivatedRules(&sv.Rules, value); err != nil { 14613 return err 14614 } 14615 14616 case "WebACLArn": 14617 if value != nil { 14618 jtv, ok := value.(string) 14619 if !ok { 14620 return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) 14621 } 14622 sv.WebACLArn = ptr.String(jtv) 14623 } 14624 14625 case "WebACLId": 14626 if value != nil { 14627 jtv, ok := value.(string) 14628 if !ok { 14629 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 14630 } 14631 sv.WebACLId = ptr.String(jtv) 14632 } 14633 14634 default: 14635 _, _ = key, value 14636 14637 } 14638 } 14639 *v = sv 14640 return nil 14641} 14642 14643func awsAwsjson11_deserializeDocumentWebACLSummaries(v *[]types.WebACLSummary, value interface{}) error { 14644 if v == nil { 14645 return fmt.Errorf("unexpected nil of type %T", v) 14646 } 14647 if value == nil { 14648 return nil 14649 } 14650 14651 shape, ok := value.([]interface{}) 14652 if !ok { 14653 return fmt.Errorf("unexpected JSON type %v", value) 14654 } 14655 14656 var cv []types.WebACLSummary 14657 if *v == nil { 14658 cv = []types.WebACLSummary{} 14659 } else { 14660 cv = *v 14661 } 14662 14663 for _, value := range shape { 14664 var col types.WebACLSummary 14665 destAddr := &col 14666 if err := awsAwsjson11_deserializeDocumentWebACLSummary(&destAddr, value); err != nil { 14667 return err 14668 } 14669 col = *destAddr 14670 cv = append(cv, col) 14671 14672 } 14673 *v = cv 14674 return nil 14675} 14676 14677func awsAwsjson11_deserializeDocumentWebACLSummary(v **types.WebACLSummary, value interface{}) error { 14678 if v == nil { 14679 return fmt.Errorf("unexpected nil of type %T", v) 14680 } 14681 if value == nil { 14682 return nil 14683 } 14684 14685 shape, ok := value.(map[string]interface{}) 14686 if !ok { 14687 return fmt.Errorf("unexpected JSON type %v", value) 14688 } 14689 14690 var sv *types.WebACLSummary 14691 if *v == nil { 14692 sv = &types.WebACLSummary{} 14693 } else { 14694 sv = *v 14695 } 14696 14697 for key, value := range shape { 14698 switch key { 14699 case "Name": 14700 if value != nil { 14701 jtv, ok := value.(string) 14702 if !ok { 14703 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 14704 } 14705 sv.Name = ptr.String(jtv) 14706 } 14707 14708 case "WebACLId": 14709 if value != nil { 14710 jtv, ok := value.(string) 14711 if !ok { 14712 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 14713 } 14714 sv.WebACLId = ptr.String(jtv) 14715 } 14716 14717 default: 14718 _, _ = key, value 14719 14720 } 14721 } 14722 *v = sv 14723 return nil 14724} 14725 14726func awsAwsjson11_deserializeDocumentXssMatchSet(v **types.XssMatchSet, value interface{}) error { 14727 if v == nil { 14728 return fmt.Errorf("unexpected nil of type %T", v) 14729 } 14730 if value == nil { 14731 return nil 14732 } 14733 14734 shape, ok := value.(map[string]interface{}) 14735 if !ok { 14736 return fmt.Errorf("unexpected JSON type %v", value) 14737 } 14738 14739 var sv *types.XssMatchSet 14740 if *v == nil { 14741 sv = &types.XssMatchSet{} 14742 } else { 14743 sv = *v 14744 } 14745 14746 for key, value := range shape { 14747 switch key { 14748 case "Name": 14749 if value != nil { 14750 jtv, ok := value.(string) 14751 if !ok { 14752 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 14753 } 14754 sv.Name = ptr.String(jtv) 14755 } 14756 14757 case "XssMatchSetId": 14758 if value != nil { 14759 jtv, ok := value.(string) 14760 if !ok { 14761 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 14762 } 14763 sv.XssMatchSetId = ptr.String(jtv) 14764 } 14765 14766 case "XssMatchTuples": 14767 if err := awsAwsjson11_deserializeDocumentXssMatchTuples(&sv.XssMatchTuples, value); err != nil { 14768 return err 14769 } 14770 14771 default: 14772 _, _ = key, value 14773 14774 } 14775 } 14776 *v = sv 14777 return nil 14778} 14779 14780func awsAwsjson11_deserializeDocumentXssMatchSetSummaries(v *[]types.XssMatchSetSummary, value interface{}) error { 14781 if v == nil { 14782 return fmt.Errorf("unexpected nil of type %T", v) 14783 } 14784 if value == nil { 14785 return nil 14786 } 14787 14788 shape, ok := value.([]interface{}) 14789 if !ok { 14790 return fmt.Errorf("unexpected JSON type %v", value) 14791 } 14792 14793 var cv []types.XssMatchSetSummary 14794 if *v == nil { 14795 cv = []types.XssMatchSetSummary{} 14796 } else { 14797 cv = *v 14798 } 14799 14800 for _, value := range shape { 14801 var col types.XssMatchSetSummary 14802 destAddr := &col 14803 if err := awsAwsjson11_deserializeDocumentXssMatchSetSummary(&destAddr, value); err != nil { 14804 return err 14805 } 14806 col = *destAddr 14807 cv = append(cv, col) 14808 14809 } 14810 *v = cv 14811 return nil 14812} 14813 14814func awsAwsjson11_deserializeDocumentXssMatchSetSummary(v **types.XssMatchSetSummary, value interface{}) error { 14815 if v == nil { 14816 return fmt.Errorf("unexpected nil of type %T", v) 14817 } 14818 if value == nil { 14819 return nil 14820 } 14821 14822 shape, ok := value.(map[string]interface{}) 14823 if !ok { 14824 return fmt.Errorf("unexpected JSON type %v", value) 14825 } 14826 14827 var sv *types.XssMatchSetSummary 14828 if *v == nil { 14829 sv = &types.XssMatchSetSummary{} 14830 } else { 14831 sv = *v 14832 } 14833 14834 for key, value := range shape { 14835 switch key { 14836 case "Name": 14837 if value != nil { 14838 jtv, ok := value.(string) 14839 if !ok { 14840 return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) 14841 } 14842 sv.Name = ptr.String(jtv) 14843 } 14844 14845 case "XssMatchSetId": 14846 if value != nil { 14847 jtv, ok := value.(string) 14848 if !ok { 14849 return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) 14850 } 14851 sv.XssMatchSetId = ptr.String(jtv) 14852 } 14853 14854 default: 14855 _, _ = key, value 14856 14857 } 14858 } 14859 *v = sv 14860 return nil 14861} 14862 14863func awsAwsjson11_deserializeDocumentXssMatchTuple(v **types.XssMatchTuple, value interface{}) error { 14864 if v == nil { 14865 return fmt.Errorf("unexpected nil of type %T", v) 14866 } 14867 if value == nil { 14868 return nil 14869 } 14870 14871 shape, ok := value.(map[string]interface{}) 14872 if !ok { 14873 return fmt.Errorf("unexpected JSON type %v", value) 14874 } 14875 14876 var sv *types.XssMatchTuple 14877 if *v == nil { 14878 sv = &types.XssMatchTuple{} 14879 } else { 14880 sv = *v 14881 } 14882 14883 for key, value := range shape { 14884 switch key { 14885 case "FieldToMatch": 14886 if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil { 14887 return err 14888 } 14889 14890 case "TextTransformation": 14891 if value != nil { 14892 jtv, ok := value.(string) 14893 if !ok { 14894 return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value) 14895 } 14896 sv.TextTransformation = types.TextTransformation(jtv) 14897 } 14898 14899 default: 14900 _, _ = key, value 14901 14902 } 14903 } 14904 *v = sv 14905 return nil 14906} 14907 14908func awsAwsjson11_deserializeDocumentXssMatchTuples(v *[]types.XssMatchTuple, value interface{}) error { 14909 if v == nil { 14910 return fmt.Errorf("unexpected nil of type %T", v) 14911 } 14912 if value == nil { 14913 return nil 14914 } 14915 14916 shape, ok := value.([]interface{}) 14917 if !ok { 14918 return fmt.Errorf("unexpected JSON type %v", value) 14919 } 14920 14921 var cv []types.XssMatchTuple 14922 if *v == nil { 14923 cv = []types.XssMatchTuple{} 14924 } else { 14925 cv = *v 14926 } 14927 14928 for _, value := range shape { 14929 var col types.XssMatchTuple 14930 destAddr := &col 14931 if err := awsAwsjson11_deserializeDocumentXssMatchTuple(&destAddr, value); err != nil { 14932 return err 14933 } 14934 col = *destAddr 14935 cv = append(cv, col) 14936 14937 } 14938 *v = cv 14939 return nil 14940} 14941 14942func awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(v **AssociateWebACLOutput, value interface{}) error { 14943 if v == nil { 14944 return fmt.Errorf("unexpected nil of type %T", v) 14945 } 14946 if value == nil { 14947 return nil 14948 } 14949 14950 shape, ok := value.(map[string]interface{}) 14951 if !ok { 14952 return fmt.Errorf("unexpected JSON type %v", value) 14953 } 14954 14955 var sv *AssociateWebACLOutput 14956 if *v == nil { 14957 sv = &AssociateWebACLOutput{} 14958 } else { 14959 sv = *v 14960 } 14961 14962 for key, value := range shape { 14963 switch key { 14964 default: 14965 _, _ = key, value 14966 14967 } 14968 } 14969 *v = sv 14970 return nil 14971} 14972 14973func awsAwsjson11_deserializeOpDocumentCreateByteMatchSetOutput(v **CreateByteMatchSetOutput, value interface{}) error { 14974 if v == nil { 14975 return fmt.Errorf("unexpected nil of type %T", v) 14976 } 14977 if value == nil { 14978 return nil 14979 } 14980 14981 shape, ok := value.(map[string]interface{}) 14982 if !ok { 14983 return fmt.Errorf("unexpected JSON type %v", value) 14984 } 14985 14986 var sv *CreateByteMatchSetOutput 14987 if *v == nil { 14988 sv = &CreateByteMatchSetOutput{} 14989 } else { 14990 sv = *v 14991 } 14992 14993 for key, value := range shape { 14994 switch key { 14995 case "ByteMatchSet": 14996 if err := awsAwsjson11_deserializeDocumentByteMatchSet(&sv.ByteMatchSet, value); err != nil { 14997 return err 14998 } 14999 15000 case "ChangeToken": 15001 if value != nil { 15002 jtv, ok := value.(string) 15003 if !ok { 15004 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15005 } 15006 sv.ChangeToken = ptr.String(jtv) 15007 } 15008 15009 default: 15010 _, _ = key, value 15011 15012 } 15013 } 15014 *v = sv 15015 return nil 15016} 15017 15018func awsAwsjson11_deserializeOpDocumentCreateGeoMatchSetOutput(v **CreateGeoMatchSetOutput, value interface{}) error { 15019 if v == nil { 15020 return fmt.Errorf("unexpected nil of type %T", v) 15021 } 15022 if value == nil { 15023 return nil 15024 } 15025 15026 shape, ok := value.(map[string]interface{}) 15027 if !ok { 15028 return fmt.Errorf("unexpected JSON type %v", value) 15029 } 15030 15031 var sv *CreateGeoMatchSetOutput 15032 if *v == nil { 15033 sv = &CreateGeoMatchSetOutput{} 15034 } else { 15035 sv = *v 15036 } 15037 15038 for key, value := range shape { 15039 switch key { 15040 case "ChangeToken": 15041 if value != nil { 15042 jtv, ok := value.(string) 15043 if !ok { 15044 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15045 } 15046 sv.ChangeToken = ptr.String(jtv) 15047 } 15048 15049 case "GeoMatchSet": 15050 if err := awsAwsjson11_deserializeDocumentGeoMatchSet(&sv.GeoMatchSet, value); err != nil { 15051 return err 15052 } 15053 15054 default: 15055 _, _ = key, value 15056 15057 } 15058 } 15059 *v = sv 15060 return nil 15061} 15062 15063func awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(v **CreateIPSetOutput, value interface{}) error { 15064 if v == nil { 15065 return fmt.Errorf("unexpected nil of type %T", v) 15066 } 15067 if value == nil { 15068 return nil 15069 } 15070 15071 shape, ok := value.(map[string]interface{}) 15072 if !ok { 15073 return fmt.Errorf("unexpected JSON type %v", value) 15074 } 15075 15076 var sv *CreateIPSetOutput 15077 if *v == nil { 15078 sv = &CreateIPSetOutput{} 15079 } else { 15080 sv = *v 15081 } 15082 15083 for key, value := range shape { 15084 switch key { 15085 case "ChangeToken": 15086 if value != nil { 15087 jtv, ok := value.(string) 15088 if !ok { 15089 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15090 } 15091 sv.ChangeToken = ptr.String(jtv) 15092 } 15093 15094 case "IPSet": 15095 if err := awsAwsjson11_deserializeDocumentIPSet(&sv.IPSet, value); err != nil { 15096 return err 15097 } 15098 15099 default: 15100 _, _ = key, value 15101 15102 } 15103 } 15104 *v = sv 15105 return nil 15106} 15107 15108func awsAwsjson11_deserializeOpDocumentCreateRateBasedRuleOutput(v **CreateRateBasedRuleOutput, value interface{}) error { 15109 if v == nil { 15110 return fmt.Errorf("unexpected nil of type %T", v) 15111 } 15112 if value == nil { 15113 return nil 15114 } 15115 15116 shape, ok := value.(map[string]interface{}) 15117 if !ok { 15118 return fmt.Errorf("unexpected JSON type %v", value) 15119 } 15120 15121 var sv *CreateRateBasedRuleOutput 15122 if *v == nil { 15123 sv = &CreateRateBasedRuleOutput{} 15124 } else { 15125 sv = *v 15126 } 15127 15128 for key, value := range shape { 15129 switch key { 15130 case "ChangeToken": 15131 if value != nil { 15132 jtv, ok := value.(string) 15133 if !ok { 15134 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15135 } 15136 sv.ChangeToken = ptr.String(jtv) 15137 } 15138 15139 case "Rule": 15140 if err := awsAwsjson11_deserializeDocumentRateBasedRule(&sv.Rule, value); err != nil { 15141 return err 15142 } 15143 15144 default: 15145 _, _ = key, value 15146 15147 } 15148 } 15149 *v = sv 15150 return nil 15151} 15152 15153func awsAwsjson11_deserializeOpDocumentCreateRegexMatchSetOutput(v **CreateRegexMatchSetOutput, value interface{}) error { 15154 if v == nil { 15155 return fmt.Errorf("unexpected nil of type %T", v) 15156 } 15157 if value == nil { 15158 return nil 15159 } 15160 15161 shape, ok := value.(map[string]interface{}) 15162 if !ok { 15163 return fmt.Errorf("unexpected JSON type %v", value) 15164 } 15165 15166 var sv *CreateRegexMatchSetOutput 15167 if *v == nil { 15168 sv = &CreateRegexMatchSetOutput{} 15169 } else { 15170 sv = *v 15171 } 15172 15173 for key, value := range shape { 15174 switch key { 15175 case "ChangeToken": 15176 if value != nil { 15177 jtv, ok := value.(string) 15178 if !ok { 15179 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15180 } 15181 sv.ChangeToken = ptr.String(jtv) 15182 } 15183 15184 case "RegexMatchSet": 15185 if err := awsAwsjson11_deserializeDocumentRegexMatchSet(&sv.RegexMatchSet, value); err != nil { 15186 return err 15187 } 15188 15189 default: 15190 _, _ = key, value 15191 15192 } 15193 } 15194 *v = sv 15195 return nil 15196} 15197 15198func awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(v **CreateRegexPatternSetOutput, value interface{}) error { 15199 if v == nil { 15200 return fmt.Errorf("unexpected nil of type %T", v) 15201 } 15202 if value == nil { 15203 return nil 15204 } 15205 15206 shape, ok := value.(map[string]interface{}) 15207 if !ok { 15208 return fmt.Errorf("unexpected JSON type %v", value) 15209 } 15210 15211 var sv *CreateRegexPatternSetOutput 15212 if *v == nil { 15213 sv = &CreateRegexPatternSetOutput{} 15214 } else { 15215 sv = *v 15216 } 15217 15218 for key, value := range shape { 15219 switch key { 15220 case "ChangeToken": 15221 if value != nil { 15222 jtv, ok := value.(string) 15223 if !ok { 15224 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15225 } 15226 sv.ChangeToken = ptr.String(jtv) 15227 } 15228 15229 case "RegexPatternSet": 15230 if err := awsAwsjson11_deserializeDocumentRegexPatternSet(&sv.RegexPatternSet, value); err != nil { 15231 return err 15232 } 15233 15234 default: 15235 _, _ = key, value 15236 15237 } 15238 } 15239 *v = sv 15240 return nil 15241} 15242 15243func awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(v **CreateRuleGroupOutput, value interface{}) error { 15244 if v == nil { 15245 return fmt.Errorf("unexpected nil of type %T", v) 15246 } 15247 if value == nil { 15248 return nil 15249 } 15250 15251 shape, ok := value.(map[string]interface{}) 15252 if !ok { 15253 return fmt.Errorf("unexpected JSON type %v", value) 15254 } 15255 15256 var sv *CreateRuleGroupOutput 15257 if *v == nil { 15258 sv = &CreateRuleGroupOutput{} 15259 } else { 15260 sv = *v 15261 } 15262 15263 for key, value := range shape { 15264 switch key { 15265 case "ChangeToken": 15266 if value != nil { 15267 jtv, ok := value.(string) 15268 if !ok { 15269 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15270 } 15271 sv.ChangeToken = ptr.String(jtv) 15272 } 15273 15274 case "RuleGroup": 15275 if err := awsAwsjson11_deserializeDocumentRuleGroup(&sv.RuleGroup, value); err != nil { 15276 return err 15277 } 15278 15279 default: 15280 _, _ = key, value 15281 15282 } 15283 } 15284 *v = sv 15285 return nil 15286} 15287 15288func awsAwsjson11_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, value interface{}) error { 15289 if v == nil { 15290 return fmt.Errorf("unexpected nil of type %T", v) 15291 } 15292 if value == nil { 15293 return nil 15294 } 15295 15296 shape, ok := value.(map[string]interface{}) 15297 if !ok { 15298 return fmt.Errorf("unexpected JSON type %v", value) 15299 } 15300 15301 var sv *CreateRuleOutput 15302 if *v == nil { 15303 sv = &CreateRuleOutput{} 15304 } else { 15305 sv = *v 15306 } 15307 15308 for key, value := range shape { 15309 switch key { 15310 case "ChangeToken": 15311 if value != nil { 15312 jtv, ok := value.(string) 15313 if !ok { 15314 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15315 } 15316 sv.ChangeToken = ptr.String(jtv) 15317 } 15318 15319 case "Rule": 15320 if err := awsAwsjson11_deserializeDocumentRule(&sv.Rule, value); err != nil { 15321 return err 15322 } 15323 15324 default: 15325 _, _ = key, value 15326 15327 } 15328 } 15329 *v = sv 15330 return nil 15331} 15332 15333func awsAwsjson11_deserializeOpDocumentCreateSizeConstraintSetOutput(v **CreateSizeConstraintSetOutput, value interface{}) error { 15334 if v == nil { 15335 return fmt.Errorf("unexpected nil of type %T", v) 15336 } 15337 if value == nil { 15338 return nil 15339 } 15340 15341 shape, ok := value.(map[string]interface{}) 15342 if !ok { 15343 return fmt.Errorf("unexpected JSON type %v", value) 15344 } 15345 15346 var sv *CreateSizeConstraintSetOutput 15347 if *v == nil { 15348 sv = &CreateSizeConstraintSetOutput{} 15349 } else { 15350 sv = *v 15351 } 15352 15353 for key, value := range shape { 15354 switch key { 15355 case "ChangeToken": 15356 if value != nil { 15357 jtv, ok := value.(string) 15358 if !ok { 15359 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15360 } 15361 sv.ChangeToken = ptr.String(jtv) 15362 } 15363 15364 case "SizeConstraintSet": 15365 if err := awsAwsjson11_deserializeDocumentSizeConstraintSet(&sv.SizeConstraintSet, value); err != nil { 15366 return err 15367 } 15368 15369 default: 15370 _, _ = key, value 15371 15372 } 15373 } 15374 *v = sv 15375 return nil 15376} 15377 15378func awsAwsjson11_deserializeOpDocumentCreateSqlInjectionMatchSetOutput(v **CreateSqlInjectionMatchSetOutput, value interface{}) error { 15379 if v == nil { 15380 return fmt.Errorf("unexpected nil of type %T", v) 15381 } 15382 if value == nil { 15383 return nil 15384 } 15385 15386 shape, ok := value.(map[string]interface{}) 15387 if !ok { 15388 return fmt.Errorf("unexpected JSON type %v", value) 15389 } 15390 15391 var sv *CreateSqlInjectionMatchSetOutput 15392 if *v == nil { 15393 sv = &CreateSqlInjectionMatchSetOutput{} 15394 } else { 15395 sv = *v 15396 } 15397 15398 for key, value := range shape { 15399 switch key { 15400 case "ChangeToken": 15401 if value != nil { 15402 jtv, ok := value.(string) 15403 if !ok { 15404 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15405 } 15406 sv.ChangeToken = ptr.String(jtv) 15407 } 15408 15409 case "SqlInjectionMatchSet": 15410 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(&sv.SqlInjectionMatchSet, value); err != nil { 15411 return err 15412 } 15413 15414 default: 15415 _, _ = key, value 15416 15417 } 15418 } 15419 *v = sv 15420 return nil 15421} 15422 15423func awsAwsjson11_deserializeOpDocumentCreateWebACLMigrationStackOutput(v **CreateWebACLMigrationStackOutput, value interface{}) error { 15424 if v == nil { 15425 return fmt.Errorf("unexpected nil of type %T", v) 15426 } 15427 if value == nil { 15428 return nil 15429 } 15430 15431 shape, ok := value.(map[string]interface{}) 15432 if !ok { 15433 return fmt.Errorf("unexpected JSON type %v", value) 15434 } 15435 15436 var sv *CreateWebACLMigrationStackOutput 15437 if *v == nil { 15438 sv = &CreateWebACLMigrationStackOutput{} 15439 } else { 15440 sv = *v 15441 } 15442 15443 for key, value := range shape { 15444 switch key { 15445 case "S3ObjectUrl": 15446 if value != nil { 15447 jtv, ok := value.(string) 15448 if !ok { 15449 return fmt.Errorf("expected S3ObjectUrl to be of type string, got %T instead", value) 15450 } 15451 sv.S3ObjectUrl = ptr.String(jtv) 15452 } 15453 15454 default: 15455 _, _ = key, value 15456 15457 } 15458 } 15459 *v = sv 15460 return nil 15461} 15462 15463func awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(v **CreateWebACLOutput, value interface{}) error { 15464 if v == nil { 15465 return fmt.Errorf("unexpected nil of type %T", v) 15466 } 15467 if value == nil { 15468 return nil 15469 } 15470 15471 shape, ok := value.(map[string]interface{}) 15472 if !ok { 15473 return fmt.Errorf("unexpected JSON type %v", value) 15474 } 15475 15476 var sv *CreateWebACLOutput 15477 if *v == nil { 15478 sv = &CreateWebACLOutput{} 15479 } else { 15480 sv = *v 15481 } 15482 15483 for key, value := range shape { 15484 switch key { 15485 case "ChangeToken": 15486 if value != nil { 15487 jtv, ok := value.(string) 15488 if !ok { 15489 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15490 } 15491 sv.ChangeToken = ptr.String(jtv) 15492 } 15493 15494 case "WebACL": 15495 if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil { 15496 return err 15497 } 15498 15499 default: 15500 _, _ = key, value 15501 15502 } 15503 } 15504 *v = sv 15505 return nil 15506} 15507 15508func awsAwsjson11_deserializeOpDocumentCreateXssMatchSetOutput(v **CreateXssMatchSetOutput, value interface{}) error { 15509 if v == nil { 15510 return fmt.Errorf("unexpected nil of type %T", v) 15511 } 15512 if value == nil { 15513 return nil 15514 } 15515 15516 shape, ok := value.(map[string]interface{}) 15517 if !ok { 15518 return fmt.Errorf("unexpected JSON type %v", value) 15519 } 15520 15521 var sv *CreateXssMatchSetOutput 15522 if *v == nil { 15523 sv = &CreateXssMatchSetOutput{} 15524 } else { 15525 sv = *v 15526 } 15527 15528 for key, value := range shape { 15529 switch key { 15530 case "ChangeToken": 15531 if value != nil { 15532 jtv, ok := value.(string) 15533 if !ok { 15534 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15535 } 15536 sv.ChangeToken = ptr.String(jtv) 15537 } 15538 15539 case "XssMatchSet": 15540 if err := awsAwsjson11_deserializeDocumentXssMatchSet(&sv.XssMatchSet, value); err != nil { 15541 return err 15542 } 15543 15544 default: 15545 _, _ = key, value 15546 15547 } 15548 } 15549 *v = sv 15550 return nil 15551} 15552 15553func awsAwsjson11_deserializeOpDocumentDeleteByteMatchSetOutput(v **DeleteByteMatchSetOutput, value interface{}) error { 15554 if v == nil { 15555 return fmt.Errorf("unexpected nil of type %T", v) 15556 } 15557 if value == nil { 15558 return nil 15559 } 15560 15561 shape, ok := value.(map[string]interface{}) 15562 if !ok { 15563 return fmt.Errorf("unexpected JSON type %v", value) 15564 } 15565 15566 var sv *DeleteByteMatchSetOutput 15567 if *v == nil { 15568 sv = &DeleteByteMatchSetOutput{} 15569 } else { 15570 sv = *v 15571 } 15572 15573 for key, value := range shape { 15574 switch key { 15575 case "ChangeToken": 15576 if value != nil { 15577 jtv, ok := value.(string) 15578 if !ok { 15579 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15580 } 15581 sv.ChangeToken = ptr.String(jtv) 15582 } 15583 15584 default: 15585 _, _ = key, value 15586 15587 } 15588 } 15589 *v = sv 15590 return nil 15591} 15592 15593func awsAwsjson11_deserializeOpDocumentDeleteGeoMatchSetOutput(v **DeleteGeoMatchSetOutput, value interface{}) error { 15594 if v == nil { 15595 return fmt.Errorf("unexpected nil of type %T", v) 15596 } 15597 if value == nil { 15598 return nil 15599 } 15600 15601 shape, ok := value.(map[string]interface{}) 15602 if !ok { 15603 return fmt.Errorf("unexpected JSON type %v", value) 15604 } 15605 15606 var sv *DeleteGeoMatchSetOutput 15607 if *v == nil { 15608 sv = &DeleteGeoMatchSetOutput{} 15609 } else { 15610 sv = *v 15611 } 15612 15613 for key, value := range shape { 15614 switch key { 15615 case "ChangeToken": 15616 if value != nil { 15617 jtv, ok := value.(string) 15618 if !ok { 15619 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15620 } 15621 sv.ChangeToken = ptr.String(jtv) 15622 } 15623 15624 default: 15625 _, _ = key, value 15626 15627 } 15628 } 15629 *v = sv 15630 return nil 15631} 15632 15633func awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(v **DeleteIPSetOutput, value interface{}) error { 15634 if v == nil { 15635 return fmt.Errorf("unexpected nil of type %T", v) 15636 } 15637 if value == nil { 15638 return nil 15639 } 15640 15641 shape, ok := value.(map[string]interface{}) 15642 if !ok { 15643 return fmt.Errorf("unexpected JSON type %v", value) 15644 } 15645 15646 var sv *DeleteIPSetOutput 15647 if *v == nil { 15648 sv = &DeleteIPSetOutput{} 15649 } else { 15650 sv = *v 15651 } 15652 15653 for key, value := range shape { 15654 switch key { 15655 case "ChangeToken": 15656 if value != nil { 15657 jtv, ok := value.(string) 15658 if !ok { 15659 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15660 } 15661 sv.ChangeToken = ptr.String(jtv) 15662 } 15663 15664 default: 15665 _, _ = key, value 15666 15667 } 15668 } 15669 *v = sv 15670 return nil 15671} 15672 15673func awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(v **DeleteLoggingConfigurationOutput, value interface{}) error { 15674 if v == nil { 15675 return fmt.Errorf("unexpected nil of type %T", v) 15676 } 15677 if value == nil { 15678 return nil 15679 } 15680 15681 shape, ok := value.(map[string]interface{}) 15682 if !ok { 15683 return fmt.Errorf("unexpected JSON type %v", value) 15684 } 15685 15686 var sv *DeleteLoggingConfigurationOutput 15687 if *v == nil { 15688 sv = &DeleteLoggingConfigurationOutput{} 15689 } else { 15690 sv = *v 15691 } 15692 15693 for key, value := range shape { 15694 switch key { 15695 default: 15696 _, _ = key, value 15697 15698 } 15699 } 15700 *v = sv 15701 return nil 15702} 15703 15704func awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(v **DeletePermissionPolicyOutput, value interface{}) error { 15705 if v == nil { 15706 return fmt.Errorf("unexpected nil of type %T", v) 15707 } 15708 if value == nil { 15709 return nil 15710 } 15711 15712 shape, ok := value.(map[string]interface{}) 15713 if !ok { 15714 return fmt.Errorf("unexpected JSON type %v", value) 15715 } 15716 15717 var sv *DeletePermissionPolicyOutput 15718 if *v == nil { 15719 sv = &DeletePermissionPolicyOutput{} 15720 } else { 15721 sv = *v 15722 } 15723 15724 for key, value := range shape { 15725 switch key { 15726 default: 15727 _, _ = key, value 15728 15729 } 15730 } 15731 *v = sv 15732 return nil 15733} 15734 15735func awsAwsjson11_deserializeOpDocumentDeleteRateBasedRuleOutput(v **DeleteRateBasedRuleOutput, value interface{}) error { 15736 if v == nil { 15737 return fmt.Errorf("unexpected nil of type %T", v) 15738 } 15739 if value == nil { 15740 return nil 15741 } 15742 15743 shape, ok := value.(map[string]interface{}) 15744 if !ok { 15745 return fmt.Errorf("unexpected JSON type %v", value) 15746 } 15747 15748 var sv *DeleteRateBasedRuleOutput 15749 if *v == nil { 15750 sv = &DeleteRateBasedRuleOutput{} 15751 } else { 15752 sv = *v 15753 } 15754 15755 for key, value := range shape { 15756 switch key { 15757 case "ChangeToken": 15758 if value != nil { 15759 jtv, ok := value.(string) 15760 if !ok { 15761 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15762 } 15763 sv.ChangeToken = ptr.String(jtv) 15764 } 15765 15766 default: 15767 _, _ = key, value 15768 15769 } 15770 } 15771 *v = sv 15772 return nil 15773} 15774 15775func awsAwsjson11_deserializeOpDocumentDeleteRegexMatchSetOutput(v **DeleteRegexMatchSetOutput, value interface{}) error { 15776 if v == nil { 15777 return fmt.Errorf("unexpected nil of type %T", v) 15778 } 15779 if value == nil { 15780 return nil 15781 } 15782 15783 shape, ok := value.(map[string]interface{}) 15784 if !ok { 15785 return fmt.Errorf("unexpected JSON type %v", value) 15786 } 15787 15788 var sv *DeleteRegexMatchSetOutput 15789 if *v == nil { 15790 sv = &DeleteRegexMatchSetOutput{} 15791 } else { 15792 sv = *v 15793 } 15794 15795 for key, value := range shape { 15796 switch key { 15797 case "ChangeToken": 15798 if value != nil { 15799 jtv, ok := value.(string) 15800 if !ok { 15801 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15802 } 15803 sv.ChangeToken = ptr.String(jtv) 15804 } 15805 15806 default: 15807 _, _ = key, value 15808 15809 } 15810 } 15811 *v = sv 15812 return nil 15813} 15814 15815func awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(v **DeleteRegexPatternSetOutput, value interface{}) error { 15816 if v == nil { 15817 return fmt.Errorf("unexpected nil of type %T", v) 15818 } 15819 if value == nil { 15820 return nil 15821 } 15822 15823 shape, ok := value.(map[string]interface{}) 15824 if !ok { 15825 return fmt.Errorf("unexpected JSON type %v", value) 15826 } 15827 15828 var sv *DeleteRegexPatternSetOutput 15829 if *v == nil { 15830 sv = &DeleteRegexPatternSetOutput{} 15831 } else { 15832 sv = *v 15833 } 15834 15835 for key, value := range shape { 15836 switch key { 15837 case "ChangeToken": 15838 if value != nil { 15839 jtv, ok := value.(string) 15840 if !ok { 15841 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15842 } 15843 sv.ChangeToken = ptr.String(jtv) 15844 } 15845 15846 default: 15847 _, _ = key, value 15848 15849 } 15850 } 15851 *v = sv 15852 return nil 15853} 15854 15855func awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(v **DeleteRuleGroupOutput, value interface{}) error { 15856 if v == nil { 15857 return fmt.Errorf("unexpected nil of type %T", v) 15858 } 15859 if value == nil { 15860 return nil 15861 } 15862 15863 shape, ok := value.(map[string]interface{}) 15864 if !ok { 15865 return fmt.Errorf("unexpected JSON type %v", value) 15866 } 15867 15868 var sv *DeleteRuleGroupOutput 15869 if *v == nil { 15870 sv = &DeleteRuleGroupOutput{} 15871 } else { 15872 sv = *v 15873 } 15874 15875 for key, value := range shape { 15876 switch key { 15877 case "ChangeToken": 15878 if value != nil { 15879 jtv, ok := value.(string) 15880 if !ok { 15881 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15882 } 15883 sv.ChangeToken = ptr.String(jtv) 15884 } 15885 15886 default: 15887 _, _ = key, value 15888 15889 } 15890 } 15891 *v = sv 15892 return nil 15893} 15894 15895func awsAwsjson11_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, value interface{}) error { 15896 if v == nil { 15897 return fmt.Errorf("unexpected nil of type %T", v) 15898 } 15899 if value == nil { 15900 return nil 15901 } 15902 15903 shape, ok := value.(map[string]interface{}) 15904 if !ok { 15905 return fmt.Errorf("unexpected JSON type %v", value) 15906 } 15907 15908 var sv *DeleteRuleOutput 15909 if *v == nil { 15910 sv = &DeleteRuleOutput{} 15911 } else { 15912 sv = *v 15913 } 15914 15915 for key, value := range shape { 15916 switch key { 15917 case "ChangeToken": 15918 if value != nil { 15919 jtv, ok := value.(string) 15920 if !ok { 15921 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15922 } 15923 sv.ChangeToken = ptr.String(jtv) 15924 } 15925 15926 default: 15927 _, _ = key, value 15928 15929 } 15930 } 15931 *v = sv 15932 return nil 15933} 15934 15935func awsAwsjson11_deserializeOpDocumentDeleteSizeConstraintSetOutput(v **DeleteSizeConstraintSetOutput, value interface{}) error { 15936 if v == nil { 15937 return fmt.Errorf("unexpected nil of type %T", v) 15938 } 15939 if value == nil { 15940 return nil 15941 } 15942 15943 shape, ok := value.(map[string]interface{}) 15944 if !ok { 15945 return fmt.Errorf("unexpected JSON type %v", value) 15946 } 15947 15948 var sv *DeleteSizeConstraintSetOutput 15949 if *v == nil { 15950 sv = &DeleteSizeConstraintSetOutput{} 15951 } else { 15952 sv = *v 15953 } 15954 15955 for key, value := range shape { 15956 switch key { 15957 case "ChangeToken": 15958 if value != nil { 15959 jtv, ok := value.(string) 15960 if !ok { 15961 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 15962 } 15963 sv.ChangeToken = ptr.String(jtv) 15964 } 15965 15966 default: 15967 _, _ = key, value 15968 15969 } 15970 } 15971 *v = sv 15972 return nil 15973} 15974 15975func awsAwsjson11_deserializeOpDocumentDeleteSqlInjectionMatchSetOutput(v **DeleteSqlInjectionMatchSetOutput, value interface{}) error { 15976 if v == nil { 15977 return fmt.Errorf("unexpected nil of type %T", v) 15978 } 15979 if value == nil { 15980 return nil 15981 } 15982 15983 shape, ok := value.(map[string]interface{}) 15984 if !ok { 15985 return fmt.Errorf("unexpected JSON type %v", value) 15986 } 15987 15988 var sv *DeleteSqlInjectionMatchSetOutput 15989 if *v == nil { 15990 sv = &DeleteSqlInjectionMatchSetOutput{} 15991 } else { 15992 sv = *v 15993 } 15994 15995 for key, value := range shape { 15996 switch key { 15997 case "ChangeToken": 15998 if value != nil { 15999 jtv, ok := value.(string) 16000 if !ok { 16001 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 16002 } 16003 sv.ChangeToken = ptr.String(jtv) 16004 } 16005 16006 default: 16007 _, _ = key, value 16008 16009 } 16010 } 16011 *v = sv 16012 return nil 16013} 16014 16015func awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(v **DeleteWebACLOutput, value interface{}) error { 16016 if v == nil { 16017 return fmt.Errorf("unexpected nil of type %T", v) 16018 } 16019 if value == nil { 16020 return nil 16021 } 16022 16023 shape, ok := value.(map[string]interface{}) 16024 if !ok { 16025 return fmt.Errorf("unexpected JSON type %v", value) 16026 } 16027 16028 var sv *DeleteWebACLOutput 16029 if *v == nil { 16030 sv = &DeleteWebACLOutput{} 16031 } else { 16032 sv = *v 16033 } 16034 16035 for key, value := range shape { 16036 switch key { 16037 case "ChangeToken": 16038 if value != nil { 16039 jtv, ok := value.(string) 16040 if !ok { 16041 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 16042 } 16043 sv.ChangeToken = ptr.String(jtv) 16044 } 16045 16046 default: 16047 _, _ = key, value 16048 16049 } 16050 } 16051 *v = sv 16052 return nil 16053} 16054 16055func awsAwsjson11_deserializeOpDocumentDeleteXssMatchSetOutput(v **DeleteXssMatchSetOutput, value interface{}) error { 16056 if v == nil { 16057 return fmt.Errorf("unexpected nil of type %T", v) 16058 } 16059 if value == nil { 16060 return nil 16061 } 16062 16063 shape, ok := value.(map[string]interface{}) 16064 if !ok { 16065 return fmt.Errorf("unexpected JSON type %v", value) 16066 } 16067 16068 var sv *DeleteXssMatchSetOutput 16069 if *v == nil { 16070 sv = &DeleteXssMatchSetOutput{} 16071 } else { 16072 sv = *v 16073 } 16074 16075 for key, value := range shape { 16076 switch key { 16077 case "ChangeToken": 16078 if value != nil { 16079 jtv, ok := value.(string) 16080 if !ok { 16081 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 16082 } 16083 sv.ChangeToken = ptr.String(jtv) 16084 } 16085 16086 default: 16087 _, _ = key, value 16088 16089 } 16090 } 16091 *v = sv 16092 return nil 16093} 16094 16095func awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(v **DisassociateWebACLOutput, value interface{}) error { 16096 if v == nil { 16097 return fmt.Errorf("unexpected nil of type %T", v) 16098 } 16099 if value == nil { 16100 return nil 16101 } 16102 16103 shape, ok := value.(map[string]interface{}) 16104 if !ok { 16105 return fmt.Errorf("unexpected JSON type %v", value) 16106 } 16107 16108 var sv *DisassociateWebACLOutput 16109 if *v == nil { 16110 sv = &DisassociateWebACLOutput{} 16111 } else { 16112 sv = *v 16113 } 16114 16115 for key, value := range shape { 16116 switch key { 16117 default: 16118 _, _ = key, value 16119 16120 } 16121 } 16122 *v = sv 16123 return nil 16124} 16125 16126func awsAwsjson11_deserializeOpDocumentGetByteMatchSetOutput(v **GetByteMatchSetOutput, value interface{}) error { 16127 if v == nil { 16128 return fmt.Errorf("unexpected nil of type %T", v) 16129 } 16130 if value == nil { 16131 return nil 16132 } 16133 16134 shape, ok := value.(map[string]interface{}) 16135 if !ok { 16136 return fmt.Errorf("unexpected JSON type %v", value) 16137 } 16138 16139 var sv *GetByteMatchSetOutput 16140 if *v == nil { 16141 sv = &GetByteMatchSetOutput{} 16142 } else { 16143 sv = *v 16144 } 16145 16146 for key, value := range shape { 16147 switch key { 16148 case "ByteMatchSet": 16149 if err := awsAwsjson11_deserializeDocumentByteMatchSet(&sv.ByteMatchSet, value); err != nil { 16150 return err 16151 } 16152 16153 default: 16154 _, _ = key, value 16155 16156 } 16157 } 16158 *v = sv 16159 return nil 16160} 16161 16162func awsAwsjson11_deserializeOpDocumentGetChangeTokenOutput(v **GetChangeTokenOutput, value interface{}) error { 16163 if v == nil { 16164 return fmt.Errorf("unexpected nil of type %T", v) 16165 } 16166 if value == nil { 16167 return nil 16168 } 16169 16170 shape, ok := value.(map[string]interface{}) 16171 if !ok { 16172 return fmt.Errorf("unexpected JSON type %v", value) 16173 } 16174 16175 var sv *GetChangeTokenOutput 16176 if *v == nil { 16177 sv = &GetChangeTokenOutput{} 16178 } else { 16179 sv = *v 16180 } 16181 16182 for key, value := range shape { 16183 switch key { 16184 case "ChangeToken": 16185 if value != nil { 16186 jtv, ok := value.(string) 16187 if !ok { 16188 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 16189 } 16190 sv.ChangeToken = ptr.String(jtv) 16191 } 16192 16193 default: 16194 _, _ = key, value 16195 16196 } 16197 } 16198 *v = sv 16199 return nil 16200} 16201 16202func awsAwsjson11_deserializeOpDocumentGetChangeTokenStatusOutput(v **GetChangeTokenStatusOutput, value interface{}) error { 16203 if v == nil { 16204 return fmt.Errorf("unexpected nil of type %T", v) 16205 } 16206 if value == nil { 16207 return nil 16208 } 16209 16210 shape, ok := value.(map[string]interface{}) 16211 if !ok { 16212 return fmt.Errorf("unexpected JSON type %v", value) 16213 } 16214 16215 var sv *GetChangeTokenStatusOutput 16216 if *v == nil { 16217 sv = &GetChangeTokenStatusOutput{} 16218 } else { 16219 sv = *v 16220 } 16221 16222 for key, value := range shape { 16223 switch key { 16224 case "ChangeTokenStatus": 16225 if value != nil { 16226 jtv, ok := value.(string) 16227 if !ok { 16228 return fmt.Errorf("expected ChangeTokenStatus to be of type string, got %T instead", value) 16229 } 16230 sv.ChangeTokenStatus = types.ChangeTokenStatus(jtv) 16231 } 16232 16233 default: 16234 _, _ = key, value 16235 16236 } 16237 } 16238 *v = sv 16239 return nil 16240} 16241 16242func awsAwsjson11_deserializeOpDocumentGetGeoMatchSetOutput(v **GetGeoMatchSetOutput, value interface{}) error { 16243 if v == nil { 16244 return fmt.Errorf("unexpected nil of type %T", v) 16245 } 16246 if value == nil { 16247 return nil 16248 } 16249 16250 shape, ok := value.(map[string]interface{}) 16251 if !ok { 16252 return fmt.Errorf("unexpected JSON type %v", value) 16253 } 16254 16255 var sv *GetGeoMatchSetOutput 16256 if *v == nil { 16257 sv = &GetGeoMatchSetOutput{} 16258 } else { 16259 sv = *v 16260 } 16261 16262 for key, value := range shape { 16263 switch key { 16264 case "GeoMatchSet": 16265 if err := awsAwsjson11_deserializeDocumentGeoMatchSet(&sv.GeoMatchSet, value); err != nil { 16266 return err 16267 } 16268 16269 default: 16270 _, _ = key, value 16271 16272 } 16273 } 16274 *v = sv 16275 return nil 16276} 16277 16278func awsAwsjson11_deserializeOpDocumentGetIPSetOutput(v **GetIPSetOutput, value interface{}) error { 16279 if v == nil { 16280 return fmt.Errorf("unexpected nil of type %T", v) 16281 } 16282 if value == nil { 16283 return nil 16284 } 16285 16286 shape, ok := value.(map[string]interface{}) 16287 if !ok { 16288 return fmt.Errorf("unexpected JSON type %v", value) 16289 } 16290 16291 var sv *GetIPSetOutput 16292 if *v == nil { 16293 sv = &GetIPSetOutput{} 16294 } else { 16295 sv = *v 16296 } 16297 16298 for key, value := range shape { 16299 switch key { 16300 case "IPSet": 16301 if err := awsAwsjson11_deserializeDocumentIPSet(&sv.IPSet, value); err != nil { 16302 return err 16303 } 16304 16305 default: 16306 _, _ = key, value 16307 16308 } 16309 } 16310 *v = sv 16311 return nil 16312} 16313 16314func awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(v **GetLoggingConfigurationOutput, value interface{}) error { 16315 if v == nil { 16316 return fmt.Errorf("unexpected nil of type %T", v) 16317 } 16318 if value == nil { 16319 return nil 16320 } 16321 16322 shape, ok := value.(map[string]interface{}) 16323 if !ok { 16324 return fmt.Errorf("unexpected JSON type %v", value) 16325 } 16326 16327 var sv *GetLoggingConfigurationOutput 16328 if *v == nil { 16329 sv = &GetLoggingConfigurationOutput{} 16330 } else { 16331 sv = *v 16332 } 16333 16334 for key, value := range shape { 16335 switch key { 16336 case "LoggingConfiguration": 16337 if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { 16338 return err 16339 } 16340 16341 default: 16342 _, _ = key, value 16343 16344 } 16345 } 16346 *v = sv 16347 return nil 16348} 16349 16350func awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(v **GetPermissionPolicyOutput, value interface{}) error { 16351 if v == nil { 16352 return fmt.Errorf("unexpected nil of type %T", v) 16353 } 16354 if value == nil { 16355 return nil 16356 } 16357 16358 shape, ok := value.(map[string]interface{}) 16359 if !ok { 16360 return fmt.Errorf("unexpected JSON type %v", value) 16361 } 16362 16363 var sv *GetPermissionPolicyOutput 16364 if *v == nil { 16365 sv = &GetPermissionPolicyOutput{} 16366 } else { 16367 sv = *v 16368 } 16369 16370 for key, value := range shape { 16371 switch key { 16372 case "Policy": 16373 if value != nil { 16374 jtv, ok := value.(string) 16375 if !ok { 16376 return fmt.Errorf("expected PolicyString to be of type string, got %T instead", value) 16377 } 16378 sv.Policy = ptr.String(jtv) 16379 } 16380 16381 default: 16382 _, _ = key, value 16383 16384 } 16385 } 16386 *v = sv 16387 return nil 16388} 16389 16390func awsAwsjson11_deserializeOpDocumentGetRateBasedRuleManagedKeysOutput(v **GetRateBasedRuleManagedKeysOutput, value interface{}) error { 16391 if v == nil { 16392 return fmt.Errorf("unexpected nil of type %T", v) 16393 } 16394 if value == nil { 16395 return nil 16396 } 16397 16398 shape, ok := value.(map[string]interface{}) 16399 if !ok { 16400 return fmt.Errorf("unexpected JSON type %v", value) 16401 } 16402 16403 var sv *GetRateBasedRuleManagedKeysOutput 16404 if *v == nil { 16405 sv = &GetRateBasedRuleManagedKeysOutput{} 16406 } else { 16407 sv = *v 16408 } 16409 16410 for key, value := range shape { 16411 switch key { 16412 case "ManagedKeys": 16413 if err := awsAwsjson11_deserializeDocumentManagedKeys(&sv.ManagedKeys, value); err != nil { 16414 return err 16415 } 16416 16417 case "NextMarker": 16418 if value != nil { 16419 jtv, ok := value.(string) 16420 if !ok { 16421 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 16422 } 16423 sv.NextMarker = ptr.String(jtv) 16424 } 16425 16426 default: 16427 _, _ = key, value 16428 16429 } 16430 } 16431 *v = sv 16432 return nil 16433} 16434 16435func awsAwsjson11_deserializeOpDocumentGetRateBasedRuleOutput(v **GetRateBasedRuleOutput, value interface{}) error { 16436 if v == nil { 16437 return fmt.Errorf("unexpected nil of type %T", v) 16438 } 16439 if value == nil { 16440 return nil 16441 } 16442 16443 shape, ok := value.(map[string]interface{}) 16444 if !ok { 16445 return fmt.Errorf("unexpected JSON type %v", value) 16446 } 16447 16448 var sv *GetRateBasedRuleOutput 16449 if *v == nil { 16450 sv = &GetRateBasedRuleOutput{} 16451 } else { 16452 sv = *v 16453 } 16454 16455 for key, value := range shape { 16456 switch key { 16457 case "Rule": 16458 if err := awsAwsjson11_deserializeDocumentRateBasedRule(&sv.Rule, value); err != nil { 16459 return err 16460 } 16461 16462 default: 16463 _, _ = key, value 16464 16465 } 16466 } 16467 *v = sv 16468 return nil 16469} 16470 16471func awsAwsjson11_deserializeOpDocumentGetRegexMatchSetOutput(v **GetRegexMatchSetOutput, value interface{}) error { 16472 if v == nil { 16473 return fmt.Errorf("unexpected nil of type %T", v) 16474 } 16475 if value == nil { 16476 return nil 16477 } 16478 16479 shape, ok := value.(map[string]interface{}) 16480 if !ok { 16481 return fmt.Errorf("unexpected JSON type %v", value) 16482 } 16483 16484 var sv *GetRegexMatchSetOutput 16485 if *v == nil { 16486 sv = &GetRegexMatchSetOutput{} 16487 } else { 16488 sv = *v 16489 } 16490 16491 for key, value := range shape { 16492 switch key { 16493 case "RegexMatchSet": 16494 if err := awsAwsjson11_deserializeDocumentRegexMatchSet(&sv.RegexMatchSet, value); err != nil { 16495 return err 16496 } 16497 16498 default: 16499 _, _ = key, value 16500 16501 } 16502 } 16503 *v = sv 16504 return nil 16505} 16506 16507func awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(v **GetRegexPatternSetOutput, value interface{}) error { 16508 if v == nil { 16509 return fmt.Errorf("unexpected nil of type %T", v) 16510 } 16511 if value == nil { 16512 return nil 16513 } 16514 16515 shape, ok := value.(map[string]interface{}) 16516 if !ok { 16517 return fmt.Errorf("unexpected JSON type %v", value) 16518 } 16519 16520 var sv *GetRegexPatternSetOutput 16521 if *v == nil { 16522 sv = &GetRegexPatternSetOutput{} 16523 } else { 16524 sv = *v 16525 } 16526 16527 for key, value := range shape { 16528 switch key { 16529 case "RegexPatternSet": 16530 if err := awsAwsjson11_deserializeDocumentRegexPatternSet(&sv.RegexPatternSet, value); err != nil { 16531 return err 16532 } 16533 16534 default: 16535 _, _ = key, value 16536 16537 } 16538 } 16539 *v = sv 16540 return nil 16541} 16542 16543func awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(v **GetRuleGroupOutput, value interface{}) error { 16544 if v == nil { 16545 return fmt.Errorf("unexpected nil of type %T", v) 16546 } 16547 if value == nil { 16548 return nil 16549 } 16550 16551 shape, ok := value.(map[string]interface{}) 16552 if !ok { 16553 return fmt.Errorf("unexpected JSON type %v", value) 16554 } 16555 16556 var sv *GetRuleGroupOutput 16557 if *v == nil { 16558 sv = &GetRuleGroupOutput{} 16559 } else { 16560 sv = *v 16561 } 16562 16563 for key, value := range shape { 16564 switch key { 16565 case "RuleGroup": 16566 if err := awsAwsjson11_deserializeDocumentRuleGroup(&sv.RuleGroup, value); err != nil { 16567 return err 16568 } 16569 16570 default: 16571 _, _ = key, value 16572 16573 } 16574 } 16575 *v = sv 16576 return nil 16577} 16578 16579func awsAwsjson11_deserializeOpDocumentGetRuleOutput(v **GetRuleOutput, value interface{}) error { 16580 if v == nil { 16581 return fmt.Errorf("unexpected nil of type %T", v) 16582 } 16583 if value == nil { 16584 return nil 16585 } 16586 16587 shape, ok := value.(map[string]interface{}) 16588 if !ok { 16589 return fmt.Errorf("unexpected JSON type %v", value) 16590 } 16591 16592 var sv *GetRuleOutput 16593 if *v == nil { 16594 sv = &GetRuleOutput{} 16595 } else { 16596 sv = *v 16597 } 16598 16599 for key, value := range shape { 16600 switch key { 16601 case "Rule": 16602 if err := awsAwsjson11_deserializeDocumentRule(&sv.Rule, value); err != nil { 16603 return err 16604 } 16605 16606 default: 16607 _, _ = key, value 16608 16609 } 16610 } 16611 *v = sv 16612 return nil 16613} 16614 16615func awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(v **GetSampledRequestsOutput, value interface{}) error { 16616 if v == nil { 16617 return fmt.Errorf("unexpected nil of type %T", v) 16618 } 16619 if value == nil { 16620 return nil 16621 } 16622 16623 shape, ok := value.(map[string]interface{}) 16624 if !ok { 16625 return fmt.Errorf("unexpected JSON type %v", value) 16626 } 16627 16628 var sv *GetSampledRequestsOutput 16629 if *v == nil { 16630 sv = &GetSampledRequestsOutput{} 16631 } else { 16632 sv = *v 16633 } 16634 16635 for key, value := range shape { 16636 switch key { 16637 case "PopulationSize": 16638 if value != nil { 16639 jtv, ok := value.(json.Number) 16640 if !ok { 16641 return fmt.Errorf("expected PopulationSize to be json.Number, got %T instead", value) 16642 } 16643 i64, err := jtv.Int64() 16644 if err != nil { 16645 return err 16646 } 16647 sv.PopulationSize = i64 16648 } 16649 16650 case "SampledRequests": 16651 if err := awsAwsjson11_deserializeDocumentSampledHTTPRequests(&sv.SampledRequests, value); err != nil { 16652 return err 16653 } 16654 16655 case "TimeWindow": 16656 if err := awsAwsjson11_deserializeDocumentTimeWindow(&sv.TimeWindow, value); err != nil { 16657 return err 16658 } 16659 16660 default: 16661 _, _ = key, value 16662 16663 } 16664 } 16665 *v = sv 16666 return nil 16667} 16668 16669func awsAwsjson11_deserializeOpDocumentGetSizeConstraintSetOutput(v **GetSizeConstraintSetOutput, value interface{}) error { 16670 if v == nil { 16671 return fmt.Errorf("unexpected nil of type %T", v) 16672 } 16673 if value == nil { 16674 return nil 16675 } 16676 16677 shape, ok := value.(map[string]interface{}) 16678 if !ok { 16679 return fmt.Errorf("unexpected JSON type %v", value) 16680 } 16681 16682 var sv *GetSizeConstraintSetOutput 16683 if *v == nil { 16684 sv = &GetSizeConstraintSetOutput{} 16685 } else { 16686 sv = *v 16687 } 16688 16689 for key, value := range shape { 16690 switch key { 16691 case "SizeConstraintSet": 16692 if err := awsAwsjson11_deserializeDocumentSizeConstraintSet(&sv.SizeConstraintSet, value); err != nil { 16693 return err 16694 } 16695 16696 default: 16697 _, _ = key, value 16698 16699 } 16700 } 16701 *v = sv 16702 return nil 16703} 16704 16705func awsAwsjson11_deserializeOpDocumentGetSqlInjectionMatchSetOutput(v **GetSqlInjectionMatchSetOutput, value interface{}) error { 16706 if v == nil { 16707 return fmt.Errorf("unexpected nil of type %T", v) 16708 } 16709 if value == nil { 16710 return nil 16711 } 16712 16713 shape, ok := value.(map[string]interface{}) 16714 if !ok { 16715 return fmt.Errorf("unexpected JSON type %v", value) 16716 } 16717 16718 var sv *GetSqlInjectionMatchSetOutput 16719 if *v == nil { 16720 sv = &GetSqlInjectionMatchSetOutput{} 16721 } else { 16722 sv = *v 16723 } 16724 16725 for key, value := range shape { 16726 switch key { 16727 case "SqlInjectionMatchSet": 16728 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(&sv.SqlInjectionMatchSet, value); err != nil { 16729 return err 16730 } 16731 16732 default: 16733 _, _ = key, value 16734 16735 } 16736 } 16737 *v = sv 16738 return nil 16739} 16740 16741func awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(v **GetWebACLForResourceOutput, value interface{}) error { 16742 if v == nil { 16743 return fmt.Errorf("unexpected nil of type %T", v) 16744 } 16745 if value == nil { 16746 return nil 16747 } 16748 16749 shape, ok := value.(map[string]interface{}) 16750 if !ok { 16751 return fmt.Errorf("unexpected JSON type %v", value) 16752 } 16753 16754 var sv *GetWebACLForResourceOutput 16755 if *v == nil { 16756 sv = &GetWebACLForResourceOutput{} 16757 } else { 16758 sv = *v 16759 } 16760 16761 for key, value := range shape { 16762 switch key { 16763 case "WebACLSummary": 16764 if err := awsAwsjson11_deserializeDocumentWebACLSummary(&sv.WebACLSummary, value); err != nil { 16765 return err 16766 } 16767 16768 default: 16769 _, _ = key, value 16770 16771 } 16772 } 16773 *v = sv 16774 return nil 16775} 16776 16777func awsAwsjson11_deserializeOpDocumentGetWebACLOutput(v **GetWebACLOutput, value interface{}) error { 16778 if v == nil { 16779 return fmt.Errorf("unexpected nil of type %T", v) 16780 } 16781 if value == nil { 16782 return nil 16783 } 16784 16785 shape, ok := value.(map[string]interface{}) 16786 if !ok { 16787 return fmt.Errorf("unexpected JSON type %v", value) 16788 } 16789 16790 var sv *GetWebACLOutput 16791 if *v == nil { 16792 sv = &GetWebACLOutput{} 16793 } else { 16794 sv = *v 16795 } 16796 16797 for key, value := range shape { 16798 switch key { 16799 case "WebACL": 16800 if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil { 16801 return err 16802 } 16803 16804 default: 16805 _, _ = key, value 16806 16807 } 16808 } 16809 *v = sv 16810 return nil 16811} 16812 16813func awsAwsjson11_deserializeOpDocumentGetXssMatchSetOutput(v **GetXssMatchSetOutput, value interface{}) error { 16814 if v == nil { 16815 return fmt.Errorf("unexpected nil of type %T", v) 16816 } 16817 if value == nil { 16818 return nil 16819 } 16820 16821 shape, ok := value.(map[string]interface{}) 16822 if !ok { 16823 return fmt.Errorf("unexpected JSON type %v", value) 16824 } 16825 16826 var sv *GetXssMatchSetOutput 16827 if *v == nil { 16828 sv = &GetXssMatchSetOutput{} 16829 } else { 16830 sv = *v 16831 } 16832 16833 for key, value := range shape { 16834 switch key { 16835 case "XssMatchSet": 16836 if err := awsAwsjson11_deserializeDocumentXssMatchSet(&sv.XssMatchSet, value); err != nil { 16837 return err 16838 } 16839 16840 default: 16841 _, _ = key, value 16842 16843 } 16844 } 16845 *v = sv 16846 return nil 16847} 16848 16849func awsAwsjson11_deserializeOpDocumentListActivatedRulesInRuleGroupOutput(v **ListActivatedRulesInRuleGroupOutput, value interface{}) error { 16850 if v == nil { 16851 return fmt.Errorf("unexpected nil of type %T", v) 16852 } 16853 if value == nil { 16854 return nil 16855 } 16856 16857 shape, ok := value.(map[string]interface{}) 16858 if !ok { 16859 return fmt.Errorf("unexpected JSON type %v", value) 16860 } 16861 16862 var sv *ListActivatedRulesInRuleGroupOutput 16863 if *v == nil { 16864 sv = &ListActivatedRulesInRuleGroupOutput{} 16865 } else { 16866 sv = *v 16867 } 16868 16869 for key, value := range shape { 16870 switch key { 16871 case "ActivatedRules": 16872 if err := awsAwsjson11_deserializeDocumentActivatedRules(&sv.ActivatedRules, value); err != nil { 16873 return err 16874 } 16875 16876 case "NextMarker": 16877 if value != nil { 16878 jtv, ok := value.(string) 16879 if !ok { 16880 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 16881 } 16882 sv.NextMarker = ptr.String(jtv) 16883 } 16884 16885 default: 16886 _, _ = key, value 16887 16888 } 16889 } 16890 *v = sv 16891 return nil 16892} 16893 16894func awsAwsjson11_deserializeOpDocumentListByteMatchSetsOutput(v **ListByteMatchSetsOutput, value interface{}) error { 16895 if v == nil { 16896 return fmt.Errorf("unexpected nil of type %T", v) 16897 } 16898 if value == nil { 16899 return nil 16900 } 16901 16902 shape, ok := value.(map[string]interface{}) 16903 if !ok { 16904 return fmt.Errorf("unexpected JSON type %v", value) 16905 } 16906 16907 var sv *ListByteMatchSetsOutput 16908 if *v == nil { 16909 sv = &ListByteMatchSetsOutput{} 16910 } else { 16911 sv = *v 16912 } 16913 16914 for key, value := range shape { 16915 switch key { 16916 case "ByteMatchSets": 16917 if err := awsAwsjson11_deserializeDocumentByteMatchSetSummaries(&sv.ByteMatchSets, value); err != nil { 16918 return err 16919 } 16920 16921 case "NextMarker": 16922 if value != nil { 16923 jtv, ok := value.(string) 16924 if !ok { 16925 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 16926 } 16927 sv.NextMarker = ptr.String(jtv) 16928 } 16929 16930 default: 16931 _, _ = key, value 16932 16933 } 16934 } 16935 *v = sv 16936 return nil 16937} 16938 16939func awsAwsjson11_deserializeOpDocumentListGeoMatchSetsOutput(v **ListGeoMatchSetsOutput, value interface{}) error { 16940 if v == nil { 16941 return fmt.Errorf("unexpected nil of type %T", v) 16942 } 16943 if value == nil { 16944 return nil 16945 } 16946 16947 shape, ok := value.(map[string]interface{}) 16948 if !ok { 16949 return fmt.Errorf("unexpected JSON type %v", value) 16950 } 16951 16952 var sv *ListGeoMatchSetsOutput 16953 if *v == nil { 16954 sv = &ListGeoMatchSetsOutput{} 16955 } else { 16956 sv = *v 16957 } 16958 16959 for key, value := range shape { 16960 switch key { 16961 case "GeoMatchSets": 16962 if err := awsAwsjson11_deserializeDocumentGeoMatchSetSummaries(&sv.GeoMatchSets, value); err != nil { 16963 return err 16964 } 16965 16966 case "NextMarker": 16967 if value != nil { 16968 jtv, ok := value.(string) 16969 if !ok { 16970 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 16971 } 16972 sv.NextMarker = ptr.String(jtv) 16973 } 16974 16975 default: 16976 _, _ = key, value 16977 16978 } 16979 } 16980 *v = sv 16981 return nil 16982} 16983 16984func awsAwsjson11_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, value interface{}) error { 16985 if v == nil { 16986 return fmt.Errorf("unexpected nil of type %T", v) 16987 } 16988 if value == nil { 16989 return nil 16990 } 16991 16992 shape, ok := value.(map[string]interface{}) 16993 if !ok { 16994 return fmt.Errorf("unexpected JSON type %v", value) 16995 } 16996 16997 var sv *ListIPSetsOutput 16998 if *v == nil { 16999 sv = &ListIPSetsOutput{} 17000 } else { 17001 sv = *v 17002 } 17003 17004 for key, value := range shape { 17005 switch key { 17006 case "IPSets": 17007 if err := awsAwsjson11_deserializeDocumentIPSetSummaries(&sv.IPSets, value); err != nil { 17008 return err 17009 } 17010 17011 case "NextMarker": 17012 if value != nil { 17013 jtv, ok := value.(string) 17014 if !ok { 17015 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17016 } 17017 sv.NextMarker = ptr.String(jtv) 17018 } 17019 17020 default: 17021 _, _ = key, value 17022 17023 } 17024 } 17025 *v = sv 17026 return nil 17027} 17028 17029func awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(v **ListLoggingConfigurationsOutput, value interface{}) error { 17030 if v == nil { 17031 return fmt.Errorf("unexpected nil of type %T", v) 17032 } 17033 if value == nil { 17034 return nil 17035 } 17036 17037 shape, ok := value.(map[string]interface{}) 17038 if !ok { 17039 return fmt.Errorf("unexpected JSON type %v", value) 17040 } 17041 17042 var sv *ListLoggingConfigurationsOutput 17043 if *v == nil { 17044 sv = &ListLoggingConfigurationsOutput{} 17045 } else { 17046 sv = *v 17047 } 17048 17049 for key, value := range shape { 17050 switch key { 17051 case "LoggingConfigurations": 17052 if err := awsAwsjson11_deserializeDocumentLoggingConfigurations(&sv.LoggingConfigurations, value); err != nil { 17053 return err 17054 } 17055 17056 case "NextMarker": 17057 if value != nil { 17058 jtv, ok := value.(string) 17059 if !ok { 17060 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17061 } 17062 sv.NextMarker = ptr.String(jtv) 17063 } 17064 17065 default: 17066 _, _ = key, value 17067 17068 } 17069 } 17070 *v = sv 17071 return nil 17072} 17073 17074func awsAwsjson11_deserializeOpDocumentListRateBasedRulesOutput(v **ListRateBasedRulesOutput, value interface{}) error { 17075 if v == nil { 17076 return fmt.Errorf("unexpected nil of type %T", v) 17077 } 17078 if value == nil { 17079 return nil 17080 } 17081 17082 shape, ok := value.(map[string]interface{}) 17083 if !ok { 17084 return fmt.Errorf("unexpected JSON type %v", value) 17085 } 17086 17087 var sv *ListRateBasedRulesOutput 17088 if *v == nil { 17089 sv = &ListRateBasedRulesOutput{} 17090 } else { 17091 sv = *v 17092 } 17093 17094 for key, value := range shape { 17095 switch key { 17096 case "NextMarker": 17097 if value != nil { 17098 jtv, ok := value.(string) 17099 if !ok { 17100 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17101 } 17102 sv.NextMarker = ptr.String(jtv) 17103 } 17104 17105 case "Rules": 17106 if err := awsAwsjson11_deserializeDocumentRuleSummaries(&sv.Rules, value); err != nil { 17107 return err 17108 } 17109 17110 default: 17111 _, _ = key, value 17112 17113 } 17114 } 17115 *v = sv 17116 return nil 17117} 17118 17119func awsAwsjson11_deserializeOpDocumentListRegexMatchSetsOutput(v **ListRegexMatchSetsOutput, value interface{}) error { 17120 if v == nil { 17121 return fmt.Errorf("unexpected nil of type %T", v) 17122 } 17123 if value == nil { 17124 return nil 17125 } 17126 17127 shape, ok := value.(map[string]interface{}) 17128 if !ok { 17129 return fmt.Errorf("unexpected JSON type %v", value) 17130 } 17131 17132 var sv *ListRegexMatchSetsOutput 17133 if *v == nil { 17134 sv = &ListRegexMatchSetsOutput{} 17135 } else { 17136 sv = *v 17137 } 17138 17139 for key, value := range shape { 17140 switch key { 17141 case "NextMarker": 17142 if value != nil { 17143 jtv, ok := value.(string) 17144 if !ok { 17145 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17146 } 17147 sv.NextMarker = ptr.String(jtv) 17148 } 17149 17150 case "RegexMatchSets": 17151 if err := awsAwsjson11_deserializeDocumentRegexMatchSetSummaries(&sv.RegexMatchSets, value); err != nil { 17152 return err 17153 } 17154 17155 default: 17156 _, _ = key, value 17157 17158 } 17159 } 17160 *v = sv 17161 return nil 17162} 17163 17164func awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(v **ListRegexPatternSetsOutput, value interface{}) error { 17165 if v == nil { 17166 return fmt.Errorf("unexpected nil of type %T", v) 17167 } 17168 if value == nil { 17169 return nil 17170 } 17171 17172 shape, ok := value.(map[string]interface{}) 17173 if !ok { 17174 return fmt.Errorf("unexpected JSON type %v", value) 17175 } 17176 17177 var sv *ListRegexPatternSetsOutput 17178 if *v == nil { 17179 sv = &ListRegexPatternSetsOutput{} 17180 } else { 17181 sv = *v 17182 } 17183 17184 for key, value := range shape { 17185 switch key { 17186 case "NextMarker": 17187 if value != nil { 17188 jtv, ok := value.(string) 17189 if !ok { 17190 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17191 } 17192 sv.NextMarker = ptr.String(jtv) 17193 } 17194 17195 case "RegexPatternSets": 17196 if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(&sv.RegexPatternSets, value); err != nil { 17197 return err 17198 } 17199 17200 default: 17201 _, _ = key, value 17202 17203 } 17204 } 17205 *v = sv 17206 return nil 17207} 17208 17209func awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(v **ListResourcesForWebACLOutput, value interface{}) error { 17210 if v == nil { 17211 return fmt.Errorf("unexpected nil of type %T", v) 17212 } 17213 if value == nil { 17214 return nil 17215 } 17216 17217 shape, ok := value.(map[string]interface{}) 17218 if !ok { 17219 return fmt.Errorf("unexpected JSON type %v", value) 17220 } 17221 17222 var sv *ListResourcesForWebACLOutput 17223 if *v == nil { 17224 sv = &ListResourcesForWebACLOutput{} 17225 } else { 17226 sv = *v 17227 } 17228 17229 for key, value := range shape { 17230 switch key { 17231 case "ResourceArns": 17232 if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { 17233 return err 17234 } 17235 17236 default: 17237 _, _ = key, value 17238 17239 } 17240 } 17241 *v = sv 17242 return nil 17243} 17244 17245func awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(v **ListRuleGroupsOutput, value interface{}) error { 17246 if v == nil { 17247 return fmt.Errorf("unexpected nil of type %T", v) 17248 } 17249 if value == nil { 17250 return nil 17251 } 17252 17253 shape, ok := value.(map[string]interface{}) 17254 if !ok { 17255 return fmt.Errorf("unexpected JSON type %v", value) 17256 } 17257 17258 var sv *ListRuleGroupsOutput 17259 if *v == nil { 17260 sv = &ListRuleGroupsOutput{} 17261 } else { 17262 sv = *v 17263 } 17264 17265 for key, value := range shape { 17266 switch key { 17267 case "NextMarker": 17268 if value != nil { 17269 jtv, ok := value.(string) 17270 if !ok { 17271 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17272 } 17273 sv.NextMarker = ptr.String(jtv) 17274 } 17275 17276 case "RuleGroups": 17277 if err := awsAwsjson11_deserializeDocumentRuleGroupSummaries(&sv.RuleGroups, value); err != nil { 17278 return err 17279 } 17280 17281 default: 17282 _, _ = key, value 17283 17284 } 17285 } 17286 *v = sv 17287 return nil 17288} 17289 17290func awsAwsjson11_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, value interface{}) error { 17291 if v == nil { 17292 return fmt.Errorf("unexpected nil of type %T", v) 17293 } 17294 if value == nil { 17295 return nil 17296 } 17297 17298 shape, ok := value.(map[string]interface{}) 17299 if !ok { 17300 return fmt.Errorf("unexpected JSON type %v", value) 17301 } 17302 17303 var sv *ListRulesOutput 17304 if *v == nil { 17305 sv = &ListRulesOutput{} 17306 } else { 17307 sv = *v 17308 } 17309 17310 for key, value := range shape { 17311 switch key { 17312 case "NextMarker": 17313 if value != nil { 17314 jtv, ok := value.(string) 17315 if !ok { 17316 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17317 } 17318 sv.NextMarker = ptr.String(jtv) 17319 } 17320 17321 case "Rules": 17322 if err := awsAwsjson11_deserializeDocumentRuleSummaries(&sv.Rules, value); err != nil { 17323 return err 17324 } 17325 17326 default: 17327 _, _ = key, value 17328 17329 } 17330 } 17331 *v = sv 17332 return nil 17333} 17334 17335func awsAwsjson11_deserializeOpDocumentListSizeConstraintSetsOutput(v **ListSizeConstraintSetsOutput, value interface{}) error { 17336 if v == nil { 17337 return fmt.Errorf("unexpected nil of type %T", v) 17338 } 17339 if value == nil { 17340 return nil 17341 } 17342 17343 shape, ok := value.(map[string]interface{}) 17344 if !ok { 17345 return fmt.Errorf("unexpected JSON type %v", value) 17346 } 17347 17348 var sv *ListSizeConstraintSetsOutput 17349 if *v == nil { 17350 sv = &ListSizeConstraintSetsOutput{} 17351 } else { 17352 sv = *v 17353 } 17354 17355 for key, value := range shape { 17356 switch key { 17357 case "NextMarker": 17358 if value != nil { 17359 jtv, ok := value.(string) 17360 if !ok { 17361 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17362 } 17363 sv.NextMarker = ptr.String(jtv) 17364 } 17365 17366 case "SizeConstraintSets": 17367 if err := awsAwsjson11_deserializeDocumentSizeConstraintSetSummaries(&sv.SizeConstraintSets, value); err != nil { 17368 return err 17369 } 17370 17371 default: 17372 _, _ = key, value 17373 17374 } 17375 } 17376 *v = sv 17377 return nil 17378} 17379 17380func awsAwsjson11_deserializeOpDocumentListSqlInjectionMatchSetsOutput(v **ListSqlInjectionMatchSetsOutput, value interface{}) error { 17381 if v == nil { 17382 return fmt.Errorf("unexpected nil of type %T", v) 17383 } 17384 if value == nil { 17385 return nil 17386 } 17387 17388 shape, ok := value.(map[string]interface{}) 17389 if !ok { 17390 return fmt.Errorf("unexpected JSON type %v", value) 17391 } 17392 17393 var sv *ListSqlInjectionMatchSetsOutput 17394 if *v == nil { 17395 sv = &ListSqlInjectionMatchSetsOutput{} 17396 } else { 17397 sv = *v 17398 } 17399 17400 for key, value := range shape { 17401 switch key { 17402 case "NextMarker": 17403 if value != nil { 17404 jtv, ok := value.(string) 17405 if !ok { 17406 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17407 } 17408 sv.NextMarker = ptr.String(jtv) 17409 } 17410 17411 case "SqlInjectionMatchSets": 17412 if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummaries(&sv.SqlInjectionMatchSets, value); err != nil { 17413 return err 17414 } 17415 17416 default: 17417 _, _ = key, value 17418 17419 } 17420 } 17421 *v = sv 17422 return nil 17423} 17424 17425func awsAwsjson11_deserializeOpDocumentListSubscribedRuleGroupsOutput(v **ListSubscribedRuleGroupsOutput, value interface{}) error { 17426 if v == nil { 17427 return fmt.Errorf("unexpected nil of type %T", v) 17428 } 17429 if value == nil { 17430 return nil 17431 } 17432 17433 shape, ok := value.(map[string]interface{}) 17434 if !ok { 17435 return fmt.Errorf("unexpected JSON type %v", value) 17436 } 17437 17438 var sv *ListSubscribedRuleGroupsOutput 17439 if *v == nil { 17440 sv = &ListSubscribedRuleGroupsOutput{} 17441 } else { 17442 sv = *v 17443 } 17444 17445 for key, value := range shape { 17446 switch key { 17447 case "NextMarker": 17448 if value != nil { 17449 jtv, ok := value.(string) 17450 if !ok { 17451 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17452 } 17453 sv.NextMarker = ptr.String(jtv) 17454 } 17455 17456 case "RuleGroups": 17457 if err := awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummaries(&sv.RuleGroups, value); err != nil { 17458 return err 17459 } 17460 17461 default: 17462 _, _ = key, value 17463 17464 } 17465 } 17466 *v = sv 17467 return nil 17468} 17469 17470func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 17471 if v == nil { 17472 return fmt.Errorf("unexpected nil of type %T", v) 17473 } 17474 if value == nil { 17475 return nil 17476 } 17477 17478 shape, ok := value.(map[string]interface{}) 17479 if !ok { 17480 return fmt.Errorf("unexpected JSON type %v", value) 17481 } 17482 17483 var sv *ListTagsForResourceOutput 17484 if *v == nil { 17485 sv = &ListTagsForResourceOutput{} 17486 } else { 17487 sv = *v 17488 } 17489 17490 for key, value := range shape { 17491 switch key { 17492 case "NextMarker": 17493 if value != nil { 17494 jtv, ok := value.(string) 17495 if !ok { 17496 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17497 } 17498 sv.NextMarker = ptr.String(jtv) 17499 } 17500 17501 case "TagInfoForResource": 17502 if err := awsAwsjson11_deserializeDocumentTagInfoForResource(&sv.TagInfoForResource, value); err != nil { 17503 return err 17504 } 17505 17506 default: 17507 _, _ = key, value 17508 17509 } 17510 } 17511 *v = sv 17512 return nil 17513} 17514 17515func awsAwsjson11_deserializeOpDocumentListWebACLsOutput(v **ListWebACLsOutput, value interface{}) error { 17516 if v == nil { 17517 return fmt.Errorf("unexpected nil of type %T", v) 17518 } 17519 if value == nil { 17520 return nil 17521 } 17522 17523 shape, ok := value.(map[string]interface{}) 17524 if !ok { 17525 return fmt.Errorf("unexpected JSON type %v", value) 17526 } 17527 17528 var sv *ListWebACLsOutput 17529 if *v == nil { 17530 sv = &ListWebACLsOutput{} 17531 } else { 17532 sv = *v 17533 } 17534 17535 for key, value := range shape { 17536 switch key { 17537 case "NextMarker": 17538 if value != nil { 17539 jtv, ok := value.(string) 17540 if !ok { 17541 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17542 } 17543 sv.NextMarker = ptr.String(jtv) 17544 } 17545 17546 case "WebACLs": 17547 if err := awsAwsjson11_deserializeDocumentWebACLSummaries(&sv.WebACLs, value); err != nil { 17548 return err 17549 } 17550 17551 default: 17552 _, _ = key, value 17553 17554 } 17555 } 17556 *v = sv 17557 return nil 17558} 17559 17560func awsAwsjson11_deserializeOpDocumentListXssMatchSetsOutput(v **ListXssMatchSetsOutput, value interface{}) error { 17561 if v == nil { 17562 return fmt.Errorf("unexpected nil of type %T", v) 17563 } 17564 if value == nil { 17565 return nil 17566 } 17567 17568 shape, ok := value.(map[string]interface{}) 17569 if !ok { 17570 return fmt.Errorf("unexpected JSON type %v", value) 17571 } 17572 17573 var sv *ListXssMatchSetsOutput 17574 if *v == nil { 17575 sv = &ListXssMatchSetsOutput{} 17576 } else { 17577 sv = *v 17578 } 17579 17580 for key, value := range shape { 17581 switch key { 17582 case "NextMarker": 17583 if value != nil { 17584 jtv, ok := value.(string) 17585 if !ok { 17586 return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value) 17587 } 17588 sv.NextMarker = ptr.String(jtv) 17589 } 17590 17591 case "XssMatchSets": 17592 if err := awsAwsjson11_deserializeDocumentXssMatchSetSummaries(&sv.XssMatchSets, value); err != nil { 17593 return err 17594 } 17595 17596 default: 17597 _, _ = key, value 17598 17599 } 17600 } 17601 *v = sv 17602 return nil 17603} 17604 17605func awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(v **PutLoggingConfigurationOutput, value interface{}) error { 17606 if v == nil { 17607 return fmt.Errorf("unexpected nil of type %T", v) 17608 } 17609 if value == nil { 17610 return nil 17611 } 17612 17613 shape, ok := value.(map[string]interface{}) 17614 if !ok { 17615 return fmt.Errorf("unexpected JSON type %v", value) 17616 } 17617 17618 var sv *PutLoggingConfigurationOutput 17619 if *v == nil { 17620 sv = &PutLoggingConfigurationOutput{} 17621 } else { 17622 sv = *v 17623 } 17624 17625 for key, value := range shape { 17626 switch key { 17627 case "LoggingConfiguration": 17628 if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { 17629 return err 17630 } 17631 17632 default: 17633 _, _ = key, value 17634 17635 } 17636 } 17637 *v = sv 17638 return nil 17639} 17640 17641func awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(v **PutPermissionPolicyOutput, value interface{}) error { 17642 if v == nil { 17643 return fmt.Errorf("unexpected nil of type %T", v) 17644 } 17645 if value == nil { 17646 return nil 17647 } 17648 17649 shape, ok := value.(map[string]interface{}) 17650 if !ok { 17651 return fmt.Errorf("unexpected JSON type %v", value) 17652 } 17653 17654 var sv *PutPermissionPolicyOutput 17655 if *v == nil { 17656 sv = &PutPermissionPolicyOutput{} 17657 } else { 17658 sv = *v 17659 } 17660 17661 for key, value := range shape { 17662 switch key { 17663 default: 17664 _, _ = key, value 17665 17666 } 17667 } 17668 *v = sv 17669 return nil 17670} 17671 17672func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { 17673 if v == nil { 17674 return fmt.Errorf("unexpected nil of type %T", v) 17675 } 17676 if value == nil { 17677 return nil 17678 } 17679 17680 shape, ok := value.(map[string]interface{}) 17681 if !ok { 17682 return fmt.Errorf("unexpected JSON type %v", value) 17683 } 17684 17685 var sv *TagResourceOutput 17686 if *v == nil { 17687 sv = &TagResourceOutput{} 17688 } else { 17689 sv = *v 17690 } 17691 17692 for key, value := range shape { 17693 switch key { 17694 default: 17695 _, _ = key, value 17696 17697 } 17698 } 17699 *v = sv 17700 return nil 17701} 17702 17703func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { 17704 if v == nil { 17705 return fmt.Errorf("unexpected nil of type %T", v) 17706 } 17707 if value == nil { 17708 return nil 17709 } 17710 17711 shape, ok := value.(map[string]interface{}) 17712 if !ok { 17713 return fmt.Errorf("unexpected JSON type %v", value) 17714 } 17715 17716 var sv *UntagResourceOutput 17717 if *v == nil { 17718 sv = &UntagResourceOutput{} 17719 } else { 17720 sv = *v 17721 } 17722 17723 for key, value := range shape { 17724 switch key { 17725 default: 17726 _, _ = key, value 17727 17728 } 17729 } 17730 *v = sv 17731 return nil 17732} 17733 17734func awsAwsjson11_deserializeOpDocumentUpdateByteMatchSetOutput(v **UpdateByteMatchSetOutput, value interface{}) error { 17735 if v == nil { 17736 return fmt.Errorf("unexpected nil of type %T", v) 17737 } 17738 if value == nil { 17739 return nil 17740 } 17741 17742 shape, ok := value.(map[string]interface{}) 17743 if !ok { 17744 return fmt.Errorf("unexpected JSON type %v", value) 17745 } 17746 17747 var sv *UpdateByteMatchSetOutput 17748 if *v == nil { 17749 sv = &UpdateByteMatchSetOutput{} 17750 } else { 17751 sv = *v 17752 } 17753 17754 for key, value := range shape { 17755 switch key { 17756 case "ChangeToken": 17757 if value != nil { 17758 jtv, ok := value.(string) 17759 if !ok { 17760 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17761 } 17762 sv.ChangeToken = ptr.String(jtv) 17763 } 17764 17765 default: 17766 _, _ = key, value 17767 17768 } 17769 } 17770 *v = sv 17771 return nil 17772} 17773 17774func awsAwsjson11_deserializeOpDocumentUpdateGeoMatchSetOutput(v **UpdateGeoMatchSetOutput, value interface{}) error { 17775 if v == nil { 17776 return fmt.Errorf("unexpected nil of type %T", v) 17777 } 17778 if value == nil { 17779 return nil 17780 } 17781 17782 shape, ok := value.(map[string]interface{}) 17783 if !ok { 17784 return fmt.Errorf("unexpected JSON type %v", value) 17785 } 17786 17787 var sv *UpdateGeoMatchSetOutput 17788 if *v == nil { 17789 sv = &UpdateGeoMatchSetOutput{} 17790 } else { 17791 sv = *v 17792 } 17793 17794 for key, value := range shape { 17795 switch key { 17796 case "ChangeToken": 17797 if value != nil { 17798 jtv, ok := value.(string) 17799 if !ok { 17800 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17801 } 17802 sv.ChangeToken = ptr.String(jtv) 17803 } 17804 17805 default: 17806 _, _ = key, value 17807 17808 } 17809 } 17810 *v = sv 17811 return nil 17812} 17813 17814func awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(v **UpdateIPSetOutput, value interface{}) error { 17815 if v == nil { 17816 return fmt.Errorf("unexpected nil of type %T", v) 17817 } 17818 if value == nil { 17819 return nil 17820 } 17821 17822 shape, ok := value.(map[string]interface{}) 17823 if !ok { 17824 return fmt.Errorf("unexpected JSON type %v", value) 17825 } 17826 17827 var sv *UpdateIPSetOutput 17828 if *v == nil { 17829 sv = &UpdateIPSetOutput{} 17830 } else { 17831 sv = *v 17832 } 17833 17834 for key, value := range shape { 17835 switch key { 17836 case "ChangeToken": 17837 if value != nil { 17838 jtv, ok := value.(string) 17839 if !ok { 17840 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17841 } 17842 sv.ChangeToken = ptr.String(jtv) 17843 } 17844 17845 default: 17846 _, _ = key, value 17847 17848 } 17849 } 17850 *v = sv 17851 return nil 17852} 17853 17854func awsAwsjson11_deserializeOpDocumentUpdateRateBasedRuleOutput(v **UpdateRateBasedRuleOutput, value interface{}) error { 17855 if v == nil { 17856 return fmt.Errorf("unexpected nil of type %T", v) 17857 } 17858 if value == nil { 17859 return nil 17860 } 17861 17862 shape, ok := value.(map[string]interface{}) 17863 if !ok { 17864 return fmt.Errorf("unexpected JSON type %v", value) 17865 } 17866 17867 var sv *UpdateRateBasedRuleOutput 17868 if *v == nil { 17869 sv = &UpdateRateBasedRuleOutput{} 17870 } else { 17871 sv = *v 17872 } 17873 17874 for key, value := range shape { 17875 switch key { 17876 case "ChangeToken": 17877 if value != nil { 17878 jtv, ok := value.(string) 17879 if !ok { 17880 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17881 } 17882 sv.ChangeToken = ptr.String(jtv) 17883 } 17884 17885 default: 17886 _, _ = key, value 17887 17888 } 17889 } 17890 *v = sv 17891 return nil 17892} 17893 17894func awsAwsjson11_deserializeOpDocumentUpdateRegexMatchSetOutput(v **UpdateRegexMatchSetOutput, value interface{}) error { 17895 if v == nil { 17896 return fmt.Errorf("unexpected nil of type %T", v) 17897 } 17898 if value == nil { 17899 return nil 17900 } 17901 17902 shape, ok := value.(map[string]interface{}) 17903 if !ok { 17904 return fmt.Errorf("unexpected JSON type %v", value) 17905 } 17906 17907 var sv *UpdateRegexMatchSetOutput 17908 if *v == nil { 17909 sv = &UpdateRegexMatchSetOutput{} 17910 } else { 17911 sv = *v 17912 } 17913 17914 for key, value := range shape { 17915 switch key { 17916 case "ChangeToken": 17917 if value != nil { 17918 jtv, ok := value.(string) 17919 if !ok { 17920 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17921 } 17922 sv.ChangeToken = ptr.String(jtv) 17923 } 17924 17925 default: 17926 _, _ = key, value 17927 17928 } 17929 } 17930 *v = sv 17931 return nil 17932} 17933 17934func awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(v **UpdateRegexPatternSetOutput, value interface{}) error { 17935 if v == nil { 17936 return fmt.Errorf("unexpected nil of type %T", v) 17937 } 17938 if value == nil { 17939 return nil 17940 } 17941 17942 shape, ok := value.(map[string]interface{}) 17943 if !ok { 17944 return fmt.Errorf("unexpected JSON type %v", value) 17945 } 17946 17947 var sv *UpdateRegexPatternSetOutput 17948 if *v == nil { 17949 sv = &UpdateRegexPatternSetOutput{} 17950 } else { 17951 sv = *v 17952 } 17953 17954 for key, value := range shape { 17955 switch key { 17956 case "ChangeToken": 17957 if value != nil { 17958 jtv, ok := value.(string) 17959 if !ok { 17960 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 17961 } 17962 sv.ChangeToken = ptr.String(jtv) 17963 } 17964 17965 default: 17966 _, _ = key, value 17967 17968 } 17969 } 17970 *v = sv 17971 return nil 17972} 17973 17974func awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(v **UpdateRuleGroupOutput, value interface{}) error { 17975 if v == nil { 17976 return fmt.Errorf("unexpected nil of type %T", v) 17977 } 17978 if value == nil { 17979 return nil 17980 } 17981 17982 shape, ok := value.(map[string]interface{}) 17983 if !ok { 17984 return fmt.Errorf("unexpected JSON type %v", value) 17985 } 17986 17987 var sv *UpdateRuleGroupOutput 17988 if *v == nil { 17989 sv = &UpdateRuleGroupOutput{} 17990 } else { 17991 sv = *v 17992 } 17993 17994 for key, value := range shape { 17995 switch key { 17996 case "ChangeToken": 17997 if value != nil { 17998 jtv, ok := value.(string) 17999 if !ok { 18000 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18001 } 18002 sv.ChangeToken = ptr.String(jtv) 18003 } 18004 18005 default: 18006 _, _ = key, value 18007 18008 } 18009 } 18010 *v = sv 18011 return nil 18012} 18013 18014func awsAwsjson11_deserializeOpDocumentUpdateRuleOutput(v **UpdateRuleOutput, value interface{}) error { 18015 if v == nil { 18016 return fmt.Errorf("unexpected nil of type %T", v) 18017 } 18018 if value == nil { 18019 return nil 18020 } 18021 18022 shape, ok := value.(map[string]interface{}) 18023 if !ok { 18024 return fmt.Errorf("unexpected JSON type %v", value) 18025 } 18026 18027 var sv *UpdateRuleOutput 18028 if *v == nil { 18029 sv = &UpdateRuleOutput{} 18030 } else { 18031 sv = *v 18032 } 18033 18034 for key, value := range shape { 18035 switch key { 18036 case "ChangeToken": 18037 if value != nil { 18038 jtv, ok := value.(string) 18039 if !ok { 18040 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18041 } 18042 sv.ChangeToken = ptr.String(jtv) 18043 } 18044 18045 default: 18046 _, _ = key, value 18047 18048 } 18049 } 18050 *v = sv 18051 return nil 18052} 18053 18054func awsAwsjson11_deserializeOpDocumentUpdateSizeConstraintSetOutput(v **UpdateSizeConstraintSetOutput, value interface{}) error { 18055 if v == nil { 18056 return fmt.Errorf("unexpected nil of type %T", v) 18057 } 18058 if value == nil { 18059 return nil 18060 } 18061 18062 shape, ok := value.(map[string]interface{}) 18063 if !ok { 18064 return fmt.Errorf("unexpected JSON type %v", value) 18065 } 18066 18067 var sv *UpdateSizeConstraintSetOutput 18068 if *v == nil { 18069 sv = &UpdateSizeConstraintSetOutput{} 18070 } else { 18071 sv = *v 18072 } 18073 18074 for key, value := range shape { 18075 switch key { 18076 case "ChangeToken": 18077 if value != nil { 18078 jtv, ok := value.(string) 18079 if !ok { 18080 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18081 } 18082 sv.ChangeToken = ptr.String(jtv) 18083 } 18084 18085 default: 18086 _, _ = key, value 18087 18088 } 18089 } 18090 *v = sv 18091 return nil 18092} 18093 18094func awsAwsjson11_deserializeOpDocumentUpdateSqlInjectionMatchSetOutput(v **UpdateSqlInjectionMatchSetOutput, value interface{}) error { 18095 if v == nil { 18096 return fmt.Errorf("unexpected nil of type %T", v) 18097 } 18098 if value == nil { 18099 return nil 18100 } 18101 18102 shape, ok := value.(map[string]interface{}) 18103 if !ok { 18104 return fmt.Errorf("unexpected JSON type %v", value) 18105 } 18106 18107 var sv *UpdateSqlInjectionMatchSetOutput 18108 if *v == nil { 18109 sv = &UpdateSqlInjectionMatchSetOutput{} 18110 } else { 18111 sv = *v 18112 } 18113 18114 for key, value := range shape { 18115 switch key { 18116 case "ChangeToken": 18117 if value != nil { 18118 jtv, ok := value.(string) 18119 if !ok { 18120 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18121 } 18122 sv.ChangeToken = ptr.String(jtv) 18123 } 18124 18125 default: 18126 _, _ = key, value 18127 18128 } 18129 } 18130 *v = sv 18131 return nil 18132} 18133 18134func awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(v **UpdateWebACLOutput, value interface{}) error { 18135 if v == nil { 18136 return fmt.Errorf("unexpected nil of type %T", v) 18137 } 18138 if value == nil { 18139 return nil 18140 } 18141 18142 shape, ok := value.(map[string]interface{}) 18143 if !ok { 18144 return fmt.Errorf("unexpected JSON type %v", value) 18145 } 18146 18147 var sv *UpdateWebACLOutput 18148 if *v == nil { 18149 sv = &UpdateWebACLOutput{} 18150 } else { 18151 sv = *v 18152 } 18153 18154 for key, value := range shape { 18155 switch key { 18156 case "ChangeToken": 18157 if value != nil { 18158 jtv, ok := value.(string) 18159 if !ok { 18160 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18161 } 18162 sv.ChangeToken = ptr.String(jtv) 18163 } 18164 18165 default: 18166 _, _ = key, value 18167 18168 } 18169 } 18170 *v = sv 18171 return nil 18172} 18173 18174func awsAwsjson11_deserializeOpDocumentUpdateXssMatchSetOutput(v **UpdateXssMatchSetOutput, value interface{}) error { 18175 if v == nil { 18176 return fmt.Errorf("unexpected nil of type %T", v) 18177 } 18178 if value == nil { 18179 return nil 18180 } 18181 18182 shape, ok := value.(map[string]interface{}) 18183 if !ok { 18184 return fmt.Errorf("unexpected JSON type %v", value) 18185 } 18186 18187 var sv *UpdateXssMatchSetOutput 18188 if *v == nil { 18189 sv = &UpdateXssMatchSetOutput{} 18190 } else { 18191 sv = *v 18192 } 18193 18194 for key, value := range shape { 18195 switch key { 18196 case "ChangeToken": 18197 if value != nil { 18198 jtv, ok := value.(string) 18199 if !ok { 18200 return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value) 18201 } 18202 sv.ChangeToken = ptr.String(jtv) 18203 } 18204 18205 default: 18206 _, _ = key, value 18207 18208 } 18209 } 18210 *v = sv 18211 return nil 18212} 18213