1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package iot
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/iot/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	"io/ioutil"
21	"strings"
22)
23
24type awsRestjson1_deserializeOpAcceptCertificateTransfer struct {
25}
26
27func (*awsRestjson1_deserializeOpAcceptCertificateTransfer) ID() string {
28	return "OperationDeserializer"
29}
30
31func (m *awsRestjson1_deserializeOpAcceptCertificateTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
32	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
33) {
34	out, metadata, err = next.HandleDeserialize(ctx, in)
35	if err != nil {
36		return out, metadata, err
37	}
38
39	response, ok := out.RawResponse.(*smithyhttp.Response)
40	if !ok {
41		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
42	}
43
44	if response.StatusCode < 200 || response.StatusCode >= 300 {
45		return out, metadata, awsRestjson1_deserializeOpErrorAcceptCertificateTransfer(response, &metadata)
46	}
47	output := &AcceptCertificateTransferOutput{}
48	out.Result = output
49
50	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
51		return out, metadata, &smithy.DeserializationError{
52			Err: fmt.Errorf("failed to discard response body, %w", err),
53		}
54	}
55
56	return out, metadata, err
57}
58
59func awsRestjson1_deserializeOpErrorAcceptCertificateTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
60	var errorBuffer bytes.Buffer
61	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
62		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
63	}
64	errorBody := bytes.NewReader(errorBuffer.Bytes())
65
66	errorCode := "UnknownError"
67	errorMessage := errorCode
68
69	code := response.Header.Get("X-Amzn-ErrorType")
70	if len(code) != 0 {
71		errorCode = restjson.SanitizeErrorCode(code)
72	}
73
74	var buff [1024]byte
75	ringBuffer := smithyio.NewRingBuffer(buff[:])
76
77	body := io.TeeReader(errorBody, ringBuffer)
78	decoder := json.NewDecoder(body)
79	decoder.UseNumber()
80	code, message, err := restjson.GetErrorInfo(decoder)
81	if err != nil {
82		var snapshot bytes.Buffer
83		io.Copy(&snapshot, ringBuffer)
84		err = &smithy.DeserializationError{
85			Err:      fmt.Errorf("failed to decode response body, %w", err),
86			Snapshot: snapshot.Bytes(),
87		}
88		return err
89	}
90
91	errorBody.Seek(0, io.SeekStart)
92	if len(code) != 0 {
93		errorCode = restjson.SanitizeErrorCode(code)
94	}
95	if len(message) != 0 {
96		errorMessage = message
97	}
98
99	switch {
100	case strings.EqualFold("InternalFailureException", errorCode):
101		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
102
103	case strings.EqualFold("InvalidRequestException", errorCode):
104		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
105
106	case strings.EqualFold("ResourceNotFoundException", errorCode):
107		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
108
109	case strings.EqualFold("ServiceUnavailableException", errorCode):
110		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
111
112	case strings.EqualFold("ThrottlingException", errorCode):
113		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
114
115	case strings.EqualFold("TransferAlreadyCompletedException", errorCode):
116		return awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response, errorBody)
117
118	case strings.EqualFold("UnauthorizedException", errorCode):
119		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
120
121	default:
122		genericError := &smithy.GenericAPIError{
123			Code:    errorCode,
124			Message: errorMessage,
125		}
126		return genericError
127
128	}
129}
130
131type awsRestjson1_deserializeOpAddThingToBillingGroup struct {
132}
133
134func (*awsRestjson1_deserializeOpAddThingToBillingGroup) ID() string {
135	return "OperationDeserializer"
136}
137
138func (m *awsRestjson1_deserializeOpAddThingToBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
139	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
140) {
141	out, metadata, err = next.HandleDeserialize(ctx, in)
142	if err != nil {
143		return out, metadata, err
144	}
145
146	response, ok := out.RawResponse.(*smithyhttp.Response)
147	if !ok {
148		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
149	}
150
151	if response.StatusCode < 200 || response.StatusCode >= 300 {
152		return out, metadata, awsRestjson1_deserializeOpErrorAddThingToBillingGroup(response, &metadata)
153	}
154	output := &AddThingToBillingGroupOutput{}
155	out.Result = output
156
157	return out, metadata, err
158}
159
160func awsRestjson1_deserializeOpErrorAddThingToBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
161	var errorBuffer bytes.Buffer
162	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
163		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
164	}
165	errorBody := bytes.NewReader(errorBuffer.Bytes())
166
167	errorCode := "UnknownError"
168	errorMessage := errorCode
169
170	code := response.Header.Get("X-Amzn-ErrorType")
171	if len(code) != 0 {
172		errorCode = restjson.SanitizeErrorCode(code)
173	}
174
175	var buff [1024]byte
176	ringBuffer := smithyio.NewRingBuffer(buff[:])
177
178	body := io.TeeReader(errorBody, ringBuffer)
179	decoder := json.NewDecoder(body)
180	decoder.UseNumber()
181	code, message, err := restjson.GetErrorInfo(decoder)
182	if err != nil {
183		var snapshot bytes.Buffer
184		io.Copy(&snapshot, ringBuffer)
185		err = &smithy.DeserializationError{
186			Err:      fmt.Errorf("failed to decode response body, %w", err),
187			Snapshot: snapshot.Bytes(),
188		}
189		return err
190	}
191
192	errorBody.Seek(0, io.SeekStart)
193	if len(code) != 0 {
194		errorCode = restjson.SanitizeErrorCode(code)
195	}
196	if len(message) != 0 {
197		errorMessage = message
198	}
199
200	switch {
201	case strings.EqualFold("InternalFailureException", errorCode):
202		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
203
204	case strings.EqualFold("InvalidRequestException", errorCode):
205		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
206
207	case strings.EqualFold("ResourceNotFoundException", errorCode):
208		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
209
210	case strings.EqualFold("ThrottlingException", errorCode):
211		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
212
213	default:
214		genericError := &smithy.GenericAPIError{
215			Code:    errorCode,
216			Message: errorMessage,
217		}
218		return genericError
219
220	}
221}
222
223type awsRestjson1_deserializeOpAddThingToThingGroup struct {
224}
225
226func (*awsRestjson1_deserializeOpAddThingToThingGroup) ID() string {
227	return "OperationDeserializer"
228}
229
230func (m *awsRestjson1_deserializeOpAddThingToThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
231	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
232) {
233	out, metadata, err = next.HandleDeserialize(ctx, in)
234	if err != nil {
235		return out, metadata, err
236	}
237
238	response, ok := out.RawResponse.(*smithyhttp.Response)
239	if !ok {
240		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
241	}
242
243	if response.StatusCode < 200 || response.StatusCode >= 300 {
244		return out, metadata, awsRestjson1_deserializeOpErrorAddThingToThingGroup(response, &metadata)
245	}
246	output := &AddThingToThingGroupOutput{}
247	out.Result = output
248
249	return out, metadata, err
250}
251
252func awsRestjson1_deserializeOpErrorAddThingToThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
253	var errorBuffer bytes.Buffer
254	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
255		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
256	}
257	errorBody := bytes.NewReader(errorBuffer.Bytes())
258
259	errorCode := "UnknownError"
260	errorMessage := errorCode
261
262	code := response.Header.Get("X-Amzn-ErrorType")
263	if len(code) != 0 {
264		errorCode = restjson.SanitizeErrorCode(code)
265	}
266
267	var buff [1024]byte
268	ringBuffer := smithyio.NewRingBuffer(buff[:])
269
270	body := io.TeeReader(errorBody, ringBuffer)
271	decoder := json.NewDecoder(body)
272	decoder.UseNumber()
273	code, message, err := restjson.GetErrorInfo(decoder)
274	if err != nil {
275		var snapshot bytes.Buffer
276		io.Copy(&snapshot, ringBuffer)
277		err = &smithy.DeserializationError{
278			Err:      fmt.Errorf("failed to decode response body, %w", err),
279			Snapshot: snapshot.Bytes(),
280		}
281		return err
282	}
283
284	errorBody.Seek(0, io.SeekStart)
285	if len(code) != 0 {
286		errorCode = restjson.SanitizeErrorCode(code)
287	}
288	if len(message) != 0 {
289		errorMessage = message
290	}
291
292	switch {
293	case strings.EqualFold("InternalFailureException", errorCode):
294		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
295
296	case strings.EqualFold("InvalidRequestException", errorCode):
297		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
298
299	case strings.EqualFold("ResourceNotFoundException", errorCode):
300		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
301
302	case strings.EqualFold("ThrottlingException", errorCode):
303		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
304
305	default:
306		genericError := &smithy.GenericAPIError{
307			Code:    errorCode,
308			Message: errorMessage,
309		}
310		return genericError
311
312	}
313}
314
315type awsRestjson1_deserializeOpAssociateTargetsWithJob struct {
316}
317
318func (*awsRestjson1_deserializeOpAssociateTargetsWithJob) ID() string {
319	return "OperationDeserializer"
320}
321
322func (m *awsRestjson1_deserializeOpAssociateTargetsWithJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
323	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
324) {
325	out, metadata, err = next.HandleDeserialize(ctx, in)
326	if err != nil {
327		return out, metadata, err
328	}
329
330	response, ok := out.RawResponse.(*smithyhttp.Response)
331	if !ok {
332		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
333	}
334
335	if response.StatusCode < 200 || response.StatusCode >= 300 {
336		return out, metadata, awsRestjson1_deserializeOpErrorAssociateTargetsWithJob(response, &metadata)
337	}
338	output := &AssociateTargetsWithJobOutput{}
339	out.Result = output
340
341	var buff [1024]byte
342	ringBuffer := smithyio.NewRingBuffer(buff[:])
343
344	body := io.TeeReader(response.Body, ringBuffer)
345
346	decoder := json.NewDecoder(body)
347	decoder.UseNumber()
348	var shape interface{}
349	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
350		var snapshot bytes.Buffer
351		io.Copy(&snapshot, ringBuffer)
352		err = &smithy.DeserializationError{
353			Err:      fmt.Errorf("failed to decode response body, %w", err),
354			Snapshot: snapshot.Bytes(),
355		}
356		return out, metadata, err
357	}
358
359	err = awsRestjson1_deserializeOpDocumentAssociateTargetsWithJobOutput(&output, shape)
360	if err != nil {
361		var snapshot bytes.Buffer
362		io.Copy(&snapshot, ringBuffer)
363		return out, metadata, &smithy.DeserializationError{
364			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
365			Snapshot: snapshot.Bytes(),
366		}
367	}
368
369	return out, metadata, err
370}
371
372func awsRestjson1_deserializeOpErrorAssociateTargetsWithJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
373	var errorBuffer bytes.Buffer
374	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
375		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
376	}
377	errorBody := bytes.NewReader(errorBuffer.Bytes())
378
379	errorCode := "UnknownError"
380	errorMessage := errorCode
381
382	code := response.Header.Get("X-Amzn-ErrorType")
383	if len(code) != 0 {
384		errorCode = restjson.SanitizeErrorCode(code)
385	}
386
387	var buff [1024]byte
388	ringBuffer := smithyio.NewRingBuffer(buff[:])
389
390	body := io.TeeReader(errorBody, ringBuffer)
391	decoder := json.NewDecoder(body)
392	decoder.UseNumber()
393	code, message, err := restjson.GetErrorInfo(decoder)
394	if err != nil {
395		var snapshot bytes.Buffer
396		io.Copy(&snapshot, ringBuffer)
397		err = &smithy.DeserializationError{
398			Err:      fmt.Errorf("failed to decode response body, %w", err),
399			Snapshot: snapshot.Bytes(),
400		}
401		return err
402	}
403
404	errorBody.Seek(0, io.SeekStart)
405	if len(code) != 0 {
406		errorCode = restjson.SanitizeErrorCode(code)
407	}
408	if len(message) != 0 {
409		errorMessage = message
410	}
411
412	switch {
413	case strings.EqualFold("InvalidRequestException", errorCode):
414		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
415
416	case strings.EqualFold("LimitExceededException", errorCode):
417		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
418
419	case strings.EqualFold("ResourceNotFoundException", errorCode):
420		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
421
422	case strings.EqualFold("ServiceUnavailableException", errorCode):
423		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
424
425	case strings.EqualFold("ThrottlingException", errorCode):
426		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
427
428	default:
429		genericError := &smithy.GenericAPIError{
430			Code:    errorCode,
431			Message: errorMessage,
432		}
433		return genericError
434
435	}
436}
437
438func awsRestjson1_deserializeOpDocumentAssociateTargetsWithJobOutput(v **AssociateTargetsWithJobOutput, value interface{}) error {
439	if v == nil {
440		return fmt.Errorf("unexpected nil of type %T", v)
441	}
442	if value == nil {
443		return nil
444	}
445
446	shape, ok := value.(map[string]interface{})
447	if !ok {
448		return fmt.Errorf("unexpected JSON type %v", value)
449	}
450
451	var sv *AssociateTargetsWithJobOutput
452	if *v == nil {
453		sv = &AssociateTargetsWithJobOutput{}
454	} else {
455		sv = *v
456	}
457
458	for key, value := range shape {
459		switch key {
460		case "description":
461			if value != nil {
462				jtv, ok := value.(string)
463				if !ok {
464					return fmt.Errorf("expected JobDescription to be of type string, got %T instead", value)
465				}
466				sv.Description = ptr.String(jtv)
467			}
468
469		case "jobArn":
470			if value != nil {
471				jtv, ok := value.(string)
472				if !ok {
473					return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
474				}
475				sv.JobArn = ptr.String(jtv)
476			}
477
478		case "jobId":
479			if value != nil {
480				jtv, ok := value.(string)
481				if !ok {
482					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
483				}
484				sv.JobId = ptr.String(jtv)
485			}
486
487		default:
488			_, _ = key, value
489
490		}
491	}
492	*v = sv
493	return nil
494}
495
496type awsRestjson1_deserializeOpAttachPolicy struct {
497}
498
499func (*awsRestjson1_deserializeOpAttachPolicy) ID() string {
500	return "OperationDeserializer"
501}
502
503func (m *awsRestjson1_deserializeOpAttachPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
504	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
505) {
506	out, metadata, err = next.HandleDeserialize(ctx, in)
507	if err != nil {
508		return out, metadata, err
509	}
510
511	response, ok := out.RawResponse.(*smithyhttp.Response)
512	if !ok {
513		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
514	}
515
516	if response.StatusCode < 200 || response.StatusCode >= 300 {
517		return out, metadata, awsRestjson1_deserializeOpErrorAttachPolicy(response, &metadata)
518	}
519	output := &AttachPolicyOutput{}
520	out.Result = output
521
522	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
523		return out, metadata, &smithy.DeserializationError{
524			Err: fmt.Errorf("failed to discard response body, %w", err),
525		}
526	}
527
528	return out, metadata, err
529}
530
531func awsRestjson1_deserializeOpErrorAttachPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
532	var errorBuffer bytes.Buffer
533	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
534		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
535	}
536	errorBody := bytes.NewReader(errorBuffer.Bytes())
537
538	errorCode := "UnknownError"
539	errorMessage := errorCode
540
541	code := response.Header.Get("X-Amzn-ErrorType")
542	if len(code) != 0 {
543		errorCode = restjson.SanitizeErrorCode(code)
544	}
545
546	var buff [1024]byte
547	ringBuffer := smithyio.NewRingBuffer(buff[:])
548
549	body := io.TeeReader(errorBody, ringBuffer)
550	decoder := json.NewDecoder(body)
551	decoder.UseNumber()
552	code, message, err := restjson.GetErrorInfo(decoder)
553	if err != nil {
554		var snapshot bytes.Buffer
555		io.Copy(&snapshot, ringBuffer)
556		err = &smithy.DeserializationError{
557			Err:      fmt.Errorf("failed to decode response body, %w", err),
558			Snapshot: snapshot.Bytes(),
559		}
560		return err
561	}
562
563	errorBody.Seek(0, io.SeekStart)
564	if len(code) != 0 {
565		errorCode = restjson.SanitizeErrorCode(code)
566	}
567	if len(message) != 0 {
568		errorMessage = message
569	}
570
571	switch {
572	case strings.EqualFold("InternalFailureException", errorCode):
573		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
574
575	case strings.EqualFold("InvalidRequestException", errorCode):
576		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
577
578	case strings.EqualFold("LimitExceededException", errorCode):
579		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
580
581	case strings.EqualFold("ResourceNotFoundException", errorCode):
582		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
583
584	case strings.EqualFold("ServiceUnavailableException", errorCode):
585		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
586
587	case strings.EqualFold("ThrottlingException", errorCode):
588		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
589
590	case strings.EqualFold("UnauthorizedException", errorCode):
591		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
592
593	default:
594		genericError := &smithy.GenericAPIError{
595			Code:    errorCode,
596			Message: errorMessage,
597		}
598		return genericError
599
600	}
601}
602
603type awsRestjson1_deserializeOpAttachPrincipalPolicy struct {
604}
605
606func (*awsRestjson1_deserializeOpAttachPrincipalPolicy) ID() string {
607	return "OperationDeserializer"
608}
609
610func (m *awsRestjson1_deserializeOpAttachPrincipalPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
611	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
612) {
613	out, metadata, err = next.HandleDeserialize(ctx, in)
614	if err != nil {
615		return out, metadata, err
616	}
617
618	response, ok := out.RawResponse.(*smithyhttp.Response)
619	if !ok {
620		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
621	}
622
623	if response.StatusCode < 200 || response.StatusCode >= 300 {
624		return out, metadata, awsRestjson1_deserializeOpErrorAttachPrincipalPolicy(response, &metadata)
625	}
626	output := &AttachPrincipalPolicyOutput{}
627	out.Result = output
628
629	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
630		return out, metadata, &smithy.DeserializationError{
631			Err: fmt.Errorf("failed to discard response body, %w", err),
632		}
633	}
634
635	return out, metadata, err
636}
637
638func awsRestjson1_deserializeOpErrorAttachPrincipalPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
639	var errorBuffer bytes.Buffer
640	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
641		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
642	}
643	errorBody := bytes.NewReader(errorBuffer.Bytes())
644
645	errorCode := "UnknownError"
646	errorMessage := errorCode
647
648	code := response.Header.Get("X-Amzn-ErrorType")
649	if len(code) != 0 {
650		errorCode = restjson.SanitizeErrorCode(code)
651	}
652
653	var buff [1024]byte
654	ringBuffer := smithyio.NewRingBuffer(buff[:])
655
656	body := io.TeeReader(errorBody, ringBuffer)
657	decoder := json.NewDecoder(body)
658	decoder.UseNumber()
659	code, message, err := restjson.GetErrorInfo(decoder)
660	if err != nil {
661		var snapshot bytes.Buffer
662		io.Copy(&snapshot, ringBuffer)
663		err = &smithy.DeserializationError{
664			Err:      fmt.Errorf("failed to decode response body, %w", err),
665			Snapshot: snapshot.Bytes(),
666		}
667		return err
668	}
669
670	errorBody.Seek(0, io.SeekStart)
671	if len(code) != 0 {
672		errorCode = restjson.SanitizeErrorCode(code)
673	}
674	if len(message) != 0 {
675		errorMessage = message
676	}
677
678	switch {
679	case strings.EqualFold("InternalFailureException", errorCode):
680		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
681
682	case strings.EqualFold("InvalidRequestException", errorCode):
683		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
684
685	case strings.EqualFold("LimitExceededException", errorCode):
686		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
687
688	case strings.EqualFold("ResourceNotFoundException", errorCode):
689		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
690
691	case strings.EqualFold("ServiceUnavailableException", errorCode):
692		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
693
694	case strings.EqualFold("ThrottlingException", errorCode):
695		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
696
697	case strings.EqualFold("UnauthorizedException", errorCode):
698		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
699
700	default:
701		genericError := &smithy.GenericAPIError{
702			Code:    errorCode,
703			Message: errorMessage,
704		}
705		return genericError
706
707	}
708}
709
710type awsRestjson1_deserializeOpAttachSecurityProfile struct {
711}
712
713func (*awsRestjson1_deserializeOpAttachSecurityProfile) ID() string {
714	return "OperationDeserializer"
715}
716
717func (m *awsRestjson1_deserializeOpAttachSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
718	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
719) {
720	out, metadata, err = next.HandleDeserialize(ctx, in)
721	if err != nil {
722		return out, metadata, err
723	}
724
725	response, ok := out.RawResponse.(*smithyhttp.Response)
726	if !ok {
727		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
728	}
729
730	if response.StatusCode < 200 || response.StatusCode >= 300 {
731		return out, metadata, awsRestjson1_deserializeOpErrorAttachSecurityProfile(response, &metadata)
732	}
733	output := &AttachSecurityProfileOutput{}
734	out.Result = output
735
736	return out, metadata, err
737}
738
739func awsRestjson1_deserializeOpErrorAttachSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
740	var errorBuffer bytes.Buffer
741	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
742		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
743	}
744	errorBody := bytes.NewReader(errorBuffer.Bytes())
745
746	errorCode := "UnknownError"
747	errorMessage := errorCode
748
749	code := response.Header.Get("X-Amzn-ErrorType")
750	if len(code) != 0 {
751		errorCode = restjson.SanitizeErrorCode(code)
752	}
753
754	var buff [1024]byte
755	ringBuffer := smithyio.NewRingBuffer(buff[:])
756
757	body := io.TeeReader(errorBody, ringBuffer)
758	decoder := json.NewDecoder(body)
759	decoder.UseNumber()
760	code, message, err := restjson.GetErrorInfo(decoder)
761	if err != nil {
762		var snapshot bytes.Buffer
763		io.Copy(&snapshot, ringBuffer)
764		err = &smithy.DeserializationError{
765			Err:      fmt.Errorf("failed to decode response body, %w", err),
766			Snapshot: snapshot.Bytes(),
767		}
768		return err
769	}
770
771	errorBody.Seek(0, io.SeekStart)
772	if len(code) != 0 {
773		errorCode = restjson.SanitizeErrorCode(code)
774	}
775	if len(message) != 0 {
776		errorMessage = message
777	}
778
779	switch {
780	case strings.EqualFold("InternalFailureException", errorCode):
781		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
782
783	case strings.EqualFold("InvalidRequestException", errorCode):
784		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
785
786	case strings.EqualFold("LimitExceededException", errorCode):
787		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
788
789	case strings.EqualFold("ResourceNotFoundException", errorCode):
790		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
791
792	case strings.EqualFold("ThrottlingException", errorCode):
793		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
794
795	case strings.EqualFold("VersionConflictException", errorCode):
796		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
797
798	default:
799		genericError := &smithy.GenericAPIError{
800			Code:    errorCode,
801			Message: errorMessage,
802		}
803		return genericError
804
805	}
806}
807
808type awsRestjson1_deserializeOpAttachThingPrincipal struct {
809}
810
811func (*awsRestjson1_deserializeOpAttachThingPrincipal) ID() string {
812	return "OperationDeserializer"
813}
814
815func (m *awsRestjson1_deserializeOpAttachThingPrincipal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
816	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
817) {
818	out, metadata, err = next.HandleDeserialize(ctx, in)
819	if err != nil {
820		return out, metadata, err
821	}
822
823	response, ok := out.RawResponse.(*smithyhttp.Response)
824	if !ok {
825		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
826	}
827
828	if response.StatusCode < 200 || response.StatusCode >= 300 {
829		return out, metadata, awsRestjson1_deserializeOpErrorAttachThingPrincipal(response, &metadata)
830	}
831	output := &AttachThingPrincipalOutput{}
832	out.Result = output
833
834	return out, metadata, err
835}
836
837func awsRestjson1_deserializeOpErrorAttachThingPrincipal(response *smithyhttp.Response, metadata *middleware.Metadata) error {
838	var errorBuffer bytes.Buffer
839	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
840		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
841	}
842	errorBody := bytes.NewReader(errorBuffer.Bytes())
843
844	errorCode := "UnknownError"
845	errorMessage := errorCode
846
847	code := response.Header.Get("X-Amzn-ErrorType")
848	if len(code) != 0 {
849		errorCode = restjson.SanitizeErrorCode(code)
850	}
851
852	var buff [1024]byte
853	ringBuffer := smithyio.NewRingBuffer(buff[:])
854
855	body := io.TeeReader(errorBody, ringBuffer)
856	decoder := json.NewDecoder(body)
857	decoder.UseNumber()
858	code, message, err := restjson.GetErrorInfo(decoder)
859	if err != nil {
860		var snapshot bytes.Buffer
861		io.Copy(&snapshot, ringBuffer)
862		err = &smithy.DeserializationError{
863			Err:      fmt.Errorf("failed to decode response body, %w", err),
864			Snapshot: snapshot.Bytes(),
865		}
866		return err
867	}
868
869	errorBody.Seek(0, io.SeekStart)
870	if len(code) != 0 {
871		errorCode = restjson.SanitizeErrorCode(code)
872	}
873	if len(message) != 0 {
874		errorMessage = message
875	}
876
877	switch {
878	case strings.EqualFold("InternalFailureException", errorCode):
879		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
880
881	case strings.EqualFold("InvalidRequestException", errorCode):
882		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
883
884	case strings.EqualFold("ResourceNotFoundException", errorCode):
885		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
886
887	case strings.EqualFold("ServiceUnavailableException", errorCode):
888		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
889
890	case strings.EqualFold("ThrottlingException", errorCode):
891		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
892
893	case strings.EqualFold("UnauthorizedException", errorCode):
894		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
895
896	default:
897		genericError := &smithy.GenericAPIError{
898			Code:    errorCode,
899			Message: errorMessage,
900		}
901		return genericError
902
903	}
904}
905
906type awsRestjson1_deserializeOpCancelAuditMitigationActionsTask struct {
907}
908
909func (*awsRestjson1_deserializeOpCancelAuditMitigationActionsTask) ID() string {
910	return "OperationDeserializer"
911}
912
913func (m *awsRestjson1_deserializeOpCancelAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
914	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
915) {
916	out, metadata, err = next.HandleDeserialize(ctx, in)
917	if err != nil {
918		return out, metadata, err
919	}
920
921	response, ok := out.RawResponse.(*smithyhttp.Response)
922	if !ok {
923		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
924	}
925
926	if response.StatusCode < 200 || response.StatusCode >= 300 {
927		return out, metadata, awsRestjson1_deserializeOpErrorCancelAuditMitigationActionsTask(response, &metadata)
928	}
929	output := &CancelAuditMitigationActionsTaskOutput{}
930	out.Result = output
931
932	return out, metadata, err
933}
934
935func awsRestjson1_deserializeOpErrorCancelAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
936	var errorBuffer bytes.Buffer
937	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
938		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
939	}
940	errorBody := bytes.NewReader(errorBuffer.Bytes())
941
942	errorCode := "UnknownError"
943	errorMessage := errorCode
944
945	code := response.Header.Get("X-Amzn-ErrorType")
946	if len(code) != 0 {
947		errorCode = restjson.SanitizeErrorCode(code)
948	}
949
950	var buff [1024]byte
951	ringBuffer := smithyio.NewRingBuffer(buff[:])
952
953	body := io.TeeReader(errorBody, ringBuffer)
954	decoder := json.NewDecoder(body)
955	decoder.UseNumber()
956	code, message, err := restjson.GetErrorInfo(decoder)
957	if err != nil {
958		var snapshot bytes.Buffer
959		io.Copy(&snapshot, ringBuffer)
960		err = &smithy.DeserializationError{
961			Err:      fmt.Errorf("failed to decode response body, %w", err),
962			Snapshot: snapshot.Bytes(),
963		}
964		return err
965	}
966
967	errorBody.Seek(0, io.SeekStart)
968	if len(code) != 0 {
969		errorCode = restjson.SanitizeErrorCode(code)
970	}
971	if len(message) != 0 {
972		errorMessage = message
973	}
974
975	switch {
976	case strings.EqualFold("InternalFailureException", errorCode):
977		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
978
979	case strings.EqualFold("InvalidRequestException", errorCode):
980		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
981
982	case strings.EqualFold("ResourceNotFoundException", errorCode):
983		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
984
985	case strings.EqualFold("ThrottlingException", errorCode):
986		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
987
988	default:
989		genericError := &smithy.GenericAPIError{
990			Code:    errorCode,
991			Message: errorMessage,
992		}
993		return genericError
994
995	}
996}
997
998type awsRestjson1_deserializeOpCancelAuditTask struct {
999}
1000
1001func (*awsRestjson1_deserializeOpCancelAuditTask) ID() string {
1002	return "OperationDeserializer"
1003}
1004
1005func (m *awsRestjson1_deserializeOpCancelAuditTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1006	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1007) {
1008	out, metadata, err = next.HandleDeserialize(ctx, in)
1009	if err != nil {
1010		return out, metadata, err
1011	}
1012
1013	response, ok := out.RawResponse.(*smithyhttp.Response)
1014	if !ok {
1015		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1016	}
1017
1018	if response.StatusCode < 200 || response.StatusCode >= 300 {
1019		return out, metadata, awsRestjson1_deserializeOpErrorCancelAuditTask(response, &metadata)
1020	}
1021	output := &CancelAuditTaskOutput{}
1022	out.Result = output
1023
1024	return out, metadata, err
1025}
1026
1027func awsRestjson1_deserializeOpErrorCancelAuditTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1028	var errorBuffer bytes.Buffer
1029	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1030		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1031	}
1032	errorBody := bytes.NewReader(errorBuffer.Bytes())
1033
1034	errorCode := "UnknownError"
1035	errorMessage := errorCode
1036
1037	code := response.Header.Get("X-Amzn-ErrorType")
1038	if len(code) != 0 {
1039		errorCode = restjson.SanitizeErrorCode(code)
1040	}
1041
1042	var buff [1024]byte
1043	ringBuffer := smithyio.NewRingBuffer(buff[:])
1044
1045	body := io.TeeReader(errorBody, ringBuffer)
1046	decoder := json.NewDecoder(body)
1047	decoder.UseNumber()
1048	code, message, err := restjson.GetErrorInfo(decoder)
1049	if err != nil {
1050		var snapshot bytes.Buffer
1051		io.Copy(&snapshot, ringBuffer)
1052		err = &smithy.DeserializationError{
1053			Err:      fmt.Errorf("failed to decode response body, %w", err),
1054			Snapshot: snapshot.Bytes(),
1055		}
1056		return err
1057	}
1058
1059	errorBody.Seek(0, io.SeekStart)
1060	if len(code) != 0 {
1061		errorCode = restjson.SanitizeErrorCode(code)
1062	}
1063	if len(message) != 0 {
1064		errorMessage = message
1065	}
1066
1067	switch {
1068	case strings.EqualFold("InternalFailureException", errorCode):
1069		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1070
1071	case strings.EqualFold("InvalidRequestException", errorCode):
1072		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1073
1074	case strings.EqualFold("ResourceNotFoundException", errorCode):
1075		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1076
1077	case strings.EqualFold("ThrottlingException", errorCode):
1078		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1079
1080	default:
1081		genericError := &smithy.GenericAPIError{
1082			Code:    errorCode,
1083			Message: errorMessage,
1084		}
1085		return genericError
1086
1087	}
1088}
1089
1090type awsRestjson1_deserializeOpCancelCertificateTransfer struct {
1091}
1092
1093func (*awsRestjson1_deserializeOpCancelCertificateTransfer) ID() string {
1094	return "OperationDeserializer"
1095}
1096
1097func (m *awsRestjson1_deserializeOpCancelCertificateTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1098	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1099) {
1100	out, metadata, err = next.HandleDeserialize(ctx, in)
1101	if err != nil {
1102		return out, metadata, err
1103	}
1104
1105	response, ok := out.RawResponse.(*smithyhttp.Response)
1106	if !ok {
1107		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1108	}
1109
1110	if response.StatusCode < 200 || response.StatusCode >= 300 {
1111		return out, metadata, awsRestjson1_deserializeOpErrorCancelCertificateTransfer(response, &metadata)
1112	}
1113	output := &CancelCertificateTransferOutput{}
1114	out.Result = output
1115
1116	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
1117		return out, metadata, &smithy.DeserializationError{
1118			Err: fmt.Errorf("failed to discard response body, %w", err),
1119		}
1120	}
1121
1122	return out, metadata, err
1123}
1124
1125func awsRestjson1_deserializeOpErrorCancelCertificateTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1126	var errorBuffer bytes.Buffer
1127	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1128		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1129	}
1130	errorBody := bytes.NewReader(errorBuffer.Bytes())
1131
1132	errorCode := "UnknownError"
1133	errorMessage := errorCode
1134
1135	code := response.Header.Get("X-Amzn-ErrorType")
1136	if len(code) != 0 {
1137		errorCode = restjson.SanitizeErrorCode(code)
1138	}
1139
1140	var buff [1024]byte
1141	ringBuffer := smithyio.NewRingBuffer(buff[:])
1142
1143	body := io.TeeReader(errorBody, ringBuffer)
1144	decoder := json.NewDecoder(body)
1145	decoder.UseNumber()
1146	code, message, err := restjson.GetErrorInfo(decoder)
1147	if err != nil {
1148		var snapshot bytes.Buffer
1149		io.Copy(&snapshot, ringBuffer)
1150		err = &smithy.DeserializationError{
1151			Err:      fmt.Errorf("failed to decode response body, %w", err),
1152			Snapshot: snapshot.Bytes(),
1153		}
1154		return err
1155	}
1156
1157	errorBody.Seek(0, io.SeekStart)
1158	if len(code) != 0 {
1159		errorCode = restjson.SanitizeErrorCode(code)
1160	}
1161	if len(message) != 0 {
1162		errorMessage = message
1163	}
1164
1165	switch {
1166	case strings.EqualFold("InternalFailureException", errorCode):
1167		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1168
1169	case strings.EqualFold("InvalidRequestException", errorCode):
1170		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1171
1172	case strings.EqualFold("ResourceNotFoundException", errorCode):
1173		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1174
1175	case strings.EqualFold("ServiceUnavailableException", errorCode):
1176		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1177
1178	case strings.EqualFold("ThrottlingException", errorCode):
1179		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1180
1181	case strings.EqualFold("TransferAlreadyCompletedException", errorCode):
1182		return awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response, errorBody)
1183
1184	case strings.EqualFold("UnauthorizedException", errorCode):
1185		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
1186
1187	default:
1188		genericError := &smithy.GenericAPIError{
1189			Code:    errorCode,
1190			Message: errorMessage,
1191		}
1192		return genericError
1193
1194	}
1195}
1196
1197type awsRestjson1_deserializeOpCancelJob struct {
1198}
1199
1200func (*awsRestjson1_deserializeOpCancelJob) ID() string {
1201	return "OperationDeserializer"
1202}
1203
1204func (m *awsRestjson1_deserializeOpCancelJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1205	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1206) {
1207	out, metadata, err = next.HandleDeserialize(ctx, in)
1208	if err != nil {
1209		return out, metadata, err
1210	}
1211
1212	response, ok := out.RawResponse.(*smithyhttp.Response)
1213	if !ok {
1214		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1215	}
1216
1217	if response.StatusCode < 200 || response.StatusCode >= 300 {
1218		return out, metadata, awsRestjson1_deserializeOpErrorCancelJob(response, &metadata)
1219	}
1220	output := &CancelJobOutput{}
1221	out.Result = output
1222
1223	var buff [1024]byte
1224	ringBuffer := smithyio.NewRingBuffer(buff[:])
1225
1226	body := io.TeeReader(response.Body, ringBuffer)
1227
1228	decoder := json.NewDecoder(body)
1229	decoder.UseNumber()
1230	var shape interface{}
1231	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1232		var snapshot bytes.Buffer
1233		io.Copy(&snapshot, ringBuffer)
1234		err = &smithy.DeserializationError{
1235			Err:      fmt.Errorf("failed to decode response body, %w", err),
1236			Snapshot: snapshot.Bytes(),
1237		}
1238		return out, metadata, err
1239	}
1240
1241	err = awsRestjson1_deserializeOpDocumentCancelJobOutput(&output, shape)
1242	if err != nil {
1243		var snapshot bytes.Buffer
1244		io.Copy(&snapshot, ringBuffer)
1245		return out, metadata, &smithy.DeserializationError{
1246			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1247			Snapshot: snapshot.Bytes(),
1248		}
1249	}
1250
1251	return out, metadata, err
1252}
1253
1254func awsRestjson1_deserializeOpErrorCancelJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1255	var errorBuffer bytes.Buffer
1256	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1257		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1258	}
1259	errorBody := bytes.NewReader(errorBuffer.Bytes())
1260
1261	errorCode := "UnknownError"
1262	errorMessage := errorCode
1263
1264	code := response.Header.Get("X-Amzn-ErrorType")
1265	if len(code) != 0 {
1266		errorCode = restjson.SanitizeErrorCode(code)
1267	}
1268
1269	var buff [1024]byte
1270	ringBuffer := smithyio.NewRingBuffer(buff[:])
1271
1272	body := io.TeeReader(errorBody, ringBuffer)
1273	decoder := json.NewDecoder(body)
1274	decoder.UseNumber()
1275	code, message, err := restjson.GetErrorInfo(decoder)
1276	if err != nil {
1277		var snapshot bytes.Buffer
1278		io.Copy(&snapshot, ringBuffer)
1279		err = &smithy.DeserializationError{
1280			Err:      fmt.Errorf("failed to decode response body, %w", err),
1281			Snapshot: snapshot.Bytes(),
1282		}
1283		return err
1284	}
1285
1286	errorBody.Seek(0, io.SeekStart)
1287	if len(code) != 0 {
1288		errorCode = restjson.SanitizeErrorCode(code)
1289	}
1290	if len(message) != 0 {
1291		errorMessage = message
1292	}
1293
1294	switch {
1295	case strings.EqualFold("InvalidRequestException", errorCode):
1296		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1297
1298	case strings.EqualFold("ResourceNotFoundException", errorCode):
1299		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1300
1301	case strings.EqualFold("ServiceUnavailableException", errorCode):
1302		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1303
1304	case strings.EqualFold("ThrottlingException", errorCode):
1305		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1306
1307	default:
1308		genericError := &smithy.GenericAPIError{
1309			Code:    errorCode,
1310			Message: errorMessage,
1311		}
1312		return genericError
1313
1314	}
1315}
1316
1317func awsRestjson1_deserializeOpDocumentCancelJobOutput(v **CancelJobOutput, value interface{}) error {
1318	if v == nil {
1319		return fmt.Errorf("unexpected nil of type %T", v)
1320	}
1321	if value == nil {
1322		return nil
1323	}
1324
1325	shape, ok := value.(map[string]interface{})
1326	if !ok {
1327		return fmt.Errorf("unexpected JSON type %v", value)
1328	}
1329
1330	var sv *CancelJobOutput
1331	if *v == nil {
1332		sv = &CancelJobOutput{}
1333	} else {
1334		sv = *v
1335	}
1336
1337	for key, value := range shape {
1338		switch key {
1339		case "description":
1340			if value != nil {
1341				jtv, ok := value.(string)
1342				if !ok {
1343					return fmt.Errorf("expected JobDescription to be of type string, got %T instead", value)
1344				}
1345				sv.Description = ptr.String(jtv)
1346			}
1347
1348		case "jobArn":
1349			if value != nil {
1350				jtv, ok := value.(string)
1351				if !ok {
1352					return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
1353				}
1354				sv.JobArn = ptr.String(jtv)
1355			}
1356
1357		case "jobId":
1358			if value != nil {
1359				jtv, ok := value.(string)
1360				if !ok {
1361					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
1362				}
1363				sv.JobId = ptr.String(jtv)
1364			}
1365
1366		default:
1367			_, _ = key, value
1368
1369		}
1370	}
1371	*v = sv
1372	return nil
1373}
1374
1375type awsRestjson1_deserializeOpCancelJobExecution struct {
1376}
1377
1378func (*awsRestjson1_deserializeOpCancelJobExecution) ID() string {
1379	return "OperationDeserializer"
1380}
1381
1382func (m *awsRestjson1_deserializeOpCancelJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1383	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1384) {
1385	out, metadata, err = next.HandleDeserialize(ctx, in)
1386	if err != nil {
1387		return out, metadata, err
1388	}
1389
1390	response, ok := out.RawResponse.(*smithyhttp.Response)
1391	if !ok {
1392		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1393	}
1394
1395	if response.StatusCode < 200 || response.StatusCode >= 300 {
1396		return out, metadata, awsRestjson1_deserializeOpErrorCancelJobExecution(response, &metadata)
1397	}
1398	output := &CancelJobExecutionOutput{}
1399	out.Result = output
1400
1401	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
1402		return out, metadata, &smithy.DeserializationError{
1403			Err: fmt.Errorf("failed to discard response body, %w", err),
1404		}
1405	}
1406
1407	return out, metadata, err
1408}
1409
1410func awsRestjson1_deserializeOpErrorCancelJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1411	var errorBuffer bytes.Buffer
1412	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1413		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1414	}
1415	errorBody := bytes.NewReader(errorBuffer.Bytes())
1416
1417	errorCode := "UnknownError"
1418	errorMessage := errorCode
1419
1420	code := response.Header.Get("X-Amzn-ErrorType")
1421	if len(code) != 0 {
1422		errorCode = restjson.SanitizeErrorCode(code)
1423	}
1424
1425	var buff [1024]byte
1426	ringBuffer := smithyio.NewRingBuffer(buff[:])
1427
1428	body := io.TeeReader(errorBody, ringBuffer)
1429	decoder := json.NewDecoder(body)
1430	decoder.UseNumber()
1431	code, message, err := restjson.GetErrorInfo(decoder)
1432	if err != nil {
1433		var snapshot bytes.Buffer
1434		io.Copy(&snapshot, ringBuffer)
1435		err = &smithy.DeserializationError{
1436			Err:      fmt.Errorf("failed to decode response body, %w", err),
1437			Snapshot: snapshot.Bytes(),
1438		}
1439		return err
1440	}
1441
1442	errorBody.Seek(0, io.SeekStart)
1443	if len(code) != 0 {
1444		errorCode = restjson.SanitizeErrorCode(code)
1445	}
1446	if len(message) != 0 {
1447		errorMessage = message
1448	}
1449
1450	switch {
1451	case strings.EqualFold("InvalidRequestException", errorCode):
1452		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1453
1454	case strings.EqualFold("InvalidStateTransitionException", errorCode):
1455		return awsRestjson1_deserializeErrorInvalidStateTransitionException(response, errorBody)
1456
1457	case strings.EqualFold("ResourceNotFoundException", errorCode):
1458		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1459
1460	case strings.EqualFold("ServiceUnavailableException", errorCode):
1461		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1462
1463	case strings.EqualFold("ThrottlingException", errorCode):
1464		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1465
1466	case strings.EqualFold("VersionConflictException", errorCode):
1467		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
1468
1469	default:
1470		genericError := &smithy.GenericAPIError{
1471			Code:    errorCode,
1472			Message: errorMessage,
1473		}
1474		return genericError
1475
1476	}
1477}
1478
1479type awsRestjson1_deserializeOpClearDefaultAuthorizer struct {
1480}
1481
1482func (*awsRestjson1_deserializeOpClearDefaultAuthorizer) ID() string {
1483	return "OperationDeserializer"
1484}
1485
1486func (m *awsRestjson1_deserializeOpClearDefaultAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1487	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1488) {
1489	out, metadata, err = next.HandleDeserialize(ctx, in)
1490	if err != nil {
1491		return out, metadata, err
1492	}
1493
1494	response, ok := out.RawResponse.(*smithyhttp.Response)
1495	if !ok {
1496		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1497	}
1498
1499	if response.StatusCode < 200 || response.StatusCode >= 300 {
1500		return out, metadata, awsRestjson1_deserializeOpErrorClearDefaultAuthorizer(response, &metadata)
1501	}
1502	output := &ClearDefaultAuthorizerOutput{}
1503	out.Result = output
1504
1505	return out, metadata, err
1506}
1507
1508func awsRestjson1_deserializeOpErrorClearDefaultAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1509	var errorBuffer bytes.Buffer
1510	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1511		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1512	}
1513	errorBody := bytes.NewReader(errorBuffer.Bytes())
1514
1515	errorCode := "UnknownError"
1516	errorMessage := errorCode
1517
1518	code := response.Header.Get("X-Amzn-ErrorType")
1519	if len(code) != 0 {
1520		errorCode = restjson.SanitizeErrorCode(code)
1521	}
1522
1523	var buff [1024]byte
1524	ringBuffer := smithyio.NewRingBuffer(buff[:])
1525
1526	body := io.TeeReader(errorBody, ringBuffer)
1527	decoder := json.NewDecoder(body)
1528	decoder.UseNumber()
1529	code, message, err := restjson.GetErrorInfo(decoder)
1530	if err != nil {
1531		var snapshot bytes.Buffer
1532		io.Copy(&snapshot, ringBuffer)
1533		err = &smithy.DeserializationError{
1534			Err:      fmt.Errorf("failed to decode response body, %w", err),
1535			Snapshot: snapshot.Bytes(),
1536		}
1537		return err
1538	}
1539
1540	errorBody.Seek(0, io.SeekStart)
1541	if len(code) != 0 {
1542		errorCode = restjson.SanitizeErrorCode(code)
1543	}
1544	if len(message) != 0 {
1545		errorMessage = message
1546	}
1547
1548	switch {
1549	case strings.EqualFold("InternalFailureException", errorCode):
1550		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1551
1552	case strings.EqualFold("InvalidRequestException", errorCode):
1553		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1554
1555	case strings.EqualFold("ResourceNotFoundException", errorCode):
1556		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1557
1558	case strings.EqualFold("ServiceUnavailableException", errorCode):
1559		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1560
1561	case strings.EqualFold("ThrottlingException", errorCode):
1562		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1563
1564	case strings.EqualFold("UnauthorizedException", errorCode):
1565		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
1566
1567	default:
1568		genericError := &smithy.GenericAPIError{
1569			Code:    errorCode,
1570			Message: errorMessage,
1571		}
1572		return genericError
1573
1574	}
1575}
1576
1577type awsRestjson1_deserializeOpConfirmTopicRuleDestination struct {
1578}
1579
1580func (*awsRestjson1_deserializeOpConfirmTopicRuleDestination) ID() string {
1581	return "OperationDeserializer"
1582}
1583
1584func (m *awsRestjson1_deserializeOpConfirmTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1585	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1586) {
1587	out, metadata, err = next.HandleDeserialize(ctx, in)
1588	if err != nil {
1589		return out, metadata, err
1590	}
1591
1592	response, ok := out.RawResponse.(*smithyhttp.Response)
1593	if !ok {
1594		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1595	}
1596
1597	if response.StatusCode < 200 || response.StatusCode >= 300 {
1598		return out, metadata, awsRestjson1_deserializeOpErrorConfirmTopicRuleDestination(response, &metadata)
1599	}
1600	output := &ConfirmTopicRuleDestinationOutput{}
1601	out.Result = output
1602
1603	return out, metadata, err
1604}
1605
1606func awsRestjson1_deserializeOpErrorConfirmTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1607	var errorBuffer bytes.Buffer
1608	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1609		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1610	}
1611	errorBody := bytes.NewReader(errorBuffer.Bytes())
1612
1613	errorCode := "UnknownError"
1614	errorMessage := errorCode
1615
1616	code := response.Header.Get("X-Amzn-ErrorType")
1617	if len(code) != 0 {
1618		errorCode = restjson.SanitizeErrorCode(code)
1619	}
1620
1621	var buff [1024]byte
1622	ringBuffer := smithyio.NewRingBuffer(buff[:])
1623
1624	body := io.TeeReader(errorBody, ringBuffer)
1625	decoder := json.NewDecoder(body)
1626	decoder.UseNumber()
1627	code, message, err := restjson.GetErrorInfo(decoder)
1628	if err != nil {
1629		var snapshot bytes.Buffer
1630		io.Copy(&snapshot, ringBuffer)
1631		err = &smithy.DeserializationError{
1632			Err:      fmt.Errorf("failed to decode response body, %w", err),
1633			Snapshot: snapshot.Bytes(),
1634		}
1635		return err
1636	}
1637
1638	errorBody.Seek(0, io.SeekStart)
1639	if len(code) != 0 {
1640		errorCode = restjson.SanitizeErrorCode(code)
1641	}
1642	if len(message) != 0 {
1643		errorMessage = message
1644	}
1645
1646	switch {
1647	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
1648		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
1649
1650	case strings.EqualFold("InternalException", errorCode):
1651		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
1652
1653	case strings.EqualFold("InvalidRequestException", errorCode):
1654		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1655
1656	case strings.EqualFold("ServiceUnavailableException", errorCode):
1657		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1658
1659	case strings.EqualFold("UnauthorizedException", errorCode):
1660		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
1661
1662	default:
1663		genericError := &smithy.GenericAPIError{
1664			Code:    errorCode,
1665			Message: errorMessage,
1666		}
1667		return genericError
1668
1669	}
1670}
1671
1672type awsRestjson1_deserializeOpCreateAuditSuppression struct {
1673}
1674
1675func (*awsRestjson1_deserializeOpCreateAuditSuppression) ID() string {
1676	return "OperationDeserializer"
1677}
1678
1679func (m *awsRestjson1_deserializeOpCreateAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1680	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1681) {
1682	out, metadata, err = next.HandleDeserialize(ctx, in)
1683	if err != nil {
1684		return out, metadata, err
1685	}
1686
1687	response, ok := out.RawResponse.(*smithyhttp.Response)
1688	if !ok {
1689		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1690	}
1691
1692	if response.StatusCode < 200 || response.StatusCode >= 300 {
1693		return out, metadata, awsRestjson1_deserializeOpErrorCreateAuditSuppression(response, &metadata)
1694	}
1695	output := &CreateAuditSuppressionOutput{}
1696	out.Result = output
1697
1698	return out, metadata, err
1699}
1700
1701func awsRestjson1_deserializeOpErrorCreateAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1702	var errorBuffer bytes.Buffer
1703	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1704		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1705	}
1706	errorBody := bytes.NewReader(errorBuffer.Bytes())
1707
1708	errorCode := "UnknownError"
1709	errorMessage := errorCode
1710
1711	code := response.Header.Get("X-Amzn-ErrorType")
1712	if len(code) != 0 {
1713		errorCode = restjson.SanitizeErrorCode(code)
1714	}
1715
1716	var buff [1024]byte
1717	ringBuffer := smithyio.NewRingBuffer(buff[:])
1718
1719	body := io.TeeReader(errorBody, ringBuffer)
1720	decoder := json.NewDecoder(body)
1721	decoder.UseNumber()
1722	code, message, err := restjson.GetErrorInfo(decoder)
1723	if err != nil {
1724		var snapshot bytes.Buffer
1725		io.Copy(&snapshot, ringBuffer)
1726		err = &smithy.DeserializationError{
1727			Err:      fmt.Errorf("failed to decode response body, %w", err),
1728			Snapshot: snapshot.Bytes(),
1729		}
1730		return err
1731	}
1732
1733	errorBody.Seek(0, io.SeekStart)
1734	if len(code) != 0 {
1735		errorCode = restjson.SanitizeErrorCode(code)
1736	}
1737	if len(message) != 0 {
1738		errorMessage = message
1739	}
1740
1741	switch {
1742	case strings.EqualFold("InternalFailureException", errorCode):
1743		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1744
1745	case strings.EqualFold("InvalidRequestException", errorCode):
1746		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1747
1748	case strings.EqualFold("LimitExceededException", errorCode):
1749		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
1750
1751	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
1752		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
1753
1754	case strings.EqualFold("ThrottlingException", errorCode):
1755		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1756
1757	default:
1758		genericError := &smithy.GenericAPIError{
1759			Code:    errorCode,
1760			Message: errorMessage,
1761		}
1762		return genericError
1763
1764	}
1765}
1766
1767type awsRestjson1_deserializeOpCreateAuthorizer struct {
1768}
1769
1770func (*awsRestjson1_deserializeOpCreateAuthorizer) ID() string {
1771	return "OperationDeserializer"
1772}
1773
1774func (m *awsRestjson1_deserializeOpCreateAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1775	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1776) {
1777	out, metadata, err = next.HandleDeserialize(ctx, in)
1778	if err != nil {
1779		return out, metadata, err
1780	}
1781
1782	response, ok := out.RawResponse.(*smithyhttp.Response)
1783	if !ok {
1784		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1785	}
1786
1787	if response.StatusCode < 200 || response.StatusCode >= 300 {
1788		return out, metadata, awsRestjson1_deserializeOpErrorCreateAuthorizer(response, &metadata)
1789	}
1790	output := &CreateAuthorizerOutput{}
1791	out.Result = output
1792
1793	var buff [1024]byte
1794	ringBuffer := smithyio.NewRingBuffer(buff[:])
1795
1796	body := io.TeeReader(response.Body, ringBuffer)
1797
1798	decoder := json.NewDecoder(body)
1799	decoder.UseNumber()
1800	var shape interface{}
1801	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1802		var snapshot bytes.Buffer
1803		io.Copy(&snapshot, ringBuffer)
1804		err = &smithy.DeserializationError{
1805			Err:      fmt.Errorf("failed to decode response body, %w", err),
1806			Snapshot: snapshot.Bytes(),
1807		}
1808		return out, metadata, err
1809	}
1810
1811	err = awsRestjson1_deserializeOpDocumentCreateAuthorizerOutput(&output, shape)
1812	if err != nil {
1813		var snapshot bytes.Buffer
1814		io.Copy(&snapshot, ringBuffer)
1815		return out, metadata, &smithy.DeserializationError{
1816			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1817			Snapshot: snapshot.Bytes(),
1818		}
1819	}
1820
1821	return out, metadata, err
1822}
1823
1824func awsRestjson1_deserializeOpErrorCreateAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1825	var errorBuffer bytes.Buffer
1826	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1827		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1828	}
1829	errorBody := bytes.NewReader(errorBuffer.Bytes())
1830
1831	errorCode := "UnknownError"
1832	errorMessage := errorCode
1833
1834	code := response.Header.Get("X-Amzn-ErrorType")
1835	if len(code) != 0 {
1836		errorCode = restjson.SanitizeErrorCode(code)
1837	}
1838
1839	var buff [1024]byte
1840	ringBuffer := smithyio.NewRingBuffer(buff[:])
1841
1842	body := io.TeeReader(errorBody, ringBuffer)
1843	decoder := json.NewDecoder(body)
1844	decoder.UseNumber()
1845	code, message, err := restjson.GetErrorInfo(decoder)
1846	if err != nil {
1847		var snapshot bytes.Buffer
1848		io.Copy(&snapshot, ringBuffer)
1849		err = &smithy.DeserializationError{
1850			Err:      fmt.Errorf("failed to decode response body, %w", err),
1851			Snapshot: snapshot.Bytes(),
1852		}
1853		return err
1854	}
1855
1856	errorBody.Seek(0, io.SeekStart)
1857	if len(code) != 0 {
1858		errorCode = restjson.SanitizeErrorCode(code)
1859	}
1860	if len(message) != 0 {
1861		errorMessage = message
1862	}
1863
1864	switch {
1865	case strings.EqualFold("InternalFailureException", errorCode):
1866		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1867
1868	case strings.EqualFold("InvalidRequestException", errorCode):
1869		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
1870
1871	case strings.EqualFold("LimitExceededException", errorCode):
1872		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
1873
1874	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
1875		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
1876
1877	case strings.EqualFold("ServiceUnavailableException", errorCode):
1878		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
1879
1880	case strings.EqualFold("ThrottlingException", errorCode):
1881		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1882
1883	case strings.EqualFold("UnauthorizedException", errorCode):
1884		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
1885
1886	default:
1887		genericError := &smithy.GenericAPIError{
1888			Code:    errorCode,
1889			Message: errorMessage,
1890		}
1891		return genericError
1892
1893	}
1894}
1895
1896func awsRestjson1_deserializeOpDocumentCreateAuthorizerOutput(v **CreateAuthorizerOutput, value interface{}) error {
1897	if v == nil {
1898		return fmt.Errorf("unexpected nil of type %T", v)
1899	}
1900	if value == nil {
1901		return nil
1902	}
1903
1904	shape, ok := value.(map[string]interface{})
1905	if !ok {
1906		return fmt.Errorf("unexpected JSON type %v", value)
1907	}
1908
1909	var sv *CreateAuthorizerOutput
1910	if *v == nil {
1911		sv = &CreateAuthorizerOutput{}
1912	} else {
1913		sv = *v
1914	}
1915
1916	for key, value := range shape {
1917		switch key {
1918		case "authorizerArn":
1919			if value != nil {
1920				jtv, ok := value.(string)
1921				if !ok {
1922					return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value)
1923				}
1924				sv.AuthorizerArn = ptr.String(jtv)
1925			}
1926
1927		case "authorizerName":
1928			if value != nil {
1929				jtv, ok := value.(string)
1930				if !ok {
1931					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
1932				}
1933				sv.AuthorizerName = ptr.String(jtv)
1934			}
1935
1936		default:
1937			_, _ = key, value
1938
1939		}
1940	}
1941	*v = sv
1942	return nil
1943}
1944
1945type awsRestjson1_deserializeOpCreateBillingGroup struct {
1946}
1947
1948func (*awsRestjson1_deserializeOpCreateBillingGroup) ID() string {
1949	return "OperationDeserializer"
1950}
1951
1952func (m *awsRestjson1_deserializeOpCreateBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1953	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1954) {
1955	out, metadata, err = next.HandleDeserialize(ctx, in)
1956	if err != nil {
1957		return out, metadata, err
1958	}
1959
1960	response, ok := out.RawResponse.(*smithyhttp.Response)
1961	if !ok {
1962		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1963	}
1964
1965	if response.StatusCode < 200 || response.StatusCode >= 300 {
1966		return out, metadata, awsRestjson1_deserializeOpErrorCreateBillingGroup(response, &metadata)
1967	}
1968	output := &CreateBillingGroupOutput{}
1969	out.Result = output
1970
1971	var buff [1024]byte
1972	ringBuffer := smithyio.NewRingBuffer(buff[:])
1973
1974	body := io.TeeReader(response.Body, ringBuffer)
1975
1976	decoder := json.NewDecoder(body)
1977	decoder.UseNumber()
1978	var shape interface{}
1979	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1980		var snapshot bytes.Buffer
1981		io.Copy(&snapshot, ringBuffer)
1982		err = &smithy.DeserializationError{
1983			Err:      fmt.Errorf("failed to decode response body, %w", err),
1984			Snapshot: snapshot.Bytes(),
1985		}
1986		return out, metadata, err
1987	}
1988
1989	err = awsRestjson1_deserializeOpDocumentCreateBillingGroupOutput(&output, shape)
1990	if err != nil {
1991		var snapshot bytes.Buffer
1992		io.Copy(&snapshot, ringBuffer)
1993		return out, metadata, &smithy.DeserializationError{
1994			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1995			Snapshot: snapshot.Bytes(),
1996		}
1997	}
1998
1999	return out, metadata, err
2000}
2001
2002func awsRestjson1_deserializeOpErrorCreateBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2003	var errorBuffer bytes.Buffer
2004	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2005		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2006	}
2007	errorBody := bytes.NewReader(errorBuffer.Bytes())
2008
2009	errorCode := "UnknownError"
2010	errorMessage := errorCode
2011
2012	code := response.Header.Get("X-Amzn-ErrorType")
2013	if len(code) != 0 {
2014		errorCode = restjson.SanitizeErrorCode(code)
2015	}
2016
2017	var buff [1024]byte
2018	ringBuffer := smithyio.NewRingBuffer(buff[:])
2019
2020	body := io.TeeReader(errorBody, ringBuffer)
2021	decoder := json.NewDecoder(body)
2022	decoder.UseNumber()
2023	code, message, err := restjson.GetErrorInfo(decoder)
2024	if err != nil {
2025		var snapshot bytes.Buffer
2026		io.Copy(&snapshot, ringBuffer)
2027		err = &smithy.DeserializationError{
2028			Err:      fmt.Errorf("failed to decode response body, %w", err),
2029			Snapshot: snapshot.Bytes(),
2030		}
2031		return err
2032	}
2033
2034	errorBody.Seek(0, io.SeekStart)
2035	if len(code) != 0 {
2036		errorCode = restjson.SanitizeErrorCode(code)
2037	}
2038	if len(message) != 0 {
2039		errorMessage = message
2040	}
2041
2042	switch {
2043	case strings.EqualFold("InternalFailureException", errorCode):
2044		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2045
2046	case strings.EqualFold("InvalidRequestException", errorCode):
2047		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2048
2049	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
2050		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
2051
2052	case strings.EqualFold("ThrottlingException", errorCode):
2053		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2054
2055	default:
2056		genericError := &smithy.GenericAPIError{
2057			Code:    errorCode,
2058			Message: errorMessage,
2059		}
2060		return genericError
2061
2062	}
2063}
2064
2065func awsRestjson1_deserializeOpDocumentCreateBillingGroupOutput(v **CreateBillingGroupOutput, value interface{}) error {
2066	if v == nil {
2067		return fmt.Errorf("unexpected nil of type %T", v)
2068	}
2069	if value == nil {
2070		return nil
2071	}
2072
2073	shape, ok := value.(map[string]interface{})
2074	if !ok {
2075		return fmt.Errorf("unexpected JSON type %v", value)
2076	}
2077
2078	var sv *CreateBillingGroupOutput
2079	if *v == nil {
2080		sv = &CreateBillingGroupOutput{}
2081	} else {
2082		sv = *v
2083	}
2084
2085	for key, value := range shape {
2086		switch key {
2087		case "billingGroupArn":
2088			if value != nil {
2089				jtv, ok := value.(string)
2090				if !ok {
2091					return fmt.Errorf("expected BillingGroupArn to be of type string, got %T instead", value)
2092				}
2093				sv.BillingGroupArn = ptr.String(jtv)
2094			}
2095
2096		case "billingGroupId":
2097			if value != nil {
2098				jtv, ok := value.(string)
2099				if !ok {
2100					return fmt.Errorf("expected BillingGroupId to be of type string, got %T instead", value)
2101				}
2102				sv.BillingGroupId = ptr.String(jtv)
2103			}
2104
2105		case "billingGroupName":
2106			if value != nil {
2107				jtv, ok := value.(string)
2108				if !ok {
2109					return fmt.Errorf("expected BillingGroupName to be of type string, got %T instead", value)
2110				}
2111				sv.BillingGroupName = ptr.String(jtv)
2112			}
2113
2114		default:
2115			_, _ = key, value
2116
2117		}
2118	}
2119	*v = sv
2120	return nil
2121}
2122
2123type awsRestjson1_deserializeOpCreateCertificateFromCsr struct {
2124}
2125
2126func (*awsRestjson1_deserializeOpCreateCertificateFromCsr) ID() string {
2127	return "OperationDeserializer"
2128}
2129
2130func (m *awsRestjson1_deserializeOpCreateCertificateFromCsr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2131	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2132) {
2133	out, metadata, err = next.HandleDeserialize(ctx, in)
2134	if err != nil {
2135		return out, metadata, err
2136	}
2137
2138	response, ok := out.RawResponse.(*smithyhttp.Response)
2139	if !ok {
2140		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2141	}
2142
2143	if response.StatusCode < 200 || response.StatusCode >= 300 {
2144		return out, metadata, awsRestjson1_deserializeOpErrorCreateCertificateFromCsr(response, &metadata)
2145	}
2146	output := &CreateCertificateFromCsrOutput{}
2147	out.Result = output
2148
2149	var buff [1024]byte
2150	ringBuffer := smithyio.NewRingBuffer(buff[:])
2151
2152	body := io.TeeReader(response.Body, ringBuffer)
2153
2154	decoder := json.NewDecoder(body)
2155	decoder.UseNumber()
2156	var shape interface{}
2157	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2158		var snapshot bytes.Buffer
2159		io.Copy(&snapshot, ringBuffer)
2160		err = &smithy.DeserializationError{
2161			Err:      fmt.Errorf("failed to decode response body, %w", err),
2162			Snapshot: snapshot.Bytes(),
2163		}
2164		return out, metadata, err
2165	}
2166
2167	err = awsRestjson1_deserializeOpDocumentCreateCertificateFromCsrOutput(&output, shape)
2168	if err != nil {
2169		var snapshot bytes.Buffer
2170		io.Copy(&snapshot, ringBuffer)
2171		return out, metadata, &smithy.DeserializationError{
2172			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2173			Snapshot: snapshot.Bytes(),
2174		}
2175	}
2176
2177	return out, metadata, err
2178}
2179
2180func awsRestjson1_deserializeOpErrorCreateCertificateFromCsr(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2181	var errorBuffer bytes.Buffer
2182	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2183		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2184	}
2185	errorBody := bytes.NewReader(errorBuffer.Bytes())
2186
2187	errorCode := "UnknownError"
2188	errorMessage := errorCode
2189
2190	code := response.Header.Get("X-Amzn-ErrorType")
2191	if len(code) != 0 {
2192		errorCode = restjson.SanitizeErrorCode(code)
2193	}
2194
2195	var buff [1024]byte
2196	ringBuffer := smithyio.NewRingBuffer(buff[:])
2197
2198	body := io.TeeReader(errorBody, ringBuffer)
2199	decoder := json.NewDecoder(body)
2200	decoder.UseNumber()
2201	code, message, err := restjson.GetErrorInfo(decoder)
2202	if err != nil {
2203		var snapshot bytes.Buffer
2204		io.Copy(&snapshot, ringBuffer)
2205		err = &smithy.DeserializationError{
2206			Err:      fmt.Errorf("failed to decode response body, %w", err),
2207			Snapshot: snapshot.Bytes(),
2208		}
2209		return err
2210	}
2211
2212	errorBody.Seek(0, io.SeekStart)
2213	if len(code) != 0 {
2214		errorCode = restjson.SanitizeErrorCode(code)
2215	}
2216	if len(message) != 0 {
2217		errorMessage = message
2218	}
2219
2220	switch {
2221	case strings.EqualFold("InternalFailureException", errorCode):
2222		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2223
2224	case strings.EqualFold("InvalidRequestException", errorCode):
2225		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2226
2227	case strings.EqualFold("ServiceUnavailableException", errorCode):
2228		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
2229
2230	case strings.EqualFold("ThrottlingException", errorCode):
2231		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2232
2233	case strings.EqualFold("UnauthorizedException", errorCode):
2234		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
2235
2236	default:
2237		genericError := &smithy.GenericAPIError{
2238			Code:    errorCode,
2239			Message: errorMessage,
2240		}
2241		return genericError
2242
2243	}
2244}
2245
2246func awsRestjson1_deserializeOpDocumentCreateCertificateFromCsrOutput(v **CreateCertificateFromCsrOutput, value interface{}) error {
2247	if v == nil {
2248		return fmt.Errorf("unexpected nil of type %T", v)
2249	}
2250	if value == nil {
2251		return nil
2252	}
2253
2254	shape, ok := value.(map[string]interface{})
2255	if !ok {
2256		return fmt.Errorf("unexpected JSON type %v", value)
2257	}
2258
2259	var sv *CreateCertificateFromCsrOutput
2260	if *v == nil {
2261		sv = &CreateCertificateFromCsrOutput{}
2262	} else {
2263		sv = *v
2264	}
2265
2266	for key, value := range shape {
2267		switch key {
2268		case "certificateArn":
2269			if value != nil {
2270				jtv, ok := value.(string)
2271				if !ok {
2272					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
2273				}
2274				sv.CertificateArn = ptr.String(jtv)
2275			}
2276
2277		case "certificateId":
2278			if value != nil {
2279				jtv, ok := value.(string)
2280				if !ok {
2281					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
2282				}
2283				sv.CertificateId = ptr.String(jtv)
2284			}
2285
2286		case "certificatePem":
2287			if value != nil {
2288				jtv, ok := value.(string)
2289				if !ok {
2290					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
2291				}
2292				sv.CertificatePem = ptr.String(jtv)
2293			}
2294
2295		default:
2296			_, _ = key, value
2297
2298		}
2299	}
2300	*v = sv
2301	return nil
2302}
2303
2304type awsRestjson1_deserializeOpCreateDimension struct {
2305}
2306
2307func (*awsRestjson1_deserializeOpCreateDimension) ID() string {
2308	return "OperationDeserializer"
2309}
2310
2311func (m *awsRestjson1_deserializeOpCreateDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2312	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2313) {
2314	out, metadata, err = next.HandleDeserialize(ctx, in)
2315	if err != nil {
2316		return out, metadata, err
2317	}
2318
2319	response, ok := out.RawResponse.(*smithyhttp.Response)
2320	if !ok {
2321		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2322	}
2323
2324	if response.StatusCode < 200 || response.StatusCode >= 300 {
2325		return out, metadata, awsRestjson1_deserializeOpErrorCreateDimension(response, &metadata)
2326	}
2327	output := &CreateDimensionOutput{}
2328	out.Result = output
2329
2330	var buff [1024]byte
2331	ringBuffer := smithyio.NewRingBuffer(buff[:])
2332
2333	body := io.TeeReader(response.Body, ringBuffer)
2334
2335	decoder := json.NewDecoder(body)
2336	decoder.UseNumber()
2337	var shape interface{}
2338	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2339		var snapshot bytes.Buffer
2340		io.Copy(&snapshot, ringBuffer)
2341		err = &smithy.DeserializationError{
2342			Err:      fmt.Errorf("failed to decode response body, %w", err),
2343			Snapshot: snapshot.Bytes(),
2344		}
2345		return out, metadata, err
2346	}
2347
2348	err = awsRestjson1_deserializeOpDocumentCreateDimensionOutput(&output, shape)
2349	if err != nil {
2350		var snapshot bytes.Buffer
2351		io.Copy(&snapshot, ringBuffer)
2352		return out, metadata, &smithy.DeserializationError{
2353			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2354			Snapshot: snapshot.Bytes(),
2355		}
2356	}
2357
2358	return out, metadata, err
2359}
2360
2361func awsRestjson1_deserializeOpErrorCreateDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2362	var errorBuffer bytes.Buffer
2363	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2364		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2365	}
2366	errorBody := bytes.NewReader(errorBuffer.Bytes())
2367
2368	errorCode := "UnknownError"
2369	errorMessage := errorCode
2370
2371	code := response.Header.Get("X-Amzn-ErrorType")
2372	if len(code) != 0 {
2373		errorCode = restjson.SanitizeErrorCode(code)
2374	}
2375
2376	var buff [1024]byte
2377	ringBuffer := smithyio.NewRingBuffer(buff[:])
2378
2379	body := io.TeeReader(errorBody, ringBuffer)
2380	decoder := json.NewDecoder(body)
2381	decoder.UseNumber()
2382	code, message, err := restjson.GetErrorInfo(decoder)
2383	if err != nil {
2384		var snapshot bytes.Buffer
2385		io.Copy(&snapshot, ringBuffer)
2386		err = &smithy.DeserializationError{
2387			Err:      fmt.Errorf("failed to decode response body, %w", err),
2388			Snapshot: snapshot.Bytes(),
2389		}
2390		return err
2391	}
2392
2393	errorBody.Seek(0, io.SeekStart)
2394	if len(code) != 0 {
2395		errorCode = restjson.SanitizeErrorCode(code)
2396	}
2397	if len(message) != 0 {
2398		errorMessage = message
2399	}
2400
2401	switch {
2402	case strings.EqualFold("InternalFailureException", errorCode):
2403		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2404
2405	case strings.EqualFold("InvalidRequestException", errorCode):
2406		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2407
2408	case strings.EqualFold("LimitExceededException", errorCode):
2409		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2410
2411	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
2412		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
2413
2414	case strings.EqualFold("ThrottlingException", errorCode):
2415		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2416
2417	default:
2418		genericError := &smithy.GenericAPIError{
2419			Code:    errorCode,
2420			Message: errorMessage,
2421		}
2422		return genericError
2423
2424	}
2425}
2426
2427func awsRestjson1_deserializeOpDocumentCreateDimensionOutput(v **CreateDimensionOutput, value interface{}) error {
2428	if v == nil {
2429		return fmt.Errorf("unexpected nil of type %T", v)
2430	}
2431	if value == nil {
2432		return nil
2433	}
2434
2435	shape, ok := value.(map[string]interface{})
2436	if !ok {
2437		return fmt.Errorf("unexpected JSON type %v", value)
2438	}
2439
2440	var sv *CreateDimensionOutput
2441	if *v == nil {
2442		sv = &CreateDimensionOutput{}
2443	} else {
2444		sv = *v
2445	}
2446
2447	for key, value := range shape {
2448		switch key {
2449		case "arn":
2450			if value != nil {
2451				jtv, ok := value.(string)
2452				if !ok {
2453					return fmt.Errorf("expected DimensionArn to be of type string, got %T instead", value)
2454				}
2455				sv.Arn = ptr.String(jtv)
2456			}
2457
2458		case "name":
2459			if value != nil {
2460				jtv, ok := value.(string)
2461				if !ok {
2462					return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
2463				}
2464				sv.Name = ptr.String(jtv)
2465			}
2466
2467		default:
2468			_, _ = key, value
2469
2470		}
2471	}
2472	*v = sv
2473	return nil
2474}
2475
2476type awsRestjson1_deserializeOpCreateDomainConfiguration struct {
2477}
2478
2479func (*awsRestjson1_deserializeOpCreateDomainConfiguration) ID() string {
2480	return "OperationDeserializer"
2481}
2482
2483func (m *awsRestjson1_deserializeOpCreateDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2484	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2485) {
2486	out, metadata, err = next.HandleDeserialize(ctx, in)
2487	if err != nil {
2488		return out, metadata, err
2489	}
2490
2491	response, ok := out.RawResponse.(*smithyhttp.Response)
2492	if !ok {
2493		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2494	}
2495
2496	if response.StatusCode < 200 || response.StatusCode >= 300 {
2497		return out, metadata, awsRestjson1_deserializeOpErrorCreateDomainConfiguration(response, &metadata)
2498	}
2499	output := &CreateDomainConfigurationOutput{}
2500	out.Result = output
2501
2502	var buff [1024]byte
2503	ringBuffer := smithyio.NewRingBuffer(buff[:])
2504
2505	body := io.TeeReader(response.Body, ringBuffer)
2506
2507	decoder := json.NewDecoder(body)
2508	decoder.UseNumber()
2509	var shape interface{}
2510	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2511		var snapshot bytes.Buffer
2512		io.Copy(&snapshot, ringBuffer)
2513		err = &smithy.DeserializationError{
2514			Err:      fmt.Errorf("failed to decode response body, %w", err),
2515			Snapshot: snapshot.Bytes(),
2516		}
2517		return out, metadata, err
2518	}
2519
2520	err = awsRestjson1_deserializeOpDocumentCreateDomainConfigurationOutput(&output, shape)
2521	if err != nil {
2522		var snapshot bytes.Buffer
2523		io.Copy(&snapshot, ringBuffer)
2524		return out, metadata, &smithy.DeserializationError{
2525			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2526			Snapshot: snapshot.Bytes(),
2527		}
2528	}
2529
2530	return out, metadata, err
2531}
2532
2533func awsRestjson1_deserializeOpErrorCreateDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2534	var errorBuffer bytes.Buffer
2535	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2536		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2537	}
2538	errorBody := bytes.NewReader(errorBuffer.Bytes())
2539
2540	errorCode := "UnknownError"
2541	errorMessage := errorCode
2542
2543	code := response.Header.Get("X-Amzn-ErrorType")
2544	if len(code) != 0 {
2545		errorCode = restjson.SanitizeErrorCode(code)
2546	}
2547
2548	var buff [1024]byte
2549	ringBuffer := smithyio.NewRingBuffer(buff[:])
2550
2551	body := io.TeeReader(errorBody, ringBuffer)
2552	decoder := json.NewDecoder(body)
2553	decoder.UseNumber()
2554	code, message, err := restjson.GetErrorInfo(decoder)
2555	if err != nil {
2556		var snapshot bytes.Buffer
2557		io.Copy(&snapshot, ringBuffer)
2558		err = &smithy.DeserializationError{
2559			Err:      fmt.Errorf("failed to decode response body, %w", err),
2560			Snapshot: snapshot.Bytes(),
2561		}
2562		return err
2563	}
2564
2565	errorBody.Seek(0, io.SeekStart)
2566	if len(code) != 0 {
2567		errorCode = restjson.SanitizeErrorCode(code)
2568	}
2569	if len(message) != 0 {
2570		errorMessage = message
2571	}
2572
2573	switch {
2574	case strings.EqualFold("CertificateValidationException", errorCode):
2575		return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody)
2576
2577	case strings.EqualFold("InternalFailureException", errorCode):
2578		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2579
2580	case strings.EqualFold("InvalidRequestException", errorCode):
2581		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2582
2583	case strings.EqualFold("LimitExceededException", errorCode):
2584		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2585
2586	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
2587		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
2588
2589	case strings.EqualFold("ServiceUnavailableException", errorCode):
2590		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
2591
2592	case strings.EqualFold("ThrottlingException", errorCode):
2593		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2594
2595	case strings.EqualFold("UnauthorizedException", errorCode):
2596		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
2597
2598	default:
2599		genericError := &smithy.GenericAPIError{
2600			Code:    errorCode,
2601			Message: errorMessage,
2602		}
2603		return genericError
2604
2605	}
2606}
2607
2608func awsRestjson1_deserializeOpDocumentCreateDomainConfigurationOutput(v **CreateDomainConfigurationOutput, value interface{}) error {
2609	if v == nil {
2610		return fmt.Errorf("unexpected nil of type %T", v)
2611	}
2612	if value == nil {
2613		return nil
2614	}
2615
2616	shape, ok := value.(map[string]interface{})
2617	if !ok {
2618		return fmt.Errorf("unexpected JSON type %v", value)
2619	}
2620
2621	var sv *CreateDomainConfigurationOutput
2622	if *v == nil {
2623		sv = &CreateDomainConfigurationOutput{}
2624	} else {
2625		sv = *v
2626	}
2627
2628	for key, value := range shape {
2629		switch key {
2630		case "domainConfigurationArn":
2631			if value != nil {
2632				jtv, ok := value.(string)
2633				if !ok {
2634					return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value)
2635				}
2636				sv.DomainConfigurationArn = ptr.String(jtv)
2637			}
2638
2639		case "domainConfigurationName":
2640			if value != nil {
2641				jtv, ok := value.(string)
2642				if !ok {
2643					return fmt.Errorf("expected DomainConfigurationName to be of type string, got %T instead", value)
2644				}
2645				sv.DomainConfigurationName = ptr.String(jtv)
2646			}
2647
2648		default:
2649			_, _ = key, value
2650
2651		}
2652	}
2653	*v = sv
2654	return nil
2655}
2656
2657type awsRestjson1_deserializeOpCreateDynamicThingGroup struct {
2658}
2659
2660func (*awsRestjson1_deserializeOpCreateDynamicThingGroup) ID() string {
2661	return "OperationDeserializer"
2662}
2663
2664func (m *awsRestjson1_deserializeOpCreateDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2665	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2666) {
2667	out, metadata, err = next.HandleDeserialize(ctx, in)
2668	if err != nil {
2669		return out, metadata, err
2670	}
2671
2672	response, ok := out.RawResponse.(*smithyhttp.Response)
2673	if !ok {
2674		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2675	}
2676
2677	if response.StatusCode < 200 || response.StatusCode >= 300 {
2678		return out, metadata, awsRestjson1_deserializeOpErrorCreateDynamicThingGroup(response, &metadata)
2679	}
2680	output := &CreateDynamicThingGroupOutput{}
2681	out.Result = output
2682
2683	var buff [1024]byte
2684	ringBuffer := smithyio.NewRingBuffer(buff[:])
2685
2686	body := io.TeeReader(response.Body, ringBuffer)
2687
2688	decoder := json.NewDecoder(body)
2689	decoder.UseNumber()
2690	var shape interface{}
2691	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2692		var snapshot bytes.Buffer
2693		io.Copy(&snapshot, ringBuffer)
2694		err = &smithy.DeserializationError{
2695			Err:      fmt.Errorf("failed to decode response body, %w", err),
2696			Snapshot: snapshot.Bytes(),
2697		}
2698		return out, metadata, err
2699	}
2700
2701	err = awsRestjson1_deserializeOpDocumentCreateDynamicThingGroupOutput(&output, shape)
2702	if err != nil {
2703		var snapshot bytes.Buffer
2704		io.Copy(&snapshot, ringBuffer)
2705		return out, metadata, &smithy.DeserializationError{
2706			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2707			Snapshot: snapshot.Bytes(),
2708		}
2709	}
2710
2711	return out, metadata, err
2712}
2713
2714func awsRestjson1_deserializeOpErrorCreateDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2715	var errorBuffer bytes.Buffer
2716	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2717		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2718	}
2719	errorBody := bytes.NewReader(errorBuffer.Bytes())
2720
2721	errorCode := "UnknownError"
2722	errorMessage := errorCode
2723
2724	code := response.Header.Get("X-Amzn-ErrorType")
2725	if len(code) != 0 {
2726		errorCode = restjson.SanitizeErrorCode(code)
2727	}
2728
2729	var buff [1024]byte
2730	ringBuffer := smithyio.NewRingBuffer(buff[:])
2731
2732	body := io.TeeReader(errorBody, ringBuffer)
2733	decoder := json.NewDecoder(body)
2734	decoder.UseNumber()
2735	code, message, err := restjson.GetErrorInfo(decoder)
2736	if err != nil {
2737		var snapshot bytes.Buffer
2738		io.Copy(&snapshot, ringBuffer)
2739		err = &smithy.DeserializationError{
2740			Err:      fmt.Errorf("failed to decode response body, %w", err),
2741			Snapshot: snapshot.Bytes(),
2742		}
2743		return err
2744	}
2745
2746	errorBody.Seek(0, io.SeekStart)
2747	if len(code) != 0 {
2748		errorCode = restjson.SanitizeErrorCode(code)
2749	}
2750	if len(message) != 0 {
2751		errorMessage = message
2752	}
2753
2754	switch {
2755	case strings.EqualFold("InternalFailureException", errorCode):
2756		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2757
2758	case strings.EqualFold("InvalidQueryException", errorCode):
2759		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
2760
2761	case strings.EqualFold("InvalidRequestException", errorCode):
2762		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2763
2764	case strings.EqualFold("LimitExceededException", errorCode):
2765		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2766
2767	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
2768		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
2769
2770	case strings.EqualFold("ResourceNotFoundException", errorCode):
2771		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2772
2773	case strings.EqualFold("ThrottlingException", errorCode):
2774		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2775
2776	default:
2777		genericError := &smithy.GenericAPIError{
2778			Code:    errorCode,
2779			Message: errorMessage,
2780		}
2781		return genericError
2782
2783	}
2784}
2785
2786func awsRestjson1_deserializeOpDocumentCreateDynamicThingGroupOutput(v **CreateDynamicThingGroupOutput, value interface{}) error {
2787	if v == nil {
2788		return fmt.Errorf("unexpected nil of type %T", v)
2789	}
2790	if value == nil {
2791		return nil
2792	}
2793
2794	shape, ok := value.(map[string]interface{})
2795	if !ok {
2796		return fmt.Errorf("unexpected JSON type %v", value)
2797	}
2798
2799	var sv *CreateDynamicThingGroupOutput
2800	if *v == nil {
2801		sv = &CreateDynamicThingGroupOutput{}
2802	} else {
2803		sv = *v
2804	}
2805
2806	for key, value := range shape {
2807		switch key {
2808		case "indexName":
2809			if value != nil {
2810				jtv, ok := value.(string)
2811				if !ok {
2812					return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
2813				}
2814				sv.IndexName = ptr.String(jtv)
2815			}
2816
2817		case "queryString":
2818			if value != nil {
2819				jtv, ok := value.(string)
2820				if !ok {
2821					return fmt.Errorf("expected QueryString to be of type string, got %T instead", value)
2822				}
2823				sv.QueryString = ptr.String(jtv)
2824			}
2825
2826		case "queryVersion":
2827			if value != nil {
2828				jtv, ok := value.(string)
2829				if !ok {
2830					return fmt.Errorf("expected QueryVersion to be of type string, got %T instead", value)
2831				}
2832				sv.QueryVersion = ptr.String(jtv)
2833			}
2834
2835		case "thingGroupArn":
2836			if value != nil {
2837				jtv, ok := value.(string)
2838				if !ok {
2839					return fmt.Errorf("expected ThingGroupArn to be of type string, got %T instead", value)
2840				}
2841				sv.ThingGroupArn = ptr.String(jtv)
2842			}
2843
2844		case "thingGroupId":
2845			if value != nil {
2846				jtv, ok := value.(string)
2847				if !ok {
2848					return fmt.Errorf("expected ThingGroupId to be of type string, got %T instead", value)
2849				}
2850				sv.ThingGroupId = ptr.String(jtv)
2851			}
2852
2853		case "thingGroupName":
2854			if value != nil {
2855				jtv, ok := value.(string)
2856				if !ok {
2857					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
2858				}
2859				sv.ThingGroupName = ptr.String(jtv)
2860			}
2861
2862		default:
2863			_, _ = key, value
2864
2865		}
2866	}
2867	*v = sv
2868	return nil
2869}
2870
2871type awsRestjson1_deserializeOpCreateJob struct {
2872}
2873
2874func (*awsRestjson1_deserializeOpCreateJob) ID() string {
2875	return "OperationDeserializer"
2876}
2877
2878func (m *awsRestjson1_deserializeOpCreateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2879	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2880) {
2881	out, metadata, err = next.HandleDeserialize(ctx, in)
2882	if err != nil {
2883		return out, metadata, err
2884	}
2885
2886	response, ok := out.RawResponse.(*smithyhttp.Response)
2887	if !ok {
2888		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2889	}
2890
2891	if response.StatusCode < 200 || response.StatusCode >= 300 {
2892		return out, metadata, awsRestjson1_deserializeOpErrorCreateJob(response, &metadata)
2893	}
2894	output := &CreateJobOutput{}
2895	out.Result = output
2896
2897	var buff [1024]byte
2898	ringBuffer := smithyio.NewRingBuffer(buff[:])
2899
2900	body := io.TeeReader(response.Body, ringBuffer)
2901
2902	decoder := json.NewDecoder(body)
2903	decoder.UseNumber()
2904	var shape interface{}
2905	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2906		var snapshot bytes.Buffer
2907		io.Copy(&snapshot, ringBuffer)
2908		err = &smithy.DeserializationError{
2909			Err:      fmt.Errorf("failed to decode response body, %w", err),
2910			Snapshot: snapshot.Bytes(),
2911		}
2912		return out, metadata, err
2913	}
2914
2915	err = awsRestjson1_deserializeOpDocumentCreateJobOutput(&output, shape)
2916	if err != nil {
2917		var snapshot bytes.Buffer
2918		io.Copy(&snapshot, ringBuffer)
2919		return out, metadata, &smithy.DeserializationError{
2920			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2921			Snapshot: snapshot.Bytes(),
2922		}
2923	}
2924
2925	return out, metadata, err
2926}
2927
2928func awsRestjson1_deserializeOpErrorCreateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2929	var errorBuffer bytes.Buffer
2930	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2931		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2932	}
2933	errorBody := bytes.NewReader(errorBuffer.Bytes())
2934
2935	errorCode := "UnknownError"
2936	errorMessage := errorCode
2937
2938	code := response.Header.Get("X-Amzn-ErrorType")
2939	if len(code) != 0 {
2940		errorCode = restjson.SanitizeErrorCode(code)
2941	}
2942
2943	var buff [1024]byte
2944	ringBuffer := smithyio.NewRingBuffer(buff[:])
2945
2946	body := io.TeeReader(errorBody, ringBuffer)
2947	decoder := json.NewDecoder(body)
2948	decoder.UseNumber()
2949	code, message, err := restjson.GetErrorInfo(decoder)
2950	if err != nil {
2951		var snapshot bytes.Buffer
2952		io.Copy(&snapshot, ringBuffer)
2953		err = &smithy.DeserializationError{
2954			Err:      fmt.Errorf("failed to decode response body, %w", err),
2955			Snapshot: snapshot.Bytes(),
2956		}
2957		return err
2958	}
2959
2960	errorBody.Seek(0, io.SeekStart)
2961	if len(code) != 0 {
2962		errorCode = restjson.SanitizeErrorCode(code)
2963	}
2964	if len(message) != 0 {
2965		errorMessage = message
2966	}
2967
2968	switch {
2969	case strings.EqualFold("InvalidRequestException", errorCode):
2970		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
2971
2972	case strings.EqualFold("LimitExceededException", errorCode):
2973		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2974
2975	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
2976		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
2977
2978	case strings.EqualFold("ResourceNotFoundException", errorCode):
2979		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2980
2981	case strings.EqualFold("ServiceUnavailableException", errorCode):
2982		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
2983
2984	case strings.EqualFold("ThrottlingException", errorCode):
2985		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2986
2987	default:
2988		genericError := &smithy.GenericAPIError{
2989			Code:    errorCode,
2990			Message: errorMessage,
2991		}
2992		return genericError
2993
2994	}
2995}
2996
2997func awsRestjson1_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, value interface{}) error {
2998	if v == nil {
2999		return fmt.Errorf("unexpected nil of type %T", v)
3000	}
3001	if value == nil {
3002		return nil
3003	}
3004
3005	shape, ok := value.(map[string]interface{})
3006	if !ok {
3007		return fmt.Errorf("unexpected JSON type %v", value)
3008	}
3009
3010	var sv *CreateJobOutput
3011	if *v == nil {
3012		sv = &CreateJobOutput{}
3013	} else {
3014		sv = *v
3015	}
3016
3017	for key, value := range shape {
3018		switch key {
3019		case "description":
3020			if value != nil {
3021				jtv, ok := value.(string)
3022				if !ok {
3023					return fmt.Errorf("expected JobDescription to be of type string, got %T instead", value)
3024				}
3025				sv.Description = ptr.String(jtv)
3026			}
3027
3028		case "jobArn":
3029			if value != nil {
3030				jtv, ok := value.(string)
3031				if !ok {
3032					return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
3033				}
3034				sv.JobArn = ptr.String(jtv)
3035			}
3036
3037		case "jobId":
3038			if value != nil {
3039				jtv, ok := value.(string)
3040				if !ok {
3041					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
3042				}
3043				sv.JobId = ptr.String(jtv)
3044			}
3045
3046		default:
3047			_, _ = key, value
3048
3049		}
3050	}
3051	*v = sv
3052	return nil
3053}
3054
3055type awsRestjson1_deserializeOpCreateKeysAndCertificate struct {
3056}
3057
3058func (*awsRestjson1_deserializeOpCreateKeysAndCertificate) ID() string {
3059	return "OperationDeserializer"
3060}
3061
3062func (m *awsRestjson1_deserializeOpCreateKeysAndCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3063	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3064) {
3065	out, metadata, err = next.HandleDeserialize(ctx, in)
3066	if err != nil {
3067		return out, metadata, err
3068	}
3069
3070	response, ok := out.RawResponse.(*smithyhttp.Response)
3071	if !ok {
3072		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3073	}
3074
3075	if response.StatusCode < 200 || response.StatusCode >= 300 {
3076		return out, metadata, awsRestjson1_deserializeOpErrorCreateKeysAndCertificate(response, &metadata)
3077	}
3078	output := &CreateKeysAndCertificateOutput{}
3079	out.Result = output
3080
3081	var buff [1024]byte
3082	ringBuffer := smithyio.NewRingBuffer(buff[:])
3083
3084	body := io.TeeReader(response.Body, ringBuffer)
3085
3086	decoder := json.NewDecoder(body)
3087	decoder.UseNumber()
3088	var shape interface{}
3089	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3090		var snapshot bytes.Buffer
3091		io.Copy(&snapshot, ringBuffer)
3092		err = &smithy.DeserializationError{
3093			Err:      fmt.Errorf("failed to decode response body, %w", err),
3094			Snapshot: snapshot.Bytes(),
3095		}
3096		return out, metadata, err
3097	}
3098
3099	err = awsRestjson1_deserializeOpDocumentCreateKeysAndCertificateOutput(&output, shape)
3100	if err != nil {
3101		var snapshot bytes.Buffer
3102		io.Copy(&snapshot, ringBuffer)
3103		return out, metadata, &smithy.DeserializationError{
3104			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3105			Snapshot: snapshot.Bytes(),
3106		}
3107	}
3108
3109	return out, metadata, err
3110}
3111
3112func awsRestjson1_deserializeOpErrorCreateKeysAndCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3113	var errorBuffer bytes.Buffer
3114	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3115		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3116	}
3117	errorBody := bytes.NewReader(errorBuffer.Bytes())
3118
3119	errorCode := "UnknownError"
3120	errorMessage := errorCode
3121
3122	code := response.Header.Get("X-Amzn-ErrorType")
3123	if len(code) != 0 {
3124		errorCode = restjson.SanitizeErrorCode(code)
3125	}
3126
3127	var buff [1024]byte
3128	ringBuffer := smithyio.NewRingBuffer(buff[:])
3129
3130	body := io.TeeReader(errorBody, ringBuffer)
3131	decoder := json.NewDecoder(body)
3132	decoder.UseNumber()
3133	code, message, err := restjson.GetErrorInfo(decoder)
3134	if err != nil {
3135		var snapshot bytes.Buffer
3136		io.Copy(&snapshot, ringBuffer)
3137		err = &smithy.DeserializationError{
3138			Err:      fmt.Errorf("failed to decode response body, %w", err),
3139			Snapshot: snapshot.Bytes(),
3140		}
3141		return err
3142	}
3143
3144	errorBody.Seek(0, io.SeekStart)
3145	if len(code) != 0 {
3146		errorCode = restjson.SanitizeErrorCode(code)
3147	}
3148	if len(message) != 0 {
3149		errorMessage = message
3150	}
3151
3152	switch {
3153	case strings.EqualFold("InternalFailureException", errorCode):
3154		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3155
3156	case strings.EqualFold("InvalidRequestException", errorCode):
3157		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
3158
3159	case strings.EqualFold("ServiceUnavailableException", errorCode):
3160		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
3161
3162	case strings.EqualFold("ThrottlingException", errorCode):
3163		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3164
3165	case strings.EqualFold("UnauthorizedException", errorCode):
3166		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
3167
3168	default:
3169		genericError := &smithy.GenericAPIError{
3170			Code:    errorCode,
3171			Message: errorMessage,
3172		}
3173		return genericError
3174
3175	}
3176}
3177
3178func awsRestjson1_deserializeOpDocumentCreateKeysAndCertificateOutput(v **CreateKeysAndCertificateOutput, value interface{}) error {
3179	if v == nil {
3180		return fmt.Errorf("unexpected nil of type %T", v)
3181	}
3182	if value == nil {
3183		return nil
3184	}
3185
3186	shape, ok := value.(map[string]interface{})
3187	if !ok {
3188		return fmt.Errorf("unexpected JSON type %v", value)
3189	}
3190
3191	var sv *CreateKeysAndCertificateOutput
3192	if *v == nil {
3193		sv = &CreateKeysAndCertificateOutput{}
3194	} else {
3195		sv = *v
3196	}
3197
3198	for key, value := range shape {
3199		switch key {
3200		case "certificateArn":
3201			if value != nil {
3202				jtv, ok := value.(string)
3203				if !ok {
3204					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
3205				}
3206				sv.CertificateArn = ptr.String(jtv)
3207			}
3208
3209		case "certificateId":
3210			if value != nil {
3211				jtv, ok := value.(string)
3212				if !ok {
3213					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
3214				}
3215				sv.CertificateId = ptr.String(jtv)
3216			}
3217
3218		case "certificatePem":
3219			if value != nil {
3220				jtv, ok := value.(string)
3221				if !ok {
3222					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
3223				}
3224				sv.CertificatePem = ptr.String(jtv)
3225			}
3226
3227		case "keyPair":
3228			if err := awsRestjson1_deserializeDocumentKeyPair(&sv.KeyPair, value); err != nil {
3229				return err
3230			}
3231
3232		default:
3233			_, _ = key, value
3234
3235		}
3236	}
3237	*v = sv
3238	return nil
3239}
3240
3241type awsRestjson1_deserializeOpCreateMitigationAction struct {
3242}
3243
3244func (*awsRestjson1_deserializeOpCreateMitigationAction) ID() string {
3245	return "OperationDeserializer"
3246}
3247
3248func (m *awsRestjson1_deserializeOpCreateMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3249	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3250) {
3251	out, metadata, err = next.HandleDeserialize(ctx, in)
3252	if err != nil {
3253		return out, metadata, err
3254	}
3255
3256	response, ok := out.RawResponse.(*smithyhttp.Response)
3257	if !ok {
3258		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3259	}
3260
3261	if response.StatusCode < 200 || response.StatusCode >= 300 {
3262		return out, metadata, awsRestjson1_deserializeOpErrorCreateMitigationAction(response, &metadata)
3263	}
3264	output := &CreateMitigationActionOutput{}
3265	out.Result = output
3266
3267	var buff [1024]byte
3268	ringBuffer := smithyio.NewRingBuffer(buff[:])
3269
3270	body := io.TeeReader(response.Body, ringBuffer)
3271
3272	decoder := json.NewDecoder(body)
3273	decoder.UseNumber()
3274	var shape interface{}
3275	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3276		var snapshot bytes.Buffer
3277		io.Copy(&snapshot, ringBuffer)
3278		err = &smithy.DeserializationError{
3279			Err:      fmt.Errorf("failed to decode response body, %w", err),
3280			Snapshot: snapshot.Bytes(),
3281		}
3282		return out, metadata, err
3283	}
3284
3285	err = awsRestjson1_deserializeOpDocumentCreateMitigationActionOutput(&output, shape)
3286	if err != nil {
3287		var snapshot bytes.Buffer
3288		io.Copy(&snapshot, ringBuffer)
3289		return out, metadata, &smithy.DeserializationError{
3290			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3291			Snapshot: snapshot.Bytes(),
3292		}
3293	}
3294
3295	return out, metadata, err
3296}
3297
3298func awsRestjson1_deserializeOpErrorCreateMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3299	var errorBuffer bytes.Buffer
3300	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3301		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3302	}
3303	errorBody := bytes.NewReader(errorBuffer.Bytes())
3304
3305	errorCode := "UnknownError"
3306	errorMessage := errorCode
3307
3308	code := response.Header.Get("X-Amzn-ErrorType")
3309	if len(code) != 0 {
3310		errorCode = restjson.SanitizeErrorCode(code)
3311	}
3312
3313	var buff [1024]byte
3314	ringBuffer := smithyio.NewRingBuffer(buff[:])
3315
3316	body := io.TeeReader(errorBody, ringBuffer)
3317	decoder := json.NewDecoder(body)
3318	decoder.UseNumber()
3319	code, message, err := restjson.GetErrorInfo(decoder)
3320	if err != nil {
3321		var snapshot bytes.Buffer
3322		io.Copy(&snapshot, ringBuffer)
3323		err = &smithy.DeserializationError{
3324			Err:      fmt.Errorf("failed to decode response body, %w", err),
3325			Snapshot: snapshot.Bytes(),
3326		}
3327		return err
3328	}
3329
3330	errorBody.Seek(0, io.SeekStart)
3331	if len(code) != 0 {
3332		errorCode = restjson.SanitizeErrorCode(code)
3333	}
3334	if len(message) != 0 {
3335		errorMessage = message
3336	}
3337
3338	switch {
3339	case strings.EqualFold("InternalFailureException", errorCode):
3340		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3341
3342	case strings.EqualFold("InvalidRequestException", errorCode):
3343		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
3344
3345	case strings.EqualFold("LimitExceededException", errorCode):
3346		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
3347
3348	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
3349		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
3350
3351	case strings.EqualFold("ThrottlingException", errorCode):
3352		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3353
3354	default:
3355		genericError := &smithy.GenericAPIError{
3356			Code:    errorCode,
3357			Message: errorMessage,
3358		}
3359		return genericError
3360
3361	}
3362}
3363
3364func awsRestjson1_deserializeOpDocumentCreateMitigationActionOutput(v **CreateMitigationActionOutput, value interface{}) error {
3365	if v == nil {
3366		return fmt.Errorf("unexpected nil of type %T", v)
3367	}
3368	if value == nil {
3369		return nil
3370	}
3371
3372	shape, ok := value.(map[string]interface{})
3373	if !ok {
3374		return fmt.Errorf("unexpected JSON type %v", value)
3375	}
3376
3377	var sv *CreateMitigationActionOutput
3378	if *v == nil {
3379		sv = &CreateMitigationActionOutput{}
3380	} else {
3381		sv = *v
3382	}
3383
3384	for key, value := range shape {
3385		switch key {
3386		case "actionArn":
3387			if value != nil {
3388				jtv, ok := value.(string)
3389				if !ok {
3390					return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value)
3391				}
3392				sv.ActionArn = ptr.String(jtv)
3393			}
3394
3395		case "actionId":
3396			if value != nil {
3397				jtv, ok := value.(string)
3398				if !ok {
3399					return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value)
3400				}
3401				sv.ActionId = ptr.String(jtv)
3402			}
3403
3404		default:
3405			_, _ = key, value
3406
3407		}
3408	}
3409	*v = sv
3410	return nil
3411}
3412
3413type awsRestjson1_deserializeOpCreateOTAUpdate struct {
3414}
3415
3416func (*awsRestjson1_deserializeOpCreateOTAUpdate) ID() string {
3417	return "OperationDeserializer"
3418}
3419
3420func (m *awsRestjson1_deserializeOpCreateOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3421	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3422) {
3423	out, metadata, err = next.HandleDeserialize(ctx, in)
3424	if err != nil {
3425		return out, metadata, err
3426	}
3427
3428	response, ok := out.RawResponse.(*smithyhttp.Response)
3429	if !ok {
3430		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3431	}
3432
3433	if response.StatusCode < 200 || response.StatusCode >= 300 {
3434		return out, metadata, awsRestjson1_deserializeOpErrorCreateOTAUpdate(response, &metadata)
3435	}
3436	output := &CreateOTAUpdateOutput{}
3437	out.Result = output
3438
3439	var buff [1024]byte
3440	ringBuffer := smithyio.NewRingBuffer(buff[:])
3441
3442	body := io.TeeReader(response.Body, ringBuffer)
3443
3444	decoder := json.NewDecoder(body)
3445	decoder.UseNumber()
3446	var shape interface{}
3447	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3448		var snapshot bytes.Buffer
3449		io.Copy(&snapshot, ringBuffer)
3450		err = &smithy.DeserializationError{
3451			Err:      fmt.Errorf("failed to decode response body, %w", err),
3452			Snapshot: snapshot.Bytes(),
3453		}
3454		return out, metadata, err
3455	}
3456
3457	err = awsRestjson1_deserializeOpDocumentCreateOTAUpdateOutput(&output, shape)
3458	if err != nil {
3459		var snapshot bytes.Buffer
3460		io.Copy(&snapshot, ringBuffer)
3461		return out, metadata, &smithy.DeserializationError{
3462			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3463			Snapshot: snapshot.Bytes(),
3464		}
3465	}
3466
3467	return out, metadata, err
3468}
3469
3470func awsRestjson1_deserializeOpErrorCreateOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3471	var errorBuffer bytes.Buffer
3472	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3473		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3474	}
3475	errorBody := bytes.NewReader(errorBuffer.Bytes())
3476
3477	errorCode := "UnknownError"
3478	errorMessage := errorCode
3479
3480	code := response.Header.Get("X-Amzn-ErrorType")
3481	if len(code) != 0 {
3482		errorCode = restjson.SanitizeErrorCode(code)
3483	}
3484
3485	var buff [1024]byte
3486	ringBuffer := smithyio.NewRingBuffer(buff[:])
3487
3488	body := io.TeeReader(errorBody, ringBuffer)
3489	decoder := json.NewDecoder(body)
3490	decoder.UseNumber()
3491	code, message, err := restjson.GetErrorInfo(decoder)
3492	if err != nil {
3493		var snapshot bytes.Buffer
3494		io.Copy(&snapshot, ringBuffer)
3495		err = &smithy.DeserializationError{
3496			Err:      fmt.Errorf("failed to decode response body, %w", err),
3497			Snapshot: snapshot.Bytes(),
3498		}
3499		return err
3500	}
3501
3502	errorBody.Seek(0, io.SeekStart)
3503	if len(code) != 0 {
3504		errorCode = restjson.SanitizeErrorCode(code)
3505	}
3506	if len(message) != 0 {
3507		errorMessage = message
3508	}
3509
3510	switch {
3511	case strings.EqualFold("InternalFailureException", errorCode):
3512		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3513
3514	case strings.EqualFold("InvalidRequestException", errorCode):
3515		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
3516
3517	case strings.EqualFold("LimitExceededException", errorCode):
3518		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
3519
3520	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
3521		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
3522
3523	case strings.EqualFold("ResourceNotFoundException", errorCode):
3524		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3525
3526	case strings.EqualFold("ServiceUnavailableException", errorCode):
3527		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
3528
3529	case strings.EqualFold("ThrottlingException", errorCode):
3530		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3531
3532	case strings.EqualFold("UnauthorizedException", errorCode):
3533		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
3534
3535	default:
3536		genericError := &smithy.GenericAPIError{
3537			Code:    errorCode,
3538			Message: errorMessage,
3539		}
3540		return genericError
3541
3542	}
3543}
3544
3545func awsRestjson1_deserializeOpDocumentCreateOTAUpdateOutput(v **CreateOTAUpdateOutput, value interface{}) error {
3546	if v == nil {
3547		return fmt.Errorf("unexpected nil of type %T", v)
3548	}
3549	if value == nil {
3550		return nil
3551	}
3552
3553	shape, ok := value.(map[string]interface{})
3554	if !ok {
3555		return fmt.Errorf("unexpected JSON type %v", value)
3556	}
3557
3558	var sv *CreateOTAUpdateOutput
3559	if *v == nil {
3560		sv = &CreateOTAUpdateOutput{}
3561	} else {
3562		sv = *v
3563	}
3564
3565	for key, value := range shape {
3566		switch key {
3567		case "awsIotJobArn":
3568			if value != nil {
3569				jtv, ok := value.(string)
3570				if !ok {
3571					return fmt.Errorf("expected AwsIotJobArn to be of type string, got %T instead", value)
3572				}
3573				sv.AwsIotJobArn = ptr.String(jtv)
3574			}
3575
3576		case "awsIotJobId":
3577			if value != nil {
3578				jtv, ok := value.(string)
3579				if !ok {
3580					return fmt.Errorf("expected AwsIotJobId to be of type string, got %T instead", value)
3581				}
3582				sv.AwsIotJobId = ptr.String(jtv)
3583			}
3584
3585		case "otaUpdateArn":
3586			if value != nil {
3587				jtv, ok := value.(string)
3588				if !ok {
3589					return fmt.Errorf("expected OTAUpdateArn to be of type string, got %T instead", value)
3590				}
3591				sv.OtaUpdateArn = ptr.String(jtv)
3592			}
3593
3594		case "otaUpdateId":
3595			if value != nil {
3596				jtv, ok := value.(string)
3597				if !ok {
3598					return fmt.Errorf("expected OTAUpdateId to be of type string, got %T instead", value)
3599				}
3600				sv.OtaUpdateId = ptr.String(jtv)
3601			}
3602
3603		case "otaUpdateStatus":
3604			if value != nil {
3605				jtv, ok := value.(string)
3606				if !ok {
3607					return fmt.Errorf("expected OTAUpdateStatus to be of type string, got %T instead", value)
3608				}
3609				sv.OtaUpdateStatus = types.OTAUpdateStatus(jtv)
3610			}
3611
3612		default:
3613			_, _ = key, value
3614
3615		}
3616	}
3617	*v = sv
3618	return nil
3619}
3620
3621type awsRestjson1_deserializeOpCreatePolicy struct {
3622}
3623
3624func (*awsRestjson1_deserializeOpCreatePolicy) ID() string {
3625	return "OperationDeserializer"
3626}
3627
3628func (m *awsRestjson1_deserializeOpCreatePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3629	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3630) {
3631	out, metadata, err = next.HandleDeserialize(ctx, in)
3632	if err != nil {
3633		return out, metadata, err
3634	}
3635
3636	response, ok := out.RawResponse.(*smithyhttp.Response)
3637	if !ok {
3638		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3639	}
3640
3641	if response.StatusCode < 200 || response.StatusCode >= 300 {
3642		return out, metadata, awsRestjson1_deserializeOpErrorCreatePolicy(response, &metadata)
3643	}
3644	output := &CreatePolicyOutput{}
3645	out.Result = output
3646
3647	var buff [1024]byte
3648	ringBuffer := smithyio.NewRingBuffer(buff[:])
3649
3650	body := io.TeeReader(response.Body, ringBuffer)
3651
3652	decoder := json.NewDecoder(body)
3653	decoder.UseNumber()
3654	var shape interface{}
3655	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3656		var snapshot bytes.Buffer
3657		io.Copy(&snapshot, ringBuffer)
3658		err = &smithy.DeserializationError{
3659			Err:      fmt.Errorf("failed to decode response body, %w", err),
3660			Snapshot: snapshot.Bytes(),
3661		}
3662		return out, metadata, err
3663	}
3664
3665	err = awsRestjson1_deserializeOpDocumentCreatePolicyOutput(&output, shape)
3666	if err != nil {
3667		var snapshot bytes.Buffer
3668		io.Copy(&snapshot, ringBuffer)
3669		return out, metadata, &smithy.DeserializationError{
3670			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3671			Snapshot: snapshot.Bytes(),
3672		}
3673	}
3674
3675	return out, metadata, err
3676}
3677
3678func awsRestjson1_deserializeOpErrorCreatePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3679	var errorBuffer bytes.Buffer
3680	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3681		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3682	}
3683	errorBody := bytes.NewReader(errorBuffer.Bytes())
3684
3685	errorCode := "UnknownError"
3686	errorMessage := errorCode
3687
3688	code := response.Header.Get("X-Amzn-ErrorType")
3689	if len(code) != 0 {
3690		errorCode = restjson.SanitizeErrorCode(code)
3691	}
3692
3693	var buff [1024]byte
3694	ringBuffer := smithyio.NewRingBuffer(buff[:])
3695
3696	body := io.TeeReader(errorBody, ringBuffer)
3697	decoder := json.NewDecoder(body)
3698	decoder.UseNumber()
3699	code, message, err := restjson.GetErrorInfo(decoder)
3700	if err != nil {
3701		var snapshot bytes.Buffer
3702		io.Copy(&snapshot, ringBuffer)
3703		err = &smithy.DeserializationError{
3704			Err:      fmt.Errorf("failed to decode response body, %w", err),
3705			Snapshot: snapshot.Bytes(),
3706		}
3707		return err
3708	}
3709
3710	errorBody.Seek(0, io.SeekStart)
3711	if len(code) != 0 {
3712		errorCode = restjson.SanitizeErrorCode(code)
3713	}
3714	if len(message) != 0 {
3715		errorMessage = message
3716	}
3717
3718	switch {
3719	case strings.EqualFold("InternalFailureException", errorCode):
3720		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3721
3722	case strings.EqualFold("InvalidRequestException", errorCode):
3723		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
3724
3725	case strings.EqualFold("MalformedPolicyException", errorCode):
3726		return awsRestjson1_deserializeErrorMalformedPolicyException(response, errorBody)
3727
3728	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
3729		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
3730
3731	case strings.EqualFold("ServiceUnavailableException", errorCode):
3732		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
3733
3734	case strings.EqualFold("ThrottlingException", errorCode):
3735		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3736
3737	case strings.EqualFold("UnauthorizedException", errorCode):
3738		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
3739
3740	default:
3741		genericError := &smithy.GenericAPIError{
3742			Code:    errorCode,
3743			Message: errorMessage,
3744		}
3745		return genericError
3746
3747	}
3748}
3749
3750func awsRestjson1_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput, value interface{}) error {
3751	if v == nil {
3752		return fmt.Errorf("unexpected nil of type %T", v)
3753	}
3754	if value == nil {
3755		return nil
3756	}
3757
3758	shape, ok := value.(map[string]interface{})
3759	if !ok {
3760		return fmt.Errorf("unexpected JSON type %v", value)
3761	}
3762
3763	var sv *CreatePolicyOutput
3764	if *v == nil {
3765		sv = &CreatePolicyOutput{}
3766	} else {
3767		sv = *v
3768	}
3769
3770	for key, value := range shape {
3771		switch key {
3772		case "policyArn":
3773			if value != nil {
3774				jtv, ok := value.(string)
3775				if !ok {
3776					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
3777				}
3778				sv.PolicyArn = ptr.String(jtv)
3779			}
3780
3781		case "policyDocument":
3782			if value != nil {
3783				jtv, ok := value.(string)
3784				if !ok {
3785					return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
3786				}
3787				sv.PolicyDocument = ptr.String(jtv)
3788			}
3789
3790		case "policyName":
3791			if value != nil {
3792				jtv, ok := value.(string)
3793				if !ok {
3794					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
3795				}
3796				sv.PolicyName = ptr.String(jtv)
3797			}
3798
3799		case "policyVersionId":
3800			if value != nil {
3801				jtv, ok := value.(string)
3802				if !ok {
3803					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
3804				}
3805				sv.PolicyVersionId = ptr.String(jtv)
3806			}
3807
3808		default:
3809			_, _ = key, value
3810
3811		}
3812	}
3813	*v = sv
3814	return nil
3815}
3816
3817type awsRestjson1_deserializeOpCreatePolicyVersion struct {
3818}
3819
3820func (*awsRestjson1_deserializeOpCreatePolicyVersion) ID() string {
3821	return "OperationDeserializer"
3822}
3823
3824func (m *awsRestjson1_deserializeOpCreatePolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3825	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3826) {
3827	out, metadata, err = next.HandleDeserialize(ctx, in)
3828	if err != nil {
3829		return out, metadata, err
3830	}
3831
3832	response, ok := out.RawResponse.(*smithyhttp.Response)
3833	if !ok {
3834		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3835	}
3836
3837	if response.StatusCode < 200 || response.StatusCode >= 300 {
3838		return out, metadata, awsRestjson1_deserializeOpErrorCreatePolicyVersion(response, &metadata)
3839	}
3840	output := &CreatePolicyVersionOutput{}
3841	out.Result = output
3842
3843	var buff [1024]byte
3844	ringBuffer := smithyio.NewRingBuffer(buff[:])
3845
3846	body := io.TeeReader(response.Body, ringBuffer)
3847
3848	decoder := json.NewDecoder(body)
3849	decoder.UseNumber()
3850	var shape interface{}
3851	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3852		var snapshot bytes.Buffer
3853		io.Copy(&snapshot, ringBuffer)
3854		err = &smithy.DeserializationError{
3855			Err:      fmt.Errorf("failed to decode response body, %w", err),
3856			Snapshot: snapshot.Bytes(),
3857		}
3858		return out, metadata, err
3859	}
3860
3861	err = awsRestjson1_deserializeOpDocumentCreatePolicyVersionOutput(&output, shape)
3862	if err != nil {
3863		var snapshot bytes.Buffer
3864		io.Copy(&snapshot, ringBuffer)
3865		return out, metadata, &smithy.DeserializationError{
3866			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3867			Snapshot: snapshot.Bytes(),
3868		}
3869	}
3870
3871	return out, metadata, err
3872}
3873
3874func awsRestjson1_deserializeOpErrorCreatePolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3875	var errorBuffer bytes.Buffer
3876	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3877		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3878	}
3879	errorBody := bytes.NewReader(errorBuffer.Bytes())
3880
3881	errorCode := "UnknownError"
3882	errorMessage := errorCode
3883
3884	code := response.Header.Get("X-Amzn-ErrorType")
3885	if len(code) != 0 {
3886		errorCode = restjson.SanitizeErrorCode(code)
3887	}
3888
3889	var buff [1024]byte
3890	ringBuffer := smithyio.NewRingBuffer(buff[:])
3891
3892	body := io.TeeReader(errorBody, ringBuffer)
3893	decoder := json.NewDecoder(body)
3894	decoder.UseNumber()
3895	code, message, err := restjson.GetErrorInfo(decoder)
3896	if err != nil {
3897		var snapshot bytes.Buffer
3898		io.Copy(&snapshot, ringBuffer)
3899		err = &smithy.DeserializationError{
3900			Err:      fmt.Errorf("failed to decode response body, %w", err),
3901			Snapshot: snapshot.Bytes(),
3902		}
3903		return err
3904	}
3905
3906	errorBody.Seek(0, io.SeekStart)
3907	if len(code) != 0 {
3908		errorCode = restjson.SanitizeErrorCode(code)
3909	}
3910	if len(message) != 0 {
3911		errorMessage = message
3912	}
3913
3914	switch {
3915	case strings.EqualFold("InternalFailureException", errorCode):
3916		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3917
3918	case strings.EqualFold("InvalidRequestException", errorCode):
3919		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
3920
3921	case strings.EqualFold("MalformedPolicyException", errorCode):
3922		return awsRestjson1_deserializeErrorMalformedPolicyException(response, errorBody)
3923
3924	case strings.EqualFold("ResourceNotFoundException", errorCode):
3925		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3926
3927	case strings.EqualFold("ServiceUnavailableException", errorCode):
3928		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
3929
3930	case strings.EqualFold("ThrottlingException", errorCode):
3931		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3932
3933	case strings.EqualFold("UnauthorizedException", errorCode):
3934		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
3935
3936	case strings.EqualFold("VersionsLimitExceededException", errorCode):
3937		return awsRestjson1_deserializeErrorVersionsLimitExceededException(response, errorBody)
3938
3939	default:
3940		genericError := &smithy.GenericAPIError{
3941			Code:    errorCode,
3942			Message: errorMessage,
3943		}
3944		return genericError
3945
3946	}
3947}
3948
3949func awsRestjson1_deserializeOpDocumentCreatePolicyVersionOutput(v **CreatePolicyVersionOutput, value interface{}) error {
3950	if v == nil {
3951		return fmt.Errorf("unexpected nil of type %T", v)
3952	}
3953	if value == nil {
3954		return nil
3955	}
3956
3957	shape, ok := value.(map[string]interface{})
3958	if !ok {
3959		return fmt.Errorf("unexpected JSON type %v", value)
3960	}
3961
3962	var sv *CreatePolicyVersionOutput
3963	if *v == nil {
3964		sv = &CreatePolicyVersionOutput{}
3965	} else {
3966		sv = *v
3967	}
3968
3969	for key, value := range shape {
3970		switch key {
3971		case "isDefaultVersion":
3972			if value != nil {
3973				jtv, ok := value.(bool)
3974				if !ok {
3975					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
3976				}
3977				sv.IsDefaultVersion = jtv
3978			}
3979
3980		case "policyArn":
3981			if value != nil {
3982				jtv, ok := value.(string)
3983				if !ok {
3984					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
3985				}
3986				sv.PolicyArn = ptr.String(jtv)
3987			}
3988
3989		case "policyDocument":
3990			if value != nil {
3991				jtv, ok := value.(string)
3992				if !ok {
3993					return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
3994				}
3995				sv.PolicyDocument = ptr.String(jtv)
3996			}
3997
3998		case "policyVersionId":
3999			if value != nil {
4000				jtv, ok := value.(string)
4001				if !ok {
4002					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
4003				}
4004				sv.PolicyVersionId = ptr.String(jtv)
4005			}
4006
4007		default:
4008			_, _ = key, value
4009
4010		}
4011	}
4012	*v = sv
4013	return nil
4014}
4015
4016type awsRestjson1_deserializeOpCreateProvisioningClaim struct {
4017}
4018
4019func (*awsRestjson1_deserializeOpCreateProvisioningClaim) ID() string {
4020	return "OperationDeserializer"
4021}
4022
4023func (m *awsRestjson1_deserializeOpCreateProvisioningClaim) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4024	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4025) {
4026	out, metadata, err = next.HandleDeserialize(ctx, in)
4027	if err != nil {
4028		return out, metadata, err
4029	}
4030
4031	response, ok := out.RawResponse.(*smithyhttp.Response)
4032	if !ok {
4033		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4034	}
4035
4036	if response.StatusCode < 200 || response.StatusCode >= 300 {
4037		return out, metadata, awsRestjson1_deserializeOpErrorCreateProvisioningClaim(response, &metadata)
4038	}
4039	output := &CreateProvisioningClaimOutput{}
4040	out.Result = output
4041
4042	var buff [1024]byte
4043	ringBuffer := smithyio.NewRingBuffer(buff[:])
4044
4045	body := io.TeeReader(response.Body, ringBuffer)
4046
4047	decoder := json.NewDecoder(body)
4048	decoder.UseNumber()
4049	var shape interface{}
4050	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4051		var snapshot bytes.Buffer
4052		io.Copy(&snapshot, ringBuffer)
4053		err = &smithy.DeserializationError{
4054			Err:      fmt.Errorf("failed to decode response body, %w", err),
4055			Snapshot: snapshot.Bytes(),
4056		}
4057		return out, metadata, err
4058	}
4059
4060	err = awsRestjson1_deserializeOpDocumentCreateProvisioningClaimOutput(&output, shape)
4061	if err != nil {
4062		var snapshot bytes.Buffer
4063		io.Copy(&snapshot, ringBuffer)
4064		return out, metadata, &smithy.DeserializationError{
4065			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4066			Snapshot: snapshot.Bytes(),
4067		}
4068	}
4069
4070	return out, metadata, err
4071}
4072
4073func awsRestjson1_deserializeOpErrorCreateProvisioningClaim(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4074	var errorBuffer bytes.Buffer
4075	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4076		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4077	}
4078	errorBody := bytes.NewReader(errorBuffer.Bytes())
4079
4080	errorCode := "UnknownError"
4081	errorMessage := errorCode
4082
4083	code := response.Header.Get("X-Amzn-ErrorType")
4084	if len(code) != 0 {
4085		errorCode = restjson.SanitizeErrorCode(code)
4086	}
4087
4088	var buff [1024]byte
4089	ringBuffer := smithyio.NewRingBuffer(buff[:])
4090
4091	body := io.TeeReader(errorBody, ringBuffer)
4092	decoder := json.NewDecoder(body)
4093	decoder.UseNumber()
4094	code, message, err := restjson.GetErrorInfo(decoder)
4095	if err != nil {
4096		var snapshot bytes.Buffer
4097		io.Copy(&snapshot, ringBuffer)
4098		err = &smithy.DeserializationError{
4099			Err:      fmt.Errorf("failed to decode response body, %w", err),
4100			Snapshot: snapshot.Bytes(),
4101		}
4102		return err
4103	}
4104
4105	errorBody.Seek(0, io.SeekStart)
4106	if len(code) != 0 {
4107		errorCode = restjson.SanitizeErrorCode(code)
4108	}
4109	if len(message) != 0 {
4110		errorMessage = message
4111	}
4112
4113	switch {
4114	case strings.EqualFold("InternalFailureException", errorCode):
4115		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4116
4117	case strings.EqualFold("InvalidRequestException", errorCode):
4118		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
4119
4120	case strings.EqualFold("ResourceNotFoundException", errorCode):
4121		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4122
4123	case strings.EqualFold("ServiceUnavailableException", errorCode):
4124		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
4125
4126	case strings.EqualFold("ThrottlingException", errorCode):
4127		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4128
4129	case strings.EqualFold("UnauthorizedException", errorCode):
4130		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
4131
4132	default:
4133		genericError := &smithy.GenericAPIError{
4134			Code:    errorCode,
4135			Message: errorMessage,
4136		}
4137		return genericError
4138
4139	}
4140}
4141
4142func awsRestjson1_deserializeOpDocumentCreateProvisioningClaimOutput(v **CreateProvisioningClaimOutput, value interface{}) error {
4143	if v == nil {
4144		return fmt.Errorf("unexpected nil of type %T", v)
4145	}
4146	if value == nil {
4147		return nil
4148	}
4149
4150	shape, ok := value.(map[string]interface{})
4151	if !ok {
4152		return fmt.Errorf("unexpected JSON type %v", value)
4153	}
4154
4155	var sv *CreateProvisioningClaimOutput
4156	if *v == nil {
4157		sv = &CreateProvisioningClaimOutput{}
4158	} else {
4159		sv = *v
4160	}
4161
4162	for key, value := range shape {
4163		switch key {
4164		case "certificateId":
4165			if value != nil {
4166				jtv, ok := value.(string)
4167				if !ok {
4168					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
4169				}
4170				sv.CertificateId = ptr.String(jtv)
4171			}
4172
4173		case "certificatePem":
4174			if value != nil {
4175				jtv, ok := value.(string)
4176				if !ok {
4177					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
4178				}
4179				sv.CertificatePem = ptr.String(jtv)
4180			}
4181
4182		case "expiration":
4183			if value != nil {
4184				jtv, ok := value.(json.Number)
4185				if !ok {
4186					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
4187				}
4188				f64, err := jtv.Float64()
4189				if err != nil {
4190					return err
4191				}
4192				sv.Expiration = ptr.Time(smithytime.ParseEpochSeconds(f64))
4193			}
4194
4195		case "keyPair":
4196			if err := awsRestjson1_deserializeDocumentKeyPair(&sv.KeyPair, value); err != nil {
4197				return err
4198			}
4199
4200		default:
4201			_, _ = key, value
4202
4203		}
4204	}
4205	*v = sv
4206	return nil
4207}
4208
4209type awsRestjson1_deserializeOpCreateProvisioningTemplate struct {
4210}
4211
4212func (*awsRestjson1_deserializeOpCreateProvisioningTemplate) ID() string {
4213	return "OperationDeserializer"
4214}
4215
4216func (m *awsRestjson1_deserializeOpCreateProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4217	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4218) {
4219	out, metadata, err = next.HandleDeserialize(ctx, in)
4220	if err != nil {
4221		return out, metadata, err
4222	}
4223
4224	response, ok := out.RawResponse.(*smithyhttp.Response)
4225	if !ok {
4226		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4227	}
4228
4229	if response.StatusCode < 200 || response.StatusCode >= 300 {
4230		return out, metadata, awsRestjson1_deserializeOpErrorCreateProvisioningTemplate(response, &metadata)
4231	}
4232	output := &CreateProvisioningTemplateOutput{}
4233	out.Result = output
4234
4235	var buff [1024]byte
4236	ringBuffer := smithyio.NewRingBuffer(buff[:])
4237
4238	body := io.TeeReader(response.Body, ringBuffer)
4239
4240	decoder := json.NewDecoder(body)
4241	decoder.UseNumber()
4242	var shape interface{}
4243	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4244		var snapshot bytes.Buffer
4245		io.Copy(&snapshot, ringBuffer)
4246		err = &smithy.DeserializationError{
4247			Err:      fmt.Errorf("failed to decode response body, %w", err),
4248			Snapshot: snapshot.Bytes(),
4249		}
4250		return out, metadata, err
4251	}
4252
4253	err = awsRestjson1_deserializeOpDocumentCreateProvisioningTemplateOutput(&output, shape)
4254	if err != nil {
4255		var snapshot bytes.Buffer
4256		io.Copy(&snapshot, ringBuffer)
4257		return out, metadata, &smithy.DeserializationError{
4258			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4259			Snapshot: snapshot.Bytes(),
4260		}
4261	}
4262
4263	return out, metadata, err
4264}
4265
4266func awsRestjson1_deserializeOpErrorCreateProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4267	var errorBuffer bytes.Buffer
4268	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4269		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4270	}
4271	errorBody := bytes.NewReader(errorBuffer.Bytes())
4272
4273	errorCode := "UnknownError"
4274	errorMessage := errorCode
4275
4276	code := response.Header.Get("X-Amzn-ErrorType")
4277	if len(code) != 0 {
4278		errorCode = restjson.SanitizeErrorCode(code)
4279	}
4280
4281	var buff [1024]byte
4282	ringBuffer := smithyio.NewRingBuffer(buff[:])
4283
4284	body := io.TeeReader(errorBody, ringBuffer)
4285	decoder := json.NewDecoder(body)
4286	decoder.UseNumber()
4287	code, message, err := restjson.GetErrorInfo(decoder)
4288	if err != nil {
4289		var snapshot bytes.Buffer
4290		io.Copy(&snapshot, ringBuffer)
4291		err = &smithy.DeserializationError{
4292			Err:      fmt.Errorf("failed to decode response body, %w", err),
4293			Snapshot: snapshot.Bytes(),
4294		}
4295		return err
4296	}
4297
4298	errorBody.Seek(0, io.SeekStart)
4299	if len(code) != 0 {
4300		errorCode = restjson.SanitizeErrorCode(code)
4301	}
4302	if len(message) != 0 {
4303		errorMessage = message
4304	}
4305
4306	switch {
4307	case strings.EqualFold("InternalFailureException", errorCode):
4308		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4309
4310	case strings.EqualFold("InvalidRequestException", errorCode):
4311		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
4312
4313	case strings.EqualFold("LimitExceededException", errorCode):
4314		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
4315
4316	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
4317		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
4318
4319	case strings.EqualFold("ThrottlingException", errorCode):
4320		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4321
4322	case strings.EqualFold("UnauthorizedException", errorCode):
4323		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
4324
4325	default:
4326		genericError := &smithy.GenericAPIError{
4327			Code:    errorCode,
4328			Message: errorMessage,
4329		}
4330		return genericError
4331
4332	}
4333}
4334
4335func awsRestjson1_deserializeOpDocumentCreateProvisioningTemplateOutput(v **CreateProvisioningTemplateOutput, value interface{}) error {
4336	if v == nil {
4337		return fmt.Errorf("unexpected nil of type %T", v)
4338	}
4339	if value == nil {
4340		return nil
4341	}
4342
4343	shape, ok := value.(map[string]interface{})
4344	if !ok {
4345		return fmt.Errorf("unexpected JSON type %v", value)
4346	}
4347
4348	var sv *CreateProvisioningTemplateOutput
4349	if *v == nil {
4350		sv = &CreateProvisioningTemplateOutput{}
4351	} else {
4352		sv = *v
4353	}
4354
4355	for key, value := range shape {
4356		switch key {
4357		case "defaultVersionId":
4358			if value != nil {
4359				jtv, ok := value.(json.Number)
4360				if !ok {
4361					return fmt.Errorf("expected TemplateVersionId to be json.Number, got %T instead", value)
4362				}
4363				i64, err := jtv.Int64()
4364				if err != nil {
4365					return err
4366				}
4367				sv.DefaultVersionId = ptr.Int32(int32(i64))
4368			}
4369
4370		case "templateArn":
4371			if value != nil {
4372				jtv, ok := value.(string)
4373				if !ok {
4374					return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value)
4375				}
4376				sv.TemplateArn = ptr.String(jtv)
4377			}
4378
4379		case "templateName":
4380			if value != nil {
4381				jtv, ok := value.(string)
4382				if !ok {
4383					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
4384				}
4385				sv.TemplateName = ptr.String(jtv)
4386			}
4387
4388		default:
4389			_, _ = key, value
4390
4391		}
4392	}
4393	*v = sv
4394	return nil
4395}
4396
4397type awsRestjson1_deserializeOpCreateProvisioningTemplateVersion struct {
4398}
4399
4400func (*awsRestjson1_deserializeOpCreateProvisioningTemplateVersion) ID() string {
4401	return "OperationDeserializer"
4402}
4403
4404func (m *awsRestjson1_deserializeOpCreateProvisioningTemplateVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4405	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4406) {
4407	out, metadata, err = next.HandleDeserialize(ctx, in)
4408	if err != nil {
4409		return out, metadata, err
4410	}
4411
4412	response, ok := out.RawResponse.(*smithyhttp.Response)
4413	if !ok {
4414		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4415	}
4416
4417	if response.StatusCode < 200 || response.StatusCode >= 300 {
4418		return out, metadata, awsRestjson1_deserializeOpErrorCreateProvisioningTemplateVersion(response, &metadata)
4419	}
4420	output := &CreateProvisioningTemplateVersionOutput{}
4421	out.Result = output
4422
4423	var buff [1024]byte
4424	ringBuffer := smithyio.NewRingBuffer(buff[:])
4425
4426	body := io.TeeReader(response.Body, ringBuffer)
4427
4428	decoder := json.NewDecoder(body)
4429	decoder.UseNumber()
4430	var shape interface{}
4431	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4432		var snapshot bytes.Buffer
4433		io.Copy(&snapshot, ringBuffer)
4434		err = &smithy.DeserializationError{
4435			Err:      fmt.Errorf("failed to decode response body, %w", err),
4436			Snapshot: snapshot.Bytes(),
4437		}
4438		return out, metadata, err
4439	}
4440
4441	err = awsRestjson1_deserializeOpDocumentCreateProvisioningTemplateVersionOutput(&output, shape)
4442	if err != nil {
4443		var snapshot bytes.Buffer
4444		io.Copy(&snapshot, ringBuffer)
4445		return out, metadata, &smithy.DeserializationError{
4446			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4447			Snapshot: snapshot.Bytes(),
4448		}
4449	}
4450
4451	return out, metadata, err
4452}
4453
4454func awsRestjson1_deserializeOpErrorCreateProvisioningTemplateVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4455	var errorBuffer bytes.Buffer
4456	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4457		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4458	}
4459	errorBody := bytes.NewReader(errorBuffer.Bytes())
4460
4461	errorCode := "UnknownError"
4462	errorMessage := errorCode
4463
4464	code := response.Header.Get("X-Amzn-ErrorType")
4465	if len(code) != 0 {
4466		errorCode = restjson.SanitizeErrorCode(code)
4467	}
4468
4469	var buff [1024]byte
4470	ringBuffer := smithyio.NewRingBuffer(buff[:])
4471
4472	body := io.TeeReader(errorBody, ringBuffer)
4473	decoder := json.NewDecoder(body)
4474	decoder.UseNumber()
4475	code, message, err := restjson.GetErrorInfo(decoder)
4476	if err != nil {
4477		var snapshot bytes.Buffer
4478		io.Copy(&snapshot, ringBuffer)
4479		err = &smithy.DeserializationError{
4480			Err:      fmt.Errorf("failed to decode response body, %w", err),
4481			Snapshot: snapshot.Bytes(),
4482		}
4483		return err
4484	}
4485
4486	errorBody.Seek(0, io.SeekStart)
4487	if len(code) != 0 {
4488		errorCode = restjson.SanitizeErrorCode(code)
4489	}
4490	if len(message) != 0 {
4491		errorMessage = message
4492	}
4493
4494	switch {
4495	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
4496		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
4497
4498	case strings.EqualFold("InternalFailureException", errorCode):
4499		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4500
4501	case strings.EqualFold("InvalidRequestException", errorCode):
4502		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
4503
4504	case strings.EqualFold("ResourceNotFoundException", errorCode):
4505		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4506
4507	case strings.EqualFold("ThrottlingException", errorCode):
4508		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4509
4510	case strings.EqualFold("UnauthorizedException", errorCode):
4511		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
4512
4513	case strings.EqualFold("VersionsLimitExceededException", errorCode):
4514		return awsRestjson1_deserializeErrorVersionsLimitExceededException(response, errorBody)
4515
4516	default:
4517		genericError := &smithy.GenericAPIError{
4518			Code:    errorCode,
4519			Message: errorMessage,
4520		}
4521		return genericError
4522
4523	}
4524}
4525
4526func awsRestjson1_deserializeOpDocumentCreateProvisioningTemplateVersionOutput(v **CreateProvisioningTemplateVersionOutput, value interface{}) error {
4527	if v == nil {
4528		return fmt.Errorf("unexpected nil of type %T", v)
4529	}
4530	if value == nil {
4531		return nil
4532	}
4533
4534	shape, ok := value.(map[string]interface{})
4535	if !ok {
4536		return fmt.Errorf("unexpected JSON type %v", value)
4537	}
4538
4539	var sv *CreateProvisioningTemplateVersionOutput
4540	if *v == nil {
4541		sv = &CreateProvisioningTemplateVersionOutput{}
4542	} else {
4543		sv = *v
4544	}
4545
4546	for key, value := range shape {
4547		switch key {
4548		case "isDefaultVersion":
4549			if value != nil {
4550				jtv, ok := value.(bool)
4551				if !ok {
4552					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
4553				}
4554				sv.IsDefaultVersion = jtv
4555			}
4556
4557		case "templateArn":
4558			if value != nil {
4559				jtv, ok := value.(string)
4560				if !ok {
4561					return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value)
4562				}
4563				sv.TemplateArn = ptr.String(jtv)
4564			}
4565
4566		case "templateName":
4567			if value != nil {
4568				jtv, ok := value.(string)
4569				if !ok {
4570					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
4571				}
4572				sv.TemplateName = ptr.String(jtv)
4573			}
4574
4575		case "versionId":
4576			if value != nil {
4577				jtv, ok := value.(json.Number)
4578				if !ok {
4579					return fmt.Errorf("expected TemplateVersionId to be json.Number, got %T instead", value)
4580				}
4581				i64, err := jtv.Int64()
4582				if err != nil {
4583					return err
4584				}
4585				sv.VersionId = ptr.Int32(int32(i64))
4586			}
4587
4588		default:
4589			_, _ = key, value
4590
4591		}
4592	}
4593	*v = sv
4594	return nil
4595}
4596
4597type awsRestjson1_deserializeOpCreateRoleAlias struct {
4598}
4599
4600func (*awsRestjson1_deserializeOpCreateRoleAlias) ID() string {
4601	return "OperationDeserializer"
4602}
4603
4604func (m *awsRestjson1_deserializeOpCreateRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4605	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4606) {
4607	out, metadata, err = next.HandleDeserialize(ctx, in)
4608	if err != nil {
4609		return out, metadata, err
4610	}
4611
4612	response, ok := out.RawResponse.(*smithyhttp.Response)
4613	if !ok {
4614		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4615	}
4616
4617	if response.StatusCode < 200 || response.StatusCode >= 300 {
4618		return out, metadata, awsRestjson1_deserializeOpErrorCreateRoleAlias(response, &metadata)
4619	}
4620	output := &CreateRoleAliasOutput{}
4621	out.Result = output
4622
4623	var buff [1024]byte
4624	ringBuffer := smithyio.NewRingBuffer(buff[:])
4625
4626	body := io.TeeReader(response.Body, ringBuffer)
4627
4628	decoder := json.NewDecoder(body)
4629	decoder.UseNumber()
4630	var shape interface{}
4631	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4632		var snapshot bytes.Buffer
4633		io.Copy(&snapshot, ringBuffer)
4634		err = &smithy.DeserializationError{
4635			Err:      fmt.Errorf("failed to decode response body, %w", err),
4636			Snapshot: snapshot.Bytes(),
4637		}
4638		return out, metadata, err
4639	}
4640
4641	err = awsRestjson1_deserializeOpDocumentCreateRoleAliasOutput(&output, shape)
4642	if err != nil {
4643		var snapshot bytes.Buffer
4644		io.Copy(&snapshot, ringBuffer)
4645		return out, metadata, &smithy.DeserializationError{
4646			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4647			Snapshot: snapshot.Bytes(),
4648		}
4649	}
4650
4651	return out, metadata, err
4652}
4653
4654func awsRestjson1_deserializeOpErrorCreateRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4655	var errorBuffer bytes.Buffer
4656	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4657		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4658	}
4659	errorBody := bytes.NewReader(errorBuffer.Bytes())
4660
4661	errorCode := "UnknownError"
4662	errorMessage := errorCode
4663
4664	code := response.Header.Get("X-Amzn-ErrorType")
4665	if len(code) != 0 {
4666		errorCode = restjson.SanitizeErrorCode(code)
4667	}
4668
4669	var buff [1024]byte
4670	ringBuffer := smithyio.NewRingBuffer(buff[:])
4671
4672	body := io.TeeReader(errorBody, ringBuffer)
4673	decoder := json.NewDecoder(body)
4674	decoder.UseNumber()
4675	code, message, err := restjson.GetErrorInfo(decoder)
4676	if err != nil {
4677		var snapshot bytes.Buffer
4678		io.Copy(&snapshot, ringBuffer)
4679		err = &smithy.DeserializationError{
4680			Err:      fmt.Errorf("failed to decode response body, %w", err),
4681			Snapshot: snapshot.Bytes(),
4682		}
4683		return err
4684	}
4685
4686	errorBody.Seek(0, io.SeekStart)
4687	if len(code) != 0 {
4688		errorCode = restjson.SanitizeErrorCode(code)
4689	}
4690	if len(message) != 0 {
4691		errorMessage = message
4692	}
4693
4694	switch {
4695	case strings.EqualFold("InternalFailureException", errorCode):
4696		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4697
4698	case strings.EqualFold("InvalidRequestException", errorCode):
4699		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
4700
4701	case strings.EqualFold("LimitExceededException", errorCode):
4702		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
4703
4704	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
4705		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
4706
4707	case strings.EqualFold("ServiceUnavailableException", errorCode):
4708		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
4709
4710	case strings.EqualFold("ThrottlingException", errorCode):
4711		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4712
4713	case strings.EqualFold("UnauthorizedException", errorCode):
4714		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
4715
4716	default:
4717		genericError := &smithy.GenericAPIError{
4718			Code:    errorCode,
4719			Message: errorMessage,
4720		}
4721		return genericError
4722
4723	}
4724}
4725
4726func awsRestjson1_deserializeOpDocumentCreateRoleAliasOutput(v **CreateRoleAliasOutput, value interface{}) error {
4727	if v == nil {
4728		return fmt.Errorf("unexpected nil of type %T", v)
4729	}
4730	if value == nil {
4731		return nil
4732	}
4733
4734	shape, ok := value.(map[string]interface{})
4735	if !ok {
4736		return fmt.Errorf("unexpected JSON type %v", value)
4737	}
4738
4739	var sv *CreateRoleAliasOutput
4740	if *v == nil {
4741		sv = &CreateRoleAliasOutput{}
4742	} else {
4743		sv = *v
4744	}
4745
4746	for key, value := range shape {
4747		switch key {
4748		case "roleAlias":
4749			if value != nil {
4750				jtv, ok := value.(string)
4751				if !ok {
4752					return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value)
4753				}
4754				sv.RoleAlias = ptr.String(jtv)
4755			}
4756
4757		case "roleAliasArn":
4758			if value != nil {
4759				jtv, ok := value.(string)
4760				if !ok {
4761					return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value)
4762				}
4763				sv.RoleAliasArn = ptr.String(jtv)
4764			}
4765
4766		default:
4767			_, _ = key, value
4768
4769		}
4770	}
4771	*v = sv
4772	return nil
4773}
4774
4775type awsRestjson1_deserializeOpCreateScheduledAudit struct {
4776}
4777
4778func (*awsRestjson1_deserializeOpCreateScheduledAudit) ID() string {
4779	return "OperationDeserializer"
4780}
4781
4782func (m *awsRestjson1_deserializeOpCreateScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4783	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4784) {
4785	out, metadata, err = next.HandleDeserialize(ctx, in)
4786	if err != nil {
4787		return out, metadata, err
4788	}
4789
4790	response, ok := out.RawResponse.(*smithyhttp.Response)
4791	if !ok {
4792		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4793	}
4794
4795	if response.StatusCode < 200 || response.StatusCode >= 300 {
4796		return out, metadata, awsRestjson1_deserializeOpErrorCreateScheduledAudit(response, &metadata)
4797	}
4798	output := &CreateScheduledAuditOutput{}
4799	out.Result = output
4800
4801	var buff [1024]byte
4802	ringBuffer := smithyio.NewRingBuffer(buff[:])
4803
4804	body := io.TeeReader(response.Body, ringBuffer)
4805
4806	decoder := json.NewDecoder(body)
4807	decoder.UseNumber()
4808	var shape interface{}
4809	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4810		var snapshot bytes.Buffer
4811		io.Copy(&snapshot, ringBuffer)
4812		err = &smithy.DeserializationError{
4813			Err:      fmt.Errorf("failed to decode response body, %w", err),
4814			Snapshot: snapshot.Bytes(),
4815		}
4816		return out, metadata, err
4817	}
4818
4819	err = awsRestjson1_deserializeOpDocumentCreateScheduledAuditOutput(&output, shape)
4820	if err != nil {
4821		var snapshot bytes.Buffer
4822		io.Copy(&snapshot, ringBuffer)
4823		return out, metadata, &smithy.DeserializationError{
4824			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4825			Snapshot: snapshot.Bytes(),
4826		}
4827	}
4828
4829	return out, metadata, err
4830}
4831
4832func awsRestjson1_deserializeOpErrorCreateScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4833	var errorBuffer bytes.Buffer
4834	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4835		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4836	}
4837	errorBody := bytes.NewReader(errorBuffer.Bytes())
4838
4839	errorCode := "UnknownError"
4840	errorMessage := errorCode
4841
4842	code := response.Header.Get("X-Amzn-ErrorType")
4843	if len(code) != 0 {
4844		errorCode = restjson.SanitizeErrorCode(code)
4845	}
4846
4847	var buff [1024]byte
4848	ringBuffer := smithyio.NewRingBuffer(buff[:])
4849
4850	body := io.TeeReader(errorBody, ringBuffer)
4851	decoder := json.NewDecoder(body)
4852	decoder.UseNumber()
4853	code, message, err := restjson.GetErrorInfo(decoder)
4854	if err != nil {
4855		var snapshot bytes.Buffer
4856		io.Copy(&snapshot, ringBuffer)
4857		err = &smithy.DeserializationError{
4858			Err:      fmt.Errorf("failed to decode response body, %w", err),
4859			Snapshot: snapshot.Bytes(),
4860		}
4861		return err
4862	}
4863
4864	errorBody.Seek(0, io.SeekStart)
4865	if len(code) != 0 {
4866		errorCode = restjson.SanitizeErrorCode(code)
4867	}
4868	if len(message) != 0 {
4869		errorMessage = message
4870	}
4871
4872	switch {
4873	case strings.EqualFold("InternalFailureException", errorCode):
4874		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4875
4876	case strings.EqualFold("InvalidRequestException", errorCode):
4877		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
4878
4879	case strings.EqualFold("LimitExceededException", errorCode):
4880		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
4881
4882	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
4883		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
4884
4885	case strings.EqualFold("ThrottlingException", errorCode):
4886		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4887
4888	default:
4889		genericError := &smithy.GenericAPIError{
4890			Code:    errorCode,
4891			Message: errorMessage,
4892		}
4893		return genericError
4894
4895	}
4896}
4897
4898func awsRestjson1_deserializeOpDocumentCreateScheduledAuditOutput(v **CreateScheduledAuditOutput, value interface{}) error {
4899	if v == nil {
4900		return fmt.Errorf("unexpected nil of type %T", v)
4901	}
4902	if value == nil {
4903		return nil
4904	}
4905
4906	shape, ok := value.(map[string]interface{})
4907	if !ok {
4908		return fmt.Errorf("unexpected JSON type %v", value)
4909	}
4910
4911	var sv *CreateScheduledAuditOutput
4912	if *v == nil {
4913		sv = &CreateScheduledAuditOutput{}
4914	} else {
4915		sv = *v
4916	}
4917
4918	for key, value := range shape {
4919		switch key {
4920		case "scheduledAuditArn":
4921			if value != nil {
4922				jtv, ok := value.(string)
4923				if !ok {
4924					return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value)
4925				}
4926				sv.ScheduledAuditArn = ptr.String(jtv)
4927			}
4928
4929		default:
4930			_, _ = key, value
4931
4932		}
4933	}
4934	*v = sv
4935	return nil
4936}
4937
4938type awsRestjson1_deserializeOpCreateSecurityProfile struct {
4939}
4940
4941func (*awsRestjson1_deserializeOpCreateSecurityProfile) ID() string {
4942	return "OperationDeserializer"
4943}
4944
4945func (m *awsRestjson1_deserializeOpCreateSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4946	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4947) {
4948	out, metadata, err = next.HandleDeserialize(ctx, in)
4949	if err != nil {
4950		return out, metadata, err
4951	}
4952
4953	response, ok := out.RawResponse.(*smithyhttp.Response)
4954	if !ok {
4955		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4956	}
4957
4958	if response.StatusCode < 200 || response.StatusCode >= 300 {
4959		return out, metadata, awsRestjson1_deserializeOpErrorCreateSecurityProfile(response, &metadata)
4960	}
4961	output := &CreateSecurityProfileOutput{}
4962	out.Result = output
4963
4964	var buff [1024]byte
4965	ringBuffer := smithyio.NewRingBuffer(buff[:])
4966
4967	body := io.TeeReader(response.Body, ringBuffer)
4968
4969	decoder := json.NewDecoder(body)
4970	decoder.UseNumber()
4971	var shape interface{}
4972	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4973		var snapshot bytes.Buffer
4974		io.Copy(&snapshot, ringBuffer)
4975		err = &smithy.DeserializationError{
4976			Err:      fmt.Errorf("failed to decode response body, %w", err),
4977			Snapshot: snapshot.Bytes(),
4978		}
4979		return out, metadata, err
4980	}
4981
4982	err = awsRestjson1_deserializeOpDocumentCreateSecurityProfileOutput(&output, shape)
4983	if err != nil {
4984		var snapshot bytes.Buffer
4985		io.Copy(&snapshot, ringBuffer)
4986		return out, metadata, &smithy.DeserializationError{
4987			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4988			Snapshot: snapshot.Bytes(),
4989		}
4990	}
4991
4992	return out, metadata, err
4993}
4994
4995func awsRestjson1_deserializeOpErrorCreateSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4996	var errorBuffer bytes.Buffer
4997	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4998		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4999	}
5000	errorBody := bytes.NewReader(errorBuffer.Bytes())
5001
5002	errorCode := "UnknownError"
5003	errorMessage := errorCode
5004
5005	code := response.Header.Get("X-Amzn-ErrorType")
5006	if len(code) != 0 {
5007		errorCode = restjson.SanitizeErrorCode(code)
5008	}
5009
5010	var buff [1024]byte
5011	ringBuffer := smithyio.NewRingBuffer(buff[:])
5012
5013	body := io.TeeReader(errorBody, ringBuffer)
5014	decoder := json.NewDecoder(body)
5015	decoder.UseNumber()
5016	code, message, err := restjson.GetErrorInfo(decoder)
5017	if err != nil {
5018		var snapshot bytes.Buffer
5019		io.Copy(&snapshot, ringBuffer)
5020		err = &smithy.DeserializationError{
5021			Err:      fmt.Errorf("failed to decode response body, %w", err),
5022			Snapshot: snapshot.Bytes(),
5023		}
5024		return err
5025	}
5026
5027	errorBody.Seek(0, io.SeekStart)
5028	if len(code) != 0 {
5029		errorCode = restjson.SanitizeErrorCode(code)
5030	}
5031	if len(message) != 0 {
5032		errorMessage = message
5033	}
5034
5035	switch {
5036	case strings.EqualFold("InternalFailureException", errorCode):
5037		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5038
5039	case strings.EqualFold("InvalidRequestException", errorCode):
5040		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5041
5042	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5043		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5044
5045	case strings.EqualFold("ThrottlingException", errorCode):
5046		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5047
5048	default:
5049		genericError := &smithy.GenericAPIError{
5050			Code:    errorCode,
5051			Message: errorMessage,
5052		}
5053		return genericError
5054
5055	}
5056}
5057
5058func awsRestjson1_deserializeOpDocumentCreateSecurityProfileOutput(v **CreateSecurityProfileOutput, value interface{}) error {
5059	if v == nil {
5060		return fmt.Errorf("unexpected nil of type %T", v)
5061	}
5062	if value == nil {
5063		return nil
5064	}
5065
5066	shape, ok := value.(map[string]interface{})
5067	if !ok {
5068		return fmt.Errorf("unexpected JSON type %v", value)
5069	}
5070
5071	var sv *CreateSecurityProfileOutput
5072	if *v == nil {
5073		sv = &CreateSecurityProfileOutput{}
5074	} else {
5075		sv = *v
5076	}
5077
5078	for key, value := range shape {
5079		switch key {
5080		case "securityProfileArn":
5081			if value != nil {
5082				jtv, ok := value.(string)
5083				if !ok {
5084					return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value)
5085				}
5086				sv.SecurityProfileArn = ptr.String(jtv)
5087			}
5088
5089		case "securityProfileName":
5090			if value != nil {
5091				jtv, ok := value.(string)
5092				if !ok {
5093					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
5094				}
5095				sv.SecurityProfileName = ptr.String(jtv)
5096			}
5097
5098		default:
5099			_, _ = key, value
5100
5101		}
5102	}
5103	*v = sv
5104	return nil
5105}
5106
5107type awsRestjson1_deserializeOpCreateStream struct {
5108}
5109
5110func (*awsRestjson1_deserializeOpCreateStream) ID() string {
5111	return "OperationDeserializer"
5112}
5113
5114func (m *awsRestjson1_deserializeOpCreateStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5115	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5116) {
5117	out, metadata, err = next.HandleDeserialize(ctx, in)
5118	if err != nil {
5119		return out, metadata, err
5120	}
5121
5122	response, ok := out.RawResponse.(*smithyhttp.Response)
5123	if !ok {
5124		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5125	}
5126
5127	if response.StatusCode < 200 || response.StatusCode >= 300 {
5128		return out, metadata, awsRestjson1_deserializeOpErrorCreateStream(response, &metadata)
5129	}
5130	output := &CreateStreamOutput{}
5131	out.Result = output
5132
5133	var buff [1024]byte
5134	ringBuffer := smithyio.NewRingBuffer(buff[:])
5135
5136	body := io.TeeReader(response.Body, ringBuffer)
5137
5138	decoder := json.NewDecoder(body)
5139	decoder.UseNumber()
5140	var shape interface{}
5141	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5142		var snapshot bytes.Buffer
5143		io.Copy(&snapshot, ringBuffer)
5144		err = &smithy.DeserializationError{
5145			Err:      fmt.Errorf("failed to decode response body, %w", err),
5146			Snapshot: snapshot.Bytes(),
5147		}
5148		return out, metadata, err
5149	}
5150
5151	err = awsRestjson1_deserializeOpDocumentCreateStreamOutput(&output, shape)
5152	if err != nil {
5153		var snapshot bytes.Buffer
5154		io.Copy(&snapshot, ringBuffer)
5155		return out, metadata, &smithy.DeserializationError{
5156			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5157			Snapshot: snapshot.Bytes(),
5158		}
5159	}
5160
5161	return out, metadata, err
5162}
5163
5164func awsRestjson1_deserializeOpErrorCreateStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5165	var errorBuffer bytes.Buffer
5166	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5167		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5168	}
5169	errorBody := bytes.NewReader(errorBuffer.Bytes())
5170
5171	errorCode := "UnknownError"
5172	errorMessage := errorCode
5173
5174	code := response.Header.Get("X-Amzn-ErrorType")
5175	if len(code) != 0 {
5176		errorCode = restjson.SanitizeErrorCode(code)
5177	}
5178
5179	var buff [1024]byte
5180	ringBuffer := smithyio.NewRingBuffer(buff[:])
5181
5182	body := io.TeeReader(errorBody, ringBuffer)
5183	decoder := json.NewDecoder(body)
5184	decoder.UseNumber()
5185	code, message, err := restjson.GetErrorInfo(decoder)
5186	if err != nil {
5187		var snapshot bytes.Buffer
5188		io.Copy(&snapshot, ringBuffer)
5189		err = &smithy.DeserializationError{
5190			Err:      fmt.Errorf("failed to decode response body, %w", err),
5191			Snapshot: snapshot.Bytes(),
5192		}
5193		return err
5194	}
5195
5196	errorBody.Seek(0, io.SeekStart)
5197	if len(code) != 0 {
5198		errorCode = restjson.SanitizeErrorCode(code)
5199	}
5200	if len(message) != 0 {
5201		errorMessage = message
5202	}
5203
5204	switch {
5205	case strings.EqualFold("InternalFailureException", errorCode):
5206		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5207
5208	case strings.EqualFold("InvalidRequestException", errorCode):
5209		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5210
5211	case strings.EqualFold("LimitExceededException", errorCode):
5212		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
5213
5214	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5215		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5216
5217	case strings.EqualFold("ResourceNotFoundException", errorCode):
5218		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5219
5220	case strings.EqualFold("ServiceUnavailableException", errorCode):
5221		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
5222
5223	case strings.EqualFold("ThrottlingException", errorCode):
5224		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5225
5226	case strings.EqualFold("UnauthorizedException", errorCode):
5227		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
5228
5229	default:
5230		genericError := &smithy.GenericAPIError{
5231			Code:    errorCode,
5232			Message: errorMessage,
5233		}
5234		return genericError
5235
5236	}
5237}
5238
5239func awsRestjson1_deserializeOpDocumentCreateStreamOutput(v **CreateStreamOutput, value interface{}) error {
5240	if v == nil {
5241		return fmt.Errorf("unexpected nil of type %T", v)
5242	}
5243	if value == nil {
5244		return nil
5245	}
5246
5247	shape, ok := value.(map[string]interface{})
5248	if !ok {
5249		return fmt.Errorf("unexpected JSON type %v", value)
5250	}
5251
5252	var sv *CreateStreamOutput
5253	if *v == nil {
5254		sv = &CreateStreamOutput{}
5255	} else {
5256		sv = *v
5257	}
5258
5259	for key, value := range shape {
5260		switch key {
5261		case "description":
5262			if value != nil {
5263				jtv, ok := value.(string)
5264				if !ok {
5265					return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value)
5266				}
5267				sv.Description = ptr.String(jtv)
5268			}
5269
5270		case "streamArn":
5271			if value != nil {
5272				jtv, ok := value.(string)
5273				if !ok {
5274					return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
5275				}
5276				sv.StreamArn = ptr.String(jtv)
5277			}
5278
5279		case "streamId":
5280			if value != nil {
5281				jtv, ok := value.(string)
5282				if !ok {
5283					return fmt.Errorf("expected StreamId to be of type string, got %T instead", value)
5284				}
5285				sv.StreamId = ptr.String(jtv)
5286			}
5287
5288		case "streamVersion":
5289			if value != nil {
5290				jtv, ok := value.(json.Number)
5291				if !ok {
5292					return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value)
5293				}
5294				i64, err := jtv.Int64()
5295				if err != nil {
5296					return err
5297				}
5298				sv.StreamVersion = ptr.Int32(int32(i64))
5299			}
5300
5301		default:
5302			_, _ = key, value
5303
5304		}
5305	}
5306	*v = sv
5307	return nil
5308}
5309
5310type awsRestjson1_deserializeOpCreateThing struct {
5311}
5312
5313func (*awsRestjson1_deserializeOpCreateThing) ID() string {
5314	return "OperationDeserializer"
5315}
5316
5317func (m *awsRestjson1_deserializeOpCreateThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5318	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5319) {
5320	out, metadata, err = next.HandleDeserialize(ctx, in)
5321	if err != nil {
5322		return out, metadata, err
5323	}
5324
5325	response, ok := out.RawResponse.(*smithyhttp.Response)
5326	if !ok {
5327		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5328	}
5329
5330	if response.StatusCode < 200 || response.StatusCode >= 300 {
5331		return out, metadata, awsRestjson1_deserializeOpErrorCreateThing(response, &metadata)
5332	}
5333	output := &CreateThingOutput{}
5334	out.Result = output
5335
5336	var buff [1024]byte
5337	ringBuffer := smithyio.NewRingBuffer(buff[:])
5338
5339	body := io.TeeReader(response.Body, ringBuffer)
5340
5341	decoder := json.NewDecoder(body)
5342	decoder.UseNumber()
5343	var shape interface{}
5344	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5345		var snapshot bytes.Buffer
5346		io.Copy(&snapshot, ringBuffer)
5347		err = &smithy.DeserializationError{
5348			Err:      fmt.Errorf("failed to decode response body, %w", err),
5349			Snapshot: snapshot.Bytes(),
5350		}
5351		return out, metadata, err
5352	}
5353
5354	err = awsRestjson1_deserializeOpDocumentCreateThingOutput(&output, shape)
5355	if err != nil {
5356		var snapshot bytes.Buffer
5357		io.Copy(&snapshot, ringBuffer)
5358		return out, metadata, &smithy.DeserializationError{
5359			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5360			Snapshot: snapshot.Bytes(),
5361		}
5362	}
5363
5364	return out, metadata, err
5365}
5366
5367func awsRestjson1_deserializeOpErrorCreateThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5368	var errorBuffer bytes.Buffer
5369	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5370		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5371	}
5372	errorBody := bytes.NewReader(errorBuffer.Bytes())
5373
5374	errorCode := "UnknownError"
5375	errorMessage := errorCode
5376
5377	code := response.Header.Get("X-Amzn-ErrorType")
5378	if len(code) != 0 {
5379		errorCode = restjson.SanitizeErrorCode(code)
5380	}
5381
5382	var buff [1024]byte
5383	ringBuffer := smithyio.NewRingBuffer(buff[:])
5384
5385	body := io.TeeReader(errorBody, ringBuffer)
5386	decoder := json.NewDecoder(body)
5387	decoder.UseNumber()
5388	code, message, err := restjson.GetErrorInfo(decoder)
5389	if err != nil {
5390		var snapshot bytes.Buffer
5391		io.Copy(&snapshot, ringBuffer)
5392		err = &smithy.DeserializationError{
5393			Err:      fmt.Errorf("failed to decode response body, %w", err),
5394			Snapshot: snapshot.Bytes(),
5395		}
5396		return err
5397	}
5398
5399	errorBody.Seek(0, io.SeekStart)
5400	if len(code) != 0 {
5401		errorCode = restjson.SanitizeErrorCode(code)
5402	}
5403	if len(message) != 0 {
5404		errorMessage = message
5405	}
5406
5407	switch {
5408	case strings.EqualFold("InternalFailureException", errorCode):
5409		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5410
5411	case strings.EqualFold("InvalidRequestException", errorCode):
5412		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5413
5414	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5415		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5416
5417	case strings.EqualFold("ResourceNotFoundException", errorCode):
5418		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5419
5420	case strings.EqualFold("ServiceUnavailableException", errorCode):
5421		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
5422
5423	case strings.EqualFold("ThrottlingException", errorCode):
5424		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5425
5426	case strings.EqualFold("UnauthorizedException", errorCode):
5427		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
5428
5429	default:
5430		genericError := &smithy.GenericAPIError{
5431			Code:    errorCode,
5432			Message: errorMessage,
5433		}
5434		return genericError
5435
5436	}
5437}
5438
5439func awsRestjson1_deserializeOpDocumentCreateThingOutput(v **CreateThingOutput, value interface{}) error {
5440	if v == nil {
5441		return fmt.Errorf("unexpected nil of type %T", v)
5442	}
5443	if value == nil {
5444		return nil
5445	}
5446
5447	shape, ok := value.(map[string]interface{})
5448	if !ok {
5449		return fmt.Errorf("unexpected JSON type %v", value)
5450	}
5451
5452	var sv *CreateThingOutput
5453	if *v == nil {
5454		sv = &CreateThingOutput{}
5455	} else {
5456		sv = *v
5457	}
5458
5459	for key, value := range shape {
5460		switch key {
5461		case "thingArn":
5462			if value != nil {
5463				jtv, ok := value.(string)
5464				if !ok {
5465					return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
5466				}
5467				sv.ThingArn = ptr.String(jtv)
5468			}
5469
5470		case "thingId":
5471			if value != nil {
5472				jtv, ok := value.(string)
5473				if !ok {
5474					return fmt.Errorf("expected ThingId to be of type string, got %T instead", value)
5475				}
5476				sv.ThingId = ptr.String(jtv)
5477			}
5478
5479		case "thingName":
5480			if value != nil {
5481				jtv, ok := value.(string)
5482				if !ok {
5483					return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
5484				}
5485				sv.ThingName = ptr.String(jtv)
5486			}
5487
5488		default:
5489			_, _ = key, value
5490
5491		}
5492	}
5493	*v = sv
5494	return nil
5495}
5496
5497type awsRestjson1_deserializeOpCreateThingGroup struct {
5498}
5499
5500func (*awsRestjson1_deserializeOpCreateThingGroup) ID() string {
5501	return "OperationDeserializer"
5502}
5503
5504func (m *awsRestjson1_deserializeOpCreateThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5505	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5506) {
5507	out, metadata, err = next.HandleDeserialize(ctx, in)
5508	if err != nil {
5509		return out, metadata, err
5510	}
5511
5512	response, ok := out.RawResponse.(*smithyhttp.Response)
5513	if !ok {
5514		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5515	}
5516
5517	if response.StatusCode < 200 || response.StatusCode >= 300 {
5518		return out, metadata, awsRestjson1_deserializeOpErrorCreateThingGroup(response, &metadata)
5519	}
5520	output := &CreateThingGroupOutput{}
5521	out.Result = output
5522
5523	var buff [1024]byte
5524	ringBuffer := smithyio.NewRingBuffer(buff[:])
5525
5526	body := io.TeeReader(response.Body, ringBuffer)
5527
5528	decoder := json.NewDecoder(body)
5529	decoder.UseNumber()
5530	var shape interface{}
5531	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5532		var snapshot bytes.Buffer
5533		io.Copy(&snapshot, ringBuffer)
5534		err = &smithy.DeserializationError{
5535			Err:      fmt.Errorf("failed to decode response body, %w", err),
5536			Snapshot: snapshot.Bytes(),
5537		}
5538		return out, metadata, err
5539	}
5540
5541	err = awsRestjson1_deserializeOpDocumentCreateThingGroupOutput(&output, shape)
5542	if err != nil {
5543		var snapshot bytes.Buffer
5544		io.Copy(&snapshot, ringBuffer)
5545		return out, metadata, &smithy.DeserializationError{
5546			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5547			Snapshot: snapshot.Bytes(),
5548		}
5549	}
5550
5551	return out, metadata, err
5552}
5553
5554func awsRestjson1_deserializeOpErrorCreateThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5555	var errorBuffer bytes.Buffer
5556	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5557		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5558	}
5559	errorBody := bytes.NewReader(errorBuffer.Bytes())
5560
5561	errorCode := "UnknownError"
5562	errorMessage := errorCode
5563
5564	code := response.Header.Get("X-Amzn-ErrorType")
5565	if len(code) != 0 {
5566		errorCode = restjson.SanitizeErrorCode(code)
5567	}
5568
5569	var buff [1024]byte
5570	ringBuffer := smithyio.NewRingBuffer(buff[:])
5571
5572	body := io.TeeReader(errorBody, ringBuffer)
5573	decoder := json.NewDecoder(body)
5574	decoder.UseNumber()
5575	code, message, err := restjson.GetErrorInfo(decoder)
5576	if err != nil {
5577		var snapshot bytes.Buffer
5578		io.Copy(&snapshot, ringBuffer)
5579		err = &smithy.DeserializationError{
5580			Err:      fmt.Errorf("failed to decode response body, %w", err),
5581			Snapshot: snapshot.Bytes(),
5582		}
5583		return err
5584	}
5585
5586	errorBody.Seek(0, io.SeekStart)
5587	if len(code) != 0 {
5588		errorCode = restjson.SanitizeErrorCode(code)
5589	}
5590	if len(message) != 0 {
5591		errorMessage = message
5592	}
5593
5594	switch {
5595	case strings.EqualFold("InternalFailureException", errorCode):
5596		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5597
5598	case strings.EqualFold("InvalidRequestException", errorCode):
5599		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5600
5601	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5602		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5603
5604	case strings.EqualFold("ThrottlingException", errorCode):
5605		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5606
5607	default:
5608		genericError := &smithy.GenericAPIError{
5609			Code:    errorCode,
5610			Message: errorMessage,
5611		}
5612		return genericError
5613
5614	}
5615}
5616
5617func awsRestjson1_deserializeOpDocumentCreateThingGroupOutput(v **CreateThingGroupOutput, value interface{}) error {
5618	if v == nil {
5619		return fmt.Errorf("unexpected nil of type %T", v)
5620	}
5621	if value == nil {
5622		return nil
5623	}
5624
5625	shape, ok := value.(map[string]interface{})
5626	if !ok {
5627		return fmt.Errorf("unexpected JSON type %v", value)
5628	}
5629
5630	var sv *CreateThingGroupOutput
5631	if *v == nil {
5632		sv = &CreateThingGroupOutput{}
5633	} else {
5634		sv = *v
5635	}
5636
5637	for key, value := range shape {
5638		switch key {
5639		case "thingGroupArn":
5640			if value != nil {
5641				jtv, ok := value.(string)
5642				if !ok {
5643					return fmt.Errorf("expected ThingGroupArn to be of type string, got %T instead", value)
5644				}
5645				sv.ThingGroupArn = ptr.String(jtv)
5646			}
5647
5648		case "thingGroupId":
5649			if value != nil {
5650				jtv, ok := value.(string)
5651				if !ok {
5652					return fmt.Errorf("expected ThingGroupId to be of type string, got %T instead", value)
5653				}
5654				sv.ThingGroupId = ptr.String(jtv)
5655			}
5656
5657		case "thingGroupName":
5658			if value != nil {
5659				jtv, ok := value.(string)
5660				if !ok {
5661					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
5662				}
5663				sv.ThingGroupName = ptr.String(jtv)
5664			}
5665
5666		default:
5667			_, _ = key, value
5668
5669		}
5670	}
5671	*v = sv
5672	return nil
5673}
5674
5675type awsRestjson1_deserializeOpCreateThingType struct {
5676}
5677
5678func (*awsRestjson1_deserializeOpCreateThingType) ID() string {
5679	return "OperationDeserializer"
5680}
5681
5682func (m *awsRestjson1_deserializeOpCreateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5683	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5684) {
5685	out, metadata, err = next.HandleDeserialize(ctx, in)
5686	if err != nil {
5687		return out, metadata, err
5688	}
5689
5690	response, ok := out.RawResponse.(*smithyhttp.Response)
5691	if !ok {
5692		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5693	}
5694
5695	if response.StatusCode < 200 || response.StatusCode >= 300 {
5696		return out, metadata, awsRestjson1_deserializeOpErrorCreateThingType(response, &metadata)
5697	}
5698	output := &CreateThingTypeOutput{}
5699	out.Result = output
5700
5701	var buff [1024]byte
5702	ringBuffer := smithyio.NewRingBuffer(buff[:])
5703
5704	body := io.TeeReader(response.Body, ringBuffer)
5705
5706	decoder := json.NewDecoder(body)
5707	decoder.UseNumber()
5708	var shape interface{}
5709	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5710		var snapshot bytes.Buffer
5711		io.Copy(&snapshot, ringBuffer)
5712		err = &smithy.DeserializationError{
5713			Err:      fmt.Errorf("failed to decode response body, %w", err),
5714			Snapshot: snapshot.Bytes(),
5715		}
5716		return out, metadata, err
5717	}
5718
5719	err = awsRestjson1_deserializeOpDocumentCreateThingTypeOutput(&output, shape)
5720	if err != nil {
5721		var snapshot bytes.Buffer
5722		io.Copy(&snapshot, ringBuffer)
5723		return out, metadata, &smithy.DeserializationError{
5724			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5725			Snapshot: snapshot.Bytes(),
5726		}
5727	}
5728
5729	return out, metadata, err
5730}
5731
5732func awsRestjson1_deserializeOpErrorCreateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5733	var errorBuffer bytes.Buffer
5734	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5735		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5736	}
5737	errorBody := bytes.NewReader(errorBuffer.Bytes())
5738
5739	errorCode := "UnknownError"
5740	errorMessage := errorCode
5741
5742	code := response.Header.Get("X-Amzn-ErrorType")
5743	if len(code) != 0 {
5744		errorCode = restjson.SanitizeErrorCode(code)
5745	}
5746
5747	var buff [1024]byte
5748	ringBuffer := smithyio.NewRingBuffer(buff[:])
5749
5750	body := io.TeeReader(errorBody, ringBuffer)
5751	decoder := json.NewDecoder(body)
5752	decoder.UseNumber()
5753	code, message, err := restjson.GetErrorInfo(decoder)
5754	if err != nil {
5755		var snapshot bytes.Buffer
5756		io.Copy(&snapshot, ringBuffer)
5757		err = &smithy.DeserializationError{
5758			Err:      fmt.Errorf("failed to decode response body, %w", err),
5759			Snapshot: snapshot.Bytes(),
5760		}
5761		return err
5762	}
5763
5764	errorBody.Seek(0, io.SeekStart)
5765	if len(code) != 0 {
5766		errorCode = restjson.SanitizeErrorCode(code)
5767	}
5768	if len(message) != 0 {
5769		errorMessage = message
5770	}
5771
5772	switch {
5773	case strings.EqualFold("InternalFailureException", errorCode):
5774		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5775
5776	case strings.EqualFold("InvalidRequestException", errorCode):
5777		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5778
5779	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5780		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5781
5782	case strings.EqualFold("ServiceUnavailableException", errorCode):
5783		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
5784
5785	case strings.EqualFold("ThrottlingException", errorCode):
5786		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5787
5788	case strings.EqualFold("UnauthorizedException", errorCode):
5789		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
5790
5791	default:
5792		genericError := &smithy.GenericAPIError{
5793			Code:    errorCode,
5794			Message: errorMessage,
5795		}
5796		return genericError
5797
5798	}
5799}
5800
5801func awsRestjson1_deserializeOpDocumentCreateThingTypeOutput(v **CreateThingTypeOutput, value interface{}) error {
5802	if v == nil {
5803		return fmt.Errorf("unexpected nil of type %T", v)
5804	}
5805	if value == nil {
5806		return nil
5807	}
5808
5809	shape, ok := value.(map[string]interface{})
5810	if !ok {
5811		return fmt.Errorf("unexpected JSON type %v", value)
5812	}
5813
5814	var sv *CreateThingTypeOutput
5815	if *v == nil {
5816		sv = &CreateThingTypeOutput{}
5817	} else {
5818		sv = *v
5819	}
5820
5821	for key, value := range shape {
5822		switch key {
5823		case "thingTypeArn":
5824			if value != nil {
5825				jtv, ok := value.(string)
5826				if !ok {
5827					return fmt.Errorf("expected ThingTypeArn to be of type string, got %T instead", value)
5828				}
5829				sv.ThingTypeArn = ptr.String(jtv)
5830			}
5831
5832		case "thingTypeId":
5833			if value != nil {
5834				jtv, ok := value.(string)
5835				if !ok {
5836					return fmt.Errorf("expected ThingTypeId to be of type string, got %T instead", value)
5837				}
5838				sv.ThingTypeId = ptr.String(jtv)
5839			}
5840
5841		case "thingTypeName":
5842			if value != nil {
5843				jtv, ok := value.(string)
5844				if !ok {
5845					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
5846				}
5847				sv.ThingTypeName = ptr.String(jtv)
5848			}
5849
5850		default:
5851			_, _ = key, value
5852
5853		}
5854	}
5855	*v = sv
5856	return nil
5857}
5858
5859type awsRestjson1_deserializeOpCreateTopicRule struct {
5860}
5861
5862func (*awsRestjson1_deserializeOpCreateTopicRule) ID() string {
5863	return "OperationDeserializer"
5864}
5865
5866func (m *awsRestjson1_deserializeOpCreateTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5867	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5868) {
5869	out, metadata, err = next.HandleDeserialize(ctx, in)
5870	if err != nil {
5871		return out, metadata, err
5872	}
5873
5874	response, ok := out.RawResponse.(*smithyhttp.Response)
5875	if !ok {
5876		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5877	}
5878
5879	if response.StatusCode < 200 || response.StatusCode >= 300 {
5880		return out, metadata, awsRestjson1_deserializeOpErrorCreateTopicRule(response, &metadata)
5881	}
5882	output := &CreateTopicRuleOutput{}
5883	out.Result = output
5884
5885	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
5886		return out, metadata, &smithy.DeserializationError{
5887			Err: fmt.Errorf("failed to discard response body, %w", err),
5888		}
5889	}
5890
5891	return out, metadata, err
5892}
5893
5894func awsRestjson1_deserializeOpErrorCreateTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5895	var errorBuffer bytes.Buffer
5896	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5897		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5898	}
5899	errorBody := bytes.NewReader(errorBuffer.Bytes())
5900
5901	errorCode := "UnknownError"
5902	errorMessage := errorCode
5903
5904	code := response.Header.Get("X-Amzn-ErrorType")
5905	if len(code) != 0 {
5906		errorCode = restjson.SanitizeErrorCode(code)
5907	}
5908
5909	var buff [1024]byte
5910	ringBuffer := smithyio.NewRingBuffer(buff[:])
5911
5912	body := io.TeeReader(errorBody, ringBuffer)
5913	decoder := json.NewDecoder(body)
5914	decoder.UseNumber()
5915	code, message, err := restjson.GetErrorInfo(decoder)
5916	if err != nil {
5917		var snapshot bytes.Buffer
5918		io.Copy(&snapshot, ringBuffer)
5919		err = &smithy.DeserializationError{
5920			Err:      fmt.Errorf("failed to decode response body, %w", err),
5921			Snapshot: snapshot.Bytes(),
5922		}
5923		return err
5924	}
5925
5926	errorBody.Seek(0, io.SeekStart)
5927	if len(code) != 0 {
5928		errorCode = restjson.SanitizeErrorCode(code)
5929	}
5930	if len(message) != 0 {
5931		errorMessage = message
5932	}
5933
5934	switch {
5935	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
5936		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
5937
5938	case strings.EqualFold("InternalException", errorCode):
5939		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
5940
5941	case strings.EqualFold("InvalidRequestException", errorCode):
5942		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
5943
5944	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
5945		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
5946
5947	case strings.EqualFold("ServiceUnavailableException", errorCode):
5948		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
5949
5950	case strings.EqualFold("SqlParseException", errorCode):
5951		return awsRestjson1_deserializeErrorSqlParseException(response, errorBody)
5952
5953	default:
5954		genericError := &smithy.GenericAPIError{
5955			Code:    errorCode,
5956			Message: errorMessage,
5957		}
5958		return genericError
5959
5960	}
5961}
5962
5963type awsRestjson1_deserializeOpCreateTopicRuleDestination struct {
5964}
5965
5966func (*awsRestjson1_deserializeOpCreateTopicRuleDestination) ID() string {
5967	return "OperationDeserializer"
5968}
5969
5970func (m *awsRestjson1_deserializeOpCreateTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5971	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5972) {
5973	out, metadata, err = next.HandleDeserialize(ctx, in)
5974	if err != nil {
5975		return out, metadata, err
5976	}
5977
5978	response, ok := out.RawResponse.(*smithyhttp.Response)
5979	if !ok {
5980		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5981	}
5982
5983	if response.StatusCode < 200 || response.StatusCode >= 300 {
5984		return out, metadata, awsRestjson1_deserializeOpErrorCreateTopicRuleDestination(response, &metadata)
5985	}
5986	output := &CreateTopicRuleDestinationOutput{}
5987	out.Result = output
5988
5989	var buff [1024]byte
5990	ringBuffer := smithyio.NewRingBuffer(buff[:])
5991
5992	body := io.TeeReader(response.Body, ringBuffer)
5993
5994	decoder := json.NewDecoder(body)
5995	decoder.UseNumber()
5996	var shape interface{}
5997	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5998		var snapshot bytes.Buffer
5999		io.Copy(&snapshot, ringBuffer)
6000		err = &smithy.DeserializationError{
6001			Err:      fmt.Errorf("failed to decode response body, %w", err),
6002			Snapshot: snapshot.Bytes(),
6003		}
6004		return out, metadata, err
6005	}
6006
6007	err = awsRestjson1_deserializeOpDocumentCreateTopicRuleDestinationOutput(&output, shape)
6008	if err != nil {
6009		var snapshot bytes.Buffer
6010		io.Copy(&snapshot, ringBuffer)
6011		return out, metadata, &smithy.DeserializationError{
6012			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6013			Snapshot: snapshot.Bytes(),
6014		}
6015	}
6016
6017	return out, metadata, err
6018}
6019
6020func awsRestjson1_deserializeOpErrorCreateTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6021	var errorBuffer bytes.Buffer
6022	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6023		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6024	}
6025	errorBody := bytes.NewReader(errorBuffer.Bytes())
6026
6027	errorCode := "UnknownError"
6028	errorMessage := errorCode
6029
6030	code := response.Header.Get("X-Amzn-ErrorType")
6031	if len(code) != 0 {
6032		errorCode = restjson.SanitizeErrorCode(code)
6033	}
6034
6035	var buff [1024]byte
6036	ringBuffer := smithyio.NewRingBuffer(buff[:])
6037
6038	body := io.TeeReader(errorBody, ringBuffer)
6039	decoder := json.NewDecoder(body)
6040	decoder.UseNumber()
6041	code, message, err := restjson.GetErrorInfo(decoder)
6042	if err != nil {
6043		var snapshot bytes.Buffer
6044		io.Copy(&snapshot, ringBuffer)
6045		err = &smithy.DeserializationError{
6046			Err:      fmt.Errorf("failed to decode response body, %w", err),
6047			Snapshot: snapshot.Bytes(),
6048		}
6049		return err
6050	}
6051
6052	errorBody.Seek(0, io.SeekStart)
6053	if len(code) != 0 {
6054		errorCode = restjson.SanitizeErrorCode(code)
6055	}
6056	if len(message) != 0 {
6057		errorMessage = message
6058	}
6059
6060	switch {
6061	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
6062		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
6063
6064	case strings.EqualFold("InternalException", errorCode):
6065		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
6066
6067	case strings.EqualFold("InvalidRequestException", errorCode):
6068		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6069
6070	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
6071		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
6072
6073	case strings.EqualFold("ServiceUnavailableException", errorCode):
6074		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
6075
6076	default:
6077		genericError := &smithy.GenericAPIError{
6078			Code:    errorCode,
6079			Message: errorMessage,
6080		}
6081		return genericError
6082
6083	}
6084}
6085
6086func awsRestjson1_deserializeOpDocumentCreateTopicRuleDestinationOutput(v **CreateTopicRuleDestinationOutput, value interface{}) error {
6087	if v == nil {
6088		return fmt.Errorf("unexpected nil of type %T", v)
6089	}
6090	if value == nil {
6091		return nil
6092	}
6093
6094	shape, ok := value.(map[string]interface{})
6095	if !ok {
6096		return fmt.Errorf("unexpected JSON type %v", value)
6097	}
6098
6099	var sv *CreateTopicRuleDestinationOutput
6100	if *v == nil {
6101		sv = &CreateTopicRuleDestinationOutput{}
6102	} else {
6103		sv = *v
6104	}
6105
6106	for key, value := range shape {
6107		switch key {
6108		case "topicRuleDestination":
6109			if err := awsRestjson1_deserializeDocumentTopicRuleDestination(&sv.TopicRuleDestination, value); err != nil {
6110				return err
6111			}
6112
6113		default:
6114			_, _ = key, value
6115
6116		}
6117	}
6118	*v = sv
6119	return nil
6120}
6121
6122type awsRestjson1_deserializeOpDeleteAccountAuditConfiguration struct {
6123}
6124
6125func (*awsRestjson1_deserializeOpDeleteAccountAuditConfiguration) ID() string {
6126	return "OperationDeserializer"
6127}
6128
6129func (m *awsRestjson1_deserializeOpDeleteAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6130	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6131) {
6132	out, metadata, err = next.HandleDeserialize(ctx, in)
6133	if err != nil {
6134		return out, metadata, err
6135	}
6136
6137	response, ok := out.RawResponse.(*smithyhttp.Response)
6138	if !ok {
6139		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6140	}
6141
6142	if response.StatusCode < 200 || response.StatusCode >= 300 {
6143		return out, metadata, awsRestjson1_deserializeOpErrorDeleteAccountAuditConfiguration(response, &metadata)
6144	}
6145	output := &DeleteAccountAuditConfigurationOutput{}
6146	out.Result = output
6147
6148	return out, metadata, err
6149}
6150
6151func awsRestjson1_deserializeOpErrorDeleteAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6152	var errorBuffer bytes.Buffer
6153	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6154		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6155	}
6156	errorBody := bytes.NewReader(errorBuffer.Bytes())
6157
6158	errorCode := "UnknownError"
6159	errorMessage := errorCode
6160
6161	code := response.Header.Get("X-Amzn-ErrorType")
6162	if len(code) != 0 {
6163		errorCode = restjson.SanitizeErrorCode(code)
6164	}
6165
6166	var buff [1024]byte
6167	ringBuffer := smithyio.NewRingBuffer(buff[:])
6168
6169	body := io.TeeReader(errorBody, ringBuffer)
6170	decoder := json.NewDecoder(body)
6171	decoder.UseNumber()
6172	code, message, err := restjson.GetErrorInfo(decoder)
6173	if err != nil {
6174		var snapshot bytes.Buffer
6175		io.Copy(&snapshot, ringBuffer)
6176		err = &smithy.DeserializationError{
6177			Err:      fmt.Errorf("failed to decode response body, %w", err),
6178			Snapshot: snapshot.Bytes(),
6179		}
6180		return err
6181	}
6182
6183	errorBody.Seek(0, io.SeekStart)
6184	if len(code) != 0 {
6185		errorCode = restjson.SanitizeErrorCode(code)
6186	}
6187	if len(message) != 0 {
6188		errorMessage = message
6189	}
6190
6191	switch {
6192	case strings.EqualFold("InternalFailureException", errorCode):
6193		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6194
6195	case strings.EqualFold("InvalidRequestException", errorCode):
6196		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6197
6198	case strings.EqualFold("ResourceNotFoundException", errorCode):
6199		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6200
6201	case strings.EqualFold("ThrottlingException", errorCode):
6202		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6203
6204	default:
6205		genericError := &smithy.GenericAPIError{
6206			Code:    errorCode,
6207			Message: errorMessage,
6208		}
6209		return genericError
6210
6211	}
6212}
6213
6214type awsRestjson1_deserializeOpDeleteAuditSuppression struct {
6215}
6216
6217func (*awsRestjson1_deserializeOpDeleteAuditSuppression) ID() string {
6218	return "OperationDeserializer"
6219}
6220
6221func (m *awsRestjson1_deserializeOpDeleteAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6222	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6223) {
6224	out, metadata, err = next.HandleDeserialize(ctx, in)
6225	if err != nil {
6226		return out, metadata, err
6227	}
6228
6229	response, ok := out.RawResponse.(*smithyhttp.Response)
6230	if !ok {
6231		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6232	}
6233
6234	if response.StatusCode < 200 || response.StatusCode >= 300 {
6235		return out, metadata, awsRestjson1_deserializeOpErrorDeleteAuditSuppression(response, &metadata)
6236	}
6237	output := &DeleteAuditSuppressionOutput{}
6238	out.Result = output
6239
6240	return out, metadata, err
6241}
6242
6243func awsRestjson1_deserializeOpErrorDeleteAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6244	var errorBuffer bytes.Buffer
6245	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6246		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6247	}
6248	errorBody := bytes.NewReader(errorBuffer.Bytes())
6249
6250	errorCode := "UnknownError"
6251	errorMessage := errorCode
6252
6253	code := response.Header.Get("X-Amzn-ErrorType")
6254	if len(code) != 0 {
6255		errorCode = restjson.SanitizeErrorCode(code)
6256	}
6257
6258	var buff [1024]byte
6259	ringBuffer := smithyio.NewRingBuffer(buff[:])
6260
6261	body := io.TeeReader(errorBody, ringBuffer)
6262	decoder := json.NewDecoder(body)
6263	decoder.UseNumber()
6264	code, message, err := restjson.GetErrorInfo(decoder)
6265	if err != nil {
6266		var snapshot bytes.Buffer
6267		io.Copy(&snapshot, ringBuffer)
6268		err = &smithy.DeserializationError{
6269			Err:      fmt.Errorf("failed to decode response body, %w", err),
6270			Snapshot: snapshot.Bytes(),
6271		}
6272		return err
6273	}
6274
6275	errorBody.Seek(0, io.SeekStart)
6276	if len(code) != 0 {
6277		errorCode = restjson.SanitizeErrorCode(code)
6278	}
6279	if len(message) != 0 {
6280		errorMessage = message
6281	}
6282
6283	switch {
6284	case strings.EqualFold("InternalFailureException", errorCode):
6285		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6286
6287	case strings.EqualFold("InvalidRequestException", errorCode):
6288		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6289
6290	case strings.EqualFold("ThrottlingException", errorCode):
6291		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6292
6293	default:
6294		genericError := &smithy.GenericAPIError{
6295			Code:    errorCode,
6296			Message: errorMessage,
6297		}
6298		return genericError
6299
6300	}
6301}
6302
6303type awsRestjson1_deserializeOpDeleteAuthorizer struct {
6304}
6305
6306func (*awsRestjson1_deserializeOpDeleteAuthorizer) ID() string {
6307	return "OperationDeserializer"
6308}
6309
6310func (m *awsRestjson1_deserializeOpDeleteAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6311	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6312) {
6313	out, metadata, err = next.HandleDeserialize(ctx, in)
6314	if err != nil {
6315		return out, metadata, err
6316	}
6317
6318	response, ok := out.RawResponse.(*smithyhttp.Response)
6319	if !ok {
6320		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6321	}
6322
6323	if response.StatusCode < 200 || response.StatusCode >= 300 {
6324		return out, metadata, awsRestjson1_deserializeOpErrorDeleteAuthorizer(response, &metadata)
6325	}
6326	output := &DeleteAuthorizerOutput{}
6327	out.Result = output
6328
6329	return out, metadata, err
6330}
6331
6332func awsRestjson1_deserializeOpErrorDeleteAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6333	var errorBuffer bytes.Buffer
6334	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6335		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6336	}
6337	errorBody := bytes.NewReader(errorBuffer.Bytes())
6338
6339	errorCode := "UnknownError"
6340	errorMessage := errorCode
6341
6342	code := response.Header.Get("X-Amzn-ErrorType")
6343	if len(code) != 0 {
6344		errorCode = restjson.SanitizeErrorCode(code)
6345	}
6346
6347	var buff [1024]byte
6348	ringBuffer := smithyio.NewRingBuffer(buff[:])
6349
6350	body := io.TeeReader(errorBody, ringBuffer)
6351	decoder := json.NewDecoder(body)
6352	decoder.UseNumber()
6353	code, message, err := restjson.GetErrorInfo(decoder)
6354	if err != nil {
6355		var snapshot bytes.Buffer
6356		io.Copy(&snapshot, ringBuffer)
6357		err = &smithy.DeserializationError{
6358			Err:      fmt.Errorf("failed to decode response body, %w", err),
6359			Snapshot: snapshot.Bytes(),
6360		}
6361		return err
6362	}
6363
6364	errorBody.Seek(0, io.SeekStart)
6365	if len(code) != 0 {
6366		errorCode = restjson.SanitizeErrorCode(code)
6367	}
6368	if len(message) != 0 {
6369		errorMessage = message
6370	}
6371
6372	switch {
6373	case strings.EqualFold("DeleteConflictException", errorCode):
6374		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
6375
6376	case strings.EqualFold("InternalFailureException", errorCode):
6377		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6378
6379	case strings.EqualFold("InvalidRequestException", errorCode):
6380		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6381
6382	case strings.EqualFold("ResourceNotFoundException", errorCode):
6383		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6384
6385	case strings.EqualFold("ServiceUnavailableException", errorCode):
6386		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
6387
6388	case strings.EqualFold("ThrottlingException", errorCode):
6389		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6390
6391	case strings.EqualFold("UnauthorizedException", errorCode):
6392		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
6393
6394	default:
6395		genericError := &smithy.GenericAPIError{
6396			Code:    errorCode,
6397			Message: errorMessage,
6398		}
6399		return genericError
6400
6401	}
6402}
6403
6404type awsRestjson1_deserializeOpDeleteBillingGroup struct {
6405}
6406
6407func (*awsRestjson1_deserializeOpDeleteBillingGroup) ID() string {
6408	return "OperationDeserializer"
6409}
6410
6411func (m *awsRestjson1_deserializeOpDeleteBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6412	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6413) {
6414	out, metadata, err = next.HandleDeserialize(ctx, in)
6415	if err != nil {
6416		return out, metadata, err
6417	}
6418
6419	response, ok := out.RawResponse.(*smithyhttp.Response)
6420	if !ok {
6421		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6422	}
6423
6424	if response.StatusCode < 200 || response.StatusCode >= 300 {
6425		return out, metadata, awsRestjson1_deserializeOpErrorDeleteBillingGroup(response, &metadata)
6426	}
6427	output := &DeleteBillingGroupOutput{}
6428	out.Result = output
6429
6430	return out, metadata, err
6431}
6432
6433func awsRestjson1_deserializeOpErrorDeleteBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6434	var errorBuffer bytes.Buffer
6435	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6436		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6437	}
6438	errorBody := bytes.NewReader(errorBuffer.Bytes())
6439
6440	errorCode := "UnknownError"
6441	errorMessage := errorCode
6442
6443	code := response.Header.Get("X-Amzn-ErrorType")
6444	if len(code) != 0 {
6445		errorCode = restjson.SanitizeErrorCode(code)
6446	}
6447
6448	var buff [1024]byte
6449	ringBuffer := smithyio.NewRingBuffer(buff[:])
6450
6451	body := io.TeeReader(errorBody, ringBuffer)
6452	decoder := json.NewDecoder(body)
6453	decoder.UseNumber()
6454	code, message, err := restjson.GetErrorInfo(decoder)
6455	if err != nil {
6456		var snapshot bytes.Buffer
6457		io.Copy(&snapshot, ringBuffer)
6458		err = &smithy.DeserializationError{
6459			Err:      fmt.Errorf("failed to decode response body, %w", err),
6460			Snapshot: snapshot.Bytes(),
6461		}
6462		return err
6463	}
6464
6465	errorBody.Seek(0, io.SeekStart)
6466	if len(code) != 0 {
6467		errorCode = restjson.SanitizeErrorCode(code)
6468	}
6469	if len(message) != 0 {
6470		errorMessage = message
6471	}
6472
6473	switch {
6474	case strings.EqualFold("InternalFailureException", errorCode):
6475		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6476
6477	case strings.EqualFold("InvalidRequestException", errorCode):
6478		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6479
6480	case strings.EqualFold("ThrottlingException", errorCode):
6481		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6482
6483	case strings.EqualFold("VersionConflictException", errorCode):
6484		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
6485
6486	default:
6487		genericError := &smithy.GenericAPIError{
6488			Code:    errorCode,
6489			Message: errorMessage,
6490		}
6491		return genericError
6492
6493	}
6494}
6495
6496type awsRestjson1_deserializeOpDeleteCACertificate struct {
6497}
6498
6499func (*awsRestjson1_deserializeOpDeleteCACertificate) ID() string {
6500	return "OperationDeserializer"
6501}
6502
6503func (m *awsRestjson1_deserializeOpDeleteCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6504	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6505) {
6506	out, metadata, err = next.HandleDeserialize(ctx, in)
6507	if err != nil {
6508		return out, metadata, err
6509	}
6510
6511	response, ok := out.RawResponse.(*smithyhttp.Response)
6512	if !ok {
6513		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6514	}
6515
6516	if response.StatusCode < 200 || response.StatusCode >= 300 {
6517		return out, metadata, awsRestjson1_deserializeOpErrorDeleteCACertificate(response, &metadata)
6518	}
6519	output := &DeleteCACertificateOutput{}
6520	out.Result = output
6521
6522	return out, metadata, err
6523}
6524
6525func awsRestjson1_deserializeOpErrorDeleteCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6526	var errorBuffer bytes.Buffer
6527	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6528		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6529	}
6530	errorBody := bytes.NewReader(errorBuffer.Bytes())
6531
6532	errorCode := "UnknownError"
6533	errorMessage := errorCode
6534
6535	code := response.Header.Get("X-Amzn-ErrorType")
6536	if len(code) != 0 {
6537		errorCode = restjson.SanitizeErrorCode(code)
6538	}
6539
6540	var buff [1024]byte
6541	ringBuffer := smithyio.NewRingBuffer(buff[:])
6542
6543	body := io.TeeReader(errorBody, ringBuffer)
6544	decoder := json.NewDecoder(body)
6545	decoder.UseNumber()
6546	code, message, err := restjson.GetErrorInfo(decoder)
6547	if err != nil {
6548		var snapshot bytes.Buffer
6549		io.Copy(&snapshot, ringBuffer)
6550		err = &smithy.DeserializationError{
6551			Err:      fmt.Errorf("failed to decode response body, %w", err),
6552			Snapshot: snapshot.Bytes(),
6553		}
6554		return err
6555	}
6556
6557	errorBody.Seek(0, io.SeekStart)
6558	if len(code) != 0 {
6559		errorCode = restjson.SanitizeErrorCode(code)
6560	}
6561	if len(message) != 0 {
6562		errorMessage = message
6563	}
6564
6565	switch {
6566	case strings.EqualFold("CertificateStateException", errorCode):
6567		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
6568
6569	case strings.EqualFold("InternalFailureException", errorCode):
6570		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6571
6572	case strings.EqualFold("InvalidRequestException", errorCode):
6573		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6574
6575	case strings.EqualFold("ResourceNotFoundException", errorCode):
6576		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6577
6578	case strings.EqualFold("ServiceUnavailableException", errorCode):
6579		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
6580
6581	case strings.EqualFold("ThrottlingException", errorCode):
6582		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6583
6584	case strings.EqualFold("UnauthorizedException", errorCode):
6585		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
6586
6587	default:
6588		genericError := &smithy.GenericAPIError{
6589			Code:    errorCode,
6590			Message: errorMessage,
6591		}
6592		return genericError
6593
6594	}
6595}
6596
6597type awsRestjson1_deserializeOpDeleteCertificate struct {
6598}
6599
6600func (*awsRestjson1_deserializeOpDeleteCertificate) ID() string {
6601	return "OperationDeserializer"
6602}
6603
6604func (m *awsRestjson1_deserializeOpDeleteCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6605	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6606) {
6607	out, metadata, err = next.HandleDeserialize(ctx, in)
6608	if err != nil {
6609		return out, metadata, err
6610	}
6611
6612	response, ok := out.RawResponse.(*smithyhttp.Response)
6613	if !ok {
6614		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6615	}
6616
6617	if response.StatusCode < 200 || response.StatusCode >= 300 {
6618		return out, metadata, awsRestjson1_deserializeOpErrorDeleteCertificate(response, &metadata)
6619	}
6620	output := &DeleteCertificateOutput{}
6621	out.Result = output
6622
6623	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
6624		return out, metadata, &smithy.DeserializationError{
6625			Err: fmt.Errorf("failed to discard response body, %w", err),
6626		}
6627	}
6628
6629	return out, metadata, err
6630}
6631
6632func awsRestjson1_deserializeOpErrorDeleteCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6633	var errorBuffer bytes.Buffer
6634	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6635		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6636	}
6637	errorBody := bytes.NewReader(errorBuffer.Bytes())
6638
6639	errorCode := "UnknownError"
6640	errorMessage := errorCode
6641
6642	code := response.Header.Get("X-Amzn-ErrorType")
6643	if len(code) != 0 {
6644		errorCode = restjson.SanitizeErrorCode(code)
6645	}
6646
6647	var buff [1024]byte
6648	ringBuffer := smithyio.NewRingBuffer(buff[:])
6649
6650	body := io.TeeReader(errorBody, ringBuffer)
6651	decoder := json.NewDecoder(body)
6652	decoder.UseNumber()
6653	code, message, err := restjson.GetErrorInfo(decoder)
6654	if err != nil {
6655		var snapshot bytes.Buffer
6656		io.Copy(&snapshot, ringBuffer)
6657		err = &smithy.DeserializationError{
6658			Err:      fmt.Errorf("failed to decode response body, %w", err),
6659			Snapshot: snapshot.Bytes(),
6660		}
6661		return err
6662	}
6663
6664	errorBody.Seek(0, io.SeekStart)
6665	if len(code) != 0 {
6666		errorCode = restjson.SanitizeErrorCode(code)
6667	}
6668	if len(message) != 0 {
6669		errorMessage = message
6670	}
6671
6672	switch {
6673	case strings.EqualFold("CertificateStateException", errorCode):
6674		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
6675
6676	case strings.EqualFold("DeleteConflictException", errorCode):
6677		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
6678
6679	case strings.EqualFold("InternalFailureException", errorCode):
6680		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6681
6682	case strings.EqualFold("InvalidRequestException", errorCode):
6683		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6684
6685	case strings.EqualFold("ResourceNotFoundException", errorCode):
6686		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6687
6688	case strings.EqualFold("ServiceUnavailableException", errorCode):
6689		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
6690
6691	case strings.EqualFold("ThrottlingException", errorCode):
6692		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6693
6694	case strings.EqualFold("UnauthorizedException", errorCode):
6695		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
6696
6697	default:
6698		genericError := &smithy.GenericAPIError{
6699			Code:    errorCode,
6700			Message: errorMessage,
6701		}
6702		return genericError
6703
6704	}
6705}
6706
6707type awsRestjson1_deserializeOpDeleteDimension struct {
6708}
6709
6710func (*awsRestjson1_deserializeOpDeleteDimension) ID() string {
6711	return "OperationDeserializer"
6712}
6713
6714func (m *awsRestjson1_deserializeOpDeleteDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6715	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6716) {
6717	out, metadata, err = next.HandleDeserialize(ctx, in)
6718	if err != nil {
6719		return out, metadata, err
6720	}
6721
6722	response, ok := out.RawResponse.(*smithyhttp.Response)
6723	if !ok {
6724		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6725	}
6726
6727	if response.StatusCode < 200 || response.StatusCode >= 300 {
6728		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDimension(response, &metadata)
6729	}
6730	output := &DeleteDimensionOutput{}
6731	out.Result = output
6732
6733	return out, metadata, err
6734}
6735
6736func awsRestjson1_deserializeOpErrorDeleteDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6737	var errorBuffer bytes.Buffer
6738	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6739		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6740	}
6741	errorBody := bytes.NewReader(errorBuffer.Bytes())
6742
6743	errorCode := "UnknownError"
6744	errorMessage := errorCode
6745
6746	code := response.Header.Get("X-Amzn-ErrorType")
6747	if len(code) != 0 {
6748		errorCode = restjson.SanitizeErrorCode(code)
6749	}
6750
6751	var buff [1024]byte
6752	ringBuffer := smithyio.NewRingBuffer(buff[:])
6753
6754	body := io.TeeReader(errorBody, ringBuffer)
6755	decoder := json.NewDecoder(body)
6756	decoder.UseNumber()
6757	code, message, err := restjson.GetErrorInfo(decoder)
6758	if err != nil {
6759		var snapshot bytes.Buffer
6760		io.Copy(&snapshot, ringBuffer)
6761		err = &smithy.DeserializationError{
6762			Err:      fmt.Errorf("failed to decode response body, %w", err),
6763			Snapshot: snapshot.Bytes(),
6764		}
6765		return err
6766	}
6767
6768	errorBody.Seek(0, io.SeekStart)
6769	if len(code) != 0 {
6770		errorCode = restjson.SanitizeErrorCode(code)
6771	}
6772	if len(message) != 0 {
6773		errorMessage = message
6774	}
6775
6776	switch {
6777	case strings.EqualFold("InternalFailureException", errorCode):
6778		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6779
6780	case strings.EqualFold("InvalidRequestException", errorCode):
6781		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6782
6783	case strings.EqualFold("ThrottlingException", errorCode):
6784		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6785
6786	default:
6787		genericError := &smithy.GenericAPIError{
6788			Code:    errorCode,
6789			Message: errorMessage,
6790		}
6791		return genericError
6792
6793	}
6794}
6795
6796type awsRestjson1_deserializeOpDeleteDomainConfiguration struct {
6797}
6798
6799func (*awsRestjson1_deserializeOpDeleteDomainConfiguration) ID() string {
6800	return "OperationDeserializer"
6801}
6802
6803func (m *awsRestjson1_deserializeOpDeleteDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6804	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6805) {
6806	out, metadata, err = next.HandleDeserialize(ctx, in)
6807	if err != nil {
6808		return out, metadata, err
6809	}
6810
6811	response, ok := out.RawResponse.(*smithyhttp.Response)
6812	if !ok {
6813		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6814	}
6815
6816	if response.StatusCode < 200 || response.StatusCode >= 300 {
6817		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response, &metadata)
6818	}
6819	output := &DeleteDomainConfigurationOutput{}
6820	out.Result = output
6821
6822	return out, metadata, err
6823}
6824
6825func awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6826	var errorBuffer bytes.Buffer
6827	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6828		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6829	}
6830	errorBody := bytes.NewReader(errorBuffer.Bytes())
6831
6832	errorCode := "UnknownError"
6833	errorMessage := errorCode
6834
6835	code := response.Header.Get("X-Amzn-ErrorType")
6836	if len(code) != 0 {
6837		errorCode = restjson.SanitizeErrorCode(code)
6838	}
6839
6840	var buff [1024]byte
6841	ringBuffer := smithyio.NewRingBuffer(buff[:])
6842
6843	body := io.TeeReader(errorBody, ringBuffer)
6844	decoder := json.NewDecoder(body)
6845	decoder.UseNumber()
6846	code, message, err := restjson.GetErrorInfo(decoder)
6847	if err != nil {
6848		var snapshot bytes.Buffer
6849		io.Copy(&snapshot, ringBuffer)
6850		err = &smithy.DeserializationError{
6851			Err:      fmt.Errorf("failed to decode response body, %w", err),
6852			Snapshot: snapshot.Bytes(),
6853		}
6854		return err
6855	}
6856
6857	errorBody.Seek(0, io.SeekStart)
6858	if len(code) != 0 {
6859		errorCode = restjson.SanitizeErrorCode(code)
6860	}
6861	if len(message) != 0 {
6862		errorMessage = message
6863	}
6864
6865	switch {
6866	case strings.EqualFold("InternalFailureException", errorCode):
6867		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6868
6869	case strings.EqualFold("InvalidRequestException", errorCode):
6870		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6871
6872	case strings.EqualFold("ResourceNotFoundException", errorCode):
6873		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6874
6875	case strings.EqualFold("ServiceUnavailableException", errorCode):
6876		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
6877
6878	case strings.EqualFold("ThrottlingException", errorCode):
6879		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6880
6881	case strings.EqualFold("UnauthorizedException", errorCode):
6882		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
6883
6884	default:
6885		genericError := &smithy.GenericAPIError{
6886			Code:    errorCode,
6887			Message: errorMessage,
6888		}
6889		return genericError
6890
6891	}
6892}
6893
6894type awsRestjson1_deserializeOpDeleteDynamicThingGroup struct {
6895}
6896
6897func (*awsRestjson1_deserializeOpDeleteDynamicThingGroup) ID() string {
6898	return "OperationDeserializer"
6899}
6900
6901func (m *awsRestjson1_deserializeOpDeleteDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6902	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6903) {
6904	out, metadata, err = next.HandleDeserialize(ctx, in)
6905	if err != nil {
6906		return out, metadata, err
6907	}
6908
6909	response, ok := out.RawResponse.(*smithyhttp.Response)
6910	if !ok {
6911		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6912	}
6913
6914	if response.StatusCode < 200 || response.StatusCode >= 300 {
6915		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response, &metadata)
6916	}
6917	output := &DeleteDynamicThingGroupOutput{}
6918	out.Result = output
6919
6920	return out, metadata, err
6921}
6922
6923func awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6924	var errorBuffer bytes.Buffer
6925	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6926		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6927	}
6928	errorBody := bytes.NewReader(errorBuffer.Bytes())
6929
6930	errorCode := "UnknownError"
6931	errorMessage := errorCode
6932
6933	code := response.Header.Get("X-Amzn-ErrorType")
6934	if len(code) != 0 {
6935		errorCode = restjson.SanitizeErrorCode(code)
6936	}
6937
6938	var buff [1024]byte
6939	ringBuffer := smithyio.NewRingBuffer(buff[:])
6940
6941	body := io.TeeReader(errorBody, ringBuffer)
6942	decoder := json.NewDecoder(body)
6943	decoder.UseNumber()
6944	code, message, err := restjson.GetErrorInfo(decoder)
6945	if err != nil {
6946		var snapshot bytes.Buffer
6947		io.Copy(&snapshot, ringBuffer)
6948		err = &smithy.DeserializationError{
6949			Err:      fmt.Errorf("failed to decode response body, %w", err),
6950			Snapshot: snapshot.Bytes(),
6951		}
6952		return err
6953	}
6954
6955	errorBody.Seek(0, io.SeekStart)
6956	if len(code) != 0 {
6957		errorCode = restjson.SanitizeErrorCode(code)
6958	}
6959	if len(message) != 0 {
6960		errorMessage = message
6961	}
6962
6963	switch {
6964	case strings.EqualFold("InternalFailureException", errorCode):
6965		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6966
6967	case strings.EqualFold("InvalidRequestException", errorCode):
6968		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
6969
6970	case strings.EqualFold("ThrottlingException", errorCode):
6971		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6972
6973	case strings.EqualFold("VersionConflictException", errorCode):
6974		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
6975
6976	default:
6977		genericError := &smithy.GenericAPIError{
6978			Code:    errorCode,
6979			Message: errorMessage,
6980		}
6981		return genericError
6982
6983	}
6984}
6985
6986type awsRestjson1_deserializeOpDeleteJob struct {
6987}
6988
6989func (*awsRestjson1_deserializeOpDeleteJob) ID() string {
6990	return "OperationDeserializer"
6991}
6992
6993func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6994	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6995) {
6996	out, metadata, err = next.HandleDeserialize(ctx, in)
6997	if err != nil {
6998		return out, metadata, err
6999	}
7000
7001	response, ok := out.RawResponse.(*smithyhttp.Response)
7002	if !ok {
7003		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7004	}
7005
7006	if response.StatusCode < 200 || response.StatusCode >= 300 {
7007		return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata)
7008	}
7009	output := &DeleteJobOutput{}
7010	out.Result = output
7011
7012	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
7013		return out, metadata, &smithy.DeserializationError{
7014			Err: fmt.Errorf("failed to discard response body, %w", err),
7015		}
7016	}
7017
7018	return out, metadata, err
7019}
7020
7021func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7022	var errorBuffer bytes.Buffer
7023	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7024		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7025	}
7026	errorBody := bytes.NewReader(errorBuffer.Bytes())
7027
7028	errorCode := "UnknownError"
7029	errorMessage := errorCode
7030
7031	code := response.Header.Get("X-Amzn-ErrorType")
7032	if len(code) != 0 {
7033		errorCode = restjson.SanitizeErrorCode(code)
7034	}
7035
7036	var buff [1024]byte
7037	ringBuffer := smithyio.NewRingBuffer(buff[:])
7038
7039	body := io.TeeReader(errorBody, ringBuffer)
7040	decoder := json.NewDecoder(body)
7041	decoder.UseNumber()
7042	code, message, err := restjson.GetErrorInfo(decoder)
7043	if err != nil {
7044		var snapshot bytes.Buffer
7045		io.Copy(&snapshot, ringBuffer)
7046		err = &smithy.DeserializationError{
7047			Err:      fmt.Errorf("failed to decode response body, %w", err),
7048			Snapshot: snapshot.Bytes(),
7049		}
7050		return err
7051	}
7052
7053	errorBody.Seek(0, io.SeekStart)
7054	if len(code) != 0 {
7055		errorCode = restjson.SanitizeErrorCode(code)
7056	}
7057	if len(message) != 0 {
7058		errorMessage = message
7059	}
7060
7061	switch {
7062	case strings.EqualFold("InvalidRequestException", errorCode):
7063		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7064
7065	case strings.EqualFold("InvalidStateTransitionException", errorCode):
7066		return awsRestjson1_deserializeErrorInvalidStateTransitionException(response, errorBody)
7067
7068	case strings.EqualFold("LimitExceededException", errorCode):
7069		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
7070
7071	case strings.EqualFold("ResourceNotFoundException", errorCode):
7072		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7073
7074	case strings.EqualFold("ServiceUnavailableException", errorCode):
7075		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7076
7077	case strings.EqualFold("ThrottlingException", errorCode):
7078		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7079
7080	default:
7081		genericError := &smithy.GenericAPIError{
7082			Code:    errorCode,
7083			Message: errorMessage,
7084		}
7085		return genericError
7086
7087	}
7088}
7089
7090type awsRestjson1_deserializeOpDeleteJobExecution struct {
7091}
7092
7093func (*awsRestjson1_deserializeOpDeleteJobExecution) ID() string {
7094	return "OperationDeserializer"
7095}
7096
7097func (m *awsRestjson1_deserializeOpDeleteJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7098	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7099) {
7100	out, metadata, err = next.HandleDeserialize(ctx, in)
7101	if err != nil {
7102		return out, metadata, err
7103	}
7104
7105	response, ok := out.RawResponse.(*smithyhttp.Response)
7106	if !ok {
7107		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7108	}
7109
7110	if response.StatusCode < 200 || response.StatusCode >= 300 {
7111		return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobExecution(response, &metadata)
7112	}
7113	output := &DeleteJobExecutionOutput{}
7114	out.Result = output
7115
7116	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
7117		return out, metadata, &smithy.DeserializationError{
7118			Err: fmt.Errorf("failed to discard response body, %w", err),
7119		}
7120	}
7121
7122	return out, metadata, err
7123}
7124
7125func awsRestjson1_deserializeOpErrorDeleteJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7126	var errorBuffer bytes.Buffer
7127	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7128		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7129	}
7130	errorBody := bytes.NewReader(errorBuffer.Bytes())
7131
7132	errorCode := "UnknownError"
7133	errorMessage := errorCode
7134
7135	code := response.Header.Get("X-Amzn-ErrorType")
7136	if len(code) != 0 {
7137		errorCode = restjson.SanitizeErrorCode(code)
7138	}
7139
7140	var buff [1024]byte
7141	ringBuffer := smithyio.NewRingBuffer(buff[:])
7142
7143	body := io.TeeReader(errorBody, ringBuffer)
7144	decoder := json.NewDecoder(body)
7145	decoder.UseNumber()
7146	code, message, err := restjson.GetErrorInfo(decoder)
7147	if err != nil {
7148		var snapshot bytes.Buffer
7149		io.Copy(&snapshot, ringBuffer)
7150		err = &smithy.DeserializationError{
7151			Err:      fmt.Errorf("failed to decode response body, %w", err),
7152			Snapshot: snapshot.Bytes(),
7153		}
7154		return err
7155	}
7156
7157	errorBody.Seek(0, io.SeekStart)
7158	if len(code) != 0 {
7159		errorCode = restjson.SanitizeErrorCode(code)
7160	}
7161	if len(message) != 0 {
7162		errorMessage = message
7163	}
7164
7165	switch {
7166	case strings.EqualFold("InvalidRequestException", errorCode):
7167		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7168
7169	case strings.EqualFold("InvalidStateTransitionException", errorCode):
7170		return awsRestjson1_deserializeErrorInvalidStateTransitionException(response, errorBody)
7171
7172	case strings.EqualFold("ResourceNotFoundException", errorCode):
7173		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7174
7175	case strings.EqualFold("ServiceUnavailableException", errorCode):
7176		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7177
7178	case strings.EqualFold("ThrottlingException", errorCode):
7179		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7180
7181	default:
7182		genericError := &smithy.GenericAPIError{
7183			Code:    errorCode,
7184			Message: errorMessage,
7185		}
7186		return genericError
7187
7188	}
7189}
7190
7191type awsRestjson1_deserializeOpDeleteMitigationAction struct {
7192}
7193
7194func (*awsRestjson1_deserializeOpDeleteMitigationAction) ID() string {
7195	return "OperationDeserializer"
7196}
7197
7198func (m *awsRestjson1_deserializeOpDeleteMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7199	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7200) {
7201	out, metadata, err = next.HandleDeserialize(ctx, in)
7202	if err != nil {
7203		return out, metadata, err
7204	}
7205
7206	response, ok := out.RawResponse.(*smithyhttp.Response)
7207	if !ok {
7208		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7209	}
7210
7211	if response.StatusCode < 200 || response.StatusCode >= 300 {
7212		return out, metadata, awsRestjson1_deserializeOpErrorDeleteMitigationAction(response, &metadata)
7213	}
7214	output := &DeleteMitigationActionOutput{}
7215	out.Result = output
7216
7217	return out, metadata, err
7218}
7219
7220func awsRestjson1_deserializeOpErrorDeleteMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7221	var errorBuffer bytes.Buffer
7222	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7223		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7224	}
7225	errorBody := bytes.NewReader(errorBuffer.Bytes())
7226
7227	errorCode := "UnknownError"
7228	errorMessage := errorCode
7229
7230	code := response.Header.Get("X-Amzn-ErrorType")
7231	if len(code) != 0 {
7232		errorCode = restjson.SanitizeErrorCode(code)
7233	}
7234
7235	var buff [1024]byte
7236	ringBuffer := smithyio.NewRingBuffer(buff[:])
7237
7238	body := io.TeeReader(errorBody, ringBuffer)
7239	decoder := json.NewDecoder(body)
7240	decoder.UseNumber()
7241	code, message, err := restjson.GetErrorInfo(decoder)
7242	if err != nil {
7243		var snapshot bytes.Buffer
7244		io.Copy(&snapshot, ringBuffer)
7245		err = &smithy.DeserializationError{
7246			Err:      fmt.Errorf("failed to decode response body, %w", err),
7247			Snapshot: snapshot.Bytes(),
7248		}
7249		return err
7250	}
7251
7252	errorBody.Seek(0, io.SeekStart)
7253	if len(code) != 0 {
7254		errorCode = restjson.SanitizeErrorCode(code)
7255	}
7256	if len(message) != 0 {
7257		errorMessage = message
7258	}
7259
7260	switch {
7261	case strings.EqualFold("InternalFailureException", errorCode):
7262		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7263
7264	case strings.EqualFold("InvalidRequestException", errorCode):
7265		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7266
7267	case strings.EqualFold("ThrottlingException", errorCode):
7268		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7269
7270	default:
7271		genericError := &smithy.GenericAPIError{
7272			Code:    errorCode,
7273			Message: errorMessage,
7274		}
7275		return genericError
7276
7277	}
7278}
7279
7280type awsRestjson1_deserializeOpDeleteOTAUpdate struct {
7281}
7282
7283func (*awsRestjson1_deserializeOpDeleteOTAUpdate) ID() string {
7284	return "OperationDeserializer"
7285}
7286
7287func (m *awsRestjson1_deserializeOpDeleteOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7288	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7289) {
7290	out, metadata, err = next.HandleDeserialize(ctx, in)
7291	if err != nil {
7292		return out, metadata, err
7293	}
7294
7295	response, ok := out.RawResponse.(*smithyhttp.Response)
7296	if !ok {
7297		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7298	}
7299
7300	if response.StatusCode < 200 || response.StatusCode >= 300 {
7301		return out, metadata, awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response, &metadata)
7302	}
7303	output := &DeleteOTAUpdateOutput{}
7304	out.Result = output
7305
7306	return out, metadata, err
7307}
7308
7309func awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7310	var errorBuffer bytes.Buffer
7311	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7312		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7313	}
7314	errorBody := bytes.NewReader(errorBuffer.Bytes())
7315
7316	errorCode := "UnknownError"
7317	errorMessage := errorCode
7318
7319	code := response.Header.Get("X-Amzn-ErrorType")
7320	if len(code) != 0 {
7321		errorCode = restjson.SanitizeErrorCode(code)
7322	}
7323
7324	var buff [1024]byte
7325	ringBuffer := smithyio.NewRingBuffer(buff[:])
7326
7327	body := io.TeeReader(errorBody, ringBuffer)
7328	decoder := json.NewDecoder(body)
7329	decoder.UseNumber()
7330	code, message, err := restjson.GetErrorInfo(decoder)
7331	if err != nil {
7332		var snapshot bytes.Buffer
7333		io.Copy(&snapshot, ringBuffer)
7334		err = &smithy.DeserializationError{
7335			Err:      fmt.Errorf("failed to decode response body, %w", err),
7336			Snapshot: snapshot.Bytes(),
7337		}
7338		return err
7339	}
7340
7341	errorBody.Seek(0, io.SeekStart)
7342	if len(code) != 0 {
7343		errorCode = restjson.SanitizeErrorCode(code)
7344	}
7345	if len(message) != 0 {
7346		errorMessage = message
7347	}
7348
7349	switch {
7350	case strings.EqualFold("InternalFailureException", errorCode):
7351		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7352
7353	case strings.EqualFold("InvalidRequestException", errorCode):
7354		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7355
7356	case strings.EqualFold("ResourceNotFoundException", errorCode):
7357		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7358
7359	case strings.EqualFold("ServiceUnavailableException", errorCode):
7360		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7361
7362	case strings.EqualFold("ThrottlingException", errorCode):
7363		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7364
7365	case strings.EqualFold("UnauthorizedException", errorCode):
7366		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7367
7368	case strings.EqualFold("VersionConflictException", errorCode):
7369		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
7370
7371	default:
7372		genericError := &smithy.GenericAPIError{
7373			Code:    errorCode,
7374			Message: errorMessage,
7375		}
7376		return genericError
7377
7378	}
7379}
7380
7381type awsRestjson1_deserializeOpDeletePolicy struct {
7382}
7383
7384func (*awsRestjson1_deserializeOpDeletePolicy) ID() string {
7385	return "OperationDeserializer"
7386}
7387
7388func (m *awsRestjson1_deserializeOpDeletePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7389	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7390) {
7391	out, metadata, err = next.HandleDeserialize(ctx, in)
7392	if err != nil {
7393		return out, metadata, err
7394	}
7395
7396	response, ok := out.RawResponse.(*smithyhttp.Response)
7397	if !ok {
7398		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7399	}
7400
7401	if response.StatusCode < 200 || response.StatusCode >= 300 {
7402		return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicy(response, &metadata)
7403	}
7404	output := &DeletePolicyOutput{}
7405	out.Result = output
7406
7407	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
7408		return out, metadata, &smithy.DeserializationError{
7409			Err: fmt.Errorf("failed to discard response body, %w", err),
7410		}
7411	}
7412
7413	return out, metadata, err
7414}
7415
7416func awsRestjson1_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7417	var errorBuffer bytes.Buffer
7418	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7419		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7420	}
7421	errorBody := bytes.NewReader(errorBuffer.Bytes())
7422
7423	errorCode := "UnknownError"
7424	errorMessage := errorCode
7425
7426	code := response.Header.Get("X-Amzn-ErrorType")
7427	if len(code) != 0 {
7428		errorCode = restjson.SanitizeErrorCode(code)
7429	}
7430
7431	var buff [1024]byte
7432	ringBuffer := smithyio.NewRingBuffer(buff[:])
7433
7434	body := io.TeeReader(errorBody, ringBuffer)
7435	decoder := json.NewDecoder(body)
7436	decoder.UseNumber()
7437	code, message, err := restjson.GetErrorInfo(decoder)
7438	if err != nil {
7439		var snapshot bytes.Buffer
7440		io.Copy(&snapshot, ringBuffer)
7441		err = &smithy.DeserializationError{
7442			Err:      fmt.Errorf("failed to decode response body, %w", err),
7443			Snapshot: snapshot.Bytes(),
7444		}
7445		return err
7446	}
7447
7448	errorBody.Seek(0, io.SeekStart)
7449	if len(code) != 0 {
7450		errorCode = restjson.SanitizeErrorCode(code)
7451	}
7452	if len(message) != 0 {
7453		errorMessage = message
7454	}
7455
7456	switch {
7457	case strings.EqualFold("DeleteConflictException", errorCode):
7458		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
7459
7460	case strings.EqualFold("InternalFailureException", errorCode):
7461		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7462
7463	case strings.EqualFold("InvalidRequestException", errorCode):
7464		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7465
7466	case strings.EqualFold("ResourceNotFoundException", errorCode):
7467		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7468
7469	case strings.EqualFold("ServiceUnavailableException", errorCode):
7470		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7471
7472	case strings.EqualFold("ThrottlingException", errorCode):
7473		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7474
7475	case strings.EqualFold("UnauthorizedException", errorCode):
7476		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7477
7478	default:
7479		genericError := &smithy.GenericAPIError{
7480			Code:    errorCode,
7481			Message: errorMessage,
7482		}
7483		return genericError
7484
7485	}
7486}
7487
7488type awsRestjson1_deserializeOpDeletePolicyVersion struct {
7489}
7490
7491func (*awsRestjson1_deserializeOpDeletePolicyVersion) ID() string {
7492	return "OperationDeserializer"
7493}
7494
7495func (m *awsRestjson1_deserializeOpDeletePolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7496	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7497) {
7498	out, metadata, err = next.HandleDeserialize(ctx, in)
7499	if err != nil {
7500		return out, metadata, err
7501	}
7502
7503	response, ok := out.RawResponse.(*smithyhttp.Response)
7504	if !ok {
7505		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7506	}
7507
7508	if response.StatusCode < 200 || response.StatusCode >= 300 {
7509		return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicyVersion(response, &metadata)
7510	}
7511	output := &DeletePolicyVersionOutput{}
7512	out.Result = output
7513
7514	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
7515		return out, metadata, &smithy.DeserializationError{
7516			Err: fmt.Errorf("failed to discard response body, %w", err),
7517		}
7518	}
7519
7520	return out, metadata, err
7521}
7522
7523func awsRestjson1_deserializeOpErrorDeletePolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7524	var errorBuffer bytes.Buffer
7525	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7526		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7527	}
7528	errorBody := bytes.NewReader(errorBuffer.Bytes())
7529
7530	errorCode := "UnknownError"
7531	errorMessage := errorCode
7532
7533	code := response.Header.Get("X-Amzn-ErrorType")
7534	if len(code) != 0 {
7535		errorCode = restjson.SanitizeErrorCode(code)
7536	}
7537
7538	var buff [1024]byte
7539	ringBuffer := smithyio.NewRingBuffer(buff[:])
7540
7541	body := io.TeeReader(errorBody, ringBuffer)
7542	decoder := json.NewDecoder(body)
7543	decoder.UseNumber()
7544	code, message, err := restjson.GetErrorInfo(decoder)
7545	if err != nil {
7546		var snapshot bytes.Buffer
7547		io.Copy(&snapshot, ringBuffer)
7548		err = &smithy.DeserializationError{
7549			Err:      fmt.Errorf("failed to decode response body, %w", err),
7550			Snapshot: snapshot.Bytes(),
7551		}
7552		return err
7553	}
7554
7555	errorBody.Seek(0, io.SeekStart)
7556	if len(code) != 0 {
7557		errorCode = restjson.SanitizeErrorCode(code)
7558	}
7559	if len(message) != 0 {
7560		errorMessage = message
7561	}
7562
7563	switch {
7564	case strings.EqualFold("DeleteConflictException", errorCode):
7565		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
7566
7567	case strings.EqualFold("InternalFailureException", errorCode):
7568		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7569
7570	case strings.EqualFold("InvalidRequestException", errorCode):
7571		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7572
7573	case strings.EqualFold("ResourceNotFoundException", errorCode):
7574		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7575
7576	case strings.EqualFold("ServiceUnavailableException", errorCode):
7577		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7578
7579	case strings.EqualFold("ThrottlingException", errorCode):
7580		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7581
7582	case strings.EqualFold("UnauthorizedException", errorCode):
7583		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7584
7585	default:
7586		genericError := &smithy.GenericAPIError{
7587			Code:    errorCode,
7588			Message: errorMessage,
7589		}
7590		return genericError
7591
7592	}
7593}
7594
7595type awsRestjson1_deserializeOpDeleteProvisioningTemplate struct {
7596}
7597
7598func (*awsRestjson1_deserializeOpDeleteProvisioningTemplate) ID() string {
7599	return "OperationDeserializer"
7600}
7601
7602func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7603	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7604) {
7605	out, metadata, err = next.HandleDeserialize(ctx, in)
7606	if err != nil {
7607		return out, metadata, err
7608	}
7609
7610	response, ok := out.RawResponse.(*smithyhttp.Response)
7611	if !ok {
7612		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7613	}
7614
7615	if response.StatusCode < 200 || response.StatusCode >= 300 {
7616		return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response, &metadata)
7617	}
7618	output := &DeleteProvisioningTemplateOutput{}
7619	out.Result = output
7620
7621	return out, metadata, err
7622}
7623
7624func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7625	var errorBuffer bytes.Buffer
7626	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7627		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7628	}
7629	errorBody := bytes.NewReader(errorBuffer.Bytes())
7630
7631	errorCode := "UnknownError"
7632	errorMessage := errorCode
7633
7634	code := response.Header.Get("X-Amzn-ErrorType")
7635	if len(code) != 0 {
7636		errorCode = restjson.SanitizeErrorCode(code)
7637	}
7638
7639	var buff [1024]byte
7640	ringBuffer := smithyio.NewRingBuffer(buff[:])
7641
7642	body := io.TeeReader(errorBody, ringBuffer)
7643	decoder := json.NewDecoder(body)
7644	decoder.UseNumber()
7645	code, message, err := restjson.GetErrorInfo(decoder)
7646	if err != nil {
7647		var snapshot bytes.Buffer
7648		io.Copy(&snapshot, ringBuffer)
7649		err = &smithy.DeserializationError{
7650			Err:      fmt.Errorf("failed to decode response body, %w", err),
7651			Snapshot: snapshot.Bytes(),
7652		}
7653		return err
7654	}
7655
7656	errorBody.Seek(0, io.SeekStart)
7657	if len(code) != 0 {
7658		errorCode = restjson.SanitizeErrorCode(code)
7659	}
7660	if len(message) != 0 {
7661		errorMessage = message
7662	}
7663
7664	switch {
7665	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
7666		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
7667
7668	case strings.EqualFold("DeleteConflictException", errorCode):
7669		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
7670
7671	case strings.EqualFold("InternalFailureException", errorCode):
7672		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7673
7674	case strings.EqualFold("InvalidRequestException", errorCode):
7675		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7676
7677	case strings.EqualFold("ResourceNotFoundException", errorCode):
7678		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7679
7680	case strings.EqualFold("ThrottlingException", errorCode):
7681		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7682
7683	case strings.EqualFold("UnauthorizedException", errorCode):
7684		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7685
7686	default:
7687		genericError := &smithy.GenericAPIError{
7688			Code:    errorCode,
7689			Message: errorMessage,
7690		}
7691		return genericError
7692
7693	}
7694}
7695
7696type awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion struct {
7697}
7698
7699func (*awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) ID() string {
7700	return "OperationDeserializer"
7701}
7702
7703func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7704	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7705) {
7706	out, metadata, err = next.HandleDeserialize(ctx, in)
7707	if err != nil {
7708		return out, metadata, err
7709	}
7710
7711	response, ok := out.RawResponse.(*smithyhttp.Response)
7712	if !ok {
7713		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7714	}
7715
7716	if response.StatusCode < 200 || response.StatusCode >= 300 {
7717		return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response, &metadata)
7718	}
7719	output := &DeleteProvisioningTemplateVersionOutput{}
7720	out.Result = output
7721
7722	return out, metadata, err
7723}
7724
7725func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7726	var errorBuffer bytes.Buffer
7727	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7728		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7729	}
7730	errorBody := bytes.NewReader(errorBuffer.Bytes())
7731
7732	errorCode := "UnknownError"
7733	errorMessage := errorCode
7734
7735	code := response.Header.Get("X-Amzn-ErrorType")
7736	if len(code) != 0 {
7737		errorCode = restjson.SanitizeErrorCode(code)
7738	}
7739
7740	var buff [1024]byte
7741	ringBuffer := smithyio.NewRingBuffer(buff[:])
7742
7743	body := io.TeeReader(errorBody, ringBuffer)
7744	decoder := json.NewDecoder(body)
7745	decoder.UseNumber()
7746	code, message, err := restjson.GetErrorInfo(decoder)
7747	if err != nil {
7748		var snapshot bytes.Buffer
7749		io.Copy(&snapshot, ringBuffer)
7750		err = &smithy.DeserializationError{
7751			Err:      fmt.Errorf("failed to decode response body, %w", err),
7752			Snapshot: snapshot.Bytes(),
7753		}
7754		return err
7755	}
7756
7757	errorBody.Seek(0, io.SeekStart)
7758	if len(code) != 0 {
7759		errorCode = restjson.SanitizeErrorCode(code)
7760	}
7761	if len(message) != 0 {
7762		errorMessage = message
7763	}
7764
7765	switch {
7766	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
7767		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
7768
7769	case strings.EqualFold("DeleteConflictException", errorCode):
7770		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
7771
7772	case strings.EqualFold("InternalFailureException", errorCode):
7773		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7774
7775	case strings.EqualFold("InvalidRequestException", errorCode):
7776		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7777
7778	case strings.EqualFold("ResourceNotFoundException", errorCode):
7779		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7780
7781	case strings.EqualFold("ThrottlingException", errorCode):
7782		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7783
7784	case strings.EqualFold("UnauthorizedException", errorCode):
7785		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7786
7787	default:
7788		genericError := &smithy.GenericAPIError{
7789			Code:    errorCode,
7790			Message: errorMessage,
7791		}
7792		return genericError
7793
7794	}
7795}
7796
7797type awsRestjson1_deserializeOpDeleteRegistrationCode struct {
7798}
7799
7800func (*awsRestjson1_deserializeOpDeleteRegistrationCode) ID() string {
7801	return "OperationDeserializer"
7802}
7803
7804func (m *awsRestjson1_deserializeOpDeleteRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7805	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7806) {
7807	out, metadata, err = next.HandleDeserialize(ctx, in)
7808	if err != nil {
7809		return out, metadata, err
7810	}
7811
7812	response, ok := out.RawResponse.(*smithyhttp.Response)
7813	if !ok {
7814		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7815	}
7816
7817	if response.StatusCode < 200 || response.StatusCode >= 300 {
7818		return out, metadata, awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response, &metadata)
7819	}
7820	output := &DeleteRegistrationCodeOutput{}
7821	out.Result = output
7822
7823	return out, metadata, err
7824}
7825
7826func awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7827	var errorBuffer bytes.Buffer
7828	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7829		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7830	}
7831	errorBody := bytes.NewReader(errorBuffer.Bytes())
7832
7833	errorCode := "UnknownError"
7834	errorMessage := errorCode
7835
7836	code := response.Header.Get("X-Amzn-ErrorType")
7837	if len(code) != 0 {
7838		errorCode = restjson.SanitizeErrorCode(code)
7839	}
7840
7841	var buff [1024]byte
7842	ringBuffer := smithyio.NewRingBuffer(buff[:])
7843
7844	body := io.TeeReader(errorBody, ringBuffer)
7845	decoder := json.NewDecoder(body)
7846	decoder.UseNumber()
7847	code, message, err := restjson.GetErrorInfo(decoder)
7848	if err != nil {
7849		var snapshot bytes.Buffer
7850		io.Copy(&snapshot, ringBuffer)
7851		err = &smithy.DeserializationError{
7852			Err:      fmt.Errorf("failed to decode response body, %w", err),
7853			Snapshot: snapshot.Bytes(),
7854		}
7855		return err
7856	}
7857
7858	errorBody.Seek(0, io.SeekStart)
7859	if len(code) != 0 {
7860		errorCode = restjson.SanitizeErrorCode(code)
7861	}
7862	if len(message) != 0 {
7863		errorMessage = message
7864	}
7865
7866	switch {
7867	case strings.EqualFold("InternalFailureException", errorCode):
7868		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7869
7870	case strings.EqualFold("ResourceNotFoundException", errorCode):
7871		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7872
7873	case strings.EqualFold("ServiceUnavailableException", errorCode):
7874		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7875
7876	case strings.EqualFold("ThrottlingException", errorCode):
7877		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7878
7879	case strings.EqualFold("UnauthorizedException", errorCode):
7880		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7881
7882	default:
7883		genericError := &smithy.GenericAPIError{
7884			Code:    errorCode,
7885			Message: errorMessage,
7886		}
7887		return genericError
7888
7889	}
7890}
7891
7892type awsRestjson1_deserializeOpDeleteRoleAlias struct {
7893}
7894
7895func (*awsRestjson1_deserializeOpDeleteRoleAlias) ID() string {
7896	return "OperationDeserializer"
7897}
7898
7899func (m *awsRestjson1_deserializeOpDeleteRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7900	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7901) {
7902	out, metadata, err = next.HandleDeserialize(ctx, in)
7903	if err != nil {
7904		return out, metadata, err
7905	}
7906
7907	response, ok := out.RawResponse.(*smithyhttp.Response)
7908	if !ok {
7909		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7910	}
7911
7912	if response.StatusCode < 200 || response.StatusCode >= 300 {
7913		return out, metadata, awsRestjson1_deserializeOpErrorDeleteRoleAlias(response, &metadata)
7914	}
7915	output := &DeleteRoleAliasOutput{}
7916	out.Result = output
7917
7918	return out, metadata, err
7919}
7920
7921func awsRestjson1_deserializeOpErrorDeleteRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7922	var errorBuffer bytes.Buffer
7923	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7924		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7925	}
7926	errorBody := bytes.NewReader(errorBuffer.Bytes())
7927
7928	errorCode := "UnknownError"
7929	errorMessage := errorCode
7930
7931	code := response.Header.Get("X-Amzn-ErrorType")
7932	if len(code) != 0 {
7933		errorCode = restjson.SanitizeErrorCode(code)
7934	}
7935
7936	var buff [1024]byte
7937	ringBuffer := smithyio.NewRingBuffer(buff[:])
7938
7939	body := io.TeeReader(errorBody, ringBuffer)
7940	decoder := json.NewDecoder(body)
7941	decoder.UseNumber()
7942	code, message, err := restjson.GetErrorInfo(decoder)
7943	if err != nil {
7944		var snapshot bytes.Buffer
7945		io.Copy(&snapshot, ringBuffer)
7946		err = &smithy.DeserializationError{
7947			Err:      fmt.Errorf("failed to decode response body, %w", err),
7948			Snapshot: snapshot.Bytes(),
7949		}
7950		return err
7951	}
7952
7953	errorBody.Seek(0, io.SeekStart)
7954	if len(code) != 0 {
7955		errorCode = restjson.SanitizeErrorCode(code)
7956	}
7957	if len(message) != 0 {
7958		errorMessage = message
7959	}
7960
7961	switch {
7962	case strings.EqualFold("DeleteConflictException", errorCode):
7963		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
7964
7965	case strings.EqualFold("InternalFailureException", errorCode):
7966		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7967
7968	case strings.EqualFold("InvalidRequestException", errorCode):
7969		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
7970
7971	case strings.EqualFold("ResourceNotFoundException", errorCode):
7972		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7973
7974	case strings.EqualFold("ServiceUnavailableException", errorCode):
7975		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
7976
7977	case strings.EqualFold("ThrottlingException", errorCode):
7978		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7979
7980	case strings.EqualFold("UnauthorizedException", errorCode):
7981		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
7982
7983	default:
7984		genericError := &smithy.GenericAPIError{
7985			Code:    errorCode,
7986			Message: errorMessage,
7987		}
7988		return genericError
7989
7990	}
7991}
7992
7993type awsRestjson1_deserializeOpDeleteScheduledAudit struct {
7994}
7995
7996func (*awsRestjson1_deserializeOpDeleteScheduledAudit) ID() string {
7997	return "OperationDeserializer"
7998}
7999
8000func (m *awsRestjson1_deserializeOpDeleteScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8001	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8002) {
8003	out, metadata, err = next.HandleDeserialize(ctx, in)
8004	if err != nil {
8005		return out, metadata, err
8006	}
8007
8008	response, ok := out.RawResponse.(*smithyhttp.Response)
8009	if !ok {
8010		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8011	}
8012
8013	if response.StatusCode < 200 || response.StatusCode >= 300 {
8014		return out, metadata, awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response, &metadata)
8015	}
8016	output := &DeleteScheduledAuditOutput{}
8017	out.Result = output
8018
8019	return out, metadata, err
8020}
8021
8022func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8023	var errorBuffer bytes.Buffer
8024	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8025		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8026	}
8027	errorBody := bytes.NewReader(errorBuffer.Bytes())
8028
8029	errorCode := "UnknownError"
8030	errorMessage := errorCode
8031
8032	code := response.Header.Get("X-Amzn-ErrorType")
8033	if len(code) != 0 {
8034		errorCode = restjson.SanitizeErrorCode(code)
8035	}
8036
8037	var buff [1024]byte
8038	ringBuffer := smithyio.NewRingBuffer(buff[:])
8039
8040	body := io.TeeReader(errorBody, ringBuffer)
8041	decoder := json.NewDecoder(body)
8042	decoder.UseNumber()
8043	code, message, err := restjson.GetErrorInfo(decoder)
8044	if err != nil {
8045		var snapshot bytes.Buffer
8046		io.Copy(&snapshot, ringBuffer)
8047		err = &smithy.DeserializationError{
8048			Err:      fmt.Errorf("failed to decode response body, %w", err),
8049			Snapshot: snapshot.Bytes(),
8050		}
8051		return err
8052	}
8053
8054	errorBody.Seek(0, io.SeekStart)
8055	if len(code) != 0 {
8056		errorCode = restjson.SanitizeErrorCode(code)
8057	}
8058	if len(message) != 0 {
8059		errorMessage = message
8060	}
8061
8062	switch {
8063	case strings.EqualFold("InternalFailureException", errorCode):
8064		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8065
8066	case strings.EqualFold("InvalidRequestException", errorCode):
8067		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8068
8069	case strings.EqualFold("ResourceNotFoundException", errorCode):
8070		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8071
8072	case strings.EqualFold("ThrottlingException", errorCode):
8073		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8074
8075	default:
8076		genericError := &smithy.GenericAPIError{
8077			Code:    errorCode,
8078			Message: errorMessage,
8079		}
8080		return genericError
8081
8082	}
8083}
8084
8085type awsRestjson1_deserializeOpDeleteSecurityProfile struct {
8086}
8087
8088func (*awsRestjson1_deserializeOpDeleteSecurityProfile) ID() string {
8089	return "OperationDeserializer"
8090}
8091
8092func (m *awsRestjson1_deserializeOpDeleteSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8093	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8094) {
8095	out, metadata, err = next.HandleDeserialize(ctx, in)
8096	if err != nil {
8097		return out, metadata, err
8098	}
8099
8100	response, ok := out.RawResponse.(*smithyhttp.Response)
8101	if !ok {
8102		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8103	}
8104
8105	if response.StatusCode < 200 || response.StatusCode >= 300 {
8106		return out, metadata, awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response, &metadata)
8107	}
8108	output := &DeleteSecurityProfileOutput{}
8109	out.Result = output
8110
8111	return out, metadata, err
8112}
8113
8114func awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8115	var errorBuffer bytes.Buffer
8116	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8117		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8118	}
8119	errorBody := bytes.NewReader(errorBuffer.Bytes())
8120
8121	errorCode := "UnknownError"
8122	errorMessage := errorCode
8123
8124	code := response.Header.Get("X-Amzn-ErrorType")
8125	if len(code) != 0 {
8126		errorCode = restjson.SanitizeErrorCode(code)
8127	}
8128
8129	var buff [1024]byte
8130	ringBuffer := smithyio.NewRingBuffer(buff[:])
8131
8132	body := io.TeeReader(errorBody, ringBuffer)
8133	decoder := json.NewDecoder(body)
8134	decoder.UseNumber()
8135	code, message, err := restjson.GetErrorInfo(decoder)
8136	if err != nil {
8137		var snapshot bytes.Buffer
8138		io.Copy(&snapshot, ringBuffer)
8139		err = &smithy.DeserializationError{
8140			Err:      fmt.Errorf("failed to decode response body, %w", err),
8141			Snapshot: snapshot.Bytes(),
8142		}
8143		return err
8144	}
8145
8146	errorBody.Seek(0, io.SeekStart)
8147	if len(code) != 0 {
8148		errorCode = restjson.SanitizeErrorCode(code)
8149	}
8150	if len(message) != 0 {
8151		errorMessage = message
8152	}
8153
8154	switch {
8155	case strings.EqualFold("InternalFailureException", errorCode):
8156		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8157
8158	case strings.EqualFold("InvalidRequestException", errorCode):
8159		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8160
8161	case strings.EqualFold("ThrottlingException", errorCode):
8162		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8163
8164	case strings.EqualFold("VersionConflictException", errorCode):
8165		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
8166
8167	default:
8168		genericError := &smithy.GenericAPIError{
8169			Code:    errorCode,
8170			Message: errorMessage,
8171		}
8172		return genericError
8173
8174	}
8175}
8176
8177type awsRestjson1_deserializeOpDeleteStream struct {
8178}
8179
8180func (*awsRestjson1_deserializeOpDeleteStream) ID() string {
8181	return "OperationDeserializer"
8182}
8183
8184func (m *awsRestjson1_deserializeOpDeleteStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8185	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8186) {
8187	out, metadata, err = next.HandleDeserialize(ctx, in)
8188	if err != nil {
8189		return out, metadata, err
8190	}
8191
8192	response, ok := out.RawResponse.(*smithyhttp.Response)
8193	if !ok {
8194		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8195	}
8196
8197	if response.StatusCode < 200 || response.StatusCode >= 300 {
8198		return out, metadata, awsRestjson1_deserializeOpErrorDeleteStream(response, &metadata)
8199	}
8200	output := &DeleteStreamOutput{}
8201	out.Result = output
8202
8203	return out, metadata, err
8204}
8205
8206func awsRestjson1_deserializeOpErrorDeleteStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8207	var errorBuffer bytes.Buffer
8208	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8209		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8210	}
8211	errorBody := bytes.NewReader(errorBuffer.Bytes())
8212
8213	errorCode := "UnknownError"
8214	errorMessage := errorCode
8215
8216	code := response.Header.Get("X-Amzn-ErrorType")
8217	if len(code) != 0 {
8218		errorCode = restjson.SanitizeErrorCode(code)
8219	}
8220
8221	var buff [1024]byte
8222	ringBuffer := smithyio.NewRingBuffer(buff[:])
8223
8224	body := io.TeeReader(errorBody, ringBuffer)
8225	decoder := json.NewDecoder(body)
8226	decoder.UseNumber()
8227	code, message, err := restjson.GetErrorInfo(decoder)
8228	if err != nil {
8229		var snapshot bytes.Buffer
8230		io.Copy(&snapshot, ringBuffer)
8231		err = &smithy.DeserializationError{
8232			Err:      fmt.Errorf("failed to decode response body, %w", err),
8233			Snapshot: snapshot.Bytes(),
8234		}
8235		return err
8236	}
8237
8238	errorBody.Seek(0, io.SeekStart)
8239	if len(code) != 0 {
8240		errorCode = restjson.SanitizeErrorCode(code)
8241	}
8242	if len(message) != 0 {
8243		errorMessage = message
8244	}
8245
8246	switch {
8247	case strings.EqualFold("DeleteConflictException", errorCode):
8248		return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody)
8249
8250	case strings.EqualFold("InternalFailureException", errorCode):
8251		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8252
8253	case strings.EqualFold("InvalidRequestException", errorCode):
8254		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8255
8256	case strings.EqualFold("ResourceNotFoundException", errorCode):
8257		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8258
8259	case strings.EqualFold("ServiceUnavailableException", errorCode):
8260		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8261
8262	case strings.EqualFold("ThrottlingException", errorCode):
8263		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8264
8265	case strings.EqualFold("UnauthorizedException", errorCode):
8266		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8267
8268	default:
8269		genericError := &smithy.GenericAPIError{
8270			Code:    errorCode,
8271			Message: errorMessage,
8272		}
8273		return genericError
8274
8275	}
8276}
8277
8278type awsRestjson1_deserializeOpDeleteThing struct {
8279}
8280
8281func (*awsRestjson1_deserializeOpDeleteThing) ID() string {
8282	return "OperationDeserializer"
8283}
8284
8285func (m *awsRestjson1_deserializeOpDeleteThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8286	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8287) {
8288	out, metadata, err = next.HandleDeserialize(ctx, in)
8289	if err != nil {
8290		return out, metadata, err
8291	}
8292
8293	response, ok := out.RawResponse.(*smithyhttp.Response)
8294	if !ok {
8295		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8296	}
8297
8298	if response.StatusCode < 200 || response.StatusCode >= 300 {
8299		return out, metadata, awsRestjson1_deserializeOpErrorDeleteThing(response, &metadata)
8300	}
8301	output := &DeleteThingOutput{}
8302	out.Result = output
8303
8304	return out, metadata, err
8305}
8306
8307func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8308	var errorBuffer bytes.Buffer
8309	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8310		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8311	}
8312	errorBody := bytes.NewReader(errorBuffer.Bytes())
8313
8314	errorCode := "UnknownError"
8315	errorMessage := errorCode
8316
8317	code := response.Header.Get("X-Amzn-ErrorType")
8318	if len(code) != 0 {
8319		errorCode = restjson.SanitizeErrorCode(code)
8320	}
8321
8322	var buff [1024]byte
8323	ringBuffer := smithyio.NewRingBuffer(buff[:])
8324
8325	body := io.TeeReader(errorBody, ringBuffer)
8326	decoder := json.NewDecoder(body)
8327	decoder.UseNumber()
8328	code, message, err := restjson.GetErrorInfo(decoder)
8329	if err != nil {
8330		var snapshot bytes.Buffer
8331		io.Copy(&snapshot, ringBuffer)
8332		err = &smithy.DeserializationError{
8333			Err:      fmt.Errorf("failed to decode response body, %w", err),
8334			Snapshot: snapshot.Bytes(),
8335		}
8336		return err
8337	}
8338
8339	errorBody.Seek(0, io.SeekStart)
8340	if len(code) != 0 {
8341		errorCode = restjson.SanitizeErrorCode(code)
8342	}
8343	if len(message) != 0 {
8344		errorMessage = message
8345	}
8346
8347	switch {
8348	case strings.EqualFold("InternalFailureException", errorCode):
8349		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8350
8351	case strings.EqualFold("InvalidRequestException", errorCode):
8352		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8353
8354	case strings.EqualFold("ResourceNotFoundException", errorCode):
8355		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8356
8357	case strings.EqualFold("ServiceUnavailableException", errorCode):
8358		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8359
8360	case strings.EqualFold("ThrottlingException", errorCode):
8361		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8362
8363	case strings.EqualFold("UnauthorizedException", errorCode):
8364		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8365
8366	case strings.EqualFold("VersionConflictException", errorCode):
8367		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
8368
8369	default:
8370		genericError := &smithy.GenericAPIError{
8371			Code:    errorCode,
8372			Message: errorMessage,
8373		}
8374		return genericError
8375
8376	}
8377}
8378
8379type awsRestjson1_deserializeOpDeleteThingGroup struct {
8380}
8381
8382func (*awsRestjson1_deserializeOpDeleteThingGroup) ID() string {
8383	return "OperationDeserializer"
8384}
8385
8386func (m *awsRestjson1_deserializeOpDeleteThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8387	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8388) {
8389	out, metadata, err = next.HandleDeserialize(ctx, in)
8390	if err != nil {
8391		return out, metadata, err
8392	}
8393
8394	response, ok := out.RawResponse.(*smithyhttp.Response)
8395	if !ok {
8396		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8397	}
8398
8399	if response.StatusCode < 200 || response.StatusCode >= 300 {
8400		return out, metadata, awsRestjson1_deserializeOpErrorDeleteThingGroup(response, &metadata)
8401	}
8402	output := &DeleteThingGroupOutput{}
8403	out.Result = output
8404
8405	return out, metadata, err
8406}
8407
8408func awsRestjson1_deserializeOpErrorDeleteThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8409	var errorBuffer bytes.Buffer
8410	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8411		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8412	}
8413	errorBody := bytes.NewReader(errorBuffer.Bytes())
8414
8415	errorCode := "UnknownError"
8416	errorMessage := errorCode
8417
8418	code := response.Header.Get("X-Amzn-ErrorType")
8419	if len(code) != 0 {
8420		errorCode = restjson.SanitizeErrorCode(code)
8421	}
8422
8423	var buff [1024]byte
8424	ringBuffer := smithyio.NewRingBuffer(buff[:])
8425
8426	body := io.TeeReader(errorBody, ringBuffer)
8427	decoder := json.NewDecoder(body)
8428	decoder.UseNumber()
8429	code, message, err := restjson.GetErrorInfo(decoder)
8430	if err != nil {
8431		var snapshot bytes.Buffer
8432		io.Copy(&snapshot, ringBuffer)
8433		err = &smithy.DeserializationError{
8434			Err:      fmt.Errorf("failed to decode response body, %w", err),
8435			Snapshot: snapshot.Bytes(),
8436		}
8437		return err
8438	}
8439
8440	errorBody.Seek(0, io.SeekStart)
8441	if len(code) != 0 {
8442		errorCode = restjson.SanitizeErrorCode(code)
8443	}
8444	if len(message) != 0 {
8445		errorMessage = message
8446	}
8447
8448	switch {
8449	case strings.EqualFold("InternalFailureException", errorCode):
8450		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8451
8452	case strings.EqualFold("InvalidRequestException", errorCode):
8453		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8454
8455	case strings.EqualFold("ThrottlingException", errorCode):
8456		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8457
8458	case strings.EqualFold("VersionConflictException", errorCode):
8459		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
8460
8461	default:
8462		genericError := &smithy.GenericAPIError{
8463			Code:    errorCode,
8464			Message: errorMessage,
8465		}
8466		return genericError
8467
8468	}
8469}
8470
8471type awsRestjson1_deserializeOpDeleteThingType struct {
8472}
8473
8474func (*awsRestjson1_deserializeOpDeleteThingType) ID() string {
8475	return "OperationDeserializer"
8476}
8477
8478func (m *awsRestjson1_deserializeOpDeleteThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8479	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8480) {
8481	out, metadata, err = next.HandleDeserialize(ctx, in)
8482	if err != nil {
8483		return out, metadata, err
8484	}
8485
8486	response, ok := out.RawResponse.(*smithyhttp.Response)
8487	if !ok {
8488		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8489	}
8490
8491	if response.StatusCode < 200 || response.StatusCode >= 300 {
8492		return out, metadata, awsRestjson1_deserializeOpErrorDeleteThingType(response, &metadata)
8493	}
8494	output := &DeleteThingTypeOutput{}
8495	out.Result = output
8496
8497	return out, metadata, err
8498}
8499
8500func awsRestjson1_deserializeOpErrorDeleteThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8501	var errorBuffer bytes.Buffer
8502	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8503		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8504	}
8505	errorBody := bytes.NewReader(errorBuffer.Bytes())
8506
8507	errorCode := "UnknownError"
8508	errorMessage := errorCode
8509
8510	code := response.Header.Get("X-Amzn-ErrorType")
8511	if len(code) != 0 {
8512		errorCode = restjson.SanitizeErrorCode(code)
8513	}
8514
8515	var buff [1024]byte
8516	ringBuffer := smithyio.NewRingBuffer(buff[:])
8517
8518	body := io.TeeReader(errorBody, ringBuffer)
8519	decoder := json.NewDecoder(body)
8520	decoder.UseNumber()
8521	code, message, err := restjson.GetErrorInfo(decoder)
8522	if err != nil {
8523		var snapshot bytes.Buffer
8524		io.Copy(&snapshot, ringBuffer)
8525		err = &smithy.DeserializationError{
8526			Err:      fmt.Errorf("failed to decode response body, %w", err),
8527			Snapshot: snapshot.Bytes(),
8528		}
8529		return err
8530	}
8531
8532	errorBody.Seek(0, io.SeekStart)
8533	if len(code) != 0 {
8534		errorCode = restjson.SanitizeErrorCode(code)
8535	}
8536	if len(message) != 0 {
8537		errorMessage = message
8538	}
8539
8540	switch {
8541	case strings.EqualFold("InternalFailureException", errorCode):
8542		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8543
8544	case strings.EqualFold("InvalidRequestException", errorCode):
8545		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8546
8547	case strings.EqualFold("ResourceNotFoundException", errorCode):
8548		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8549
8550	case strings.EqualFold("ServiceUnavailableException", errorCode):
8551		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8552
8553	case strings.EqualFold("ThrottlingException", errorCode):
8554		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8555
8556	case strings.EqualFold("UnauthorizedException", errorCode):
8557		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8558
8559	default:
8560		genericError := &smithy.GenericAPIError{
8561			Code:    errorCode,
8562			Message: errorMessage,
8563		}
8564		return genericError
8565
8566	}
8567}
8568
8569type awsRestjson1_deserializeOpDeleteTopicRule struct {
8570}
8571
8572func (*awsRestjson1_deserializeOpDeleteTopicRule) ID() string {
8573	return "OperationDeserializer"
8574}
8575
8576func (m *awsRestjson1_deserializeOpDeleteTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8577	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8578) {
8579	out, metadata, err = next.HandleDeserialize(ctx, in)
8580	if err != nil {
8581		return out, metadata, err
8582	}
8583
8584	response, ok := out.RawResponse.(*smithyhttp.Response)
8585	if !ok {
8586		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8587	}
8588
8589	if response.StatusCode < 200 || response.StatusCode >= 300 {
8590		return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRule(response, &metadata)
8591	}
8592	output := &DeleteTopicRuleOutput{}
8593	out.Result = output
8594
8595	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
8596		return out, metadata, &smithy.DeserializationError{
8597			Err: fmt.Errorf("failed to discard response body, %w", err),
8598		}
8599	}
8600
8601	return out, metadata, err
8602}
8603
8604func awsRestjson1_deserializeOpErrorDeleteTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8605	var errorBuffer bytes.Buffer
8606	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8607		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8608	}
8609	errorBody := bytes.NewReader(errorBuffer.Bytes())
8610
8611	errorCode := "UnknownError"
8612	errorMessage := errorCode
8613
8614	code := response.Header.Get("X-Amzn-ErrorType")
8615	if len(code) != 0 {
8616		errorCode = restjson.SanitizeErrorCode(code)
8617	}
8618
8619	var buff [1024]byte
8620	ringBuffer := smithyio.NewRingBuffer(buff[:])
8621
8622	body := io.TeeReader(errorBody, ringBuffer)
8623	decoder := json.NewDecoder(body)
8624	decoder.UseNumber()
8625	code, message, err := restjson.GetErrorInfo(decoder)
8626	if err != nil {
8627		var snapshot bytes.Buffer
8628		io.Copy(&snapshot, ringBuffer)
8629		err = &smithy.DeserializationError{
8630			Err:      fmt.Errorf("failed to decode response body, %w", err),
8631			Snapshot: snapshot.Bytes(),
8632		}
8633		return err
8634	}
8635
8636	errorBody.Seek(0, io.SeekStart)
8637	if len(code) != 0 {
8638		errorCode = restjson.SanitizeErrorCode(code)
8639	}
8640	if len(message) != 0 {
8641		errorMessage = message
8642	}
8643
8644	switch {
8645	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
8646		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
8647
8648	case strings.EqualFold("InternalException", errorCode):
8649		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
8650
8651	case strings.EqualFold("InvalidRequestException", errorCode):
8652		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8653
8654	case strings.EqualFold("ServiceUnavailableException", errorCode):
8655		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8656
8657	case strings.EqualFold("UnauthorizedException", errorCode):
8658		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8659
8660	default:
8661		genericError := &smithy.GenericAPIError{
8662			Code:    errorCode,
8663			Message: errorMessage,
8664		}
8665		return genericError
8666
8667	}
8668}
8669
8670type awsRestjson1_deserializeOpDeleteTopicRuleDestination struct {
8671}
8672
8673func (*awsRestjson1_deserializeOpDeleteTopicRuleDestination) ID() string {
8674	return "OperationDeserializer"
8675}
8676
8677func (m *awsRestjson1_deserializeOpDeleteTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8678	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8679) {
8680	out, metadata, err = next.HandleDeserialize(ctx, in)
8681	if err != nil {
8682		return out, metadata, err
8683	}
8684
8685	response, ok := out.RawResponse.(*smithyhttp.Response)
8686	if !ok {
8687		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8688	}
8689
8690	if response.StatusCode < 200 || response.StatusCode >= 300 {
8691		return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response, &metadata)
8692	}
8693	output := &DeleteTopicRuleDestinationOutput{}
8694	out.Result = output
8695
8696	return out, metadata, err
8697}
8698
8699func awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8700	var errorBuffer bytes.Buffer
8701	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8702		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8703	}
8704	errorBody := bytes.NewReader(errorBuffer.Bytes())
8705
8706	errorCode := "UnknownError"
8707	errorMessage := errorCode
8708
8709	code := response.Header.Get("X-Amzn-ErrorType")
8710	if len(code) != 0 {
8711		errorCode = restjson.SanitizeErrorCode(code)
8712	}
8713
8714	var buff [1024]byte
8715	ringBuffer := smithyio.NewRingBuffer(buff[:])
8716
8717	body := io.TeeReader(errorBody, ringBuffer)
8718	decoder := json.NewDecoder(body)
8719	decoder.UseNumber()
8720	code, message, err := restjson.GetErrorInfo(decoder)
8721	if err != nil {
8722		var snapshot bytes.Buffer
8723		io.Copy(&snapshot, ringBuffer)
8724		err = &smithy.DeserializationError{
8725			Err:      fmt.Errorf("failed to decode response body, %w", err),
8726			Snapshot: snapshot.Bytes(),
8727		}
8728		return err
8729	}
8730
8731	errorBody.Seek(0, io.SeekStart)
8732	if len(code) != 0 {
8733		errorCode = restjson.SanitizeErrorCode(code)
8734	}
8735	if len(message) != 0 {
8736		errorMessage = message
8737	}
8738
8739	switch {
8740	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
8741		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
8742
8743	case strings.EqualFold("InternalException", errorCode):
8744		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
8745
8746	case strings.EqualFold("InvalidRequestException", errorCode):
8747		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8748
8749	case strings.EqualFold("ServiceUnavailableException", errorCode):
8750		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8751
8752	case strings.EqualFold("UnauthorizedException", errorCode):
8753		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8754
8755	default:
8756		genericError := &smithy.GenericAPIError{
8757			Code:    errorCode,
8758			Message: errorMessage,
8759		}
8760		return genericError
8761
8762	}
8763}
8764
8765type awsRestjson1_deserializeOpDeleteV2LoggingLevel struct {
8766}
8767
8768func (*awsRestjson1_deserializeOpDeleteV2LoggingLevel) ID() string {
8769	return "OperationDeserializer"
8770}
8771
8772func (m *awsRestjson1_deserializeOpDeleteV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8773	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8774) {
8775	out, metadata, err = next.HandleDeserialize(ctx, in)
8776	if err != nil {
8777		return out, metadata, err
8778	}
8779
8780	response, ok := out.RawResponse.(*smithyhttp.Response)
8781	if !ok {
8782		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8783	}
8784
8785	if response.StatusCode < 200 || response.StatusCode >= 300 {
8786		return out, metadata, awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response, &metadata)
8787	}
8788	output := &DeleteV2LoggingLevelOutput{}
8789	out.Result = output
8790
8791	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
8792		return out, metadata, &smithy.DeserializationError{
8793			Err: fmt.Errorf("failed to discard response body, %w", err),
8794		}
8795	}
8796
8797	return out, metadata, err
8798}
8799
8800func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8801	var errorBuffer bytes.Buffer
8802	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8803		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8804	}
8805	errorBody := bytes.NewReader(errorBuffer.Bytes())
8806
8807	errorCode := "UnknownError"
8808	errorMessage := errorCode
8809
8810	code := response.Header.Get("X-Amzn-ErrorType")
8811	if len(code) != 0 {
8812		errorCode = restjson.SanitizeErrorCode(code)
8813	}
8814
8815	var buff [1024]byte
8816	ringBuffer := smithyio.NewRingBuffer(buff[:])
8817
8818	body := io.TeeReader(errorBody, ringBuffer)
8819	decoder := json.NewDecoder(body)
8820	decoder.UseNumber()
8821	code, message, err := restjson.GetErrorInfo(decoder)
8822	if err != nil {
8823		var snapshot bytes.Buffer
8824		io.Copy(&snapshot, ringBuffer)
8825		err = &smithy.DeserializationError{
8826			Err:      fmt.Errorf("failed to decode response body, %w", err),
8827			Snapshot: snapshot.Bytes(),
8828		}
8829		return err
8830	}
8831
8832	errorBody.Seek(0, io.SeekStart)
8833	if len(code) != 0 {
8834		errorCode = restjson.SanitizeErrorCode(code)
8835	}
8836	if len(message) != 0 {
8837		errorMessage = message
8838	}
8839
8840	switch {
8841	case strings.EqualFold("InternalException", errorCode):
8842		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
8843
8844	case strings.EqualFold("InvalidRequestException", errorCode):
8845		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8846
8847	case strings.EqualFold("ServiceUnavailableException", errorCode):
8848		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8849
8850	default:
8851		genericError := &smithy.GenericAPIError{
8852			Code:    errorCode,
8853			Message: errorMessage,
8854		}
8855		return genericError
8856
8857	}
8858}
8859
8860type awsRestjson1_deserializeOpDeprecateThingType struct {
8861}
8862
8863func (*awsRestjson1_deserializeOpDeprecateThingType) ID() string {
8864	return "OperationDeserializer"
8865}
8866
8867func (m *awsRestjson1_deserializeOpDeprecateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8868	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8869) {
8870	out, metadata, err = next.HandleDeserialize(ctx, in)
8871	if err != nil {
8872		return out, metadata, err
8873	}
8874
8875	response, ok := out.RawResponse.(*smithyhttp.Response)
8876	if !ok {
8877		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8878	}
8879
8880	if response.StatusCode < 200 || response.StatusCode >= 300 {
8881		return out, metadata, awsRestjson1_deserializeOpErrorDeprecateThingType(response, &metadata)
8882	}
8883	output := &DeprecateThingTypeOutput{}
8884	out.Result = output
8885
8886	return out, metadata, err
8887}
8888
8889func awsRestjson1_deserializeOpErrorDeprecateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8890	var errorBuffer bytes.Buffer
8891	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8892		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8893	}
8894	errorBody := bytes.NewReader(errorBuffer.Bytes())
8895
8896	errorCode := "UnknownError"
8897	errorMessage := errorCode
8898
8899	code := response.Header.Get("X-Amzn-ErrorType")
8900	if len(code) != 0 {
8901		errorCode = restjson.SanitizeErrorCode(code)
8902	}
8903
8904	var buff [1024]byte
8905	ringBuffer := smithyio.NewRingBuffer(buff[:])
8906
8907	body := io.TeeReader(errorBody, ringBuffer)
8908	decoder := json.NewDecoder(body)
8909	decoder.UseNumber()
8910	code, message, err := restjson.GetErrorInfo(decoder)
8911	if err != nil {
8912		var snapshot bytes.Buffer
8913		io.Copy(&snapshot, ringBuffer)
8914		err = &smithy.DeserializationError{
8915			Err:      fmt.Errorf("failed to decode response body, %w", err),
8916			Snapshot: snapshot.Bytes(),
8917		}
8918		return err
8919	}
8920
8921	errorBody.Seek(0, io.SeekStart)
8922	if len(code) != 0 {
8923		errorCode = restjson.SanitizeErrorCode(code)
8924	}
8925	if len(message) != 0 {
8926		errorMessage = message
8927	}
8928
8929	switch {
8930	case strings.EqualFold("InternalFailureException", errorCode):
8931		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8932
8933	case strings.EqualFold("InvalidRequestException", errorCode):
8934		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
8935
8936	case strings.EqualFold("ResourceNotFoundException", errorCode):
8937		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8938
8939	case strings.EqualFold("ServiceUnavailableException", errorCode):
8940		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
8941
8942	case strings.EqualFold("ThrottlingException", errorCode):
8943		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8944
8945	case strings.EqualFold("UnauthorizedException", errorCode):
8946		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
8947
8948	default:
8949		genericError := &smithy.GenericAPIError{
8950			Code:    errorCode,
8951			Message: errorMessage,
8952		}
8953		return genericError
8954
8955	}
8956}
8957
8958type awsRestjson1_deserializeOpDescribeAccountAuditConfiguration struct {
8959}
8960
8961func (*awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) ID() string {
8962	return "OperationDeserializer"
8963}
8964
8965func (m *awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8966	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8967) {
8968	out, metadata, err = next.HandleDeserialize(ctx, in)
8969	if err != nil {
8970		return out, metadata, err
8971	}
8972
8973	response, ok := out.RawResponse.(*smithyhttp.Response)
8974	if !ok {
8975		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8976	}
8977
8978	if response.StatusCode < 200 || response.StatusCode >= 300 {
8979		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response, &metadata)
8980	}
8981	output := &DescribeAccountAuditConfigurationOutput{}
8982	out.Result = output
8983
8984	var buff [1024]byte
8985	ringBuffer := smithyio.NewRingBuffer(buff[:])
8986
8987	body := io.TeeReader(response.Body, ringBuffer)
8988
8989	decoder := json.NewDecoder(body)
8990	decoder.UseNumber()
8991	var shape interface{}
8992	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8993		var snapshot bytes.Buffer
8994		io.Copy(&snapshot, ringBuffer)
8995		err = &smithy.DeserializationError{
8996			Err:      fmt.Errorf("failed to decode response body, %w", err),
8997			Snapshot: snapshot.Bytes(),
8998		}
8999		return out, metadata, err
9000	}
9001
9002	err = awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(&output, shape)
9003	if err != nil {
9004		var snapshot bytes.Buffer
9005		io.Copy(&snapshot, ringBuffer)
9006		return out, metadata, &smithy.DeserializationError{
9007			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9008			Snapshot: snapshot.Bytes(),
9009		}
9010	}
9011
9012	return out, metadata, err
9013}
9014
9015func awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9016	var errorBuffer bytes.Buffer
9017	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9018		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9019	}
9020	errorBody := bytes.NewReader(errorBuffer.Bytes())
9021
9022	errorCode := "UnknownError"
9023	errorMessage := errorCode
9024
9025	code := response.Header.Get("X-Amzn-ErrorType")
9026	if len(code) != 0 {
9027		errorCode = restjson.SanitizeErrorCode(code)
9028	}
9029
9030	var buff [1024]byte
9031	ringBuffer := smithyio.NewRingBuffer(buff[:])
9032
9033	body := io.TeeReader(errorBody, ringBuffer)
9034	decoder := json.NewDecoder(body)
9035	decoder.UseNumber()
9036	code, message, err := restjson.GetErrorInfo(decoder)
9037	if err != nil {
9038		var snapshot bytes.Buffer
9039		io.Copy(&snapshot, ringBuffer)
9040		err = &smithy.DeserializationError{
9041			Err:      fmt.Errorf("failed to decode response body, %w", err),
9042			Snapshot: snapshot.Bytes(),
9043		}
9044		return err
9045	}
9046
9047	errorBody.Seek(0, io.SeekStart)
9048	if len(code) != 0 {
9049		errorCode = restjson.SanitizeErrorCode(code)
9050	}
9051	if len(message) != 0 {
9052		errorMessage = message
9053	}
9054
9055	switch {
9056	case strings.EqualFold("InternalFailureException", errorCode):
9057		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9058
9059	case strings.EqualFold("ThrottlingException", errorCode):
9060		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9061
9062	default:
9063		genericError := &smithy.GenericAPIError{
9064			Code:    errorCode,
9065			Message: errorMessage,
9066		}
9067		return genericError
9068
9069	}
9070}
9071
9072func awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(v **DescribeAccountAuditConfigurationOutput, value interface{}) error {
9073	if v == nil {
9074		return fmt.Errorf("unexpected nil of type %T", v)
9075	}
9076	if value == nil {
9077		return nil
9078	}
9079
9080	shape, ok := value.(map[string]interface{})
9081	if !ok {
9082		return fmt.Errorf("unexpected JSON type %v", value)
9083	}
9084
9085	var sv *DescribeAccountAuditConfigurationOutput
9086	if *v == nil {
9087		sv = &DescribeAccountAuditConfigurationOutput{}
9088	} else {
9089		sv = *v
9090	}
9091
9092	for key, value := range shape {
9093		switch key {
9094		case "auditCheckConfigurations":
9095			if err := awsRestjson1_deserializeDocumentAuditCheckConfigurations(&sv.AuditCheckConfigurations, value); err != nil {
9096				return err
9097			}
9098
9099		case "auditNotificationTargetConfigurations":
9100			if err := awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(&sv.AuditNotificationTargetConfigurations, value); err != nil {
9101				return err
9102			}
9103
9104		case "roleArn":
9105			if value != nil {
9106				jtv, ok := value.(string)
9107				if !ok {
9108					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
9109				}
9110				sv.RoleArn = ptr.String(jtv)
9111			}
9112
9113		default:
9114			_, _ = key, value
9115
9116		}
9117	}
9118	*v = sv
9119	return nil
9120}
9121
9122type awsRestjson1_deserializeOpDescribeAuditFinding struct {
9123}
9124
9125func (*awsRestjson1_deserializeOpDescribeAuditFinding) ID() string {
9126	return "OperationDeserializer"
9127}
9128
9129func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9130	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9131) {
9132	out, metadata, err = next.HandleDeserialize(ctx, in)
9133	if err != nil {
9134		return out, metadata, err
9135	}
9136
9137	response, ok := out.RawResponse.(*smithyhttp.Response)
9138	if !ok {
9139		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9140	}
9141
9142	if response.StatusCode < 200 || response.StatusCode >= 300 {
9143		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditFinding(response, &metadata)
9144	}
9145	output := &DescribeAuditFindingOutput{}
9146	out.Result = output
9147
9148	var buff [1024]byte
9149	ringBuffer := smithyio.NewRingBuffer(buff[:])
9150
9151	body := io.TeeReader(response.Body, ringBuffer)
9152
9153	decoder := json.NewDecoder(body)
9154	decoder.UseNumber()
9155	var shape interface{}
9156	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9157		var snapshot bytes.Buffer
9158		io.Copy(&snapshot, ringBuffer)
9159		err = &smithy.DeserializationError{
9160			Err:      fmt.Errorf("failed to decode response body, %w", err),
9161			Snapshot: snapshot.Bytes(),
9162		}
9163		return out, metadata, err
9164	}
9165
9166	err = awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(&output, shape)
9167	if err != nil {
9168		var snapshot bytes.Buffer
9169		io.Copy(&snapshot, ringBuffer)
9170		return out, metadata, &smithy.DeserializationError{
9171			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9172			Snapshot: snapshot.Bytes(),
9173		}
9174	}
9175
9176	return out, metadata, err
9177}
9178
9179func awsRestjson1_deserializeOpErrorDescribeAuditFinding(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9180	var errorBuffer bytes.Buffer
9181	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9182		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9183	}
9184	errorBody := bytes.NewReader(errorBuffer.Bytes())
9185
9186	errorCode := "UnknownError"
9187	errorMessage := errorCode
9188
9189	code := response.Header.Get("X-Amzn-ErrorType")
9190	if len(code) != 0 {
9191		errorCode = restjson.SanitizeErrorCode(code)
9192	}
9193
9194	var buff [1024]byte
9195	ringBuffer := smithyio.NewRingBuffer(buff[:])
9196
9197	body := io.TeeReader(errorBody, ringBuffer)
9198	decoder := json.NewDecoder(body)
9199	decoder.UseNumber()
9200	code, message, err := restjson.GetErrorInfo(decoder)
9201	if err != nil {
9202		var snapshot bytes.Buffer
9203		io.Copy(&snapshot, ringBuffer)
9204		err = &smithy.DeserializationError{
9205			Err:      fmt.Errorf("failed to decode response body, %w", err),
9206			Snapshot: snapshot.Bytes(),
9207		}
9208		return err
9209	}
9210
9211	errorBody.Seek(0, io.SeekStart)
9212	if len(code) != 0 {
9213		errorCode = restjson.SanitizeErrorCode(code)
9214	}
9215	if len(message) != 0 {
9216		errorMessage = message
9217	}
9218
9219	switch {
9220	case strings.EqualFold("InternalFailureException", errorCode):
9221		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9222
9223	case strings.EqualFold("InvalidRequestException", errorCode):
9224		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
9225
9226	case strings.EqualFold("ResourceNotFoundException", errorCode):
9227		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9228
9229	case strings.EqualFold("ThrottlingException", errorCode):
9230		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9231
9232	default:
9233		genericError := &smithy.GenericAPIError{
9234			Code:    errorCode,
9235			Message: errorMessage,
9236		}
9237		return genericError
9238
9239	}
9240}
9241
9242func awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(v **DescribeAuditFindingOutput, value interface{}) error {
9243	if v == nil {
9244		return fmt.Errorf("unexpected nil of type %T", v)
9245	}
9246	if value == nil {
9247		return nil
9248	}
9249
9250	shape, ok := value.(map[string]interface{})
9251	if !ok {
9252		return fmt.Errorf("unexpected JSON type %v", value)
9253	}
9254
9255	var sv *DescribeAuditFindingOutput
9256	if *v == nil {
9257		sv = &DescribeAuditFindingOutput{}
9258	} else {
9259		sv = *v
9260	}
9261
9262	for key, value := range shape {
9263		switch key {
9264		case "finding":
9265			if err := awsRestjson1_deserializeDocumentAuditFinding(&sv.Finding, value); err != nil {
9266				return err
9267			}
9268
9269		default:
9270			_, _ = key, value
9271
9272		}
9273	}
9274	*v = sv
9275	return nil
9276}
9277
9278type awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask struct {
9279}
9280
9281func (*awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) ID() string {
9282	return "OperationDeserializer"
9283}
9284
9285func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9286	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9287) {
9288	out, metadata, err = next.HandleDeserialize(ctx, in)
9289	if err != nil {
9290		return out, metadata, err
9291	}
9292
9293	response, ok := out.RawResponse.(*smithyhttp.Response)
9294	if !ok {
9295		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9296	}
9297
9298	if response.StatusCode < 200 || response.StatusCode >= 300 {
9299		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditMitigationActionsTask(response, &metadata)
9300	}
9301	output := &DescribeAuditMitigationActionsTaskOutput{}
9302	out.Result = output
9303
9304	var buff [1024]byte
9305	ringBuffer := smithyio.NewRingBuffer(buff[:])
9306
9307	body := io.TeeReader(response.Body, ringBuffer)
9308
9309	decoder := json.NewDecoder(body)
9310	decoder.UseNumber()
9311	var shape interface{}
9312	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9313		var snapshot bytes.Buffer
9314		io.Copy(&snapshot, ringBuffer)
9315		err = &smithy.DeserializationError{
9316			Err:      fmt.Errorf("failed to decode response body, %w", err),
9317			Snapshot: snapshot.Bytes(),
9318		}
9319		return out, metadata, err
9320	}
9321
9322	err = awsRestjson1_deserializeOpDocumentDescribeAuditMitigationActionsTaskOutput(&output, shape)
9323	if err != nil {
9324		var snapshot bytes.Buffer
9325		io.Copy(&snapshot, ringBuffer)
9326		return out, metadata, &smithy.DeserializationError{
9327			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9328			Snapshot: snapshot.Bytes(),
9329		}
9330	}
9331
9332	return out, metadata, err
9333}
9334
9335func awsRestjson1_deserializeOpErrorDescribeAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9336	var errorBuffer bytes.Buffer
9337	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9338		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9339	}
9340	errorBody := bytes.NewReader(errorBuffer.Bytes())
9341
9342	errorCode := "UnknownError"
9343	errorMessage := errorCode
9344
9345	code := response.Header.Get("X-Amzn-ErrorType")
9346	if len(code) != 0 {
9347		errorCode = restjson.SanitizeErrorCode(code)
9348	}
9349
9350	var buff [1024]byte
9351	ringBuffer := smithyio.NewRingBuffer(buff[:])
9352
9353	body := io.TeeReader(errorBody, ringBuffer)
9354	decoder := json.NewDecoder(body)
9355	decoder.UseNumber()
9356	code, message, err := restjson.GetErrorInfo(decoder)
9357	if err != nil {
9358		var snapshot bytes.Buffer
9359		io.Copy(&snapshot, ringBuffer)
9360		err = &smithy.DeserializationError{
9361			Err:      fmt.Errorf("failed to decode response body, %w", err),
9362			Snapshot: snapshot.Bytes(),
9363		}
9364		return err
9365	}
9366
9367	errorBody.Seek(0, io.SeekStart)
9368	if len(code) != 0 {
9369		errorCode = restjson.SanitizeErrorCode(code)
9370	}
9371	if len(message) != 0 {
9372		errorMessage = message
9373	}
9374
9375	switch {
9376	case strings.EqualFold("InternalFailureException", errorCode):
9377		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9378
9379	case strings.EqualFold("InvalidRequestException", errorCode):
9380		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
9381
9382	case strings.EqualFold("ResourceNotFoundException", errorCode):
9383		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9384
9385	case strings.EqualFold("ThrottlingException", errorCode):
9386		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9387
9388	default:
9389		genericError := &smithy.GenericAPIError{
9390			Code:    errorCode,
9391			Message: errorMessage,
9392		}
9393		return genericError
9394
9395	}
9396}
9397
9398func awsRestjson1_deserializeOpDocumentDescribeAuditMitigationActionsTaskOutput(v **DescribeAuditMitigationActionsTaskOutput, value interface{}) error {
9399	if v == nil {
9400		return fmt.Errorf("unexpected nil of type %T", v)
9401	}
9402	if value == nil {
9403		return nil
9404	}
9405
9406	shape, ok := value.(map[string]interface{})
9407	if !ok {
9408		return fmt.Errorf("unexpected JSON type %v", value)
9409	}
9410
9411	var sv *DescribeAuditMitigationActionsTaskOutput
9412	if *v == nil {
9413		sv = &DescribeAuditMitigationActionsTaskOutput{}
9414	} else {
9415		sv = *v
9416	}
9417
9418	for key, value := range shape {
9419		switch key {
9420		case "actionsDefinition":
9421			if err := awsRestjson1_deserializeDocumentMitigationActionList(&sv.ActionsDefinition, value); err != nil {
9422				return err
9423			}
9424
9425		case "auditCheckToActionsMapping":
9426			if err := awsRestjson1_deserializeDocumentAuditCheckToActionsMapping(&sv.AuditCheckToActionsMapping, value); err != nil {
9427				return err
9428			}
9429
9430		case "endTime":
9431			if value != nil {
9432				jtv, ok := value.(json.Number)
9433				if !ok {
9434					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
9435				}
9436				f64, err := jtv.Float64()
9437				if err != nil {
9438					return err
9439				}
9440				sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
9441			}
9442
9443		case "startTime":
9444			if value != nil {
9445				jtv, ok := value.(json.Number)
9446				if !ok {
9447					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
9448				}
9449				f64, err := jtv.Float64()
9450				if err != nil {
9451					return err
9452				}
9453				sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
9454			}
9455
9456		case "target":
9457			if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(&sv.Target, value); err != nil {
9458				return err
9459			}
9460
9461		case "taskStatistics":
9462			if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskStatistics(&sv.TaskStatistics, value); err != nil {
9463				return err
9464			}
9465
9466		case "taskStatus":
9467			if value != nil {
9468				jtv, ok := value.(string)
9469				if !ok {
9470					return fmt.Errorf("expected AuditMitigationActionsTaskStatus to be of type string, got %T instead", value)
9471				}
9472				sv.TaskStatus = types.AuditMitigationActionsTaskStatus(jtv)
9473			}
9474
9475		default:
9476			_, _ = key, value
9477
9478		}
9479	}
9480	*v = sv
9481	return nil
9482}
9483
9484type awsRestjson1_deserializeOpDescribeAuditSuppression struct {
9485}
9486
9487func (*awsRestjson1_deserializeOpDescribeAuditSuppression) ID() string {
9488	return "OperationDeserializer"
9489}
9490
9491func (m *awsRestjson1_deserializeOpDescribeAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9492	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9493) {
9494	out, metadata, err = next.HandleDeserialize(ctx, in)
9495	if err != nil {
9496		return out, metadata, err
9497	}
9498
9499	response, ok := out.RawResponse.(*smithyhttp.Response)
9500	if !ok {
9501		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9502	}
9503
9504	if response.StatusCode < 200 || response.StatusCode >= 300 {
9505		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditSuppression(response, &metadata)
9506	}
9507	output := &DescribeAuditSuppressionOutput{}
9508	out.Result = output
9509
9510	var buff [1024]byte
9511	ringBuffer := smithyio.NewRingBuffer(buff[:])
9512
9513	body := io.TeeReader(response.Body, ringBuffer)
9514
9515	decoder := json.NewDecoder(body)
9516	decoder.UseNumber()
9517	var shape interface{}
9518	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9519		var snapshot bytes.Buffer
9520		io.Copy(&snapshot, ringBuffer)
9521		err = &smithy.DeserializationError{
9522			Err:      fmt.Errorf("failed to decode response body, %w", err),
9523			Snapshot: snapshot.Bytes(),
9524		}
9525		return out, metadata, err
9526	}
9527
9528	err = awsRestjson1_deserializeOpDocumentDescribeAuditSuppressionOutput(&output, shape)
9529	if err != nil {
9530		var snapshot bytes.Buffer
9531		io.Copy(&snapshot, ringBuffer)
9532		return out, metadata, &smithy.DeserializationError{
9533			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9534			Snapshot: snapshot.Bytes(),
9535		}
9536	}
9537
9538	return out, metadata, err
9539}
9540
9541func awsRestjson1_deserializeOpErrorDescribeAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9542	var errorBuffer bytes.Buffer
9543	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9544		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9545	}
9546	errorBody := bytes.NewReader(errorBuffer.Bytes())
9547
9548	errorCode := "UnknownError"
9549	errorMessage := errorCode
9550
9551	code := response.Header.Get("X-Amzn-ErrorType")
9552	if len(code) != 0 {
9553		errorCode = restjson.SanitizeErrorCode(code)
9554	}
9555
9556	var buff [1024]byte
9557	ringBuffer := smithyio.NewRingBuffer(buff[:])
9558
9559	body := io.TeeReader(errorBody, ringBuffer)
9560	decoder := json.NewDecoder(body)
9561	decoder.UseNumber()
9562	code, message, err := restjson.GetErrorInfo(decoder)
9563	if err != nil {
9564		var snapshot bytes.Buffer
9565		io.Copy(&snapshot, ringBuffer)
9566		err = &smithy.DeserializationError{
9567			Err:      fmt.Errorf("failed to decode response body, %w", err),
9568			Snapshot: snapshot.Bytes(),
9569		}
9570		return err
9571	}
9572
9573	errorBody.Seek(0, io.SeekStart)
9574	if len(code) != 0 {
9575		errorCode = restjson.SanitizeErrorCode(code)
9576	}
9577	if len(message) != 0 {
9578		errorMessage = message
9579	}
9580
9581	switch {
9582	case strings.EqualFold("InternalFailureException", errorCode):
9583		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9584
9585	case strings.EqualFold("InvalidRequestException", errorCode):
9586		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
9587
9588	case strings.EqualFold("ResourceNotFoundException", errorCode):
9589		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9590
9591	case strings.EqualFold("ThrottlingException", errorCode):
9592		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9593
9594	default:
9595		genericError := &smithy.GenericAPIError{
9596			Code:    errorCode,
9597			Message: errorMessage,
9598		}
9599		return genericError
9600
9601	}
9602}
9603
9604func awsRestjson1_deserializeOpDocumentDescribeAuditSuppressionOutput(v **DescribeAuditSuppressionOutput, value interface{}) error {
9605	if v == nil {
9606		return fmt.Errorf("unexpected nil of type %T", v)
9607	}
9608	if value == nil {
9609		return nil
9610	}
9611
9612	shape, ok := value.(map[string]interface{})
9613	if !ok {
9614		return fmt.Errorf("unexpected JSON type %v", value)
9615	}
9616
9617	var sv *DescribeAuditSuppressionOutput
9618	if *v == nil {
9619		sv = &DescribeAuditSuppressionOutput{}
9620	} else {
9621		sv = *v
9622	}
9623
9624	for key, value := range shape {
9625		switch key {
9626		case "checkName":
9627			if value != nil {
9628				jtv, ok := value.(string)
9629				if !ok {
9630					return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value)
9631				}
9632				sv.CheckName = ptr.String(jtv)
9633			}
9634
9635		case "description":
9636			if value != nil {
9637				jtv, ok := value.(string)
9638				if !ok {
9639					return fmt.Errorf("expected AuditDescription to be of type string, got %T instead", value)
9640				}
9641				sv.Description = ptr.String(jtv)
9642			}
9643
9644		case "expirationDate":
9645			if value != nil {
9646				jtv, ok := value.(json.Number)
9647				if !ok {
9648					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
9649				}
9650				f64, err := jtv.Float64()
9651				if err != nil {
9652					return err
9653				}
9654				sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
9655			}
9656
9657		case "resourceIdentifier":
9658			if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil {
9659				return err
9660			}
9661
9662		case "suppressIndefinitely":
9663			if value != nil {
9664				jtv, ok := value.(bool)
9665				if !ok {
9666					return fmt.Errorf("expected SuppressIndefinitely to be of type *bool, got %T instead", value)
9667				}
9668				sv.SuppressIndefinitely = ptr.Bool(jtv)
9669			}
9670
9671		default:
9672			_, _ = key, value
9673
9674		}
9675	}
9676	*v = sv
9677	return nil
9678}
9679
9680type awsRestjson1_deserializeOpDescribeAuditTask struct {
9681}
9682
9683func (*awsRestjson1_deserializeOpDescribeAuditTask) ID() string {
9684	return "OperationDeserializer"
9685}
9686
9687func (m *awsRestjson1_deserializeOpDescribeAuditTask) 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, awsRestjson1_deserializeOpErrorDescribeAuditTask(response, &metadata)
9702	}
9703	output := &DescribeAuditTaskOutput{}
9704	out.Result = output
9705
9706	var buff [1024]byte
9707	ringBuffer := smithyio.NewRingBuffer(buff[:])
9708
9709	body := io.TeeReader(response.Body, ringBuffer)
9710
9711	decoder := json.NewDecoder(body)
9712	decoder.UseNumber()
9713	var shape interface{}
9714	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9715		var snapshot bytes.Buffer
9716		io.Copy(&snapshot, ringBuffer)
9717		err = &smithy.DeserializationError{
9718			Err:      fmt.Errorf("failed to decode response body, %w", err),
9719			Snapshot: snapshot.Bytes(),
9720		}
9721		return out, metadata, err
9722	}
9723
9724	err = awsRestjson1_deserializeOpDocumentDescribeAuditTaskOutput(&output, shape)
9725	if err != nil {
9726		var snapshot bytes.Buffer
9727		io.Copy(&snapshot, ringBuffer)
9728		return out, metadata, &smithy.DeserializationError{
9729			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9730			Snapshot: snapshot.Bytes(),
9731		}
9732	}
9733
9734	return out, metadata, err
9735}
9736
9737func awsRestjson1_deserializeOpErrorDescribeAuditTask(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("InternalFailureException", errorCode):
9779		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9780
9781	case strings.EqualFold("InvalidRequestException", errorCode):
9782		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
9783
9784	case strings.EqualFold("ResourceNotFoundException", errorCode):
9785		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9786
9787	case strings.EqualFold("ThrottlingException", errorCode):
9788		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9789
9790	default:
9791		genericError := &smithy.GenericAPIError{
9792			Code:    errorCode,
9793			Message: errorMessage,
9794		}
9795		return genericError
9796
9797	}
9798}
9799
9800func awsRestjson1_deserializeOpDocumentDescribeAuditTaskOutput(v **DescribeAuditTaskOutput, value interface{}) error {
9801	if v == nil {
9802		return fmt.Errorf("unexpected nil of type %T", v)
9803	}
9804	if value == nil {
9805		return nil
9806	}
9807
9808	shape, ok := value.(map[string]interface{})
9809	if !ok {
9810		return fmt.Errorf("unexpected JSON type %v", value)
9811	}
9812
9813	var sv *DescribeAuditTaskOutput
9814	if *v == nil {
9815		sv = &DescribeAuditTaskOutput{}
9816	} else {
9817		sv = *v
9818	}
9819
9820	for key, value := range shape {
9821		switch key {
9822		case "auditDetails":
9823			if err := awsRestjson1_deserializeDocumentAuditDetails(&sv.AuditDetails, value); err != nil {
9824				return err
9825			}
9826
9827		case "scheduledAuditName":
9828			if value != nil {
9829				jtv, ok := value.(string)
9830				if !ok {
9831					return fmt.Errorf("expected ScheduledAuditName to be of type string, got %T instead", value)
9832				}
9833				sv.ScheduledAuditName = ptr.String(jtv)
9834			}
9835
9836		case "taskStartTime":
9837			if value != nil {
9838				jtv, ok := value.(json.Number)
9839				if !ok {
9840					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
9841				}
9842				f64, err := jtv.Float64()
9843				if err != nil {
9844					return err
9845				}
9846				sv.TaskStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
9847			}
9848
9849		case "taskStatistics":
9850			if err := awsRestjson1_deserializeDocumentTaskStatistics(&sv.TaskStatistics, value); err != nil {
9851				return err
9852			}
9853
9854		case "taskStatus":
9855			if value != nil {
9856				jtv, ok := value.(string)
9857				if !ok {
9858					return fmt.Errorf("expected AuditTaskStatus to be of type string, got %T instead", value)
9859				}
9860				sv.TaskStatus = types.AuditTaskStatus(jtv)
9861			}
9862
9863		case "taskType":
9864			if value != nil {
9865				jtv, ok := value.(string)
9866				if !ok {
9867					return fmt.Errorf("expected AuditTaskType to be of type string, got %T instead", value)
9868				}
9869				sv.TaskType = types.AuditTaskType(jtv)
9870			}
9871
9872		default:
9873			_, _ = key, value
9874
9875		}
9876	}
9877	*v = sv
9878	return nil
9879}
9880
9881type awsRestjson1_deserializeOpDescribeAuthorizer struct {
9882}
9883
9884func (*awsRestjson1_deserializeOpDescribeAuthorizer) ID() string {
9885	return "OperationDeserializer"
9886}
9887
9888func (m *awsRestjson1_deserializeOpDescribeAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9889	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9890) {
9891	out, metadata, err = next.HandleDeserialize(ctx, in)
9892	if err != nil {
9893		return out, metadata, err
9894	}
9895
9896	response, ok := out.RawResponse.(*smithyhttp.Response)
9897	if !ok {
9898		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9899	}
9900
9901	if response.StatusCode < 200 || response.StatusCode >= 300 {
9902		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuthorizer(response, &metadata)
9903	}
9904	output := &DescribeAuthorizerOutput{}
9905	out.Result = output
9906
9907	var buff [1024]byte
9908	ringBuffer := smithyio.NewRingBuffer(buff[:])
9909
9910	body := io.TeeReader(response.Body, ringBuffer)
9911
9912	decoder := json.NewDecoder(body)
9913	decoder.UseNumber()
9914	var shape interface{}
9915	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9916		var snapshot bytes.Buffer
9917		io.Copy(&snapshot, ringBuffer)
9918		err = &smithy.DeserializationError{
9919			Err:      fmt.Errorf("failed to decode response body, %w", err),
9920			Snapshot: snapshot.Bytes(),
9921		}
9922		return out, metadata, err
9923	}
9924
9925	err = awsRestjson1_deserializeOpDocumentDescribeAuthorizerOutput(&output, shape)
9926	if err != nil {
9927		var snapshot bytes.Buffer
9928		io.Copy(&snapshot, ringBuffer)
9929		return out, metadata, &smithy.DeserializationError{
9930			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9931			Snapshot: snapshot.Bytes(),
9932		}
9933	}
9934
9935	return out, metadata, err
9936}
9937
9938func awsRestjson1_deserializeOpErrorDescribeAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9939	var errorBuffer bytes.Buffer
9940	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9941		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9942	}
9943	errorBody := bytes.NewReader(errorBuffer.Bytes())
9944
9945	errorCode := "UnknownError"
9946	errorMessage := errorCode
9947
9948	code := response.Header.Get("X-Amzn-ErrorType")
9949	if len(code) != 0 {
9950		errorCode = restjson.SanitizeErrorCode(code)
9951	}
9952
9953	var buff [1024]byte
9954	ringBuffer := smithyio.NewRingBuffer(buff[:])
9955
9956	body := io.TeeReader(errorBody, ringBuffer)
9957	decoder := json.NewDecoder(body)
9958	decoder.UseNumber()
9959	code, message, err := restjson.GetErrorInfo(decoder)
9960	if err != nil {
9961		var snapshot bytes.Buffer
9962		io.Copy(&snapshot, ringBuffer)
9963		err = &smithy.DeserializationError{
9964			Err:      fmt.Errorf("failed to decode response body, %w", err),
9965			Snapshot: snapshot.Bytes(),
9966		}
9967		return err
9968	}
9969
9970	errorBody.Seek(0, io.SeekStart)
9971	if len(code) != 0 {
9972		errorCode = restjson.SanitizeErrorCode(code)
9973	}
9974	if len(message) != 0 {
9975		errorMessage = message
9976	}
9977
9978	switch {
9979	case strings.EqualFold("InternalFailureException", errorCode):
9980		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9981
9982	case strings.EqualFold("InvalidRequestException", errorCode):
9983		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
9984
9985	case strings.EqualFold("ResourceNotFoundException", errorCode):
9986		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9987
9988	case strings.EqualFold("ServiceUnavailableException", errorCode):
9989		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
9990
9991	case strings.EqualFold("ThrottlingException", errorCode):
9992		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9993
9994	case strings.EqualFold("UnauthorizedException", errorCode):
9995		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
9996
9997	default:
9998		genericError := &smithy.GenericAPIError{
9999			Code:    errorCode,
10000			Message: errorMessage,
10001		}
10002		return genericError
10003
10004	}
10005}
10006
10007func awsRestjson1_deserializeOpDocumentDescribeAuthorizerOutput(v **DescribeAuthorizerOutput, value interface{}) error {
10008	if v == nil {
10009		return fmt.Errorf("unexpected nil of type %T", v)
10010	}
10011	if value == nil {
10012		return nil
10013	}
10014
10015	shape, ok := value.(map[string]interface{})
10016	if !ok {
10017		return fmt.Errorf("unexpected JSON type %v", value)
10018	}
10019
10020	var sv *DescribeAuthorizerOutput
10021	if *v == nil {
10022		sv = &DescribeAuthorizerOutput{}
10023	} else {
10024		sv = *v
10025	}
10026
10027	for key, value := range shape {
10028		switch key {
10029		case "authorizerDescription":
10030			if err := awsRestjson1_deserializeDocumentAuthorizerDescription(&sv.AuthorizerDescription, value); err != nil {
10031				return err
10032			}
10033
10034		default:
10035			_, _ = key, value
10036
10037		}
10038	}
10039	*v = sv
10040	return nil
10041}
10042
10043type awsRestjson1_deserializeOpDescribeBillingGroup struct {
10044}
10045
10046func (*awsRestjson1_deserializeOpDescribeBillingGroup) ID() string {
10047	return "OperationDeserializer"
10048}
10049
10050func (m *awsRestjson1_deserializeOpDescribeBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10051	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10052) {
10053	out, metadata, err = next.HandleDeserialize(ctx, in)
10054	if err != nil {
10055		return out, metadata, err
10056	}
10057
10058	response, ok := out.RawResponse.(*smithyhttp.Response)
10059	if !ok {
10060		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10061	}
10062
10063	if response.StatusCode < 200 || response.StatusCode >= 300 {
10064		return out, metadata, awsRestjson1_deserializeOpErrorDescribeBillingGroup(response, &metadata)
10065	}
10066	output := &DescribeBillingGroupOutput{}
10067	out.Result = output
10068
10069	var buff [1024]byte
10070	ringBuffer := smithyio.NewRingBuffer(buff[:])
10071
10072	body := io.TeeReader(response.Body, ringBuffer)
10073
10074	decoder := json.NewDecoder(body)
10075	decoder.UseNumber()
10076	var shape interface{}
10077	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10078		var snapshot bytes.Buffer
10079		io.Copy(&snapshot, ringBuffer)
10080		err = &smithy.DeserializationError{
10081			Err:      fmt.Errorf("failed to decode response body, %w", err),
10082			Snapshot: snapshot.Bytes(),
10083		}
10084		return out, metadata, err
10085	}
10086
10087	err = awsRestjson1_deserializeOpDocumentDescribeBillingGroupOutput(&output, shape)
10088	if err != nil {
10089		var snapshot bytes.Buffer
10090		io.Copy(&snapshot, ringBuffer)
10091		return out, metadata, &smithy.DeserializationError{
10092			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10093			Snapshot: snapshot.Bytes(),
10094		}
10095	}
10096
10097	return out, metadata, err
10098}
10099
10100func awsRestjson1_deserializeOpErrorDescribeBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10101	var errorBuffer bytes.Buffer
10102	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10103		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10104	}
10105	errorBody := bytes.NewReader(errorBuffer.Bytes())
10106
10107	errorCode := "UnknownError"
10108	errorMessage := errorCode
10109
10110	code := response.Header.Get("X-Amzn-ErrorType")
10111	if len(code) != 0 {
10112		errorCode = restjson.SanitizeErrorCode(code)
10113	}
10114
10115	var buff [1024]byte
10116	ringBuffer := smithyio.NewRingBuffer(buff[:])
10117
10118	body := io.TeeReader(errorBody, ringBuffer)
10119	decoder := json.NewDecoder(body)
10120	decoder.UseNumber()
10121	code, message, err := restjson.GetErrorInfo(decoder)
10122	if err != nil {
10123		var snapshot bytes.Buffer
10124		io.Copy(&snapshot, ringBuffer)
10125		err = &smithy.DeserializationError{
10126			Err:      fmt.Errorf("failed to decode response body, %w", err),
10127			Snapshot: snapshot.Bytes(),
10128		}
10129		return err
10130	}
10131
10132	errorBody.Seek(0, io.SeekStart)
10133	if len(code) != 0 {
10134		errorCode = restjson.SanitizeErrorCode(code)
10135	}
10136	if len(message) != 0 {
10137		errorMessage = message
10138	}
10139
10140	switch {
10141	case strings.EqualFold("InternalFailureException", errorCode):
10142		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10143
10144	case strings.EqualFold("InvalidRequestException", errorCode):
10145		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
10146
10147	case strings.EqualFold("ResourceNotFoundException", errorCode):
10148		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10149
10150	case strings.EqualFold("ThrottlingException", errorCode):
10151		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10152
10153	default:
10154		genericError := &smithy.GenericAPIError{
10155			Code:    errorCode,
10156			Message: errorMessage,
10157		}
10158		return genericError
10159
10160	}
10161}
10162
10163func awsRestjson1_deserializeOpDocumentDescribeBillingGroupOutput(v **DescribeBillingGroupOutput, value interface{}) error {
10164	if v == nil {
10165		return fmt.Errorf("unexpected nil of type %T", v)
10166	}
10167	if value == nil {
10168		return nil
10169	}
10170
10171	shape, ok := value.(map[string]interface{})
10172	if !ok {
10173		return fmt.Errorf("unexpected JSON type %v", value)
10174	}
10175
10176	var sv *DescribeBillingGroupOutput
10177	if *v == nil {
10178		sv = &DescribeBillingGroupOutput{}
10179	} else {
10180		sv = *v
10181	}
10182
10183	for key, value := range shape {
10184		switch key {
10185		case "billingGroupArn":
10186			if value != nil {
10187				jtv, ok := value.(string)
10188				if !ok {
10189					return fmt.Errorf("expected BillingGroupArn to be of type string, got %T instead", value)
10190				}
10191				sv.BillingGroupArn = ptr.String(jtv)
10192			}
10193
10194		case "billingGroupId":
10195			if value != nil {
10196				jtv, ok := value.(string)
10197				if !ok {
10198					return fmt.Errorf("expected BillingGroupId to be of type string, got %T instead", value)
10199				}
10200				sv.BillingGroupId = ptr.String(jtv)
10201			}
10202
10203		case "billingGroupMetadata":
10204			if err := awsRestjson1_deserializeDocumentBillingGroupMetadata(&sv.BillingGroupMetadata, value); err != nil {
10205				return err
10206			}
10207
10208		case "billingGroupName":
10209			if value != nil {
10210				jtv, ok := value.(string)
10211				if !ok {
10212					return fmt.Errorf("expected BillingGroupName to be of type string, got %T instead", value)
10213				}
10214				sv.BillingGroupName = ptr.String(jtv)
10215			}
10216
10217		case "billingGroupProperties":
10218			if err := awsRestjson1_deserializeDocumentBillingGroupProperties(&sv.BillingGroupProperties, value); err != nil {
10219				return err
10220			}
10221
10222		case "version":
10223			if value != nil {
10224				jtv, ok := value.(json.Number)
10225				if !ok {
10226					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
10227				}
10228				i64, err := jtv.Int64()
10229				if err != nil {
10230					return err
10231				}
10232				sv.Version = i64
10233			}
10234
10235		default:
10236			_, _ = key, value
10237
10238		}
10239	}
10240	*v = sv
10241	return nil
10242}
10243
10244type awsRestjson1_deserializeOpDescribeCACertificate struct {
10245}
10246
10247func (*awsRestjson1_deserializeOpDescribeCACertificate) ID() string {
10248	return "OperationDeserializer"
10249}
10250
10251func (m *awsRestjson1_deserializeOpDescribeCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10252	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10253) {
10254	out, metadata, err = next.HandleDeserialize(ctx, in)
10255	if err != nil {
10256		return out, metadata, err
10257	}
10258
10259	response, ok := out.RawResponse.(*smithyhttp.Response)
10260	if !ok {
10261		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10262	}
10263
10264	if response.StatusCode < 200 || response.StatusCode >= 300 {
10265		return out, metadata, awsRestjson1_deserializeOpErrorDescribeCACertificate(response, &metadata)
10266	}
10267	output := &DescribeCACertificateOutput{}
10268	out.Result = output
10269
10270	var buff [1024]byte
10271	ringBuffer := smithyio.NewRingBuffer(buff[:])
10272
10273	body := io.TeeReader(response.Body, ringBuffer)
10274
10275	decoder := json.NewDecoder(body)
10276	decoder.UseNumber()
10277	var shape interface{}
10278	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10279		var snapshot bytes.Buffer
10280		io.Copy(&snapshot, ringBuffer)
10281		err = &smithy.DeserializationError{
10282			Err:      fmt.Errorf("failed to decode response body, %w", err),
10283			Snapshot: snapshot.Bytes(),
10284		}
10285		return out, metadata, err
10286	}
10287
10288	err = awsRestjson1_deserializeOpDocumentDescribeCACertificateOutput(&output, shape)
10289	if err != nil {
10290		var snapshot bytes.Buffer
10291		io.Copy(&snapshot, ringBuffer)
10292		return out, metadata, &smithy.DeserializationError{
10293			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10294			Snapshot: snapshot.Bytes(),
10295		}
10296	}
10297
10298	return out, metadata, err
10299}
10300
10301func awsRestjson1_deserializeOpErrorDescribeCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10302	var errorBuffer bytes.Buffer
10303	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10304		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10305	}
10306	errorBody := bytes.NewReader(errorBuffer.Bytes())
10307
10308	errorCode := "UnknownError"
10309	errorMessage := errorCode
10310
10311	code := response.Header.Get("X-Amzn-ErrorType")
10312	if len(code) != 0 {
10313		errorCode = restjson.SanitizeErrorCode(code)
10314	}
10315
10316	var buff [1024]byte
10317	ringBuffer := smithyio.NewRingBuffer(buff[:])
10318
10319	body := io.TeeReader(errorBody, ringBuffer)
10320	decoder := json.NewDecoder(body)
10321	decoder.UseNumber()
10322	code, message, err := restjson.GetErrorInfo(decoder)
10323	if err != nil {
10324		var snapshot bytes.Buffer
10325		io.Copy(&snapshot, ringBuffer)
10326		err = &smithy.DeserializationError{
10327			Err:      fmt.Errorf("failed to decode response body, %w", err),
10328			Snapshot: snapshot.Bytes(),
10329		}
10330		return err
10331	}
10332
10333	errorBody.Seek(0, io.SeekStart)
10334	if len(code) != 0 {
10335		errorCode = restjson.SanitizeErrorCode(code)
10336	}
10337	if len(message) != 0 {
10338		errorMessage = message
10339	}
10340
10341	switch {
10342	case strings.EqualFold("InternalFailureException", errorCode):
10343		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10344
10345	case strings.EqualFold("InvalidRequestException", errorCode):
10346		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
10347
10348	case strings.EqualFold("ResourceNotFoundException", errorCode):
10349		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10350
10351	case strings.EqualFold("ServiceUnavailableException", errorCode):
10352		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
10353
10354	case strings.EqualFold("ThrottlingException", errorCode):
10355		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10356
10357	case strings.EqualFold("UnauthorizedException", errorCode):
10358		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
10359
10360	default:
10361		genericError := &smithy.GenericAPIError{
10362			Code:    errorCode,
10363			Message: errorMessage,
10364		}
10365		return genericError
10366
10367	}
10368}
10369
10370func awsRestjson1_deserializeOpDocumentDescribeCACertificateOutput(v **DescribeCACertificateOutput, value interface{}) error {
10371	if v == nil {
10372		return fmt.Errorf("unexpected nil of type %T", v)
10373	}
10374	if value == nil {
10375		return nil
10376	}
10377
10378	shape, ok := value.(map[string]interface{})
10379	if !ok {
10380		return fmt.Errorf("unexpected JSON type %v", value)
10381	}
10382
10383	var sv *DescribeCACertificateOutput
10384	if *v == nil {
10385		sv = &DescribeCACertificateOutput{}
10386	} else {
10387		sv = *v
10388	}
10389
10390	for key, value := range shape {
10391		switch key {
10392		case "certificateDescription":
10393			if err := awsRestjson1_deserializeDocumentCACertificateDescription(&sv.CertificateDescription, value); err != nil {
10394				return err
10395			}
10396
10397		case "registrationConfig":
10398			if err := awsRestjson1_deserializeDocumentRegistrationConfig(&sv.RegistrationConfig, value); err != nil {
10399				return err
10400			}
10401
10402		default:
10403			_, _ = key, value
10404
10405		}
10406	}
10407	*v = sv
10408	return nil
10409}
10410
10411type awsRestjson1_deserializeOpDescribeCertificate struct {
10412}
10413
10414func (*awsRestjson1_deserializeOpDescribeCertificate) ID() string {
10415	return "OperationDeserializer"
10416}
10417
10418func (m *awsRestjson1_deserializeOpDescribeCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10419	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10420) {
10421	out, metadata, err = next.HandleDeserialize(ctx, in)
10422	if err != nil {
10423		return out, metadata, err
10424	}
10425
10426	response, ok := out.RawResponse.(*smithyhttp.Response)
10427	if !ok {
10428		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10429	}
10430
10431	if response.StatusCode < 200 || response.StatusCode >= 300 {
10432		return out, metadata, awsRestjson1_deserializeOpErrorDescribeCertificate(response, &metadata)
10433	}
10434	output := &DescribeCertificateOutput{}
10435	out.Result = output
10436
10437	var buff [1024]byte
10438	ringBuffer := smithyio.NewRingBuffer(buff[:])
10439
10440	body := io.TeeReader(response.Body, ringBuffer)
10441
10442	decoder := json.NewDecoder(body)
10443	decoder.UseNumber()
10444	var shape interface{}
10445	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10446		var snapshot bytes.Buffer
10447		io.Copy(&snapshot, ringBuffer)
10448		err = &smithy.DeserializationError{
10449			Err:      fmt.Errorf("failed to decode response body, %w", err),
10450			Snapshot: snapshot.Bytes(),
10451		}
10452		return out, metadata, err
10453	}
10454
10455	err = awsRestjson1_deserializeOpDocumentDescribeCertificateOutput(&output, shape)
10456	if err != nil {
10457		var snapshot bytes.Buffer
10458		io.Copy(&snapshot, ringBuffer)
10459		return out, metadata, &smithy.DeserializationError{
10460			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10461			Snapshot: snapshot.Bytes(),
10462		}
10463	}
10464
10465	return out, metadata, err
10466}
10467
10468func awsRestjson1_deserializeOpErrorDescribeCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10469	var errorBuffer bytes.Buffer
10470	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10471		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10472	}
10473	errorBody := bytes.NewReader(errorBuffer.Bytes())
10474
10475	errorCode := "UnknownError"
10476	errorMessage := errorCode
10477
10478	code := response.Header.Get("X-Amzn-ErrorType")
10479	if len(code) != 0 {
10480		errorCode = restjson.SanitizeErrorCode(code)
10481	}
10482
10483	var buff [1024]byte
10484	ringBuffer := smithyio.NewRingBuffer(buff[:])
10485
10486	body := io.TeeReader(errorBody, ringBuffer)
10487	decoder := json.NewDecoder(body)
10488	decoder.UseNumber()
10489	code, message, err := restjson.GetErrorInfo(decoder)
10490	if err != nil {
10491		var snapshot bytes.Buffer
10492		io.Copy(&snapshot, ringBuffer)
10493		err = &smithy.DeserializationError{
10494			Err:      fmt.Errorf("failed to decode response body, %w", err),
10495			Snapshot: snapshot.Bytes(),
10496		}
10497		return err
10498	}
10499
10500	errorBody.Seek(0, io.SeekStart)
10501	if len(code) != 0 {
10502		errorCode = restjson.SanitizeErrorCode(code)
10503	}
10504	if len(message) != 0 {
10505		errorMessage = message
10506	}
10507
10508	switch {
10509	case strings.EqualFold("InternalFailureException", errorCode):
10510		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10511
10512	case strings.EqualFold("InvalidRequestException", errorCode):
10513		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
10514
10515	case strings.EqualFold("ResourceNotFoundException", errorCode):
10516		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10517
10518	case strings.EqualFold("ServiceUnavailableException", errorCode):
10519		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
10520
10521	case strings.EqualFold("ThrottlingException", errorCode):
10522		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10523
10524	case strings.EqualFold("UnauthorizedException", errorCode):
10525		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
10526
10527	default:
10528		genericError := &smithy.GenericAPIError{
10529			Code:    errorCode,
10530			Message: errorMessage,
10531		}
10532		return genericError
10533
10534	}
10535}
10536
10537func awsRestjson1_deserializeOpDocumentDescribeCertificateOutput(v **DescribeCertificateOutput, value interface{}) error {
10538	if v == nil {
10539		return fmt.Errorf("unexpected nil of type %T", v)
10540	}
10541	if value == nil {
10542		return nil
10543	}
10544
10545	shape, ok := value.(map[string]interface{})
10546	if !ok {
10547		return fmt.Errorf("unexpected JSON type %v", value)
10548	}
10549
10550	var sv *DescribeCertificateOutput
10551	if *v == nil {
10552		sv = &DescribeCertificateOutput{}
10553	} else {
10554		sv = *v
10555	}
10556
10557	for key, value := range shape {
10558		switch key {
10559		case "certificateDescription":
10560			if err := awsRestjson1_deserializeDocumentCertificateDescription(&sv.CertificateDescription, value); err != nil {
10561				return err
10562			}
10563
10564		default:
10565			_, _ = key, value
10566
10567		}
10568	}
10569	*v = sv
10570	return nil
10571}
10572
10573type awsRestjson1_deserializeOpDescribeDefaultAuthorizer struct {
10574}
10575
10576func (*awsRestjson1_deserializeOpDescribeDefaultAuthorizer) ID() string {
10577	return "OperationDeserializer"
10578}
10579
10580func (m *awsRestjson1_deserializeOpDescribeDefaultAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10581	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10582) {
10583	out, metadata, err = next.HandleDeserialize(ctx, in)
10584	if err != nil {
10585		return out, metadata, err
10586	}
10587
10588	response, ok := out.RawResponse.(*smithyhttp.Response)
10589	if !ok {
10590		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10591	}
10592
10593	if response.StatusCode < 200 || response.StatusCode >= 300 {
10594		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDefaultAuthorizer(response, &metadata)
10595	}
10596	output := &DescribeDefaultAuthorizerOutput{}
10597	out.Result = output
10598
10599	var buff [1024]byte
10600	ringBuffer := smithyio.NewRingBuffer(buff[:])
10601
10602	body := io.TeeReader(response.Body, ringBuffer)
10603
10604	decoder := json.NewDecoder(body)
10605	decoder.UseNumber()
10606	var shape interface{}
10607	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10608		var snapshot bytes.Buffer
10609		io.Copy(&snapshot, ringBuffer)
10610		err = &smithy.DeserializationError{
10611			Err:      fmt.Errorf("failed to decode response body, %w", err),
10612			Snapshot: snapshot.Bytes(),
10613		}
10614		return out, metadata, err
10615	}
10616
10617	err = awsRestjson1_deserializeOpDocumentDescribeDefaultAuthorizerOutput(&output, shape)
10618	if err != nil {
10619		var snapshot bytes.Buffer
10620		io.Copy(&snapshot, ringBuffer)
10621		return out, metadata, &smithy.DeserializationError{
10622			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10623			Snapshot: snapshot.Bytes(),
10624		}
10625	}
10626
10627	return out, metadata, err
10628}
10629
10630func awsRestjson1_deserializeOpErrorDescribeDefaultAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10631	var errorBuffer bytes.Buffer
10632	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10633		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10634	}
10635	errorBody := bytes.NewReader(errorBuffer.Bytes())
10636
10637	errorCode := "UnknownError"
10638	errorMessage := errorCode
10639
10640	code := response.Header.Get("X-Amzn-ErrorType")
10641	if len(code) != 0 {
10642		errorCode = restjson.SanitizeErrorCode(code)
10643	}
10644
10645	var buff [1024]byte
10646	ringBuffer := smithyio.NewRingBuffer(buff[:])
10647
10648	body := io.TeeReader(errorBody, ringBuffer)
10649	decoder := json.NewDecoder(body)
10650	decoder.UseNumber()
10651	code, message, err := restjson.GetErrorInfo(decoder)
10652	if err != nil {
10653		var snapshot bytes.Buffer
10654		io.Copy(&snapshot, ringBuffer)
10655		err = &smithy.DeserializationError{
10656			Err:      fmt.Errorf("failed to decode response body, %w", err),
10657			Snapshot: snapshot.Bytes(),
10658		}
10659		return err
10660	}
10661
10662	errorBody.Seek(0, io.SeekStart)
10663	if len(code) != 0 {
10664		errorCode = restjson.SanitizeErrorCode(code)
10665	}
10666	if len(message) != 0 {
10667		errorMessage = message
10668	}
10669
10670	switch {
10671	case strings.EqualFold("InternalFailureException", errorCode):
10672		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10673
10674	case strings.EqualFold("InvalidRequestException", errorCode):
10675		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
10676
10677	case strings.EqualFold("ResourceNotFoundException", errorCode):
10678		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10679
10680	case strings.EqualFold("ServiceUnavailableException", errorCode):
10681		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
10682
10683	case strings.EqualFold("ThrottlingException", errorCode):
10684		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10685
10686	case strings.EqualFold("UnauthorizedException", errorCode):
10687		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
10688
10689	default:
10690		genericError := &smithy.GenericAPIError{
10691			Code:    errorCode,
10692			Message: errorMessage,
10693		}
10694		return genericError
10695
10696	}
10697}
10698
10699func awsRestjson1_deserializeOpDocumentDescribeDefaultAuthorizerOutput(v **DescribeDefaultAuthorizerOutput, value interface{}) error {
10700	if v == nil {
10701		return fmt.Errorf("unexpected nil of type %T", v)
10702	}
10703	if value == nil {
10704		return nil
10705	}
10706
10707	shape, ok := value.(map[string]interface{})
10708	if !ok {
10709		return fmt.Errorf("unexpected JSON type %v", value)
10710	}
10711
10712	var sv *DescribeDefaultAuthorizerOutput
10713	if *v == nil {
10714		sv = &DescribeDefaultAuthorizerOutput{}
10715	} else {
10716		sv = *v
10717	}
10718
10719	for key, value := range shape {
10720		switch key {
10721		case "authorizerDescription":
10722			if err := awsRestjson1_deserializeDocumentAuthorizerDescription(&sv.AuthorizerDescription, value); err != nil {
10723				return err
10724			}
10725
10726		default:
10727			_, _ = key, value
10728
10729		}
10730	}
10731	*v = sv
10732	return nil
10733}
10734
10735type awsRestjson1_deserializeOpDescribeDimension struct {
10736}
10737
10738func (*awsRestjson1_deserializeOpDescribeDimension) ID() string {
10739	return "OperationDeserializer"
10740}
10741
10742func (m *awsRestjson1_deserializeOpDescribeDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10743	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10744) {
10745	out, metadata, err = next.HandleDeserialize(ctx, in)
10746	if err != nil {
10747		return out, metadata, err
10748	}
10749
10750	response, ok := out.RawResponse.(*smithyhttp.Response)
10751	if !ok {
10752		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10753	}
10754
10755	if response.StatusCode < 200 || response.StatusCode >= 300 {
10756		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDimension(response, &metadata)
10757	}
10758	output := &DescribeDimensionOutput{}
10759	out.Result = output
10760
10761	var buff [1024]byte
10762	ringBuffer := smithyio.NewRingBuffer(buff[:])
10763
10764	body := io.TeeReader(response.Body, ringBuffer)
10765
10766	decoder := json.NewDecoder(body)
10767	decoder.UseNumber()
10768	var shape interface{}
10769	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10770		var snapshot bytes.Buffer
10771		io.Copy(&snapshot, ringBuffer)
10772		err = &smithy.DeserializationError{
10773			Err:      fmt.Errorf("failed to decode response body, %w", err),
10774			Snapshot: snapshot.Bytes(),
10775		}
10776		return out, metadata, err
10777	}
10778
10779	err = awsRestjson1_deserializeOpDocumentDescribeDimensionOutput(&output, shape)
10780	if err != nil {
10781		var snapshot bytes.Buffer
10782		io.Copy(&snapshot, ringBuffer)
10783		return out, metadata, &smithy.DeserializationError{
10784			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10785			Snapshot: snapshot.Bytes(),
10786		}
10787	}
10788
10789	return out, metadata, err
10790}
10791
10792func awsRestjson1_deserializeOpErrorDescribeDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10793	var errorBuffer bytes.Buffer
10794	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10795		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10796	}
10797	errorBody := bytes.NewReader(errorBuffer.Bytes())
10798
10799	errorCode := "UnknownError"
10800	errorMessage := errorCode
10801
10802	code := response.Header.Get("X-Amzn-ErrorType")
10803	if len(code) != 0 {
10804		errorCode = restjson.SanitizeErrorCode(code)
10805	}
10806
10807	var buff [1024]byte
10808	ringBuffer := smithyio.NewRingBuffer(buff[:])
10809
10810	body := io.TeeReader(errorBody, ringBuffer)
10811	decoder := json.NewDecoder(body)
10812	decoder.UseNumber()
10813	code, message, err := restjson.GetErrorInfo(decoder)
10814	if err != nil {
10815		var snapshot bytes.Buffer
10816		io.Copy(&snapshot, ringBuffer)
10817		err = &smithy.DeserializationError{
10818			Err:      fmt.Errorf("failed to decode response body, %w", err),
10819			Snapshot: snapshot.Bytes(),
10820		}
10821		return err
10822	}
10823
10824	errorBody.Seek(0, io.SeekStart)
10825	if len(code) != 0 {
10826		errorCode = restjson.SanitizeErrorCode(code)
10827	}
10828	if len(message) != 0 {
10829		errorMessage = message
10830	}
10831
10832	switch {
10833	case strings.EqualFold("InternalFailureException", errorCode):
10834		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10835
10836	case strings.EqualFold("InvalidRequestException", errorCode):
10837		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
10838
10839	case strings.EqualFold("ResourceNotFoundException", errorCode):
10840		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10841
10842	case strings.EqualFold("ThrottlingException", errorCode):
10843		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10844
10845	default:
10846		genericError := &smithy.GenericAPIError{
10847			Code:    errorCode,
10848			Message: errorMessage,
10849		}
10850		return genericError
10851
10852	}
10853}
10854
10855func awsRestjson1_deserializeOpDocumentDescribeDimensionOutput(v **DescribeDimensionOutput, value interface{}) error {
10856	if v == nil {
10857		return fmt.Errorf("unexpected nil of type %T", v)
10858	}
10859	if value == nil {
10860		return nil
10861	}
10862
10863	shape, ok := value.(map[string]interface{})
10864	if !ok {
10865		return fmt.Errorf("unexpected JSON type %v", value)
10866	}
10867
10868	var sv *DescribeDimensionOutput
10869	if *v == nil {
10870		sv = &DescribeDimensionOutput{}
10871	} else {
10872		sv = *v
10873	}
10874
10875	for key, value := range shape {
10876		switch key {
10877		case "arn":
10878			if value != nil {
10879				jtv, ok := value.(string)
10880				if !ok {
10881					return fmt.Errorf("expected DimensionArn to be of type string, got %T instead", value)
10882				}
10883				sv.Arn = ptr.String(jtv)
10884			}
10885
10886		case "creationDate":
10887			if value != nil {
10888				jtv, ok := value.(json.Number)
10889				if !ok {
10890					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
10891				}
10892				f64, err := jtv.Float64()
10893				if err != nil {
10894					return err
10895				}
10896				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
10897			}
10898
10899		case "lastModifiedDate":
10900			if value != nil {
10901				jtv, ok := value.(json.Number)
10902				if !ok {
10903					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
10904				}
10905				f64, err := jtv.Float64()
10906				if err != nil {
10907					return err
10908				}
10909				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
10910			}
10911
10912		case "name":
10913			if value != nil {
10914				jtv, ok := value.(string)
10915				if !ok {
10916					return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
10917				}
10918				sv.Name = ptr.String(jtv)
10919			}
10920
10921		case "stringValues":
10922			if err := awsRestjson1_deserializeDocumentDimensionStringValues(&sv.StringValues, value); err != nil {
10923				return err
10924			}
10925
10926		case "type":
10927			if value != nil {
10928				jtv, ok := value.(string)
10929				if !ok {
10930					return fmt.Errorf("expected DimensionType to be of type string, got %T instead", value)
10931				}
10932				sv.Type = types.DimensionType(jtv)
10933			}
10934
10935		default:
10936			_, _ = key, value
10937
10938		}
10939	}
10940	*v = sv
10941	return nil
10942}
10943
10944type awsRestjson1_deserializeOpDescribeDomainConfiguration struct {
10945}
10946
10947func (*awsRestjson1_deserializeOpDescribeDomainConfiguration) ID() string {
10948	return "OperationDeserializer"
10949}
10950
10951func (m *awsRestjson1_deserializeOpDescribeDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10952	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10953) {
10954	out, metadata, err = next.HandleDeserialize(ctx, in)
10955	if err != nil {
10956		return out, metadata, err
10957	}
10958
10959	response, ok := out.RawResponse.(*smithyhttp.Response)
10960	if !ok {
10961		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10962	}
10963
10964	if response.StatusCode < 200 || response.StatusCode >= 300 {
10965		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainConfiguration(response, &metadata)
10966	}
10967	output := &DescribeDomainConfigurationOutput{}
10968	out.Result = output
10969
10970	var buff [1024]byte
10971	ringBuffer := smithyio.NewRingBuffer(buff[:])
10972
10973	body := io.TeeReader(response.Body, ringBuffer)
10974
10975	decoder := json.NewDecoder(body)
10976	decoder.UseNumber()
10977	var shape interface{}
10978	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10979		var snapshot bytes.Buffer
10980		io.Copy(&snapshot, ringBuffer)
10981		err = &smithy.DeserializationError{
10982			Err:      fmt.Errorf("failed to decode response body, %w", err),
10983			Snapshot: snapshot.Bytes(),
10984		}
10985		return out, metadata, err
10986	}
10987
10988	err = awsRestjson1_deserializeOpDocumentDescribeDomainConfigurationOutput(&output, shape)
10989	if err != nil {
10990		var snapshot bytes.Buffer
10991		io.Copy(&snapshot, ringBuffer)
10992		return out, metadata, &smithy.DeserializationError{
10993			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10994			Snapshot: snapshot.Bytes(),
10995		}
10996	}
10997
10998	return out, metadata, err
10999}
11000
11001func awsRestjson1_deserializeOpErrorDescribeDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11002	var errorBuffer bytes.Buffer
11003	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11004		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11005	}
11006	errorBody := bytes.NewReader(errorBuffer.Bytes())
11007
11008	errorCode := "UnknownError"
11009	errorMessage := errorCode
11010
11011	code := response.Header.Get("X-Amzn-ErrorType")
11012	if len(code) != 0 {
11013		errorCode = restjson.SanitizeErrorCode(code)
11014	}
11015
11016	var buff [1024]byte
11017	ringBuffer := smithyio.NewRingBuffer(buff[:])
11018
11019	body := io.TeeReader(errorBody, ringBuffer)
11020	decoder := json.NewDecoder(body)
11021	decoder.UseNumber()
11022	code, message, err := restjson.GetErrorInfo(decoder)
11023	if err != nil {
11024		var snapshot bytes.Buffer
11025		io.Copy(&snapshot, ringBuffer)
11026		err = &smithy.DeserializationError{
11027			Err:      fmt.Errorf("failed to decode response body, %w", err),
11028			Snapshot: snapshot.Bytes(),
11029		}
11030		return err
11031	}
11032
11033	errorBody.Seek(0, io.SeekStart)
11034	if len(code) != 0 {
11035		errorCode = restjson.SanitizeErrorCode(code)
11036	}
11037	if len(message) != 0 {
11038		errorMessage = message
11039	}
11040
11041	switch {
11042	case strings.EqualFold("InternalFailureException", errorCode):
11043		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11044
11045	case strings.EqualFold("InvalidRequestException", errorCode):
11046		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
11047
11048	case strings.EqualFold("ResourceNotFoundException", errorCode):
11049		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11050
11051	case strings.EqualFold("ServiceUnavailableException", errorCode):
11052		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
11053
11054	case strings.EqualFold("ThrottlingException", errorCode):
11055		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11056
11057	case strings.EqualFold("UnauthorizedException", errorCode):
11058		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
11059
11060	default:
11061		genericError := &smithy.GenericAPIError{
11062			Code:    errorCode,
11063			Message: errorMessage,
11064		}
11065		return genericError
11066
11067	}
11068}
11069
11070func awsRestjson1_deserializeOpDocumentDescribeDomainConfigurationOutput(v **DescribeDomainConfigurationOutput, value interface{}) error {
11071	if v == nil {
11072		return fmt.Errorf("unexpected nil of type %T", v)
11073	}
11074	if value == nil {
11075		return nil
11076	}
11077
11078	shape, ok := value.(map[string]interface{})
11079	if !ok {
11080		return fmt.Errorf("unexpected JSON type %v", value)
11081	}
11082
11083	var sv *DescribeDomainConfigurationOutput
11084	if *v == nil {
11085		sv = &DescribeDomainConfigurationOutput{}
11086	} else {
11087		sv = *v
11088	}
11089
11090	for key, value := range shape {
11091		switch key {
11092		case "authorizerConfig":
11093			if err := awsRestjson1_deserializeDocumentAuthorizerConfig(&sv.AuthorizerConfig, value); err != nil {
11094				return err
11095			}
11096
11097		case "domainConfigurationArn":
11098			if value != nil {
11099				jtv, ok := value.(string)
11100				if !ok {
11101					return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value)
11102				}
11103				sv.DomainConfigurationArn = ptr.String(jtv)
11104			}
11105
11106		case "domainConfigurationName":
11107			if value != nil {
11108				jtv, ok := value.(string)
11109				if !ok {
11110					return fmt.Errorf("expected ReservedDomainConfigurationName to be of type string, got %T instead", value)
11111				}
11112				sv.DomainConfigurationName = ptr.String(jtv)
11113			}
11114
11115		case "domainConfigurationStatus":
11116			if value != nil {
11117				jtv, ok := value.(string)
11118				if !ok {
11119					return fmt.Errorf("expected DomainConfigurationStatus to be of type string, got %T instead", value)
11120				}
11121				sv.DomainConfigurationStatus = types.DomainConfigurationStatus(jtv)
11122			}
11123
11124		case "domainName":
11125			if value != nil {
11126				jtv, ok := value.(string)
11127				if !ok {
11128					return fmt.Errorf("expected DomainName to be of type string, got %T instead", value)
11129				}
11130				sv.DomainName = ptr.String(jtv)
11131			}
11132
11133		case "domainType":
11134			if value != nil {
11135				jtv, ok := value.(string)
11136				if !ok {
11137					return fmt.Errorf("expected DomainType to be of type string, got %T instead", value)
11138				}
11139				sv.DomainType = types.DomainType(jtv)
11140			}
11141
11142		case "lastStatusChangeDate":
11143			if value != nil {
11144				jtv, ok := value.(json.Number)
11145				if !ok {
11146					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
11147				}
11148				f64, err := jtv.Float64()
11149				if err != nil {
11150					return err
11151				}
11152				sv.LastStatusChangeDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
11153			}
11154
11155		case "serverCertificates":
11156			if err := awsRestjson1_deserializeDocumentServerCertificates(&sv.ServerCertificates, value); err != nil {
11157				return err
11158			}
11159
11160		case "serviceType":
11161			if value != nil {
11162				jtv, ok := value.(string)
11163				if !ok {
11164					return fmt.Errorf("expected ServiceType to be of type string, got %T instead", value)
11165				}
11166				sv.ServiceType = types.ServiceType(jtv)
11167			}
11168
11169		default:
11170			_, _ = key, value
11171
11172		}
11173	}
11174	*v = sv
11175	return nil
11176}
11177
11178type awsRestjson1_deserializeOpDescribeEndpoint struct {
11179}
11180
11181func (*awsRestjson1_deserializeOpDescribeEndpoint) ID() string {
11182	return "OperationDeserializer"
11183}
11184
11185func (m *awsRestjson1_deserializeOpDescribeEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11186	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11187) {
11188	out, metadata, err = next.HandleDeserialize(ctx, in)
11189	if err != nil {
11190		return out, metadata, err
11191	}
11192
11193	response, ok := out.RawResponse.(*smithyhttp.Response)
11194	if !ok {
11195		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11196	}
11197
11198	if response.StatusCode < 200 || response.StatusCode >= 300 {
11199		return out, metadata, awsRestjson1_deserializeOpErrorDescribeEndpoint(response, &metadata)
11200	}
11201	output := &DescribeEndpointOutput{}
11202	out.Result = output
11203
11204	var buff [1024]byte
11205	ringBuffer := smithyio.NewRingBuffer(buff[:])
11206
11207	body := io.TeeReader(response.Body, ringBuffer)
11208
11209	decoder := json.NewDecoder(body)
11210	decoder.UseNumber()
11211	var shape interface{}
11212	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11213		var snapshot bytes.Buffer
11214		io.Copy(&snapshot, ringBuffer)
11215		err = &smithy.DeserializationError{
11216			Err:      fmt.Errorf("failed to decode response body, %w", err),
11217			Snapshot: snapshot.Bytes(),
11218		}
11219		return out, metadata, err
11220	}
11221
11222	err = awsRestjson1_deserializeOpDocumentDescribeEndpointOutput(&output, shape)
11223	if err != nil {
11224		var snapshot bytes.Buffer
11225		io.Copy(&snapshot, ringBuffer)
11226		return out, metadata, &smithy.DeserializationError{
11227			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11228			Snapshot: snapshot.Bytes(),
11229		}
11230	}
11231
11232	return out, metadata, err
11233}
11234
11235func awsRestjson1_deserializeOpErrorDescribeEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11236	var errorBuffer bytes.Buffer
11237	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11238		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11239	}
11240	errorBody := bytes.NewReader(errorBuffer.Bytes())
11241
11242	errorCode := "UnknownError"
11243	errorMessage := errorCode
11244
11245	code := response.Header.Get("X-Amzn-ErrorType")
11246	if len(code) != 0 {
11247		errorCode = restjson.SanitizeErrorCode(code)
11248	}
11249
11250	var buff [1024]byte
11251	ringBuffer := smithyio.NewRingBuffer(buff[:])
11252
11253	body := io.TeeReader(errorBody, ringBuffer)
11254	decoder := json.NewDecoder(body)
11255	decoder.UseNumber()
11256	code, message, err := restjson.GetErrorInfo(decoder)
11257	if err != nil {
11258		var snapshot bytes.Buffer
11259		io.Copy(&snapshot, ringBuffer)
11260		err = &smithy.DeserializationError{
11261			Err:      fmt.Errorf("failed to decode response body, %w", err),
11262			Snapshot: snapshot.Bytes(),
11263		}
11264		return err
11265	}
11266
11267	errorBody.Seek(0, io.SeekStart)
11268	if len(code) != 0 {
11269		errorCode = restjson.SanitizeErrorCode(code)
11270	}
11271	if len(message) != 0 {
11272		errorMessage = message
11273	}
11274
11275	switch {
11276	case strings.EqualFold("InternalFailureException", errorCode):
11277		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11278
11279	case strings.EqualFold("InvalidRequestException", errorCode):
11280		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
11281
11282	case strings.EqualFold("ThrottlingException", errorCode):
11283		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11284
11285	case strings.EqualFold("UnauthorizedException", errorCode):
11286		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
11287
11288	default:
11289		genericError := &smithy.GenericAPIError{
11290			Code:    errorCode,
11291			Message: errorMessage,
11292		}
11293		return genericError
11294
11295	}
11296}
11297
11298func awsRestjson1_deserializeOpDocumentDescribeEndpointOutput(v **DescribeEndpointOutput, value interface{}) error {
11299	if v == nil {
11300		return fmt.Errorf("unexpected nil of type %T", v)
11301	}
11302	if value == nil {
11303		return nil
11304	}
11305
11306	shape, ok := value.(map[string]interface{})
11307	if !ok {
11308		return fmt.Errorf("unexpected JSON type %v", value)
11309	}
11310
11311	var sv *DescribeEndpointOutput
11312	if *v == nil {
11313		sv = &DescribeEndpointOutput{}
11314	} else {
11315		sv = *v
11316	}
11317
11318	for key, value := range shape {
11319		switch key {
11320		case "endpointAddress":
11321			if value != nil {
11322				jtv, ok := value.(string)
11323				if !ok {
11324					return fmt.Errorf("expected EndpointAddress to be of type string, got %T instead", value)
11325				}
11326				sv.EndpointAddress = ptr.String(jtv)
11327			}
11328
11329		default:
11330			_, _ = key, value
11331
11332		}
11333	}
11334	*v = sv
11335	return nil
11336}
11337
11338type awsRestjson1_deserializeOpDescribeEventConfigurations struct {
11339}
11340
11341func (*awsRestjson1_deserializeOpDescribeEventConfigurations) ID() string {
11342	return "OperationDeserializer"
11343}
11344
11345func (m *awsRestjson1_deserializeOpDescribeEventConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11346	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11347) {
11348	out, metadata, err = next.HandleDeserialize(ctx, in)
11349	if err != nil {
11350		return out, metadata, err
11351	}
11352
11353	response, ok := out.RawResponse.(*smithyhttp.Response)
11354	if !ok {
11355		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11356	}
11357
11358	if response.StatusCode < 200 || response.StatusCode >= 300 {
11359		return out, metadata, awsRestjson1_deserializeOpErrorDescribeEventConfigurations(response, &metadata)
11360	}
11361	output := &DescribeEventConfigurationsOutput{}
11362	out.Result = output
11363
11364	var buff [1024]byte
11365	ringBuffer := smithyio.NewRingBuffer(buff[:])
11366
11367	body := io.TeeReader(response.Body, ringBuffer)
11368
11369	decoder := json.NewDecoder(body)
11370	decoder.UseNumber()
11371	var shape interface{}
11372	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11373		var snapshot bytes.Buffer
11374		io.Copy(&snapshot, ringBuffer)
11375		err = &smithy.DeserializationError{
11376			Err:      fmt.Errorf("failed to decode response body, %w", err),
11377			Snapshot: snapshot.Bytes(),
11378		}
11379		return out, metadata, err
11380	}
11381
11382	err = awsRestjson1_deserializeOpDocumentDescribeEventConfigurationsOutput(&output, shape)
11383	if err != nil {
11384		var snapshot bytes.Buffer
11385		io.Copy(&snapshot, ringBuffer)
11386		return out, metadata, &smithy.DeserializationError{
11387			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11388			Snapshot: snapshot.Bytes(),
11389		}
11390	}
11391
11392	return out, metadata, err
11393}
11394
11395func awsRestjson1_deserializeOpErrorDescribeEventConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11396	var errorBuffer bytes.Buffer
11397	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11398		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11399	}
11400	errorBody := bytes.NewReader(errorBuffer.Bytes())
11401
11402	errorCode := "UnknownError"
11403	errorMessage := errorCode
11404
11405	code := response.Header.Get("X-Amzn-ErrorType")
11406	if len(code) != 0 {
11407		errorCode = restjson.SanitizeErrorCode(code)
11408	}
11409
11410	var buff [1024]byte
11411	ringBuffer := smithyio.NewRingBuffer(buff[:])
11412
11413	body := io.TeeReader(errorBody, ringBuffer)
11414	decoder := json.NewDecoder(body)
11415	decoder.UseNumber()
11416	code, message, err := restjson.GetErrorInfo(decoder)
11417	if err != nil {
11418		var snapshot bytes.Buffer
11419		io.Copy(&snapshot, ringBuffer)
11420		err = &smithy.DeserializationError{
11421			Err:      fmt.Errorf("failed to decode response body, %w", err),
11422			Snapshot: snapshot.Bytes(),
11423		}
11424		return err
11425	}
11426
11427	errorBody.Seek(0, io.SeekStart)
11428	if len(code) != 0 {
11429		errorCode = restjson.SanitizeErrorCode(code)
11430	}
11431	if len(message) != 0 {
11432		errorMessage = message
11433	}
11434
11435	switch {
11436	case strings.EqualFold("InternalFailureException", errorCode):
11437		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11438
11439	case strings.EqualFold("ThrottlingException", errorCode):
11440		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11441
11442	default:
11443		genericError := &smithy.GenericAPIError{
11444			Code:    errorCode,
11445			Message: errorMessage,
11446		}
11447		return genericError
11448
11449	}
11450}
11451
11452func awsRestjson1_deserializeOpDocumentDescribeEventConfigurationsOutput(v **DescribeEventConfigurationsOutput, value interface{}) error {
11453	if v == nil {
11454		return fmt.Errorf("unexpected nil of type %T", v)
11455	}
11456	if value == nil {
11457		return nil
11458	}
11459
11460	shape, ok := value.(map[string]interface{})
11461	if !ok {
11462		return fmt.Errorf("unexpected JSON type %v", value)
11463	}
11464
11465	var sv *DescribeEventConfigurationsOutput
11466	if *v == nil {
11467		sv = &DescribeEventConfigurationsOutput{}
11468	} else {
11469		sv = *v
11470	}
11471
11472	for key, value := range shape {
11473		switch key {
11474		case "creationDate":
11475			if value != nil {
11476				jtv, ok := value.(json.Number)
11477				if !ok {
11478					return fmt.Errorf("expected CreationDate to be json.Number, got %T instead", value)
11479				}
11480				f64, err := jtv.Float64()
11481				if err != nil {
11482					return err
11483				}
11484				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
11485			}
11486
11487		case "eventConfigurations":
11488			if err := awsRestjson1_deserializeDocumentEventConfigurations(&sv.EventConfigurations, value); err != nil {
11489				return err
11490			}
11491
11492		case "lastModifiedDate":
11493			if value != nil {
11494				jtv, ok := value.(json.Number)
11495				if !ok {
11496					return fmt.Errorf("expected LastModifiedDate to be json.Number, got %T instead", value)
11497				}
11498				f64, err := jtv.Float64()
11499				if err != nil {
11500					return err
11501				}
11502				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
11503			}
11504
11505		default:
11506			_, _ = key, value
11507
11508		}
11509	}
11510	*v = sv
11511	return nil
11512}
11513
11514type awsRestjson1_deserializeOpDescribeIndex struct {
11515}
11516
11517func (*awsRestjson1_deserializeOpDescribeIndex) ID() string {
11518	return "OperationDeserializer"
11519}
11520
11521func (m *awsRestjson1_deserializeOpDescribeIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11522	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11523) {
11524	out, metadata, err = next.HandleDeserialize(ctx, in)
11525	if err != nil {
11526		return out, metadata, err
11527	}
11528
11529	response, ok := out.RawResponse.(*smithyhttp.Response)
11530	if !ok {
11531		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11532	}
11533
11534	if response.StatusCode < 200 || response.StatusCode >= 300 {
11535		return out, metadata, awsRestjson1_deserializeOpErrorDescribeIndex(response, &metadata)
11536	}
11537	output := &DescribeIndexOutput{}
11538	out.Result = output
11539
11540	var buff [1024]byte
11541	ringBuffer := smithyio.NewRingBuffer(buff[:])
11542
11543	body := io.TeeReader(response.Body, ringBuffer)
11544
11545	decoder := json.NewDecoder(body)
11546	decoder.UseNumber()
11547	var shape interface{}
11548	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11549		var snapshot bytes.Buffer
11550		io.Copy(&snapshot, ringBuffer)
11551		err = &smithy.DeserializationError{
11552			Err:      fmt.Errorf("failed to decode response body, %w", err),
11553			Snapshot: snapshot.Bytes(),
11554		}
11555		return out, metadata, err
11556	}
11557
11558	err = awsRestjson1_deserializeOpDocumentDescribeIndexOutput(&output, shape)
11559	if err != nil {
11560		var snapshot bytes.Buffer
11561		io.Copy(&snapshot, ringBuffer)
11562		return out, metadata, &smithy.DeserializationError{
11563			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11564			Snapshot: snapshot.Bytes(),
11565		}
11566	}
11567
11568	return out, metadata, err
11569}
11570
11571func awsRestjson1_deserializeOpErrorDescribeIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11572	var errorBuffer bytes.Buffer
11573	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11574		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11575	}
11576	errorBody := bytes.NewReader(errorBuffer.Bytes())
11577
11578	errorCode := "UnknownError"
11579	errorMessage := errorCode
11580
11581	code := response.Header.Get("X-Amzn-ErrorType")
11582	if len(code) != 0 {
11583		errorCode = restjson.SanitizeErrorCode(code)
11584	}
11585
11586	var buff [1024]byte
11587	ringBuffer := smithyio.NewRingBuffer(buff[:])
11588
11589	body := io.TeeReader(errorBody, ringBuffer)
11590	decoder := json.NewDecoder(body)
11591	decoder.UseNumber()
11592	code, message, err := restjson.GetErrorInfo(decoder)
11593	if err != nil {
11594		var snapshot bytes.Buffer
11595		io.Copy(&snapshot, ringBuffer)
11596		err = &smithy.DeserializationError{
11597			Err:      fmt.Errorf("failed to decode response body, %w", err),
11598			Snapshot: snapshot.Bytes(),
11599		}
11600		return err
11601	}
11602
11603	errorBody.Seek(0, io.SeekStart)
11604	if len(code) != 0 {
11605		errorCode = restjson.SanitizeErrorCode(code)
11606	}
11607	if len(message) != 0 {
11608		errorMessage = message
11609	}
11610
11611	switch {
11612	case strings.EqualFold("InternalFailureException", errorCode):
11613		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11614
11615	case strings.EqualFold("InvalidRequestException", errorCode):
11616		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
11617
11618	case strings.EqualFold("ResourceNotFoundException", errorCode):
11619		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11620
11621	case strings.EqualFold("ServiceUnavailableException", errorCode):
11622		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
11623
11624	case strings.EqualFold("ThrottlingException", errorCode):
11625		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11626
11627	case strings.EqualFold("UnauthorizedException", errorCode):
11628		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
11629
11630	default:
11631		genericError := &smithy.GenericAPIError{
11632			Code:    errorCode,
11633			Message: errorMessage,
11634		}
11635		return genericError
11636
11637	}
11638}
11639
11640func awsRestjson1_deserializeOpDocumentDescribeIndexOutput(v **DescribeIndexOutput, value interface{}) error {
11641	if v == nil {
11642		return fmt.Errorf("unexpected nil of type %T", v)
11643	}
11644	if value == nil {
11645		return nil
11646	}
11647
11648	shape, ok := value.(map[string]interface{})
11649	if !ok {
11650		return fmt.Errorf("unexpected JSON type %v", value)
11651	}
11652
11653	var sv *DescribeIndexOutput
11654	if *v == nil {
11655		sv = &DescribeIndexOutput{}
11656	} else {
11657		sv = *v
11658	}
11659
11660	for key, value := range shape {
11661		switch key {
11662		case "indexName":
11663			if value != nil {
11664				jtv, ok := value.(string)
11665				if !ok {
11666					return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
11667				}
11668				sv.IndexName = ptr.String(jtv)
11669			}
11670
11671		case "indexStatus":
11672			if value != nil {
11673				jtv, ok := value.(string)
11674				if !ok {
11675					return fmt.Errorf("expected IndexStatus to be of type string, got %T instead", value)
11676				}
11677				sv.IndexStatus = types.IndexStatus(jtv)
11678			}
11679
11680		case "schema":
11681			if value != nil {
11682				jtv, ok := value.(string)
11683				if !ok {
11684					return fmt.Errorf("expected IndexSchema to be of type string, got %T instead", value)
11685				}
11686				sv.Schema = ptr.String(jtv)
11687			}
11688
11689		default:
11690			_, _ = key, value
11691
11692		}
11693	}
11694	*v = sv
11695	return nil
11696}
11697
11698type awsRestjson1_deserializeOpDescribeJob struct {
11699}
11700
11701func (*awsRestjson1_deserializeOpDescribeJob) ID() string {
11702	return "OperationDeserializer"
11703}
11704
11705func (m *awsRestjson1_deserializeOpDescribeJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11706	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11707) {
11708	out, metadata, err = next.HandleDeserialize(ctx, in)
11709	if err != nil {
11710		return out, metadata, err
11711	}
11712
11713	response, ok := out.RawResponse.(*smithyhttp.Response)
11714	if !ok {
11715		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11716	}
11717
11718	if response.StatusCode < 200 || response.StatusCode >= 300 {
11719		return out, metadata, awsRestjson1_deserializeOpErrorDescribeJob(response, &metadata)
11720	}
11721	output := &DescribeJobOutput{}
11722	out.Result = output
11723
11724	var buff [1024]byte
11725	ringBuffer := smithyio.NewRingBuffer(buff[:])
11726
11727	body := io.TeeReader(response.Body, ringBuffer)
11728
11729	decoder := json.NewDecoder(body)
11730	decoder.UseNumber()
11731	var shape interface{}
11732	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11733		var snapshot bytes.Buffer
11734		io.Copy(&snapshot, ringBuffer)
11735		err = &smithy.DeserializationError{
11736			Err:      fmt.Errorf("failed to decode response body, %w", err),
11737			Snapshot: snapshot.Bytes(),
11738		}
11739		return out, metadata, err
11740	}
11741
11742	err = awsRestjson1_deserializeOpDocumentDescribeJobOutput(&output, shape)
11743	if err != nil {
11744		var snapshot bytes.Buffer
11745		io.Copy(&snapshot, ringBuffer)
11746		return out, metadata, &smithy.DeserializationError{
11747			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11748			Snapshot: snapshot.Bytes(),
11749		}
11750	}
11751
11752	return out, metadata, err
11753}
11754
11755func awsRestjson1_deserializeOpErrorDescribeJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11756	var errorBuffer bytes.Buffer
11757	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11758		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11759	}
11760	errorBody := bytes.NewReader(errorBuffer.Bytes())
11761
11762	errorCode := "UnknownError"
11763	errorMessage := errorCode
11764
11765	code := response.Header.Get("X-Amzn-ErrorType")
11766	if len(code) != 0 {
11767		errorCode = restjson.SanitizeErrorCode(code)
11768	}
11769
11770	var buff [1024]byte
11771	ringBuffer := smithyio.NewRingBuffer(buff[:])
11772
11773	body := io.TeeReader(errorBody, ringBuffer)
11774	decoder := json.NewDecoder(body)
11775	decoder.UseNumber()
11776	code, message, err := restjson.GetErrorInfo(decoder)
11777	if err != nil {
11778		var snapshot bytes.Buffer
11779		io.Copy(&snapshot, ringBuffer)
11780		err = &smithy.DeserializationError{
11781			Err:      fmt.Errorf("failed to decode response body, %w", err),
11782			Snapshot: snapshot.Bytes(),
11783		}
11784		return err
11785	}
11786
11787	errorBody.Seek(0, io.SeekStart)
11788	if len(code) != 0 {
11789		errorCode = restjson.SanitizeErrorCode(code)
11790	}
11791	if len(message) != 0 {
11792		errorMessage = message
11793	}
11794
11795	switch {
11796	case strings.EqualFold("InvalidRequestException", errorCode):
11797		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
11798
11799	case strings.EqualFold("ResourceNotFoundException", errorCode):
11800		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11801
11802	case strings.EqualFold("ServiceUnavailableException", errorCode):
11803		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
11804
11805	case strings.EqualFold("ThrottlingException", errorCode):
11806		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11807
11808	default:
11809		genericError := &smithy.GenericAPIError{
11810			Code:    errorCode,
11811			Message: errorMessage,
11812		}
11813		return genericError
11814
11815	}
11816}
11817
11818func awsRestjson1_deserializeOpDocumentDescribeJobOutput(v **DescribeJobOutput, value interface{}) error {
11819	if v == nil {
11820		return fmt.Errorf("unexpected nil of type %T", v)
11821	}
11822	if value == nil {
11823		return nil
11824	}
11825
11826	shape, ok := value.(map[string]interface{})
11827	if !ok {
11828		return fmt.Errorf("unexpected JSON type %v", value)
11829	}
11830
11831	var sv *DescribeJobOutput
11832	if *v == nil {
11833		sv = &DescribeJobOutput{}
11834	} else {
11835		sv = *v
11836	}
11837
11838	for key, value := range shape {
11839		switch key {
11840		case "documentSource":
11841			if value != nil {
11842				jtv, ok := value.(string)
11843				if !ok {
11844					return fmt.Errorf("expected JobDocumentSource to be of type string, got %T instead", value)
11845				}
11846				sv.DocumentSource = ptr.String(jtv)
11847			}
11848
11849		case "job":
11850			if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil {
11851				return err
11852			}
11853
11854		default:
11855			_, _ = key, value
11856
11857		}
11858	}
11859	*v = sv
11860	return nil
11861}
11862
11863type awsRestjson1_deserializeOpDescribeJobExecution struct {
11864}
11865
11866func (*awsRestjson1_deserializeOpDescribeJobExecution) ID() string {
11867	return "OperationDeserializer"
11868}
11869
11870func (m *awsRestjson1_deserializeOpDescribeJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11871	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11872) {
11873	out, metadata, err = next.HandleDeserialize(ctx, in)
11874	if err != nil {
11875		return out, metadata, err
11876	}
11877
11878	response, ok := out.RawResponse.(*smithyhttp.Response)
11879	if !ok {
11880		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11881	}
11882
11883	if response.StatusCode < 200 || response.StatusCode >= 300 {
11884		return out, metadata, awsRestjson1_deserializeOpErrorDescribeJobExecution(response, &metadata)
11885	}
11886	output := &DescribeJobExecutionOutput{}
11887	out.Result = output
11888
11889	var buff [1024]byte
11890	ringBuffer := smithyio.NewRingBuffer(buff[:])
11891
11892	body := io.TeeReader(response.Body, ringBuffer)
11893
11894	decoder := json.NewDecoder(body)
11895	decoder.UseNumber()
11896	var shape interface{}
11897	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11898		var snapshot bytes.Buffer
11899		io.Copy(&snapshot, ringBuffer)
11900		err = &smithy.DeserializationError{
11901			Err:      fmt.Errorf("failed to decode response body, %w", err),
11902			Snapshot: snapshot.Bytes(),
11903		}
11904		return out, metadata, err
11905	}
11906
11907	err = awsRestjson1_deserializeOpDocumentDescribeJobExecutionOutput(&output, shape)
11908	if err != nil {
11909		var snapshot bytes.Buffer
11910		io.Copy(&snapshot, ringBuffer)
11911		return out, metadata, &smithy.DeserializationError{
11912			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11913			Snapshot: snapshot.Bytes(),
11914		}
11915	}
11916
11917	return out, metadata, err
11918}
11919
11920func awsRestjson1_deserializeOpErrorDescribeJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11921	var errorBuffer bytes.Buffer
11922	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11923		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11924	}
11925	errorBody := bytes.NewReader(errorBuffer.Bytes())
11926
11927	errorCode := "UnknownError"
11928	errorMessage := errorCode
11929
11930	code := response.Header.Get("X-Amzn-ErrorType")
11931	if len(code) != 0 {
11932		errorCode = restjson.SanitizeErrorCode(code)
11933	}
11934
11935	var buff [1024]byte
11936	ringBuffer := smithyio.NewRingBuffer(buff[:])
11937
11938	body := io.TeeReader(errorBody, ringBuffer)
11939	decoder := json.NewDecoder(body)
11940	decoder.UseNumber()
11941	code, message, err := restjson.GetErrorInfo(decoder)
11942	if err != nil {
11943		var snapshot bytes.Buffer
11944		io.Copy(&snapshot, ringBuffer)
11945		err = &smithy.DeserializationError{
11946			Err:      fmt.Errorf("failed to decode response body, %w", err),
11947			Snapshot: snapshot.Bytes(),
11948		}
11949		return err
11950	}
11951
11952	errorBody.Seek(0, io.SeekStart)
11953	if len(code) != 0 {
11954		errorCode = restjson.SanitizeErrorCode(code)
11955	}
11956	if len(message) != 0 {
11957		errorMessage = message
11958	}
11959
11960	switch {
11961	case strings.EqualFold("InvalidRequestException", errorCode):
11962		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
11963
11964	case strings.EqualFold("ResourceNotFoundException", errorCode):
11965		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11966
11967	case strings.EqualFold("ServiceUnavailableException", errorCode):
11968		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
11969
11970	case strings.EqualFold("ThrottlingException", errorCode):
11971		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11972
11973	default:
11974		genericError := &smithy.GenericAPIError{
11975			Code:    errorCode,
11976			Message: errorMessage,
11977		}
11978		return genericError
11979
11980	}
11981}
11982
11983func awsRestjson1_deserializeOpDocumentDescribeJobExecutionOutput(v **DescribeJobExecutionOutput, value interface{}) error {
11984	if v == nil {
11985		return fmt.Errorf("unexpected nil of type %T", v)
11986	}
11987	if value == nil {
11988		return nil
11989	}
11990
11991	shape, ok := value.(map[string]interface{})
11992	if !ok {
11993		return fmt.Errorf("unexpected JSON type %v", value)
11994	}
11995
11996	var sv *DescribeJobExecutionOutput
11997	if *v == nil {
11998		sv = &DescribeJobExecutionOutput{}
11999	} else {
12000		sv = *v
12001	}
12002
12003	for key, value := range shape {
12004		switch key {
12005		case "execution":
12006			if err := awsRestjson1_deserializeDocumentJobExecution(&sv.Execution, value); err != nil {
12007				return err
12008			}
12009
12010		default:
12011			_, _ = key, value
12012
12013		}
12014	}
12015	*v = sv
12016	return nil
12017}
12018
12019type awsRestjson1_deserializeOpDescribeMitigationAction struct {
12020}
12021
12022func (*awsRestjson1_deserializeOpDescribeMitigationAction) ID() string {
12023	return "OperationDeserializer"
12024}
12025
12026func (m *awsRestjson1_deserializeOpDescribeMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12027	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12028) {
12029	out, metadata, err = next.HandleDeserialize(ctx, in)
12030	if err != nil {
12031		return out, metadata, err
12032	}
12033
12034	response, ok := out.RawResponse.(*smithyhttp.Response)
12035	if !ok {
12036		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12037	}
12038
12039	if response.StatusCode < 200 || response.StatusCode >= 300 {
12040		return out, metadata, awsRestjson1_deserializeOpErrorDescribeMitigationAction(response, &metadata)
12041	}
12042	output := &DescribeMitigationActionOutput{}
12043	out.Result = output
12044
12045	var buff [1024]byte
12046	ringBuffer := smithyio.NewRingBuffer(buff[:])
12047
12048	body := io.TeeReader(response.Body, ringBuffer)
12049
12050	decoder := json.NewDecoder(body)
12051	decoder.UseNumber()
12052	var shape interface{}
12053	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12054		var snapshot bytes.Buffer
12055		io.Copy(&snapshot, ringBuffer)
12056		err = &smithy.DeserializationError{
12057			Err:      fmt.Errorf("failed to decode response body, %w", err),
12058			Snapshot: snapshot.Bytes(),
12059		}
12060		return out, metadata, err
12061	}
12062
12063	err = awsRestjson1_deserializeOpDocumentDescribeMitigationActionOutput(&output, shape)
12064	if err != nil {
12065		var snapshot bytes.Buffer
12066		io.Copy(&snapshot, ringBuffer)
12067		return out, metadata, &smithy.DeserializationError{
12068			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12069			Snapshot: snapshot.Bytes(),
12070		}
12071	}
12072
12073	return out, metadata, err
12074}
12075
12076func awsRestjson1_deserializeOpErrorDescribeMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12077	var errorBuffer bytes.Buffer
12078	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12079		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12080	}
12081	errorBody := bytes.NewReader(errorBuffer.Bytes())
12082
12083	errorCode := "UnknownError"
12084	errorMessage := errorCode
12085
12086	code := response.Header.Get("X-Amzn-ErrorType")
12087	if len(code) != 0 {
12088		errorCode = restjson.SanitizeErrorCode(code)
12089	}
12090
12091	var buff [1024]byte
12092	ringBuffer := smithyio.NewRingBuffer(buff[:])
12093
12094	body := io.TeeReader(errorBody, ringBuffer)
12095	decoder := json.NewDecoder(body)
12096	decoder.UseNumber()
12097	code, message, err := restjson.GetErrorInfo(decoder)
12098	if err != nil {
12099		var snapshot bytes.Buffer
12100		io.Copy(&snapshot, ringBuffer)
12101		err = &smithy.DeserializationError{
12102			Err:      fmt.Errorf("failed to decode response body, %w", err),
12103			Snapshot: snapshot.Bytes(),
12104		}
12105		return err
12106	}
12107
12108	errorBody.Seek(0, io.SeekStart)
12109	if len(code) != 0 {
12110		errorCode = restjson.SanitizeErrorCode(code)
12111	}
12112	if len(message) != 0 {
12113		errorMessage = message
12114	}
12115
12116	switch {
12117	case strings.EqualFold("InternalFailureException", errorCode):
12118		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12119
12120	case strings.EqualFold("InvalidRequestException", errorCode):
12121		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
12122
12123	case strings.EqualFold("ResourceNotFoundException", errorCode):
12124		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12125
12126	case strings.EqualFold("ThrottlingException", errorCode):
12127		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12128
12129	default:
12130		genericError := &smithy.GenericAPIError{
12131			Code:    errorCode,
12132			Message: errorMessage,
12133		}
12134		return genericError
12135
12136	}
12137}
12138
12139func awsRestjson1_deserializeOpDocumentDescribeMitigationActionOutput(v **DescribeMitigationActionOutput, value interface{}) error {
12140	if v == nil {
12141		return fmt.Errorf("unexpected nil of type %T", v)
12142	}
12143	if value == nil {
12144		return nil
12145	}
12146
12147	shape, ok := value.(map[string]interface{})
12148	if !ok {
12149		return fmt.Errorf("unexpected JSON type %v", value)
12150	}
12151
12152	var sv *DescribeMitigationActionOutput
12153	if *v == nil {
12154		sv = &DescribeMitigationActionOutput{}
12155	} else {
12156		sv = *v
12157	}
12158
12159	for key, value := range shape {
12160		switch key {
12161		case "actionArn":
12162			if value != nil {
12163				jtv, ok := value.(string)
12164				if !ok {
12165					return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value)
12166				}
12167				sv.ActionArn = ptr.String(jtv)
12168			}
12169
12170		case "actionId":
12171			if value != nil {
12172				jtv, ok := value.(string)
12173				if !ok {
12174					return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value)
12175				}
12176				sv.ActionId = ptr.String(jtv)
12177			}
12178
12179		case "actionName":
12180			if value != nil {
12181				jtv, ok := value.(string)
12182				if !ok {
12183					return fmt.Errorf("expected MitigationActionName to be of type string, got %T instead", value)
12184				}
12185				sv.ActionName = ptr.String(jtv)
12186			}
12187
12188		case "actionParams":
12189			if err := awsRestjson1_deserializeDocumentMitigationActionParams(&sv.ActionParams, value); err != nil {
12190				return err
12191			}
12192
12193		case "actionType":
12194			if value != nil {
12195				jtv, ok := value.(string)
12196				if !ok {
12197					return fmt.Errorf("expected MitigationActionType to be of type string, got %T instead", value)
12198				}
12199				sv.ActionType = types.MitigationActionType(jtv)
12200			}
12201
12202		case "creationDate":
12203			if value != nil {
12204				jtv, ok := value.(json.Number)
12205				if !ok {
12206					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
12207				}
12208				f64, err := jtv.Float64()
12209				if err != nil {
12210					return err
12211				}
12212				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
12213			}
12214
12215		case "lastModifiedDate":
12216			if value != nil {
12217				jtv, ok := value.(json.Number)
12218				if !ok {
12219					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
12220				}
12221				f64, err := jtv.Float64()
12222				if err != nil {
12223					return err
12224				}
12225				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
12226			}
12227
12228		case "roleArn":
12229			if value != nil {
12230				jtv, ok := value.(string)
12231				if !ok {
12232					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
12233				}
12234				sv.RoleArn = ptr.String(jtv)
12235			}
12236
12237		default:
12238			_, _ = key, value
12239
12240		}
12241	}
12242	*v = sv
12243	return nil
12244}
12245
12246type awsRestjson1_deserializeOpDescribeProvisioningTemplate struct {
12247}
12248
12249func (*awsRestjson1_deserializeOpDescribeProvisioningTemplate) ID() string {
12250	return "OperationDeserializer"
12251}
12252
12253func (m *awsRestjson1_deserializeOpDescribeProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12254	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12255) {
12256	out, metadata, err = next.HandleDeserialize(ctx, in)
12257	if err != nil {
12258		return out, metadata, err
12259	}
12260
12261	response, ok := out.RawResponse.(*smithyhttp.Response)
12262	if !ok {
12263		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12264	}
12265
12266	if response.StatusCode < 200 || response.StatusCode >= 300 {
12267		return out, metadata, awsRestjson1_deserializeOpErrorDescribeProvisioningTemplate(response, &metadata)
12268	}
12269	output := &DescribeProvisioningTemplateOutput{}
12270	out.Result = output
12271
12272	var buff [1024]byte
12273	ringBuffer := smithyio.NewRingBuffer(buff[:])
12274
12275	body := io.TeeReader(response.Body, ringBuffer)
12276
12277	decoder := json.NewDecoder(body)
12278	decoder.UseNumber()
12279	var shape interface{}
12280	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12281		var snapshot bytes.Buffer
12282		io.Copy(&snapshot, ringBuffer)
12283		err = &smithy.DeserializationError{
12284			Err:      fmt.Errorf("failed to decode response body, %w", err),
12285			Snapshot: snapshot.Bytes(),
12286		}
12287		return out, metadata, err
12288	}
12289
12290	err = awsRestjson1_deserializeOpDocumentDescribeProvisioningTemplateOutput(&output, shape)
12291	if err != nil {
12292		var snapshot bytes.Buffer
12293		io.Copy(&snapshot, ringBuffer)
12294		return out, metadata, &smithy.DeserializationError{
12295			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12296			Snapshot: snapshot.Bytes(),
12297		}
12298	}
12299
12300	return out, metadata, err
12301}
12302
12303func awsRestjson1_deserializeOpErrorDescribeProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12304	var errorBuffer bytes.Buffer
12305	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12306		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12307	}
12308	errorBody := bytes.NewReader(errorBuffer.Bytes())
12309
12310	errorCode := "UnknownError"
12311	errorMessage := errorCode
12312
12313	code := response.Header.Get("X-Amzn-ErrorType")
12314	if len(code) != 0 {
12315		errorCode = restjson.SanitizeErrorCode(code)
12316	}
12317
12318	var buff [1024]byte
12319	ringBuffer := smithyio.NewRingBuffer(buff[:])
12320
12321	body := io.TeeReader(errorBody, ringBuffer)
12322	decoder := json.NewDecoder(body)
12323	decoder.UseNumber()
12324	code, message, err := restjson.GetErrorInfo(decoder)
12325	if err != nil {
12326		var snapshot bytes.Buffer
12327		io.Copy(&snapshot, ringBuffer)
12328		err = &smithy.DeserializationError{
12329			Err:      fmt.Errorf("failed to decode response body, %w", err),
12330			Snapshot: snapshot.Bytes(),
12331		}
12332		return err
12333	}
12334
12335	errorBody.Seek(0, io.SeekStart)
12336	if len(code) != 0 {
12337		errorCode = restjson.SanitizeErrorCode(code)
12338	}
12339	if len(message) != 0 {
12340		errorMessage = message
12341	}
12342
12343	switch {
12344	case strings.EqualFold("InternalFailureException", errorCode):
12345		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12346
12347	case strings.EqualFold("InvalidRequestException", errorCode):
12348		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
12349
12350	case strings.EqualFold("ResourceNotFoundException", errorCode):
12351		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12352
12353	case strings.EqualFold("ThrottlingException", errorCode):
12354		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12355
12356	case strings.EqualFold("UnauthorizedException", errorCode):
12357		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
12358
12359	default:
12360		genericError := &smithy.GenericAPIError{
12361			Code:    errorCode,
12362			Message: errorMessage,
12363		}
12364		return genericError
12365
12366	}
12367}
12368
12369func awsRestjson1_deserializeOpDocumentDescribeProvisioningTemplateOutput(v **DescribeProvisioningTemplateOutput, value interface{}) error {
12370	if v == nil {
12371		return fmt.Errorf("unexpected nil of type %T", v)
12372	}
12373	if value == nil {
12374		return nil
12375	}
12376
12377	shape, ok := value.(map[string]interface{})
12378	if !ok {
12379		return fmt.Errorf("unexpected JSON type %v", value)
12380	}
12381
12382	var sv *DescribeProvisioningTemplateOutput
12383	if *v == nil {
12384		sv = &DescribeProvisioningTemplateOutput{}
12385	} else {
12386		sv = *v
12387	}
12388
12389	for key, value := range shape {
12390		switch key {
12391		case "creationDate":
12392			if value != nil {
12393				jtv, ok := value.(json.Number)
12394				if !ok {
12395					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
12396				}
12397				f64, err := jtv.Float64()
12398				if err != nil {
12399					return err
12400				}
12401				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
12402			}
12403
12404		case "defaultVersionId":
12405			if value != nil {
12406				jtv, ok := value.(json.Number)
12407				if !ok {
12408					return fmt.Errorf("expected TemplateVersionId to be json.Number, got %T instead", value)
12409				}
12410				i64, err := jtv.Int64()
12411				if err != nil {
12412					return err
12413				}
12414				sv.DefaultVersionId = ptr.Int32(int32(i64))
12415			}
12416
12417		case "description":
12418			if value != nil {
12419				jtv, ok := value.(string)
12420				if !ok {
12421					return fmt.Errorf("expected TemplateDescription to be of type string, got %T instead", value)
12422				}
12423				sv.Description = ptr.String(jtv)
12424			}
12425
12426		case "enabled":
12427			if value != nil {
12428				jtv, ok := value.(bool)
12429				if !ok {
12430					return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
12431				}
12432				sv.Enabled = jtv
12433			}
12434
12435		case "lastModifiedDate":
12436			if value != nil {
12437				jtv, ok := value.(json.Number)
12438				if !ok {
12439					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
12440				}
12441				f64, err := jtv.Float64()
12442				if err != nil {
12443					return err
12444				}
12445				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
12446			}
12447
12448		case "preProvisioningHook":
12449			if err := awsRestjson1_deserializeDocumentProvisioningHook(&sv.PreProvisioningHook, value); err != nil {
12450				return err
12451			}
12452
12453		case "provisioningRoleArn":
12454			if value != nil {
12455				jtv, ok := value.(string)
12456				if !ok {
12457					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
12458				}
12459				sv.ProvisioningRoleArn = ptr.String(jtv)
12460			}
12461
12462		case "templateArn":
12463			if value != nil {
12464				jtv, ok := value.(string)
12465				if !ok {
12466					return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value)
12467				}
12468				sv.TemplateArn = ptr.String(jtv)
12469			}
12470
12471		case "templateBody":
12472			if value != nil {
12473				jtv, ok := value.(string)
12474				if !ok {
12475					return fmt.Errorf("expected TemplateBody to be of type string, got %T instead", value)
12476				}
12477				sv.TemplateBody = ptr.String(jtv)
12478			}
12479
12480		case "templateName":
12481			if value != nil {
12482				jtv, ok := value.(string)
12483				if !ok {
12484					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
12485				}
12486				sv.TemplateName = ptr.String(jtv)
12487			}
12488
12489		default:
12490			_, _ = key, value
12491
12492		}
12493	}
12494	*v = sv
12495	return nil
12496}
12497
12498type awsRestjson1_deserializeOpDescribeProvisioningTemplateVersion struct {
12499}
12500
12501func (*awsRestjson1_deserializeOpDescribeProvisioningTemplateVersion) ID() string {
12502	return "OperationDeserializer"
12503}
12504
12505func (m *awsRestjson1_deserializeOpDescribeProvisioningTemplateVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12506	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12507) {
12508	out, metadata, err = next.HandleDeserialize(ctx, in)
12509	if err != nil {
12510		return out, metadata, err
12511	}
12512
12513	response, ok := out.RawResponse.(*smithyhttp.Response)
12514	if !ok {
12515		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12516	}
12517
12518	if response.StatusCode < 200 || response.StatusCode >= 300 {
12519		return out, metadata, awsRestjson1_deserializeOpErrorDescribeProvisioningTemplateVersion(response, &metadata)
12520	}
12521	output := &DescribeProvisioningTemplateVersionOutput{}
12522	out.Result = output
12523
12524	var buff [1024]byte
12525	ringBuffer := smithyio.NewRingBuffer(buff[:])
12526
12527	body := io.TeeReader(response.Body, ringBuffer)
12528
12529	decoder := json.NewDecoder(body)
12530	decoder.UseNumber()
12531	var shape interface{}
12532	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12533		var snapshot bytes.Buffer
12534		io.Copy(&snapshot, ringBuffer)
12535		err = &smithy.DeserializationError{
12536			Err:      fmt.Errorf("failed to decode response body, %w", err),
12537			Snapshot: snapshot.Bytes(),
12538		}
12539		return out, metadata, err
12540	}
12541
12542	err = awsRestjson1_deserializeOpDocumentDescribeProvisioningTemplateVersionOutput(&output, shape)
12543	if err != nil {
12544		var snapshot bytes.Buffer
12545		io.Copy(&snapshot, ringBuffer)
12546		return out, metadata, &smithy.DeserializationError{
12547			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12548			Snapshot: snapshot.Bytes(),
12549		}
12550	}
12551
12552	return out, metadata, err
12553}
12554
12555func awsRestjson1_deserializeOpErrorDescribeProvisioningTemplateVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12556	var errorBuffer bytes.Buffer
12557	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12558		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12559	}
12560	errorBody := bytes.NewReader(errorBuffer.Bytes())
12561
12562	errorCode := "UnknownError"
12563	errorMessage := errorCode
12564
12565	code := response.Header.Get("X-Amzn-ErrorType")
12566	if len(code) != 0 {
12567		errorCode = restjson.SanitizeErrorCode(code)
12568	}
12569
12570	var buff [1024]byte
12571	ringBuffer := smithyio.NewRingBuffer(buff[:])
12572
12573	body := io.TeeReader(errorBody, ringBuffer)
12574	decoder := json.NewDecoder(body)
12575	decoder.UseNumber()
12576	code, message, err := restjson.GetErrorInfo(decoder)
12577	if err != nil {
12578		var snapshot bytes.Buffer
12579		io.Copy(&snapshot, ringBuffer)
12580		err = &smithy.DeserializationError{
12581			Err:      fmt.Errorf("failed to decode response body, %w", err),
12582			Snapshot: snapshot.Bytes(),
12583		}
12584		return err
12585	}
12586
12587	errorBody.Seek(0, io.SeekStart)
12588	if len(code) != 0 {
12589		errorCode = restjson.SanitizeErrorCode(code)
12590	}
12591	if len(message) != 0 {
12592		errorMessage = message
12593	}
12594
12595	switch {
12596	case strings.EqualFold("InternalFailureException", errorCode):
12597		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12598
12599	case strings.EqualFold("InvalidRequestException", errorCode):
12600		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
12601
12602	case strings.EqualFold("ResourceNotFoundException", errorCode):
12603		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12604
12605	case strings.EqualFold("ThrottlingException", errorCode):
12606		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12607
12608	case strings.EqualFold("UnauthorizedException", errorCode):
12609		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
12610
12611	default:
12612		genericError := &smithy.GenericAPIError{
12613			Code:    errorCode,
12614			Message: errorMessage,
12615		}
12616		return genericError
12617
12618	}
12619}
12620
12621func awsRestjson1_deserializeOpDocumentDescribeProvisioningTemplateVersionOutput(v **DescribeProvisioningTemplateVersionOutput, value interface{}) error {
12622	if v == nil {
12623		return fmt.Errorf("unexpected nil of type %T", v)
12624	}
12625	if value == nil {
12626		return nil
12627	}
12628
12629	shape, ok := value.(map[string]interface{})
12630	if !ok {
12631		return fmt.Errorf("unexpected JSON type %v", value)
12632	}
12633
12634	var sv *DescribeProvisioningTemplateVersionOutput
12635	if *v == nil {
12636		sv = &DescribeProvisioningTemplateVersionOutput{}
12637	} else {
12638		sv = *v
12639	}
12640
12641	for key, value := range shape {
12642		switch key {
12643		case "creationDate":
12644			if value != nil {
12645				jtv, ok := value.(json.Number)
12646				if !ok {
12647					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
12648				}
12649				f64, err := jtv.Float64()
12650				if err != nil {
12651					return err
12652				}
12653				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
12654			}
12655
12656		case "isDefaultVersion":
12657			if value != nil {
12658				jtv, ok := value.(bool)
12659				if !ok {
12660					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
12661				}
12662				sv.IsDefaultVersion = jtv
12663			}
12664
12665		case "templateBody":
12666			if value != nil {
12667				jtv, ok := value.(string)
12668				if !ok {
12669					return fmt.Errorf("expected TemplateBody to be of type string, got %T instead", value)
12670				}
12671				sv.TemplateBody = ptr.String(jtv)
12672			}
12673
12674		case "versionId":
12675			if value != nil {
12676				jtv, ok := value.(json.Number)
12677				if !ok {
12678					return fmt.Errorf("expected TemplateVersionId to be json.Number, got %T instead", value)
12679				}
12680				i64, err := jtv.Int64()
12681				if err != nil {
12682					return err
12683				}
12684				sv.VersionId = ptr.Int32(int32(i64))
12685			}
12686
12687		default:
12688			_, _ = key, value
12689
12690		}
12691	}
12692	*v = sv
12693	return nil
12694}
12695
12696type awsRestjson1_deserializeOpDescribeRoleAlias struct {
12697}
12698
12699func (*awsRestjson1_deserializeOpDescribeRoleAlias) ID() string {
12700	return "OperationDeserializer"
12701}
12702
12703func (m *awsRestjson1_deserializeOpDescribeRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12704	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12705) {
12706	out, metadata, err = next.HandleDeserialize(ctx, in)
12707	if err != nil {
12708		return out, metadata, err
12709	}
12710
12711	response, ok := out.RawResponse.(*smithyhttp.Response)
12712	if !ok {
12713		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12714	}
12715
12716	if response.StatusCode < 200 || response.StatusCode >= 300 {
12717		return out, metadata, awsRestjson1_deserializeOpErrorDescribeRoleAlias(response, &metadata)
12718	}
12719	output := &DescribeRoleAliasOutput{}
12720	out.Result = output
12721
12722	var buff [1024]byte
12723	ringBuffer := smithyio.NewRingBuffer(buff[:])
12724
12725	body := io.TeeReader(response.Body, ringBuffer)
12726
12727	decoder := json.NewDecoder(body)
12728	decoder.UseNumber()
12729	var shape interface{}
12730	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12731		var snapshot bytes.Buffer
12732		io.Copy(&snapshot, ringBuffer)
12733		err = &smithy.DeserializationError{
12734			Err:      fmt.Errorf("failed to decode response body, %w", err),
12735			Snapshot: snapshot.Bytes(),
12736		}
12737		return out, metadata, err
12738	}
12739
12740	err = awsRestjson1_deserializeOpDocumentDescribeRoleAliasOutput(&output, shape)
12741	if err != nil {
12742		var snapshot bytes.Buffer
12743		io.Copy(&snapshot, ringBuffer)
12744		return out, metadata, &smithy.DeserializationError{
12745			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12746			Snapshot: snapshot.Bytes(),
12747		}
12748	}
12749
12750	return out, metadata, err
12751}
12752
12753func awsRestjson1_deserializeOpErrorDescribeRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12754	var errorBuffer bytes.Buffer
12755	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12756		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12757	}
12758	errorBody := bytes.NewReader(errorBuffer.Bytes())
12759
12760	errorCode := "UnknownError"
12761	errorMessage := errorCode
12762
12763	code := response.Header.Get("X-Amzn-ErrorType")
12764	if len(code) != 0 {
12765		errorCode = restjson.SanitizeErrorCode(code)
12766	}
12767
12768	var buff [1024]byte
12769	ringBuffer := smithyio.NewRingBuffer(buff[:])
12770
12771	body := io.TeeReader(errorBody, ringBuffer)
12772	decoder := json.NewDecoder(body)
12773	decoder.UseNumber()
12774	code, message, err := restjson.GetErrorInfo(decoder)
12775	if err != nil {
12776		var snapshot bytes.Buffer
12777		io.Copy(&snapshot, ringBuffer)
12778		err = &smithy.DeserializationError{
12779			Err:      fmt.Errorf("failed to decode response body, %w", err),
12780			Snapshot: snapshot.Bytes(),
12781		}
12782		return err
12783	}
12784
12785	errorBody.Seek(0, io.SeekStart)
12786	if len(code) != 0 {
12787		errorCode = restjson.SanitizeErrorCode(code)
12788	}
12789	if len(message) != 0 {
12790		errorMessage = message
12791	}
12792
12793	switch {
12794	case strings.EqualFold("InternalFailureException", errorCode):
12795		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12796
12797	case strings.EqualFold("InvalidRequestException", errorCode):
12798		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
12799
12800	case strings.EqualFold("ResourceNotFoundException", errorCode):
12801		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12802
12803	case strings.EqualFold("ServiceUnavailableException", errorCode):
12804		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
12805
12806	case strings.EqualFold("ThrottlingException", errorCode):
12807		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12808
12809	case strings.EqualFold("UnauthorizedException", errorCode):
12810		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
12811
12812	default:
12813		genericError := &smithy.GenericAPIError{
12814			Code:    errorCode,
12815			Message: errorMessage,
12816		}
12817		return genericError
12818
12819	}
12820}
12821
12822func awsRestjson1_deserializeOpDocumentDescribeRoleAliasOutput(v **DescribeRoleAliasOutput, value interface{}) error {
12823	if v == nil {
12824		return fmt.Errorf("unexpected nil of type %T", v)
12825	}
12826	if value == nil {
12827		return nil
12828	}
12829
12830	shape, ok := value.(map[string]interface{})
12831	if !ok {
12832		return fmt.Errorf("unexpected JSON type %v", value)
12833	}
12834
12835	var sv *DescribeRoleAliasOutput
12836	if *v == nil {
12837		sv = &DescribeRoleAliasOutput{}
12838	} else {
12839		sv = *v
12840	}
12841
12842	for key, value := range shape {
12843		switch key {
12844		case "roleAliasDescription":
12845			if err := awsRestjson1_deserializeDocumentRoleAliasDescription(&sv.RoleAliasDescription, value); err != nil {
12846				return err
12847			}
12848
12849		default:
12850			_, _ = key, value
12851
12852		}
12853	}
12854	*v = sv
12855	return nil
12856}
12857
12858type awsRestjson1_deserializeOpDescribeScheduledAudit struct {
12859}
12860
12861func (*awsRestjson1_deserializeOpDescribeScheduledAudit) ID() string {
12862	return "OperationDeserializer"
12863}
12864
12865func (m *awsRestjson1_deserializeOpDescribeScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12866	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12867) {
12868	out, metadata, err = next.HandleDeserialize(ctx, in)
12869	if err != nil {
12870		return out, metadata, err
12871	}
12872
12873	response, ok := out.RawResponse.(*smithyhttp.Response)
12874	if !ok {
12875		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12876	}
12877
12878	if response.StatusCode < 200 || response.StatusCode >= 300 {
12879		return out, metadata, awsRestjson1_deserializeOpErrorDescribeScheduledAudit(response, &metadata)
12880	}
12881	output := &DescribeScheduledAuditOutput{}
12882	out.Result = output
12883
12884	var buff [1024]byte
12885	ringBuffer := smithyio.NewRingBuffer(buff[:])
12886
12887	body := io.TeeReader(response.Body, ringBuffer)
12888
12889	decoder := json.NewDecoder(body)
12890	decoder.UseNumber()
12891	var shape interface{}
12892	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12893		var snapshot bytes.Buffer
12894		io.Copy(&snapshot, ringBuffer)
12895		err = &smithy.DeserializationError{
12896			Err:      fmt.Errorf("failed to decode response body, %w", err),
12897			Snapshot: snapshot.Bytes(),
12898		}
12899		return out, metadata, err
12900	}
12901
12902	err = awsRestjson1_deserializeOpDocumentDescribeScheduledAuditOutput(&output, shape)
12903	if err != nil {
12904		var snapshot bytes.Buffer
12905		io.Copy(&snapshot, ringBuffer)
12906		return out, metadata, &smithy.DeserializationError{
12907			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12908			Snapshot: snapshot.Bytes(),
12909		}
12910	}
12911
12912	return out, metadata, err
12913}
12914
12915func awsRestjson1_deserializeOpErrorDescribeScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12916	var errorBuffer bytes.Buffer
12917	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12918		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12919	}
12920	errorBody := bytes.NewReader(errorBuffer.Bytes())
12921
12922	errorCode := "UnknownError"
12923	errorMessage := errorCode
12924
12925	code := response.Header.Get("X-Amzn-ErrorType")
12926	if len(code) != 0 {
12927		errorCode = restjson.SanitizeErrorCode(code)
12928	}
12929
12930	var buff [1024]byte
12931	ringBuffer := smithyio.NewRingBuffer(buff[:])
12932
12933	body := io.TeeReader(errorBody, ringBuffer)
12934	decoder := json.NewDecoder(body)
12935	decoder.UseNumber()
12936	code, message, err := restjson.GetErrorInfo(decoder)
12937	if err != nil {
12938		var snapshot bytes.Buffer
12939		io.Copy(&snapshot, ringBuffer)
12940		err = &smithy.DeserializationError{
12941			Err:      fmt.Errorf("failed to decode response body, %w", err),
12942			Snapshot: snapshot.Bytes(),
12943		}
12944		return err
12945	}
12946
12947	errorBody.Seek(0, io.SeekStart)
12948	if len(code) != 0 {
12949		errorCode = restjson.SanitizeErrorCode(code)
12950	}
12951	if len(message) != 0 {
12952		errorMessage = message
12953	}
12954
12955	switch {
12956	case strings.EqualFold("InternalFailureException", errorCode):
12957		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12958
12959	case strings.EqualFold("InvalidRequestException", errorCode):
12960		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
12961
12962	case strings.EqualFold("ResourceNotFoundException", errorCode):
12963		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12964
12965	case strings.EqualFold("ThrottlingException", errorCode):
12966		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12967
12968	default:
12969		genericError := &smithy.GenericAPIError{
12970			Code:    errorCode,
12971			Message: errorMessage,
12972		}
12973		return genericError
12974
12975	}
12976}
12977
12978func awsRestjson1_deserializeOpDocumentDescribeScheduledAuditOutput(v **DescribeScheduledAuditOutput, value interface{}) error {
12979	if v == nil {
12980		return fmt.Errorf("unexpected nil of type %T", v)
12981	}
12982	if value == nil {
12983		return nil
12984	}
12985
12986	shape, ok := value.(map[string]interface{})
12987	if !ok {
12988		return fmt.Errorf("unexpected JSON type %v", value)
12989	}
12990
12991	var sv *DescribeScheduledAuditOutput
12992	if *v == nil {
12993		sv = &DescribeScheduledAuditOutput{}
12994	} else {
12995		sv = *v
12996	}
12997
12998	for key, value := range shape {
12999		switch key {
13000		case "dayOfMonth":
13001			if value != nil {
13002				jtv, ok := value.(string)
13003				if !ok {
13004					return fmt.Errorf("expected DayOfMonth to be of type string, got %T instead", value)
13005				}
13006				sv.DayOfMonth = ptr.String(jtv)
13007			}
13008
13009		case "dayOfWeek":
13010			if value != nil {
13011				jtv, ok := value.(string)
13012				if !ok {
13013					return fmt.Errorf("expected DayOfWeek to be of type string, got %T instead", value)
13014				}
13015				sv.DayOfWeek = types.DayOfWeek(jtv)
13016			}
13017
13018		case "frequency":
13019			if value != nil {
13020				jtv, ok := value.(string)
13021				if !ok {
13022					return fmt.Errorf("expected AuditFrequency to be of type string, got %T instead", value)
13023				}
13024				sv.Frequency = types.AuditFrequency(jtv)
13025			}
13026
13027		case "scheduledAuditArn":
13028			if value != nil {
13029				jtv, ok := value.(string)
13030				if !ok {
13031					return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value)
13032				}
13033				sv.ScheduledAuditArn = ptr.String(jtv)
13034			}
13035
13036		case "scheduledAuditName":
13037			if value != nil {
13038				jtv, ok := value.(string)
13039				if !ok {
13040					return fmt.Errorf("expected ScheduledAuditName to be of type string, got %T instead", value)
13041				}
13042				sv.ScheduledAuditName = ptr.String(jtv)
13043			}
13044
13045		case "targetCheckNames":
13046			if err := awsRestjson1_deserializeDocumentTargetAuditCheckNames(&sv.TargetCheckNames, value); err != nil {
13047				return err
13048			}
13049
13050		default:
13051			_, _ = key, value
13052
13053		}
13054	}
13055	*v = sv
13056	return nil
13057}
13058
13059type awsRestjson1_deserializeOpDescribeSecurityProfile struct {
13060}
13061
13062func (*awsRestjson1_deserializeOpDescribeSecurityProfile) ID() string {
13063	return "OperationDeserializer"
13064}
13065
13066func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13067	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13068) {
13069	out, metadata, err = next.HandleDeserialize(ctx, in)
13070	if err != nil {
13071		return out, metadata, err
13072	}
13073
13074	response, ok := out.RawResponse.(*smithyhttp.Response)
13075	if !ok {
13076		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13077	}
13078
13079	if response.StatusCode < 200 || response.StatusCode >= 300 {
13080		return out, metadata, awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response, &metadata)
13081	}
13082	output := &DescribeSecurityProfileOutput{}
13083	out.Result = output
13084
13085	var buff [1024]byte
13086	ringBuffer := smithyio.NewRingBuffer(buff[:])
13087
13088	body := io.TeeReader(response.Body, ringBuffer)
13089
13090	decoder := json.NewDecoder(body)
13091	decoder.UseNumber()
13092	var shape interface{}
13093	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13094		var snapshot bytes.Buffer
13095		io.Copy(&snapshot, ringBuffer)
13096		err = &smithy.DeserializationError{
13097			Err:      fmt.Errorf("failed to decode response body, %w", err),
13098			Snapshot: snapshot.Bytes(),
13099		}
13100		return out, metadata, err
13101	}
13102
13103	err = awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(&output, shape)
13104	if err != nil {
13105		var snapshot bytes.Buffer
13106		io.Copy(&snapshot, ringBuffer)
13107		return out, metadata, &smithy.DeserializationError{
13108			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13109			Snapshot: snapshot.Bytes(),
13110		}
13111	}
13112
13113	return out, metadata, err
13114}
13115
13116func awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13117	var errorBuffer bytes.Buffer
13118	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13119		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13120	}
13121	errorBody := bytes.NewReader(errorBuffer.Bytes())
13122
13123	errorCode := "UnknownError"
13124	errorMessage := errorCode
13125
13126	code := response.Header.Get("X-Amzn-ErrorType")
13127	if len(code) != 0 {
13128		errorCode = restjson.SanitizeErrorCode(code)
13129	}
13130
13131	var buff [1024]byte
13132	ringBuffer := smithyio.NewRingBuffer(buff[:])
13133
13134	body := io.TeeReader(errorBody, ringBuffer)
13135	decoder := json.NewDecoder(body)
13136	decoder.UseNumber()
13137	code, message, err := restjson.GetErrorInfo(decoder)
13138	if err != nil {
13139		var snapshot bytes.Buffer
13140		io.Copy(&snapshot, ringBuffer)
13141		err = &smithy.DeserializationError{
13142			Err:      fmt.Errorf("failed to decode response body, %w", err),
13143			Snapshot: snapshot.Bytes(),
13144		}
13145		return err
13146	}
13147
13148	errorBody.Seek(0, io.SeekStart)
13149	if len(code) != 0 {
13150		errorCode = restjson.SanitizeErrorCode(code)
13151	}
13152	if len(message) != 0 {
13153		errorMessage = message
13154	}
13155
13156	switch {
13157	case strings.EqualFold("InternalFailureException", errorCode):
13158		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13159
13160	case strings.EqualFold("InvalidRequestException", errorCode):
13161		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
13162
13163	case strings.EqualFold("ResourceNotFoundException", errorCode):
13164		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13165
13166	case strings.EqualFold("ThrottlingException", errorCode):
13167		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13168
13169	default:
13170		genericError := &smithy.GenericAPIError{
13171			Code:    errorCode,
13172			Message: errorMessage,
13173		}
13174		return genericError
13175
13176	}
13177}
13178
13179func awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(v **DescribeSecurityProfileOutput, value interface{}) error {
13180	if v == nil {
13181		return fmt.Errorf("unexpected nil of type %T", v)
13182	}
13183	if value == nil {
13184		return nil
13185	}
13186
13187	shape, ok := value.(map[string]interface{})
13188	if !ok {
13189		return fmt.Errorf("unexpected JSON type %v", value)
13190	}
13191
13192	var sv *DescribeSecurityProfileOutput
13193	if *v == nil {
13194		sv = &DescribeSecurityProfileOutput{}
13195	} else {
13196		sv = *v
13197	}
13198
13199	for key, value := range shape {
13200		switch key {
13201		case "additionalMetricsToRetain":
13202			if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainList(&sv.AdditionalMetricsToRetain, value); err != nil {
13203				return err
13204			}
13205
13206		case "additionalMetricsToRetainV2":
13207			if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainV2List(&sv.AdditionalMetricsToRetainV2, value); err != nil {
13208				return err
13209			}
13210
13211		case "alertTargets":
13212			if err := awsRestjson1_deserializeDocumentAlertTargets(&sv.AlertTargets, value); err != nil {
13213				return err
13214			}
13215
13216		case "behaviors":
13217			if err := awsRestjson1_deserializeDocumentBehaviors(&sv.Behaviors, value); err != nil {
13218				return err
13219			}
13220
13221		case "creationDate":
13222			if value != nil {
13223				jtv, ok := value.(json.Number)
13224				if !ok {
13225					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
13226				}
13227				f64, err := jtv.Float64()
13228				if err != nil {
13229					return err
13230				}
13231				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
13232			}
13233
13234		case "lastModifiedDate":
13235			if value != nil {
13236				jtv, ok := value.(json.Number)
13237				if !ok {
13238					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
13239				}
13240				f64, err := jtv.Float64()
13241				if err != nil {
13242					return err
13243				}
13244				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
13245			}
13246
13247		case "securityProfileArn":
13248			if value != nil {
13249				jtv, ok := value.(string)
13250				if !ok {
13251					return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value)
13252				}
13253				sv.SecurityProfileArn = ptr.String(jtv)
13254			}
13255
13256		case "securityProfileDescription":
13257			if value != nil {
13258				jtv, ok := value.(string)
13259				if !ok {
13260					return fmt.Errorf("expected SecurityProfileDescription to be of type string, got %T instead", value)
13261				}
13262				sv.SecurityProfileDescription = ptr.String(jtv)
13263			}
13264
13265		case "securityProfileName":
13266			if value != nil {
13267				jtv, ok := value.(string)
13268				if !ok {
13269					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
13270				}
13271				sv.SecurityProfileName = ptr.String(jtv)
13272			}
13273
13274		case "version":
13275			if value != nil {
13276				jtv, ok := value.(json.Number)
13277				if !ok {
13278					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
13279				}
13280				i64, err := jtv.Int64()
13281				if err != nil {
13282					return err
13283				}
13284				sv.Version = i64
13285			}
13286
13287		default:
13288			_, _ = key, value
13289
13290		}
13291	}
13292	*v = sv
13293	return nil
13294}
13295
13296type awsRestjson1_deserializeOpDescribeStream struct {
13297}
13298
13299func (*awsRestjson1_deserializeOpDescribeStream) ID() string {
13300	return "OperationDeserializer"
13301}
13302
13303func (m *awsRestjson1_deserializeOpDescribeStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13304	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13305) {
13306	out, metadata, err = next.HandleDeserialize(ctx, in)
13307	if err != nil {
13308		return out, metadata, err
13309	}
13310
13311	response, ok := out.RawResponse.(*smithyhttp.Response)
13312	if !ok {
13313		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13314	}
13315
13316	if response.StatusCode < 200 || response.StatusCode >= 300 {
13317		return out, metadata, awsRestjson1_deserializeOpErrorDescribeStream(response, &metadata)
13318	}
13319	output := &DescribeStreamOutput{}
13320	out.Result = output
13321
13322	var buff [1024]byte
13323	ringBuffer := smithyio.NewRingBuffer(buff[:])
13324
13325	body := io.TeeReader(response.Body, ringBuffer)
13326
13327	decoder := json.NewDecoder(body)
13328	decoder.UseNumber()
13329	var shape interface{}
13330	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13331		var snapshot bytes.Buffer
13332		io.Copy(&snapshot, ringBuffer)
13333		err = &smithy.DeserializationError{
13334			Err:      fmt.Errorf("failed to decode response body, %w", err),
13335			Snapshot: snapshot.Bytes(),
13336		}
13337		return out, metadata, err
13338	}
13339
13340	err = awsRestjson1_deserializeOpDocumentDescribeStreamOutput(&output, shape)
13341	if err != nil {
13342		var snapshot bytes.Buffer
13343		io.Copy(&snapshot, ringBuffer)
13344		return out, metadata, &smithy.DeserializationError{
13345			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13346			Snapshot: snapshot.Bytes(),
13347		}
13348	}
13349
13350	return out, metadata, err
13351}
13352
13353func awsRestjson1_deserializeOpErrorDescribeStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13354	var errorBuffer bytes.Buffer
13355	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13356		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13357	}
13358	errorBody := bytes.NewReader(errorBuffer.Bytes())
13359
13360	errorCode := "UnknownError"
13361	errorMessage := errorCode
13362
13363	code := response.Header.Get("X-Amzn-ErrorType")
13364	if len(code) != 0 {
13365		errorCode = restjson.SanitizeErrorCode(code)
13366	}
13367
13368	var buff [1024]byte
13369	ringBuffer := smithyio.NewRingBuffer(buff[:])
13370
13371	body := io.TeeReader(errorBody, ringBuffer)
13372	decoder := json.NewDecoder(body)
13373	decoder.UseNumber()
13374	code, message, err := restjson.GetErrorInfo(decoder)
13375	if err != nil {
13376		var snapshot bytes.Buffer
13377		io.Copy(&snapshot, ringBuffer)
13378		err = &smithy.DeserializationError{
13379			Err:      fmt.Errorf("failed to decode response body, %w", err),
13380			Snapshot: snapshot.Bytes(),
13381		}
13382		return err
13383	}
13384
13385	errorBody.Seek(0, io.SeekStart)
13386	if len(code) != 0 {
13387		errorCode = restjson.SanitizeErrorCode(code)
13388	}
13389	if len(message) != 0 {
13390		errorMessage = message
13391	}
13392
13393	switch {
13394	case strings.EqualFold("InternalFailureException", errorCode):
13395		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13396
13397	case strings.EqualFold("InvalidRequestException", errorCode):
13398		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
13399
13400	case strings.EqualFold("ResourceNotFoundException", errorCode):
13401		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13402
13403	case strings.EqualFold("ServiceUnavailableException", errorCode):
13404		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
13405
13406	case strings.EqualFold("ThrottlingException", errorCode):
13407		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13408
13409	case strings.EqualFold("UnauthorizedException", errorCode):
13410		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
13411
13412	default:
13413		genericError := &smithy.GenericAPIError{
13414			Code:    errorCode,
13415			Message: errorMessage,
13416		}
13417		return genericError
13418
13419	}
13420}
13421
13422func awsRestjson1_deserializeOpDocumentDescribeStreamOutput(v **DescribeStreamOutput, value interface{}) error {
13423	if v == nil {
13424		return fmt.Errorf("unexpected nil of type %T", v)
13425	}
13426	if value == nil {
13427		return nil
13428	}
13429
13430	shape, ok := value.(map[string]interface{})
13431	if !ok {
13432		return fmt.Errorf("unexpected JSON type %v", value)
13433	}
13434
13435	var sv *DescribeStreamOutput
13436	if *v == nil {
13437		sv = &DescribeStreamOutput{}
13438	} else {
13439		sv = *v
13440	}
13441
13442	for key, value := range shape {
13443		switch key {
13444		case "streamInfo":
13445			if err := awsRestjson1_deserializeDocumentStreamInfo(&sv.StreamInfo, value); err != nil {
13446				return err
13447			}
13448
13449		default:
13450			_, _ = key, value
13451
13452		}
13453	}
13454	*v = sv
13455	return nil
13456}
13457
13458type awsRestjson1_deserializeOpDescribeThing struct {
13459}
13460
13461func (*awsRestjson1_deserializeOpDescribeThing) ID() string {
13462	return "OperationDeserializer"
13463}
13464
13465func (m *awsRestjson1_deserializeOpDescribeThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13466	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13467) {
13468	out, metadata, err = next.HandleDeserialize(ctx, in)
13469	if err != nil {
13470		return out, metadata, err
13471	}
13472
13473	response, ok := out.RawResponse.(*smithyhttp.Response)
13474	if !ok {
13475		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13476	}
13477
13478	if response.StatusCode < 200 || response.StatusCode >= 300 {
13479		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThing(response, &metadata)
13480	}
13481	output := &DescribeThingOutput{}
13482	out.Result = output
13483
13484	var buff [1024]byte
13485	ringBuffer := smithyio.NewRingBuffer(buff[:])
13486
13487	body := io.TeeReader(response.Body, ringBuffer)
13488
13489	decoder := json.NewDecoder(body)
13490	decoder.UseNumber()
13491	var shape interface{}
13492	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13493		var snapshot bytes.Buffer
13494		io.Copy(&snapshot, ringBuffer)
13495		err = &smithy.DeserializationError{
13496			Err:      fmt.Errorf("failed to decode response body, %w", err),
13497			Snapshot: snapshot.Bytes(),
13498		}
13499		return out, metadata, err
13500	}
13501
13502	err = awsRestjson1_deserializeOpDocumentDescribeThingOutput(&output, shape)
13503	if err != nil {
13504		var snapshot bytes.Buffer
13505		io.Copy(&snapshot, ringBuffer)
13506		return out, metadata, &smithy.DeserializationError{
13507			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13508			Snapshot: snapshot.Bytes(),
13509		}
13510	}
13511
13512	return out, metadata, err
13513}
13514
13515func awsRestjson1_deserializeOpErrorDescribeThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13516	var errorBuffer bytes.Buffer
13517	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13518		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13519	}
13520	errorBody := bytes.NewReader(errorBuffer.Bytes())
13521
13522	errorCode := "UnknownError"
13523	errorMessage := errorCode
13524
13525	code := response.Header.Get("X-Amzn-ErrorType")
13526	if len(code) != 0 {
13527		errorCode = restjson.SanitizeErrorCode(code)
13528	}
13529
13530	var buff [1024]byte
13531	ringBuffer := smithyio.NewRingBuffer(buff[:])
13532
13533	body := io.TeeReader(errorBody, ringBuffer)
13534	decoder := json.NewDecoder(body)
13535	decoder.UseNumber()
13536	code, message, err := restjson.GetErrorInfo(decoder)
13537	if err != nil {
13538		var snapshot bytes.Buffer
13539		io.Copy(&snapshot, ringBuffer)
13540		err = &smithy.DeserializationError{
13541			Err:      fmt.Errorf("failed to decode response body, %w", err),
13542			Snapshot: snapshot.Bytes(),
13543		}
13544		return err
13545	}
13546
13547	errorBody.Seek(0, io.SeekStart)
13548	if len(code) != 0 {
13549		errorCode = restjson.SanitizeErrorCode(code)
13550	}
13551	if len(message) != 0 {
13552		errorMessage = message
13553	}
13554
13555	switch {
13556	case strings.EqualFold("InternalFailureException", errorCode):
13557		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13558
13559	case strings.EqualFold("InvalidRequestException", errorCode):
13560		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
13561
13562	case strings.EqualFold("ResourceNotFoundException", errorCode):
13563		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13564
13565	case strings.EqualFold("ServiceUnavailableException", errorCode):
13566		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
13567
13568	case strings.EqualFold("ThrottlingException", errorCode):
13569		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13570
13571	case strings.EqualFold("UnauthorizedException", errorCode):
13572		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
13573
13574	default:
13575		genericError := &smithy.GenericAPIError{
13576			Code:    errorCode,
13577			Message: errorMessage,
13578		}
13579		return genericError
13580
13581	}
13582}
13583
13584func awsRestjson1_deserializeOpDocumentDescribeThingOutput(v **DescribeThingOutput, value interface{}) error {
13585	if v == nil {
13586		return fmt.Errorf("unexpected nil of type %T", v)
13587	}
13588	if value == nil {
13589		return nil
13590	}
13591
13592	shape, ok := value.(map[string]interface{})
13593	if !ok {
13594		return fmt.Errorf("unexpected JSON type %v", value)
13595	}
13596
13597	var sv *DescribeThingOutput
13598	if *v == nil {
13599		sv = &DescribeThingOutput{}
13600	} else {
13601		sv = *v
13602	}
13603
13604	for key, value := range shape {
13605		switch key {
13606		case "attributes":
13607			if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil {
13608				return err
13609			}
13610
13611		case "billingGroupName":
13612			if value != nil {
13613				jtv, ok := value.(string)
13614				if !ok {
13615					return fmt.Errorf("expected BillingGroupName to be of type string, got %T instead", value)
13616				}
13617				sv.BillingGroupName = ptr.String(jtv)
13618			}
13619
13620		case "defaultClientId":
13621			if value != nil {
13622				jtv, ok := value.(string)
13623				if !ok {
13624					return fmt.Errorf("expected ClientId to be of type string, got %T instead", value)
13625				}
13626				sv.DefaultClientId = ptr.String(jtv)
13627			}
13628
13629		case "thingArn":
13630			if value != nil {
13631				jtv, ok := value.(string)
13632				if !ok {
13633					return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
13634				}
13635				sv.ThingArn = ptr.String(jtv)
13636			}
13637
13638		case "thingId":
13639			if value != nil {
13640				jtv, ok := value.(string)
13641				if !ok {
13642					return fmt.Errorf("expected ThingId to be of type string, got %T instead", value)
13643				}
13644				sv.ThingId = ptr.String(jtv)
13645			}
13646
13647		case "thingName":
13648			if value != nil {
13649				jtv, ok := value.(string)
13650				if !ok {
13651					return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
13652				}
13653				sv.ThingName = ptr.String(jtv)
13654			}
13655
13656		case "thingTypeName":
13657			if value != nil {
13658				jtv, ok := value.(string)
13659				if !ok {
13660					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
13661				}
13662				sv.ThingTypeName = ptr.String(jtv)
13663			}
13664
13665		case "version":
13666			if value != nil {
13667				jtv, ok := value.(json.Number)
13668				if !ok {
13669					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
13670				}
13671				i64, err := jtv.Int64()
13672				if err != nil {
13673					return err
13674				}
13675				sv.Version = i64
13676			}
13677
13678		default:
13679			_, _ = key, value
13680
13681		}
13682	}
13683	*v = sv
13684	return nil
13685}
13686
13687type awsRestjson1_deserializeOpDescribeThingGroup struct {
13688}
13689
13690func (*awsRestjson1_deserializeOpDescribeThingGroup) ID() string {
13691	return "OperationDeserializer"
13692}
13693
13694func (m *awsRestjson1_deserializeOpDescribeThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13695	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13696) {
13697	out, metadata, err = next.HandleDeserialize(ctx, in)
13698	if err != nil {
13699		return out, metadata, err
13700	}
13701
13702	response, ok := out.RawResponse.(*smithyhttp.Response)
13703	if !ok {
13704		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13705	}
13706
13707	if response.StatusCode < 200 || response.StatusCode >= 300 {
13708		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThingGroup(response, &metadata)
13709	}
13710	output := &DescribeThingGroupOutput{}
13711	out.Result = output
13712
13713	var buff [1024]byte
13714	ringBuffer := smithyio.NewRingBuffer(buff[:])
13715
13716	body := io.TeeReader(response.Body, ringBuffer)
13717
13718	decoder := json.NewDecoder(body)
13719	decoder.UseNumber()
13720	var shape interface{}
13721	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13722		var snapshot bytes.Buffer
13723		io.Copy(&snapshot, ringBuffer)
13724		err = &smithy.DeserializationError{
13725			Err:      fmt.Errorf("failed to decode response body, %w", err),
13726			Snapshot: snapshot.Bytes(),
13727		}
13728		return out, metadata, err
13729	}
13730
13731	err = awsRestjson1_deserializeOpDocumentDescribeThingGroupOutput(&output, shape)
13732	if err != nil {
13733		var snapshot bytes.Buffer
13734		io.Copy(&snapshot, ringBuffer)
13735		return out, metadata, &smithy.DeserializationError{
13736			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13737			Snapshot: snapshot.Bytes(),
13738		}
13739	}
13740
13741	return out, metadata, err
13742}
13743
13744func awsRestjson1_deserializeOpErrorDescribeThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13745	var errorBuffer bytes.Buffer
13746	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13747		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13748	}
13749	errorBody := bytes.NewReader(errorBuffer.Bytes())
13750
13751	errorCode := "UnknownError"
13752	errorMessage := errorCode
13753
13754	code := response.Header.Get("X-Amzn-ErrorType")
13755	if len(code) != 0 {
13756		errorCode = restjson.SanitizeErrorCode(code)
13757	}
13758
13759	var buff [1024]byte
13760	ringBuffer := smithyio.NewRingBuffer(buff[:])
13761
13762	body := io.TeeReader(errorBody, ringBuffer)
13763	decoder := json.NewDecoder(body)
13764	decoder.UseNumber()
13765	code, message, err := restjson.GetErrorInfo(decoder)
13766	if err != nil {
13767		var snapshot bytes.Buffer
13768		io.Copy(&snapshot, ringBuffer)
13769		err = &smithy.DeserializationError{
13770			Err:      fmt.Errorf("failed to decode response body, %w", err),
13771			Snapshot: snapshot.Bytes(),
13772		}
13773		return err
13774	}
13775
13776	errorBody.Seek(0, io.SeekStart)
13777	if len(code) != 0 {
13778		errorCode = restjson.SanitizeErrorCode(code)
13779	}
13780	if len(message) != 0 {
13781		errorMessage = message
13782	}
13783
13784	switch {
13785	case strings.EqualFold("InternalFailureException", errorCode):
13786		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13787
13788	case strings.EqualFold("InvalidRequestException", errorCode):
13789		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
13790
13791	case strings.EqualFold("ResourceNotFoundException", errorCode):
13792		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13793
13794	case strings.EqualFold("ThrottlingException", errorCode):
13795		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13796
13797	default:
13798		genericError := &smithy.GenericAPIError{
13799			Code:    errorCode,
13800			Message: errorMessage,
13801		}
13802		return genericError
13803
13804	}
13805}
13806
13807func awsRestjson1_deserializeOpDocumentDescribeThingGroupOutput(v **DescribeThingGroupOutput, value interface{}) error {
13808	if v == nil {
13809		return fmt.Errorf("unexpected nil of type %T", v)
13810	}
13811	if value == nil {
13812		return nil
13813	}
13814
13815	shape, ok := value.(map[string]interface{})
13816	if !ok {
13817		return fmt.Errorf("unexpected JSON type %v", value)
13818	}
13819
13820	var sv *DescribeThingGroupOutput
13821	if *v == nil {
13822		sv = &DescribeThingGroupOutput{}
13823	} else {
13824		sv = *v
13825	}
13826
13827	for key, value := range shape {
13828		switch key {
13829		case "indexName":
13830			if value != nil {
13831				jtv, ok := value.(string)
13832				if !ok {
13833					return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
13834				}
13835				sv.IndexName = ptr.String(jtv)
13836			}
13837
13838		case "queryString":
13839			if value != nil {
13840				jtv, ok := value.(string)
13841				if !ok {
13842					return fmt.Errorf("expected QueryString to be of type string, got %T instead", value)
13843				}
13844				sv.QueryString = ptr.String(jtv)
13845			}
13846
13847		case "queryVersion":
13848			if value != nil {
13849				jtv, ok := value.(string)
13850				if !ok {
13851					return fmt.Errorf("expected QueryVersion to be of type string, got %T instead", value)
13852				}
13853				sv.QueryVersion = ptr.String(jtv)
13854			}
13855
13856		case "status":
13857			if value != nil {
13858				jtv, ok := value.(string)
13859				if !ok {
13860					return fmt.Errorf("expected DynamicGroupStatus to be of type string, got %T instead", value)
13861				}
13862				sv.Status = types.DynamicGroupStatus(jtv)
13863			}
13864
13865		case "thingGroupArn":
13866			if value != nil {
13867				jtv, ok := value.(string)
13868				if !ok {
13869					return fmt.Errorf("expected ThingGroupArn to be of type string, got %T instead", value)
13870				}
13871				sv.ThingGroupArn = ptr.String(jtv)
13872			}
13873
13874		case "thingGroupId":
13875			if value != nil {
13876				jtv, ok := value.(string)
13877				if !ok {
13878					return fmt.Errorf("expected ThingGroupId to be of type string, got %T instead", value)
13879				}
13880				sv.ThingGroupId = ptr.String(jtv)
13881			}
13882
13883		case "thingGroupMetadata":
13884			if err := awsRestjson1_deserializeDocumentThingGroupMetadata(&sv.ThingGroupMetadata, value); err != nil {
13885				return err
13886			}
13887
13888		case "thingGroupName":
13889			if value != nil {
13890				jtv, ok := value.(string)
13891				if !ok {
13892					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
13893				}
13894				sv.ThingGroupName = ptr.String(jtv)
13895			}
13896
13897		case "thingGroupProperties":
13898			if err := awsRestjson1_deserializeDocumentThingGroupProperties(&sv.ThingGroupProperties, value); err != nil {
13899				return err
13900			}
13901
13902		case "version":
13903			if value != nil {
13904				jtv, ok := value.(json.Number)
13905				if !ok {
13906					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
13907				}
13908				i64, err := jtv.Int64()
13909				if err != nil {
13910					return err
13911				}
13912				sv.Version = i64
13913			}
13914
13915		default:
13916			_, _ = key, value
13917
13918		}
13919	}
13920	*v = sv
13921	return nil
13922}
13923
13924type awsRestjson1_deserializeOpDescribeThingRegistrationTask struct {
13925}
13926
13927func (*awsRestjson1_deserializeOpDescribeThingRegistrationTask) ID() string {
13928	return "OperationDeserializer"
13929}
13930
13931func (m *awsRestjson1_deserializeOpDescribeThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13932	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13933) {
13934	out, metadata, err = next.HandleDeserialize(ctx, in)
13935	if err != nil {
13936		return out, metadata, err
13937	}
13938
13939	response, ok := out.RawResponse.(*smithyhttp.Response)
13940	if !ok {
13941		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13942	}
13943
13944	if response.StatusCode < 200 || response.StatusCode >= 300 {
13945		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThingRegistrationTask(response, &metadata)
13946	}
13947	output := &DescribeThingRegistrationTaskOutput{}
13948	out.Result = output
13949
13950	var buff [1024]byte
13951	ringBuffer := smithyio.NewRingBuffer(buff[:])
13952
13953	body := io.TeeReader(response.Body, ringBuffer)
13954
13955	decoder := json.NewDecoder(body)
13956	decoder.UseNumber()
13957	var shape interface{}
13958	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13959		var snapshot bytes.Buffer
13960		io.Copy(&snapshot, ringBuffer)
13961		err = &smithy.DeserializationError{
13962			Err:      fmt.Errorf("failed to decode response body, %w", err),
13963			Snapshot: snapshot.Bytes(),
13964		}
13965		return out, metadata, err
13966	}
13967
13968	err = awsRestjson1_deserializeOpDocumentDescribeThingRegistrationTaskOutput(&output, shape)
13969	if err != nil {
13970		var snapshot bytes.Buffer
13971		io.Copy(&snapshot, ringBuffer)
13972		return out, metadata, &smithy.DeserializationError{
13973			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13974			Snapshot: snapshot.Bytes(),
13975		}
13976	}
13977
13978	return out, metadata, err
13979}
13980
13981func awsRestjson1_deserializeOpErrorDescribeThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13982	var errorBuffer bytes.Buffer
13983	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13984		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13985	}
13986	errorBody := bytes.NewReader(errorBuffer.Bytes())
13987
13988	errorCode := "UnknownError"
13989	errorMessage := errorCode
13990
13991	code := response.Header.Get("X-Amzn-ErrorType")
13992	if len(code) != 0 {
13993		errorCode = restjson.SanitizeErrorCode(code)
13994	}
13995
13996	var buff [1024]byte
13997	ringBuffer := smithyio.NewRingBuffer(buff[:])
13998
13999	body := io.TeeReader(errorBody, ringBuffer)
14000	decoder := json.NewDecoder(body)
14001	decoder.UseNumber()
14002	code, message, err := restjson.GetErrorInfo(decoder)
14003	if err != nil {
14004		var snapshot bytes.Buffer
14005		io.Copy(&snapshot, ringBuffer)
14006		err = &smithy.DeserializationError{
14007			Err:      fmt.Errorf("failed to decode response body, %w", err),
14008			Snapshot: snapshot.Bytes(),
14009		}
14010		return err
14011	}
14012
14013	errorBody.Seek(0, io.SeekStart)
14014	if len(code) != 0 {
14015		errorCode = restjson.SanitizeErrorCode(code)
14016	}
14017	if len(message) != 0 {
14018		errorMessage = message
14019	}
14020
14021	switch {
14022	case strings.EqualFold("InternalFailureException", errorCode):
14023		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14024
14025	case strings.EqualFold("InvalidRequestException", errorCode):
14026		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14027
14028	case strings.EqualFold("ResourceNotFoundException", errorCode):
14029		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14030
14031	case strings.EqualFold("ThrottlingException", errorCode):
14032		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14033
14034	case strings.EqualFold("UnauthorizedException", errorCode):
14035		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14036
14037	default:
14038		genericError := &smithy.GenericAPIError{
14039			Code:    errorCode,
14040			Message: errorMessage,
14041		}
14042		return genericError
14043
14044	}
14045}
14046
14047func awsRestjson1_deserializeOpDocumentDescribeThingRegistrationTaskOutput(v **DescribeThingRegistrationTaskOutput, value interface{}) error {
14048	if v == nil {
14049		return fmt.Errorf("unexpected nil of type %T", v)
14050	}
14051	if value == nil {
14052		return nil
14053	}
14054
14055	shape, ok := value.(map[string]interface{})
14056	if !ok {
14057		return fmt.Errorf("unexpected JSON type %v", value)
14058	}
14059
14060	var sv *DescribeThingRegistrationTaskOutput
14061	if *v == nil {
14062		sv = &DescribeThingRegistrationTaskOutput{}
14063	} else {
14064		sv = *v
14065	}
14066
14067	for key, value := range shape {
14068		switch key {
14069		case "creationDate":
14070			if value != nil {
14071				jtv, ok := value.(json.Number)
14072				if !ok {
14073					return fmt.Errorf("expected CreationDate to be json.Number, got %T instead", value)
14074				}
14075				f64, err := jtv.Float64()
14076				if err != nil {
14077					return err
14078				}
14079				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
14080			}
14081
14082		case "failureCount":
14083			if value != nil {
14084				jtv, ok := value.(json.Number)
14085				if !ok {
14086					return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
14087				}
14088				i64, err := jtv.Int64()
14089				if err != nil {
14090					return err
14091				}
14092				sv.FailureCount = int32(i64)
14093			}
14094
14095		case "inputFileBucket":
14096			if value != nil {
14097				jtv, ok := value.(string)
14098				if !ok {
14099					return fmt.Errorf("expected RegistryS3BucketName to be of type string, got %T instead", value)
14100				}
14101				sv.InputFileBucket = ptr.String(jtv)
14102			}
14103
14104		case "inputFileKey":
14105			if value != nil {
14106				jtv, ok := value.(string)
14107				if !ok {
14108					return fmt.Errorf("expected RegistryS3KeyName to be of type string, got %T instead", value)
14109				}
14110				sv.InputFileKey = ptr.String(jtv)
14111			}
14112
14113		case "lastModifiedDate":
14114			if value != nil {
14115				jtv, ok := value.(json.Number)
14116				if !ok {
14117					return fmt.Errorf("expected LastModifiedDate to be json.Number, got %T instead", value)
14118				}
14119				f64, err := jtv.Float64()
14120				if err != nil {
14121					return err
14122				}
14123				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
14124			}
14125
14126		case "message":
14127			if value != nil {
14128				jtv, ok := value.(string)
14129				if !ok {
14130					return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
14131				}
14132				sv.Message = ptr.String(jtv)
14133			}
14134
14135		case "percentageProgress":
14136			if value != nil {
14137				jtv, ok := value.(json.Number)
14138				if !ok {
14139					return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value)
14140				}
14141				i64, err := jtv.Int64()
14142				if err != nil {
14143					return err
14144				}
14145				sv.PercentageProgress = int32(i64)
14146			}
14147
14148		case "roleArn":
14149			if value != nil {
14150				jtv, ok := value.(string)
14151				if !ok {
14152					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
14153				}
14154				sv.RoleArn = ptr.String(jtv)
14155			}
14156
14157		case "status":
14158			if value != nil {
14159				jtv, ok := value.(string)
14160				if !ok {
14161					return fmt.Errorf("expected Status to be of type string, got %T instead", value)
14162				}
14163				sv.Status = types.Status(jtv)
14164			}
14165
14166		case "successCount":
14167			if value != nil {
14168				jtv, ok := value.(json.Number)
14169				if !ok {
14170					return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
14171				}
14172				i64, err := jtv.Int64()
14173				if err != nil {
14174					return err
14175				}
14176				sv.SuccessCount = int32(i64)
14177			}
14178
14179		case "taskId":
14180			if value != nil {
14181				jtv, ok := value.(string)
14182				if !ok {
14183					return fmt.Errorf("expected TaskId to be of type string, got %T instead", value)
14184				}
14185				sv.TaskId = ptr.String(jtv)
14186			}
14187
14188		case "templateBody":
14189			if value != nil {
14190				jtv, ok := value.(string)
14191				if !ok {
14192					return fmt.Errorf("expected TemplateBody to be of type string, got %T instead", value)
14193				}
14194				sv.TemplateBody = ptr.String(jtv)
14195			}
14196
14197		default:
14198			_, _ = key, value
14199
14200		}
14201	}
14202	*v = sv
14203	return nil
14204}
14205
14206type awsRestjson1_deserializeOpDescribeThingType struct {
14207}
14208
14209func (*awsRestjson1_deserializeOpDescribeThingType) ID() string {
14210	return "OperationDeserializer"
14211}
14212
14213func (m *awsRestjson1_deserializeOpDescribeThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14214	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14215) {
14216	out, metadata, err = next.HandleDeserialize(ctx, in)
14217	if err != nil {
14218		return out, metadata, err
14219	}
14220
14221	response, ok := out.RawResponse.(*smithyhttp.Response)
14222	if !ok {
14223		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14224	}
14225
14226	if response.StatusCode < 200 || response.StatusCode >= 300 {
14227		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThingType(response, &metadata)
14228	}
14229	output := &DescribeThingTypeOutput{}
14230	out.Result = output
14231
14232	var buff [1024]byte
14233	ringBuffer := smithyio.NewRingBuffer(buff[:])
14234
14235	body := io.TeeReader(response.Body, ringBuffer)
14236
14237	decoder := json.NewDecoder(body)
14238	decoder.UseNumber()
14239	var shape interface{}
14240	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14241		var snapshot bytes.Buffer
14242		io.Copy(&snapshot, ringBuffer)
14243		err = &smithy.DeserializationError{
14244			Err:      fmt.Errorf("failed to decode response body, %w", err),
14245			Snapshot: snapshot.Bytes(),
14246		}
14247		return out, metadata, err
14248	}
14249
14250	err = awsRestjson1_deserializeOpDocumentDescribeThingTypeOutput(&output, shape)
14251	if err != nil {
14252		var snapshot bytes.Buffer
14253		io.Copy(&snapshot, ringBuffer)
14254		return out, metadata, &smithy.DeserializationError{
14255			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14256			Snapshot: snapshot.Bytes(),
14257		}
14258	}
14259
14260	return out, metadata, err
14261}
14262
14263func awsRestjson1_deserializeOpErrorDescribeThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14264	var errorBuffer bytes.Buffer
14265	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14266		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14267	}
14268	errorBody := bytes.NewReader(errorBuffer.Bytes())
14269
14270	errorCode := "UnknownError"
14271	errorMessage := errorCode
14272
14273	code := response.Header.Get("X-Amzn-ErrorType")
14274	if len(code) != 0 {
14275		errorCode = restjson.SanitizeErrorCode(code)
14276	}
14277
14278	var buff [1024]byte
14279	ringBuffer := smithyio.NewRingBuffer(buff[:])
14280
14281	body := io.TeeReader(errorBody, ringBuffer)
14282	decoder := json.NewDecoder(body)
14283	decoder.UseNumber()
14284	code, message, err := restjson.GetErrorInfo(decoder)
14285	if err != nil {
14286		var snapshot bytes.Buffer
14287		io.Copy(&snapshot, ringBuffer)
14288		err = &smithy.DeserializationError{
14289			Err:      fmt.Errorf("failed to decode response body, %w", err),
14290			Snapshot: snapshot.Bytes(),
14291		}
14292		return err
14293	}
14294
14295	errorBody.Seek(0, io.SeekStart)
14296	if len(code) != 0 {
14297		errorCode = restjson.SanitizeErrorCode(code)
14298	}
14299	if len(message) != 0 {
14300		errorMessage = message
14301	}
14302
14303	switch {
14304	case strings.EqualFold("InternalFailureException", errorCode):
14305		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14306
14307	case strings.EqualFold("InvalidRequestException", errorCode):
14308		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14309
14310	case strings.EqualFold("ResourceNotFoundException", errorCode):
14311		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14312
14313	case strings.EqualFold("ServiceUnavailableException", errorCode):
14314		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14315
14316	case strings.EqualFold("ThrottlingException", errorCode):
14317		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14318
14319	case strings.EqualFold("UnauthorizedException", errorCode):
14320		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14321
14322	default:
14323		genericError := &smithy.GenericAPIError{
14324			Code:    errorCode,
14325			Message: errorMessage,
14326		}
14327		return genericError
14328
14329	}
14330}
14331
14332func awsRestjson1_deserializeOpDocumentDescribeThingTypeOutput(v **DescribeThingTypeOutput, value interface{}) error {
14333	if v == nil {
14334		return fmt.Errorf("unexpected nil of type %T", v)
14335	}
14336	if value == nil {
14337		return nil
14338	}
14339
14340	shape, ok := value.(map[string]interface{})
14341	if !ok {
14342		return fmt.Errorf("unexpected JSON type %v", value)
14343	}
14344
14345	var sv *DescribeThingTypeOutput
14346	if *v == nil {
14347		sv = &DescribeThingTypeOutput{}
14348	} else {
14349		sv = *v
14350	}
14351
14352	for key, value := range shape {
14353		switch key {
14354		case "thingTypeArn":
14355			if value != nil {
14356				jtv, ok := value.(string)
14357				if !ok {
14358					return fmt.Errorf("expected ThingTypeArn to be of type string, got %T instead", value)
14359				}
14360				sv.ThingTypeArn = ptr.String(jtv)
14361			}
14362
14363		case "thingTypeId":
14364			if value != nil {
14365				jtv, ok := value.(string)
14366				if !ok {
14367					return fmt.Errorf("expected ThingTypeId to be of type string, got %T instead", value)
14368				}
14369				sv.ThingTypeId = ptr.String(jtv)
14370			}
14371
14372		case "thingTypeMetadata":
14373			if err := awsRestjson1_deserializeDocumentThingTypeMetadata(&sv.ThingTypeMetadata, value); err != nil {
14374				return err
14375			}
14376
14377		case "thingTypeName":
14378			if value != nil {
14379				jtv, ok := value.(string)
14380				if !ok {
14381					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
14382				}
14383				sv.ThingTypeName = ptr.String(jtv)
14384			}
14385
14386		case "thingTypeProperties":
14387			if err := awsRestjson1_deserializeDocumentThingTypeProperties(&sv.ThingTypeProperties, value); err != nil {
14388				return err
14389			}
14390
14391		default:
14392			_, _ = key, value
14393
14394		}
14395	}
14396	*v = sv
14397	return nil
14398}
14399
14400type awsRestjson1_deserializeOpDetachPolicy struct {
14401}
14402
14403func (*awsRestjson1_deserializeOpDetachPolicy) ID() string {
14404	return "OperationDeserializer"
14405}
14406
14407func (m *awsRestjson1_deserializeOpDetachPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14408	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14409) {
14410	out, metadata, err = next.HandleDeserialize(ctx, in)
14411	if err != nil {
14412		return out, metadata, err
14413	}
14414
14415	response, ok := out.RawResponse.(*smithyhttp.Response)
14416	if !ok {
14417		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14418	}
14419
14420	if response.StatusCode < 200 || response.StatusCode >= 300 {
14421		return out, metadata, awsRestjson1_deserializeOpErrorDetachPolicy(response, &metadata)
14422	}
14423	output := &DetachPolicyOutput{}
14424	out.Result = output
14425
14426	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
14427		return out, metadata, &smithy.DeserializationError{
14428			Err: fmt.Errorf("failed to discard response body, %w", err),
14429		}
14430	}
14431
14432	return out, metadata, err
14433}
14434
14435func awsRestjson1_deserializeOpErrorDetachPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14436	var errorBuffer bytes.Buffer
14437	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14438		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14439	}
14440	errorBody := bytes.NewReader(errorBuffer.Bytes())
14441
14442	errorCode := "UnknownError"
14443	errorMessage := errorCode
14444
14445	code := response.Header.Get("X-Amzn-ErrorType")
14446	if len(code) != 0 {
14447		errorCode = restjson.SanitizeErrorCode(code)
14448	}
14449
14450	var buff [1024]byte
14451	ringBuffer := smithyio.NewRingBuffer(buff[:])
14452
14453	body := io.TeeReader(errorBody, ringBuffer)
14454	decoder := json.NewDecoder(body)
14455	decoder.UseNumber()
14456	code, message, err := restjson.GetErrorInfo(decoder)
14457	if err != nil {
14458		var snapshot bytes.Buffer
14459		io.Copy(&snapshot, ringBuffer)
14460		err = &smithy.DeserializationError{
14461			Err:      fmt.Errorf("failed to decode response body, %w", err),
14462			Snapshot: snapshot.Bytes(),
14463		}
14464		return err
14465	}
14466
14467	errorBody.Seek(0, io.SeekStart)
14468	if len(code) != 0 {
14469		errorCode = restjson.SanitizeErrorCode(code)
14470	}
14471	if len(message) != 0 {
14472		errorMessage = message
14473	}
14474
14475	switch {
14476	case strings.EqualFold("InternalFailureException", errorCode):
14477		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14478
14479	case strings.EqualFold("InvalidRequestException", errorCode):
14480		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14481
14482	case strings.EqualFold("LimitExceededException", errorCode):
14483		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
14484
14485	case strings.EqualFold("ServiceUnavailableException", errorCode):
14486		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14487
14488	case strings.EqualFold("ThrottlingException", errorCode):
14489		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14490
14491	case strings.EqualFold("UnauthorizedException", errorCode):
14492		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14493
14494	default:
14495		genericError := &smithy.GenericAPIError{
14496			Code:    errorCode,
14497			Message: errorMessage,
14498		}
14499		return genericError
14500
14501	}
14502}
14503
14504type awsRestjson1_deserializeOpDetachPrincipalPolicy struct {
14505}
14506
14507func (*awsRestjson1_deserializeOpDetachPrincipalPolicy) ID() string {
14508	return "OperationDeserializer"
14509}
14510
14511func (m *awsRestjson1_deserializeOpDetachPrincipalPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14512	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14513) {
14514	out, metadata, err = next.HandleDeserialize(ctx, in)
14515	if err != nil {
14516		return out, metadata, err
14517	}
14518
14519	response, ok := out.RawResponse.(*smithyhttp.Response)
14520	if !ok {
14521		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14522	}
14523
14524	if response.StatusCode < 200 || response.StatusCode >= 300 {
14525		return out, metadata, awsRestjson1_deserializeOpErrorDetachPrincipalPolicy(response, &metadata)
14526	}
14527	output := &DetachPrincipalPolicyOutput{}
14528	out.Result = output
14529
14530	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
14531		return out, metadata, &smithy.DeserializationError{
14532			Err: fmt.Errorf("failed to discard response body, %w", err),
14533		}
14534	}
14535
14536	return out, metadata, err
14537}
14538
14539func awsRestjson1_deserializeOpErrorDetachPrincipalPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14540	var errorBuffer bytes.Buffer
14541	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14542		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14543	}
14544	errorBody := bytes.NewReader(errorBuffer.Bytes())
14545
14546	errorCode := "UnknownError"
14547	errorMessage := errorCode
14548
14549	code := response.Header.Get("X-Amzn-ErrorType")
14550	if len(code) != 0 {
14551		errorCode = restjson.SanitizeErrorCode(code)
14552	}
14553
14554	var buff [1024]byte
14555	ringBuffer := smithyio.NewRingBuffer(buff[:])
14556
14557	body := io.TeeReader(errorBody, ringBuffer)
14558	decoder := json.NewDecoder(body)
14559	decoder.UseNumber()
14560	code, message, err := restjson.GetErrorInfo(decoder)
14561	if err != nil {
14562		var snapshot bytes.Buffer
14563		io.Copy(&snapshot, ringBuffer)
14564		err = &smithy.DeserializationError{
14565			Err:      fmt.Errorf("failed to decode response body, %w", err),
14566			Snapshot: snapshot.Bytes(),
14567		}
14568		return err
14569	}
14570
14571	errorBody.Seek(0, io.SeekStart)
14572	if len(code) != 0 {
14573		errorCode = restjson.SanitizeErrorCode(code)
14574	}
14575	if len(message) != 0 {
14576		errorMessage = message
14577	}
14578
14579	switch {
14580	case strings.EqualFold("InternalFailureException", errorCode):
14581		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14582
14583	case strings.EqualFold("InvalidRequestException", errorCode):
14584		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14585
14586	case strings.EqualFold("ResourceNotFoundException", errorCode):
14587		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14588
14589	case strings.EqualFold("ServiceUnavailableException", errorCode):
14590		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14591
14592	case strings.EqualFold("ThrottlingException", errorCode):
14593		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14594
14595	case strings.EqualFold("UnauthorizedException", errorCode):
14596		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14597
14598	default:
14599		genericError := &smithy.GenericAPIError{
14600			Code:    errorCode,
14601			Message: errorMessage,
14602		}
14603		return genericError
14604
14605	}
14606}
14607
14608type awsRestjson1_deserializeOpDetachSecurityProfile struct {
14609}
14610
14611func (*awsRestjson1_deserializeOpDetachSecurityProfile) ID() string {
14612	return "OperationDeserializer"
14613}
14614
14615func (m *awsRestjson1_deserializeOpDetachSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14616	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14617) {
14618	out, metadata, err = next.HandleDeserialize(ctx, in)
14619	if err != nil {
14620		return out, metadata, err
14621	}
14622
14623	response, ok := out.RawResponse.(*smithyhttp.Response)
14624	if !ok {
14625		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14626	}
14627
14628	if response.StatusCode < 200 || response.StatusCode >= 300 {
14629		return out, metadata, awsRestjson1_deserializeOpErrorDetachSecurityProfile(response, &metadata)
14630	}
14631	output := &DetachSecurityProfileOutput{}
14632	out.Result = output
14633
14634	return out, metadata, err
14635}
14636
14637func awsRestjson1_deserializeOpErrorDetachSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14638	var errorBuffer bytes.Buffer
14639	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14640		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14641	}
14642	errorBody := bytes.NewReader(errorBuffer.Bytes())
14643
14644	errorCode := "UnknownError"
14645	errorMessage := errorCode
14646
14647	code := response.Header.Get("X-Amzn-ErrorType")
14648	if len(code) != 0 {
14649		errorCode = restjson.SanitizeErrorCode(code)
14650	}
14651
14652	var buff [1024]byte
14653	ringBuffer := smithyio.NewRingBuffer(buff[:])
14654
14655	body := io.TeeReader(errorBody, ringBuffer)
14656	decoder := json.NewDecoder(body)
14657	decoder.UseNumber()
14658	code, message, err := restjson.GetErrorInfo(decoder)
14659	if err != nil {
14660		var snapshot bytes.Buffer
14661		io.Copy(&snapshot, ringBuffer)
14662		err = &smithy.DeserializationError{
14663			Err:      fmt.Errorf("failed to decode response body, %w", err),
14664			Snapshot: snapshot.Bytes(),
14665		}
14666		return err
14667	}
14668
14669	errorBody.Seek(0, io.SeekStart)
14670	if len(code) != 0 {
14671		errorCode = restjson.SanitizeErrorCode(code)
14672	}
14673	if len(message) != 0 {
14674		errorMessage = message
14675	}
14676
14677	switch {
14678	case strings.EqualFold("InternalFailureException", errorCode):
14679		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14680
14681	case strings.EqualFold("InvalidRequestException", errorCode):
14682		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14683
14684	case strings.EqualFold("ResourceNotFoundException", errorCode):
14685		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14686
14687	case strings.EqualFold("ThrottlingException", errorCode):
14688		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14689
14690	default:
14691		genericError := &smithy.GenericAPIError{
14692			Code:    errorCode,
14693			Message: errorMessage,
14694		}
14695		return genericError
14696
14697	}
14698}
14699
14700type awsRestjson1_deserializeOpDetachThingPrincipal struct {
14701}
14702
14703func (*awsRestjson1_deserializeOpDetachThingPrincipal) ID() string {
14704	return "OperationDeserializer"
14705}
14706
14707func (m *awsRestjson1_deserializeOpDetachThingPrincipal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14708	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14709) {
14710	out, metadata, err = next.HandleDeserialize(ctx, in)
14711	if err != nil {
14712		return out, metadata, err
14713	}
14714
14715	response, ok := out.RawResponse.(*smithyhttp.Response)
14716	if !ok {
14717		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14718	}
14719
14720	if response.StatusCode < 200 || response.StatusCode >= 300 {
14721		return out, metadata, awsRestjson1_deserializeOpErrorDetachThingPrincipal(response, &metadata)
14722	}
14723	output := &DetachThingPrincipalOutput{}
14724	out.Result = output
14725
14726	return out, metadata, err
14727}
14728
14729func awsRestjson1_deserializeOpErrorDetachThingPrincipal(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14730	var errorBuffer bytes.Buffer
14731	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14732		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14733	}
14734	errorBody := bytes.NewReader(errorBuffer.Bytes())
14735
14736	errorCode := "UnknownError"
14737	errorMessage := errorCode
14738
14739	code := response.Header.Get("X-Amzn-ErrorType")
14740	if len(code) != 0 {
14741		errorCode = restjson.SanitizeErrorCode(code)
14742	}
14743
14744	var buff [1024]byte
14745	ringBuffer := smithyio.NewRingBuffer(buff[:])
14746
14747	body := io.TeeReader(errorBody, ringBuffer)
14748	decoder := json.NewDecoder(body)
14749	decoder.UseNumber()
14750	code, message, err := restjson.GetErrorInfo(decoder)
14751	if err != nil {
14752		var snapshot bytes.Buffer
14753		io.Copy(&snapshot, ringBuffer)
14754		err = &smithy.DeserializationError{
14755			Err:      fmt.Errorf("failed to decode response body, %w", err),
14756			Snapshot: snapshot.Bytes(),
14757		}
14758		return err
14759	}
14760
14761	errorBody.Seek(0, io.SeekStart)
14762	if len(code) != 0 {
14763		errorCode = restjson.SanitizeErrorCode(code)
14764	}
14765	if len(message) != 0 {
14766		errorMessage = message
14767	}
14768
14769	switch {
14770	case strings.EqualFold("InternalFailureException", errorCode):
14771		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14772
14773	case strings.EqualFold("InvalidRequestException", errorCode):
14774		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14775
14776	case strings.EqualFold("ResourceNotFoundException", errorCode):
14777		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14778
14779	case strings.EqualFold("ServiceUnavailableException", errorCode):
14780		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14781
14782	case strings.EqualFold("ThrottlingException", errorCode):
14783		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14784
14785	case strings.EqualFold("UnauthorizedException", errorCode):
14786		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14787
14788	default:
14789		genericError := &smithy.GenericAPIError{
14790			Code:    errorCode,
14791			Message: errorMessage,
14792		}
14793		return genericError
14794
14795	}
14796}
14797
14798type awsRestjson1_deserializeOpDisableTopicRule struct {
14799}
14800
14801func (*awsRestjson1_deserializeOpDisableTopicRule) ID() string {
14802	return "OperationDeserializer"
14803}
14804
14805func (m *awsRestjson1_deserializeOpDisableTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14806	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14807) {
14808	out, metadata, err = next.HandleDeserialize(ctx, in)
14809	if err != nil {
14810		return out, metadata, err
14811	}
14812
14813	response, ok := out.RawResponse.(*smithyhttp.Response)
14814	if !ok {
14815		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14816	}
14817
14818	if response.StatusCode < 200 || response.StatusCode >= 300 {
14819		return out, metadata, awsRestjson1_deserializeOpErrorDisableTopicRule(response, &metadata)
14820	}
14821	output := &DisableTopicRuleOutput{}
14822	out.Result = output
14823
14824	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
14825		return out, metadata, &smithy.DeserializationError{
14826			Err: fmt.Errorf("failed to discard response body, %w", err),
14827		}
14828	}
14829
14830	return out, metadata, err
14831}
14832
14833func awsRestjson1_deserializeOpErrorDisableTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14834	var errorBuffer bytes.Buffer
14835	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14836		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14837	}
14838	errorBody := bytes.NewReader(errorBuffer.Bytes())
14839
14840	errorCode := "UnknownError"
14841	errorMessage := errorCode
14842
14843	code := response.Header.Get("X-Amzn-ErrorType")
14844	if len(code) != 0 {
14845		errorCode = restjson.SanitizeErrorCode(code)
14846	}
14847
14848	var buff [1024]byte
14849	ringBuffer := smithyio.NewRingBuffer(buff[:])
14850
14851	body := io.TeeReader(errorBody, ringBuffer)
14852	decoder := json.NewDecoder(body)
14853	decoder.UseNumber()
14854	code, message, err := restjson.GetErrorInfo(decoder)
14855	if err != nil {
14856		var snapshot bytes.Buffer
14857		io.Copy(&snapshot, ringBuffer)
14858		err = &smithy.DeserializationError{
14859			Err:      fmt.Errorf("failed to decode response body, %w", err),
14860			Snapshot: snapshot.Bytes(),
14861		}
14862		return err
14863	}
14864
14865	errorBody.Seek(0, io.SeekStart)
14866	if len(code) != 0 {
14867		errorCode = restjson.SanitizeErrorCode(code)
14868	}
14869	if len(message) != 0 {
14870		errorMessage = message
14871	}
14872
14873	switch {
14874	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
14875		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
14876
14877	case strings.EqualFold("InternalException", errorCode):
14878		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
14879
14880	case strings.EqualFold("InvalidRequestException", errorCode):
14881		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14882
14883	case strings.EqualFold("ServiceUnavailableException", errorCode):
14884		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14885
14886	case strings.EqualFold("UnauthorizedException", errorCode):
14887		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14888
14889	default:
14890		genericError := &smithy.GenericAPIError{
14891			Code:    errorCode,
14892			Message: errorMessage,
14893		}
14894		return genericError
14895
14896	}
14897}
14898
14899type awsRestjson1_deserializeOpEnableTopicRule struct {
14900}
14901
14902func (*awsRestjson1_deserializeOpEnableTopicRule) ID() string {
14903	return "OperationDeserializer"
14904}
14905
14906func (m *awsRestjson1_deserializeOpEnableTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14907	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14908) {
14909	out, metadata, err = next.HandleDeserialize(ctx, in)
14910	if err != nil {
14911		return out, metadata, err
14912	}
14913
14914	response, ok := out.RawResponse.(*smithyhttp.Response)
14915	if !ok {
14916		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14917	}
14918
14919	if response.StatusCode < 200 || response.StatusCode >= 300 {
14920		return out, metadata, awsRestjson1_deserializeOpErrorEnableTopicRule(response, &metadata)
14921	}
14922	output := &EnableTopicRuleOutput{}
14923	out.Result = output
14924
14925	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
14926		return out, metadata, &smithy.DeserializationError{
14927			Err: fmt.Errorf("failed to discard response body, %w", err),
14928		}
14929	}
14930
14931	return out, metadata, err
14932}
14933
14934func awsRestjson1_deserializeOpErrorEnableTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14935	var errorBuffer bytes.Buffer
14936	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14937		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14938	}
14939	errorBody := bytes.NewReader(errorBuffer.Bytes())
14940
14941	errorCode := "UnknownError"
14942	errorMessage := errorCode
14943
14944	code := response.Header.Get("X-Amzn-ErrorType")
14945	if len(code) != 0 {
14946		errorCode = restjson.SanitizeErrorCode(code)
14947	}
14948
14949	var buff [1024]byte
14950	ringBuffer := smithyio.NewRingBuffer(buff[:])
14951
14952	body := io.TeeReader(errorBody, ringBuffer)
14953	decoder := json.NewDecoder(body)
14954	decoder.UseNumber()
14955	code, message, err := restjson.GetErrorInfo(decoder)
14956	if err != nil {
14957		var snapshot bytes.Buffer
14958		io.Copy(&snapshot, ringBuffer)
14959		err = &smithy.DeserializationError{
14960			Err:      fmt.Errorf("failed to decode response body, %w", err),
14961			Snapshot: snapshot.Bytes(),
14962		}
14963		return err
14964	}
14965
14966	errorBody.Seek(0, io.SeekStart)
14967	if len(code) != 0 {
14968		errorCode = restjson.SanitizeErrorCode(code)
14969	}
14970	if len(message) != 0 {
14971		errorMessage = message
14972	}
14973
14974	switch {
14975	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
14976		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
14977
14978	case strings.EqualFold("InternalException", errorCode):
14979		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
14980
14981	case strings.EqualFold("InvalidRequestException", errorCode):
14982		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
14983
14984	case strings.EqualFold("ServiceUnavailableException", errorCode):
14985		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
14986
14987	case strings.EqualFold("UnauthorizedException", errorCode):
14988		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
14989
14990	default:
14991		genericError := &smithy.GenericAPIError{
14992			Code:    errorCode,
14993			Message: errorMessage,
14994		}
14995		return genericError
14996
14997	}
14998}
14999
15000type awsRestjson1_deserializeOpGetCardinality struct {
15001}
15002
15003func (*awsRestjson1_deserializeOpGetCardinality) ID() string {
15004	return "OperationDeserializer"
15005}
15006
15007func (m *awsRestjson1_deserializeOpGetCardinality) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15008	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15009) {
15010	out, metadata, err = next.HandleDeserialize(ctx, in)
15011	if err != nil {
15012		return out, metadata, err
15013	}
15014
15015	response, ok := out.RawResponse.(*smithyhttp.Response)
15016	if !ok {
15017		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15018	}
15019
15020	if response.StatusCode < 200 || response.StatusCode >= 300 {
15021		return out, metadata, awsRestjson1_deserializeOpErrorGetCardinality(response, &metadata)
15022	}
15023	output := &GetCardinalityOutput{}
15024	out.Result = output
15025
15026	var buff [1024]byte
15027	ringBuffer := smithyio.NewRingBuffer(buff[:])
15028
15029	body := io.TeeReader(response.Body, ringBuffer)
15030
15031	decoder := json.NewDecoder(body)
15032	decoder.UseNumber()
15033	var shape interface{}
15034	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15035		var snapshot bytes.Buffer
15036		io.Copy(&snapshot, ringBuffer)
15037		err = &smithy.DeserializationError{
15038			Err:      fmt.Errorf("failed to decode response body, %w", err),
15039			Snapshot: snapshot.Bytes(),
15040		}
15041		return out, metadata, err
15042	}
15043
15044	err = awsRestjson1_deserializeOpDocumentGetCardinalityOutput(&output, shape)
15045	if err != nil {
15046		var snapshot bytes.Buffer
15047		io.Copy(&snapshot, ringBuffer)
15048		return out, metadata, &smithy.DeserializationError{
15049			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15050			Snapshot: snapshot.Bytes(),
15051		}
15052	}
15053
15054	return out, metadata, err
15055}
15056
15057func awsRestjson1_deserializeOpErrorGetCardinality(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15058	var errorBuffer bytes.Buffer
15059	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15060		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15061	}
15062	errorBody := bytes.NewReader(errorBuffer.Bytes())
15063
15064	errorCode := "UnknownError"
15065	errorMessage := errorCode
15066
15067	code := response.Header.Get("X-Amzn-ErrorType")
15068	if len(code) != 0 {
15069		errorCode = restjson.SanitizeErrorCode(code)
15070	}
15071
15072	var buff [1024]byte
15073	ringBuffer := smithyio.NewRingBuffer(buff[:])
15074
15075	body := io.TeeReader(errorBody, ringBuffer)
15076	decoder := json.NewDecoder(body)
15077	decoder.UseNumber()
15078	code, message, err := restjson.GetErrorInfo(decoder)
15079	if err != nil {
15080		var snapshot bytes.Buffer
15081		io.Copy(&snapshot, ringBuffer)
15082		err = &smithy.DeserializationError{
15083			Err:      fmt.Errorf("failed to decode response body, %w", err),
15084			Snapshot: snapshot.Bytes(),
15085		}
15086		return err
15087	}
15088
15089	errorBody.Seek(0, io.SeekStart)
15090	if len(code) != 0 {
15091		errorCode = restjson.SanitizeErrorCode(code)
15092	}
15093	if len(message) != 0 {
15094		errorMessage = message
15095	}
15096
15097	switch {
15098	case strings.EqualFold("IndexNotReadyException", errorCode):
15099		return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody)
15100
15101	case strings.EqualFold("InternalFailureException", errorCode):
15102		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15103
15104	case strings.EqualFold("InvalidAggregationException", errorCode):
15105		return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody)
15106
15107	case strings.EqualFold("InvalidQueryException", errorCode):
15108		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
15109
15110	case strings.EqualFold("InvalidRequestException", errorCode):
15111		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15112
15113	case strings.EqualFold("ResourceNotFoundException", errorCode):
15114		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15115
15116	case strings.EqualFold("ServiceUnavailableException", errorCode):
15117		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15118
15119	case strings.EqualFold("ThrottlingException", errorCode):
15120		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15121
15122	case strings.EqualFold("UnauthorizedException", errorCode):
15123		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
15124
15125	default:
15126		genericError := &smithy.GenericAPIError{
15127			Code:    errorCode,
15128			Message: errorMessage,
15129		}
15130		return genericError
15131
15132	}
15133}
15134
15135func awsRestjson1_deserializeOpDocumentGetCardinalityOutput(v **GetCardinalityOutput, value interface{}) error {
15136	if v == nil {
15137		return fmt.Errorf("unexpected nil of type %T", v)
15138	}
15139	if value == nil {
15140		return nil
15141	}
15142
15143	shape, ok := value.(map[string]interface{})
15144	if !ok {
15145		return fmt.Errorf("unexpected JSON type %v", value)
15146	}
15147
15148	var sv *GetCardinalityOutput
15149	if *v == nil {
15150		sv = &GetCardinalityOutput{}
15151	} else {
15152		sv = *v
15153	}
15154
15155	for key, value := range shape {
15156		switch key {
15157		case "cardinality":
15158			if value != nil {
15159				jtv, ok := value.(json.Number)
15160				if !ok {
15161					return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
15162				}
15163				i64, err := jtv.Int64()
15164				if err != nil {
15165					return err
15166				}
15167				sv.Cardinality = int32(i64)
15168			}
15169
15170		default:
15171			_, _ = key, value
15172
15173		}
15174	}
15175	*v = sv
15176	return nil
15177}
15178
15179type awsRestjson1_deserializeOpGetEffectivePolicies struct {
15180}
15181
15182func (*awsRestjson1_deserializeOpGetEffectivePolicies) ID() string {
15183	return "OperationDeserializer"
15184}
15185
15186func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15187	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15188) {
15189	out, metadata, err = next.HandleDeserialize(ctx, in)
15190	if err != nil {
15191		return out, metadata, err
15192	}
15193
15194	response, ok := out.RawResponse.(*smithyhttp.Response)
15195	if !ok {
15196		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15197	}
15198
15199	if response.StatusCode < 200 || response.StatusCode >= 300 {
15200		return out, metadata, awsRestjson1_deserializeOpErrorGetEffectivePolicies(response, &metadata)
15201	}
15202	output := &GetEffectivePoliciesOutput{}
15203	out.Result = output
15204
15205	var buff [1024]byte
15206	ringBuffer := smithyio.NewRingBuffer(buff[:])
15207
15208	body := io.TeeReader(response.Body, ringBuffer)
15209
15210	decoder := json.NewDecoder(body)
15211	decoder.UseNumber()
15212	var shape interface{}
15213	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15214		var snapshot bytes.Buffer
15215		io.Copy(&snapshot, ringBuffer)
15216		err = &smithy.DeserializationError{
15217			Err:      fmt.Errorf("failed to decode response body, %w", err),
15218			Snapshot: snapshot.Bytes(),
15219		}
15220		return out, metadata, err
15221	}
15222
15223	err = awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(&output, shape)
15224	if err != nil {
15225		var snapshot bytes.Buffer
15226		io.Copy(&snapshot, ringBuffer)
15227		return out, metadata, &smithy.DeserializationError{
15228			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15229			Snapshot: snapshot.Bytes(),
15230		}
15231	}
15232
15233	return out, metadata, err
15234}
15235
15236func awsRestjson1_deserializeOpErrorGetEffectivePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15237	var errorBuffer bytes.Buffer
15238	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15239		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15240	}
15241	errorBody := bytes.NewReader(errorBuffer.Bytes())
15242
15243	errorCode := "UnknownError"
15244	errorMessage := errorCode
15245
15246	code := response.Header.Get("X-Amzn-ErrorType")
15247	if len(code) != 0 {
15248		errorCode = restjson.SanitizeErrorCode(code)
15249	}
15250
15251	var buff [1024]byte
15252	ringBuffer := smithyio.NewRingBuffer(buff[:])
15253
15254	body := io.TeeReader(errorBody, ringBuffer)
15255	decoder := json.NewDecoder(body)
15256	decoder.UseNumber()
15257	code, message, err := restjson.GetErrorInfo(decoder)
15258	if err != nil {
15259		var snapshot bytes.Buffer
15260		io.Copy(&snapshot, ringBuffer)
15261		err = &smithy.DeserializationError{
15262			Err:      fmt.Errorf("failed to decode response body, %w", err),
15263			Snapshot: snapshot.Bytes(),
15264		}
15265		return err
15266	}
15267
15268	errorBody.Seek(0, io.SeekStart)
15269	if len(code) != 0 {
15270		errorCode = restjson.SanitizeErrorCode(code)
15271	}
15272	if len(message) != 0 {
15273		errorMessage = message
15274	}
15275
15276	switch {
15277	case strings.EqualFold("InternalFailureException", errorCode):
15278		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15279
15280	case strings.EqualFold("InvalidRequestException", errorCode):
15281		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15282
15283	case strings.EqualFold("LimitExceededException", errorCode):
15284		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
15285
15286	case strings.EqualFold("ResourceNotFoundException", errorCode):
15287		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15288
15289	case strings.EqualFold("ServiceUnavailableException", errorCode):
15290		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15291
15292	case strings.EqualFold("ThrottlingException", errorCode):
15293		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15294
15295	case strings.EqualFold("UnauthorizedException", errorCode):
15296		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
15297
15298	default:
15299		genericError := &smithy.GenericAPIError{
15300			Code:    errorCode,
15301			Message: errorMessage,
15302		}
15303		return genericError
15304
15305	}
15306}
15307
15308func awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(v **GetEffectivePoliciesOutput, value interface{}) error {
15309	if v == nil {
15310		return fmt.Errorf("unexpected nil of type %T", v)
15311	}
15312	if value == nil {
15313		return nil
15314	}
15315
15316	shape, ok := value.(map[string]interface{})
15317	if !ok {
15318		return fmt.Errorf("unexpected JSON type %v", value)
15319	}
15320
15321	var sv *GetEffectivePoliciesOutput
15322	if *v == nil {
15323		sv = &GetEffectivePoliciesOutput{}
15324	} else {
15325		sv = *v
15326	}
15327
15328	for key, value := range shape {
15329		switch key {
15330		case "effectivePolicies":
15331			if err := awsRestjson1_deserializeDocumentEffectivePolicies(&sv.EffectivePolicies, value); err != nil {
15332				return err
15333			}
15334
15335		default:
15336			_, _ = key, value
15337
15338		}
15339	}
15340	*v = sv
15341	return nil
15342}
15343
15344type awsRestjson1_deserializeOpGetIndexingConfiguration struct {
15345}
15346
15347func (*awsRestjson1_deserializeOpGetIndexingConfiguration) ID() string {
15348	return "OperationDeserializer"
15349}
15350
15351func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15352	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15353) {
15354	out, metadata, err = next.HandleDeserialize(ctx, in)
15355	if err != nil {
15356		return out, metadata, err
15357	}
15358
15359	response, ok := out.RawResponse.(*smithyhttp.Response)
15360	if !ok {
15361		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15362	}
15363
15364	if response.StatusCode < 200 || response.StatusCode >= 300 {
15365		return out, metadata, awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response, &metadata)
15366	}
15367	output := &GetIndexingConfigurationOutput{}
15368	out.Result = output
15369
15370	var buff [1024]byte
15371	ringBuffer := smithyio.NewRingBuffer(buff[:])
15372
15373	body := io.TeeReader(response.Body, ringBuffer)
15374
15375	decoder := json.NewDecoder(body)
15376	decoder.UseNumber()
15377	var shape interface{}
15378	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15379		var snapshot bytes.Buffer
15380		io.Copy(&snapshot, ringBuffer)
15381		err = &smithy.DeserializationError{
15382			Err:      fmt.Errorf("failed to decode response body, %w", err),
15383			Snapshot: snapshot.Bytes(),
15384		}
15385		return out, metadata, err
15386	}
15387
15388	err = awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(&output, shape)
15389	if err != nil {
15390		var snapshot bytes.Buffer
15391		io.Copy(&snapshot, ringBuffer)
15392		return out, metadata, &smithy.DeserializationError{
15393			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15394			Snapshot: snapshot.Bytes(),
15395		}
15396	}
15397
15398	return out, metadata, err
15399}
15400
15401func awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15402	var errorBuffer bytes.Buffer
15403	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15404		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15405	}
15406	errorBody := bytes.NewReader(errorBuffer.Bytes())
15407
15408	errorCode := "UnknownError"
15409	errorMessage := errorCode
15410
15411	code := response.Header.Get("X-Amzn-ErrorType")
15412	if len(code) != 0 {
15413		errorCode = restjson.SanitizeErrorCode(code)
15414	}
15415
15416	var buff [1024]byte
15417	ringBuffer := smithyio.NewRingBuffer(buff[:])
15418
15419	body := io.TeeReader(errorBody, ringBuffer)
15420	decoder := json.NewDecoder(body)
15421	decoder.UseNumber()
15422	code, message, err := restjson.GetErrorInfo(decoder)
15423	if err != nil {
15424		var snapshot bytes.Buffer
15425		io.Copy(&snapshot, ringBuffer)
15426		err = &smithy.DeserializationError{
15427			Err:      fmt.Errorf("failed to decode response body, %w", err),
15428			Snapshot: snapshot.Bytes(),
15429		}
15430		return err
15431	}
15432
15433	errorBody.Seek(0, io.SeekStart)
15434	if len(code) != 0 {
15435		errorCode = restjson.SanitizeErrorCode(code)
15436	}
15437	if len(message) != 0 {
15438		errorMessage = message
15439	}
15440
15441	switch {
15442	case strings.EqualFold("InternalFailureException", errorCode):
15443		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15444
15445	case strings.EqualFold("InvalidRequestException", errorCode):
15446		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15447
15448	case strings.EqualFold("ServiceUnavailableException", errorCode):
15449		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15450
15451	case strings.EqualFold("ThrottlingException", errorCode):
15452		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15453
15454	case strings.EqualFold("UnauthorizedException", errorCode):
15455		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
15456
15457	default:
15458		genericError := &smithy.GenericAPIError{
15459			Code:    errorCode,
15460			Message: errorMessage,
15461		}
15462		return genericError
15463
15464	}
15465}
15466
15467func awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(v **GetIndexingConfigurationOutput, value interface{}) error {
15468	if v == nil {
15469		return fmt.Errorf("unexpected nil of type %T", v)
15470	}
15471	if value == nil {
15472		return nil
15473	}
15474
15475	shape, ok := value.(map[string]interface{})
15476	if !ok {
15477		return fmt.Errorf("unexpected JSON type %v", value)
15478	}
15479
15480	var sv *GetIndexingConfigurationOutput
15481	if *v == nil {
15482		sv = &GetIndexingConfigurationOutput{}
15483	} else {
15484		sv = *v
15485	}
15486
15487	for key, value := range shape {
15488		switch key {
15489		case "thingGroupIndexingConfiguration":
15490			if err := awsRestjson1_deserializeDocumentThingGroupIndexingConfiguration(&sv.ThingGroupIndexingConfiguration, value); err != nil {
15491				return err
15492			}
15493
15494		case "thingIndexingConfiguration":
15495			if err := awsRestjson1_deserializeDocumentThingIndexingConfiguration(&sv.ThingIndexingConfiguration, value); err != nil {
15496				return err
15497			}
15498
15499		default:
15500			_, _ = key, value
15501
15502		}
15503	}
15504	*v = sv
15505	return nil
15506}
15507
15508type awsRestjson1_deserializeOpGetJobDocument struct {
15509}
15510
15511func (*awsRestjson1_deserializeOpGetJobDocument) ID() string {
15512	return "OperationDeserializer"
15513}
15514
15515func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15516	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15517) {
15518	out, metadata, err = next.HandleDeserialize(ctx, in)
15519	if err != nil {
15520		return out, metadata, err
15521	}
15522
15523	response, ok := out.RawResponse.(*smithyhttp.Response)
15524	if !ok {
15525		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15526	}
15527
15528	if response.StatusCode < 200 || response.StatusCode >= 300 {
15529		return out, metadata, awsRestjson1_deserializeOpErrorGetJobDocument(response, &metadata)
15530	}
15531	output := &GetJobDocumentOutput{}
15532	out.Result = output
15533
15534	var buff [1024]byte
15535	ringBuffer := smithyio.NewRingBuffer(buff[:])
15536
15537	body := io.TeeReader(response.Body, ringBuffer)
15538
15539	decoder := json.NewDecoder(body)
15540	decoder.UseNumber()
15541	var shape interface{}
15542	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15543		var snapshot bytes.Buffer
15544		io.Copy(&snapshot, ringBuffer)
15545		err = &smithy.DeserializationError{
15546			Err:      fmt.Errorf("failed to decode response body, %w", err),
15547			Snapshot: snapshot.Bytes(),
15548		}
15549		return out, metadata, err
15550	}
15551
15552	err = awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(&output, shape)
15553	if err != nil {
15554		var snapshot bytes.Buffer
15555		io.Copy(&snapshot, ringBuffer)
15556		return out, metadata, &smithy.DeserializationError{
15557			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15558			Snapshot: snapshot.Bytes(),
15559		}
15560	}
15561
15562	return out, metadata, err
15563}
15564
15565func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15566	var errorBuffer bytes.Buffer
15567	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15568		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15569	}
15570	errorBody := bytes.NewReader(errorBuffer.Bytes())
15571
15572	errorCode := "UnknownError"
15573	errorMessage := errorCode
15574
15575	code := response.Header.Get("X-Amzn-ErrorType")
15576	if len(code) != 0 {
15577		errorCode = restjson.SanitizeErrorCode(code)
15578	}
15579
15580	var buff [1024]byte
15581	ringBuffer := smithyio.NewRingBuffer(buff[:])
15582
15583	body := io.TeeReader(errorBody, ringBuffer)
15584	decoder := json.NewDecoder(body)
15585	decoder.UseNumber()
15586	code, message, err := restjson.GetErrorInfo(decoder)
15587	if err != nil {
15588		var snapshot bytes.Buffer
15589		io.Copy(&snapshot, ringBuffer)
15590		err = &smithy.DeserializationError{
15591			Err:      fmt.Errorf("failed to decode response body, %w", err),
15592			Snapshot: snapshot.Bytes(),
15593		}
15594		return err
15595	}
15596
15597	errorBody.Seek(0, io.SeekStart)
15598	if len(code) != 0 {
15599		errorCode = restjson.SanitizeErrorCode(code)
15600	}
15601	if len(message) != 0 {
15602		errorMessage = message
15603	}
15604
15605	switch {
15606	case strings.EqualFold("InvalidRequestException", errorCode):
15607		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15608
15609	case strings.EqualFold("ResourceNotFoundException", errorCode):
15610		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15611
15612	case strings.EqualFold("ServiceUnavailableException", errorCode):
15613		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15614
15615	case strings.EqualFold("ThrottlingException", errorCode):
15616		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15617
15618	default:
15619		genericError := &smithy.GenericAPIError{
15620			Code:    errorCode,
15621			Message: errorMessage,
15622		}
15623		return genericError
15624
15625	}
15626}
15627
15628func awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(v **GetJobDocumentOutput, value interface{}) error {
15629	if v == nil {
15630		return fmt.Errorf("unexpected nil of type %T", v)
15631	}
15632	if value == nil {
15633		return nil
15634	}
15635
15636	shape, ok := value.(map[string]interface{})
15637	if !ok {
15638		return fmt.Errorf("unexpected JSON type %v", value)
15639	}
15640
15641	var sv *GetJobDocumentOutput
15642	if *v == nil {
15643		sv = &GetJobDocumentOutput{}
15644	} else {
15645		sv = *v
15646	}
15647
15648	for key, value := range shape {
15649		switch key {
15650		case "document":
15651			if value != nil {
15652				jtv, ok := value.(string)
15653				if !ok {
15654					return fmt.Errorf("expected JobDocument to be of type string, got %T instead", value)
15655				}
15656				sv.Document = ptr.String(jtv)
15657			}
15658
15659		default:
15660			_, _ = key, value
15661
15662		}
15663	}
15664	*v = sv
15665	return nil
15666}
15667
15668type awsRestjson1_deserializeOpGetLoggingOptions struct {
15669}
15670
15671func (*awsRestjson1_deserializeOpGetLoggingOptions) ID() string {
15672	return "OperationDeserializer"
15673}
15674
15675func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15676	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15677) {
15678	out, metadata, err = next.HandleDeserialize(ctx, in)
15679	if err != nil {
15680		return out, metadata, err
15681	}
15682
15683	response, ok := out.RawResponse.(*smithyhttp.Response)
15684	if !ok {
15685		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15686	}
15687
15688	if response.StatusCode < 200 || response.StatusCode >= 300 {
15689		return out, metadata, awsRestjson1_deserializeOpErrorGetLoggingOptions(response, &metadata)
15690	}
15691	output := &GetLoggingOptionsOutput{}
15692	out.Result = output
15693
15694	var buff [1024]byte
15695	ringBuffer := smithyio.NewRingBuffer(buff[:])
15696
15697	body := io.TeeReader(response.Body, ringBuffer)
15698
15699	decoder := json.NewDecoder(body)
15700	decoder.UseNumber()
15701	var shape interface{}
15702	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15703		var snapshot bytes.Buffer
15704		io.Copy(&snapshot, ringBuffer)
15705		err = &smithy.DeserializationError{
15706			Err:      fmt.Errorf("failed to decode response body, %w", err),
15707			Snapshot: snapshot.Bytes(),
15708		}
15709		return out, metadata, err
15710	}
15711
15712	err = awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(&output, shape)
15713	if err != nil {
15714		var snapshot bytes.Buffer
15715		io.Copy(&snapshot, ringBuffer)
15716		return out, metadata, &smithy.DeserializationError{
15717			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15718			Snapshot: snapshot.Bytes(),
15719		}
15720	}
15721
15722	return out, metadata, err
15723}
15724
15725func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15726	var errorBuffer bytes.Buffer
15727	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15728		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15729	}
15730	errorBody := bytes.NewReader(errorBuffer.Bytes())
15731
15732	errorCode := "UnknownError"
15733	errorMessage := errorCode
15734
15735	code := response.Header.Get("X-Amzn-ErrorType")
15736	if len(code) != 0 {
15737		errorCode = restjson.SanitizeErrorCode(code)
15738	}
15739
15740	var buff [1024]byte
15741	ringBuffer := smithyio.NewRingBuffer(buff[:])
15742
15743	body := io.TeeReader(errorBody, ringBuffer)
15744	decoder := json.NewDecoder(body)
15745	decoder.UseNumber()
15746	code, message, err := restjson.GetErrorInfo(decoder)
15747	if err != nil {
15748		var snapshot bytes.Buffer
15749		io.Copy(&snapshot, ringBuffer)
15750		err = &smithy.DeserializationError{
15751			Err:      fmt.Errorf("failed to decode response body, %w", err),
15752			Snapshot: snapshot.Bytes(),
15753		}
15754		return err
15755	}
15756
15757	errorBody.Seek(0, io.SeekStart)
15758	if len(code) != 0 {
15759		errorCode = restjson.SanitizeErrorCode(code)
15760	}
15761	if len(message) != 0 {
15762		errorMessage = message
15763	}
15764
15765	switch {
15766	case strings.EqualFold("InternalException", errorCode):
15767		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
15768
15769	case strings.EqualFold("InvalidRequestException", errorCode):
15770		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15771
15772	case strings.EqualFold("ServiceUnavailableException", errorCode):
15773		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15774
15775	default:
15776		genericError := &smithy.GenericAPIError{
15777			Code:    errorCode,
15778			Message: errorMessage,
15779		}
15780		return genericError
15781
15782	}
15783}
15784
15785func awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(v **GetLoggingOptionsOutput, value interface{}) error {
15786	if v == nil {
15787		return fmt.Errorf("unexpected nil of type %T", v)
15788	}
15789	if value == nil {
15790		return nil
15791	}
15792
15793	shape, ok := value.(map[string]interface{})
15794	if !ok {
15795		return fmt.Errorf("unexpected JSON type %v", value)
15796	}
15797
15798	var sv *GetLoggingOptionsOutput
15799	if *v == nil {
15800		sv = &GetLoggingOptionsOutput{}
15801	} else {
15802		sv = *v
15803	}
15804
15805	for key, value := range shape {
15806		switch key {
15807		case "logLevel":
15808			if value != nil {
15809				jtv, ok := value.(string)
15810				if !ok {
15811					return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value)
15812				}
15813				sv.LogLevel = types.LogLevel(jtv)
15814			}
15815
15816		case "roleArn":
15817			if value != nil {
15818				jtv, ok := value.(string)
15819				if !ok {
15820					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
15821				}
15822				sv.RoleArn = ptr.String(jtv)
15823			}
15824
15825		default:
15826			_, _ = key, value
15827
15828		}
15829	}
15830	*v = sv
15831	return nil
15832}
15833
15834type awsRestjson1_deserializeOpGetOTAUpdate struct {
15835}
15836
15837func (*awsRestjson1_deserializeOpGetOTAUpdate) ID() string {
15838	return "OperationDeserializer"
15839}
15840
15841func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15842	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15843) {
15844	out, metadata, err = next.HandleDeserialize(ctx, in)
15845	if err != nil {
15846		return out, metadata, err
15847	}
15848
15849	response, ok := out.RawResponse.(*smithyhttp.Response)
15850	if !ok {
15851		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15852	}
15853
15854	if response.StatusCode < 200 || response.StatusCode >= 300 {
15855		return out, metadata, awsRestjson1_deserializeOpErrorGetOTAUpdate(response, &metadata)
15856	}
15857	output := &GetOTAUpdateOutput{}
15858	out.Result = output
15859
15860	var buff [1024]byte
15861	ringBuffer := smithyio.NewRingBuffer(buff[:])
15862
15863	body := io.TeeReader(response.Body, ringBuffer)
15864
15865	decoder := json.NewDecoder(body)
15866	decoder.UseNumber()
15867	var shape interface{}
15868	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15869		var snapshot bytes.Buffer
15870		io.Copy(&snapshot, ringBuffer)
15871		err = &smithy.DeserializationError{
15872			Err:      fmt.Errorf("failed to decode response body, %w", err),
15873			Snapshot: snapshot.Bytes(),
15874		}
15875		return out, metadata, err
15876	}
15877
15878	err = awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(&output, shape)
15879	if err != nil {
15880		var snapshot bytes.Buffer
15881		io.Copy(&snapshot, ringBuffer)
15882		return out, metadata, &smithy.DeserializationError{
15883			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15884			Snapshot: snapshot.Bytes(),
15885		}
15886	}
15887
15888	return out, metadata, err
15889}
15890
15891func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15892	var errorBuffer bytes.Buffer
15893	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15894		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15895	}
15896	errorBody := bytes.NewReader(errorBuffer.Bytes())
15897
15898	errorCode := "UnknownError"
15899	errorMessage := errorCode
15900
15901	code := response.Header.Get("X-Amzn-ErrorType")
15902	if len(code) != 0 {
15903		errorCode = restjson.SanitizeErrorCode(code)
15904	}
15905
15906	var buff [1024]byte
15907	ringBuffer := smithyio.NewRingBuffer(buff[:])
15908
15909	body := io.TeeReader(errorBody, ringBuffer)
15910	decoder := json.NewDecoder(body)
15911	decoder.UseNumber()
15912	code, message, err := restjson.GetErrorInfo(decoder)
15913	if err != nil {
15914		var snapshot bytes.Buffer
15915		io.Copy(&snapshot, ringBuffer)
15916		err = &smithy.DeserializationError{
15917			Err:      fmt.Errorf("failed to decode response body, %w", err),
15918			Snapshot: snapshot.Bytes(),
15919		}
15920		return err
15921	}
15922
15923	errorBody.Seek(0, io.SeekStart)
15924	if len(code) != 0 {
15925		errorCode = restjson.SanitizeErrorCode(code)
15926	}
15927	if len(message) != 0 {
15928		errorMessage = message
15929	}
15930
15931	switch {
15932	case strings.EqualFold("InternalFailureException", errorCode):
15933		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15934
15935	case strings.EqualFold("InvalidRequestException", errorCode):
15936		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
15937
15938	case strings.EqualFold("ResourceNotFoundException", errorCode):
15939		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15940
15941	case strings.EqualFold("ServiceUnavailableException", errorCode):
15942		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
15943
15944	case strings.EqualFold("ThrottlingException", errorCode):
15945		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15946
15947	case strings.EqualFold("UnauthorizedException", errorCode):
15948		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
15949
15950	default:
15951		genericError := &smithy.GenericAPIError{
15952			Code:    errorCode,
15953			Message: errorMessage,
15954		}
15955		return genericError
15956
15957	}
15958}
15959
15960func awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(v **GetOTAUpdateOutput, value interface{}) error {
15961	if v == nil {
15962		return fmt.Errorf("unexpected nil of type %T", v)
15963	}
15964	if value == nil {
15965		return nil
15966	}
15967
15968	shape, ok := value.(map[string]interface{})
15969	if !ok {
15970		return fmt.Errorf("unexpected JSON type %v", value)
15971	}
15972
15973	var sv *GetOTAUpdateOutput
15974	if *v == nil {
15975		sv = &GetOTAUpdateOutput{}
15976	} else {
15977		sv = *v
15978	}
15979
15980	for key, value := range shape {
15981		switch key {
15982		case "otaUpdateInfo":
15983			if err := awsRestjson1_deserializeDocumentOTAUpdateInfo(&sv.OtaUpdateInfo, value); err != nil {
15984				return err
15985			}
15986
15987		default:
15988			_, _ = key, value
15989
15990		}
15991	}
15992	*v = sv
15993	return nil
15994}
15995
15996type awsRestjson1_deserializeOpGetPercentiles struct {
15997}
15998
15999func (*awsRestjson1_deserializeOpGetPercentiles) ID() string {
16000	return "OperationDeserializer"
16001}
16002
16003func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16004	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16005) {
16006	out, metadata, err = next.HandleDeserialize(ctx, in)
16007	if err != nil {
16008		return out, metadata, err
16009	}
16010
16011	response, ok := out.RawResponse.(*smithyhttp.Response)
16012	if !ok {
16013		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16014	}
16015
16016	if response.StatusCode < 200 || response.StatusCode >= 300 {
16017		return out, metadata, awsRestjson1_deserializeOpErrorGetPercentiles(response, &metadata)
16018	}
16019	output := &GetPercentilesOutput{}
16020	out.Result = output
16021
16022	var buff [1024]byte
16023	ringBuffer := smithyio.NewRingBuffer(buff[:])
16024
16025	body := io.TeeReader(response.Body, ringBuffer)
16026
16027	decoder := json.NewDecoder(body)
16028	decoder.UseNumber()
16029	var shape interface{}
16030	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16031		var snapshot bytes.Buffer
16032		io.Copy(&snapshot, ringBuffer)
16033		err = &smithy.DeserializationError{
16034			Err:      fmt.Errorf("failed to decode response body, %w", err),
16035			Snapshot: snapshot.Bytes(),
16036		}
16037		return out, metadata, err
16038	}
16039
16040	err = awsRestjson1_deserializeOpDocumentGetPercentilesOutput(&output, shape)
16041	if err != nil {
16042		var snapshot bytes.Buffer
16043		io.Copy(&snapshot, ringBuffer)
16044		return out, metadata, &smithy.DeserializationError{
16045			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16046			Snapshot: snapshot.Bytes(),
16047		}
16048	}
16049
16050	return out, metadata, err
16051}
16052
16053func awsRestjson1_deserializeOpErrorGetPercentiles(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16054	var errorBuffer bytes.Buffer
16055	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16056		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16057	}
16058	errorBody := bytes.NewReader(errorBuffer.Bytes())
16059
16060	errorCode := "UnknownError"
16061	errorMessage := errorCode
16062
16063	code := response.Header.Get("X-Amzn-ErrorType")
16064	if len(code) != 0 {
16065		errorCode = restjson.SanitizeErrorCode(code)
16066	}
16067
16068	var buff [1024]byte
16069	ringBuffer := smithyio.NewRingBuffer(buff[:])
16070
16071	body := io.TeeReader(errorBody, ringBuffer)
16072	decoder := json.NewDecoder(body)
16073	decoder.UseNumber()
16074	code, message, err := restjson.GetErrorInfo(decoder)
16075	if err != nil {
16076		var snapshot bytes.Buffer
16077		io.Copy(&snapshot, ringBuffer)
16078		err = &smithy.DeserializationError{
16079			Err:      fmt.Errorf("failed to decode response body, %w", err),
16080			Snapshot: snapshot.Bytes(),
16081		}
16082		return err
16083	}
16084
16085	errorBody.Seek(0, io.SeekStart)
16086	if len(code) != 0 {
16087		errorCode = restjson.SanitizeErrorCode(code)
16088	}
16089	if len(message) != 0 {
16090		errorMessage = message
16091	}
16092
16093	switch {
16094	case strings.EqualFold("IndexNotReadyException", errorCode):
16095		return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody)
16096
16097	case strings.EqualFold("InternalFailureException", errorCode):
16098		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16099
16100	case strings.EqualFold("InvalidAggregationException", errorCode):
16101		return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody)
16102
16103	case strings.EqualFold("InvalidQueryException", errorCode):
16104		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
16105
16106	case strings.EqualFold("InvalidRequestException", errorCode):
16107		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
16108
16109	case strings.EqualFold("ResourceNotFoundException", errorCode):
16110		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16111
16112	case strings.EqualFold("ServiceUnavailableException", errorCode):
16113		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
16114
16115	case strings.EqualFold("ThrottlingException", errorCode):
16116		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16117
16118	case strings.EqualFold("UnauthorizedException", errorCode):
16119		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
16120
16121	default:
16122		genericError := &smithy.GenericAPIError{
16123			Code:    errorCode,
16124			Message: errorMessage,
16125		}
16126		return genericError
16127
16128	}
16129}
16130
16131func awsRestjson1_deserializeOpDocumentGetPercentilesOutput(v **GetPercentilesOutput, value interface{}) error {
16132	if v == nil {
16133		return fmt.Errorf("unexpected nil of type %T", v)
16134	}
16135	if value == nil {
16136		return nil
16137	}
16138
16139	shape, ok := value.(map[string]interface{})
16140	if !ok {
16141		return fmt.Errorf("unexpected JSON type %v", value)
16142	}
16143
16144	var sv *GetPercentilesOutput
16145	if *v == nil {
16146		sv = &GetPercentilesOutput{}
16147	} else {
16148		sv = *v
16149	}
16150
16151	for key, value := range shape {
16152		switch key {
16153		case "percentiles":
16154			if err := awsRestjson1_deserializeDocumentPercentiles(&sv.Percentiles, value); err != nil {
16155				return err
16156			}
16157
16158		default:
16159			_, _ = key, value
16160
16161		}
16162	}
16163	*v = sv
16164	return nil
16165}
16166
16167type awsRestjson1_deserializeOpGetPolicy struct {
16168}
16169
16170func (*awsRestjson1_deserializeOpGetPolicy) ID() string {
16171	return "OperationDeserializer"
16172}
16173
16174func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16175	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16176) {
16177	out, metadata, err = next.HandleDeserialize(ctx, in)
16178	if err != nil {
16179		return out, metadata, err
16180	}
16181
16182	response, ok := out.RawResponse.(*smithyhttp.Response)
16183	if !ok {
16184		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16185	}
16186
16187	if response.StatusCode < 200 || response.StatusCode >= 300 {
16188		return out, metadata, awsRestjson1_deserializeOpErrorGetPolicy(response, &metadata)
16189	}
16190	output := &GetPolicyOutput{}
16191	out.Result = output
16192
16193	var buff [1024]byte
16194	ringBuffer := smithyio.NewRingBuffer(buff[:])
16195
16196	body := io.TeeReader(response.Body, ringBuffer)
16197
16198	decoder := json.NewDecoder(body)
16199	decoder.UseNumber()
16200	var shape interface{}
16201	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16202		var snapshot bytes.Buffer
16203		io.Copy(&snapshot, ringBuffer)
16204		err = &smithy.DeserializationError{
16205			Err:      fmt.Errorf("failed to decode response body, %w", err),
16206			Snapshot: snapshot.Bytes(),
16207		}
16208		return out, metadata, err
16209	}
16210
16211	err = awsRestjson1_deserializeOpDocumentGetPolicyOutput(&output, shape)
16212	if err != nil {
16213		var snapshot bytes.Buffer
16214		io.Copy(&snapshot, ringBuffer)
16215		return out, metadata, &smithy.DeserializationError{
16216			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16217			Snapshot: snapshot.Bytes(),
16218		}
16219	}
16220
16221	return out, metadata, err
16222}
16223
16224func awsRestjson1_deserializeOpErrorGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16225	var errorBuffer bytes.Buffer
16226	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16227		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16228	}
16229	errorBody := bytes.NewReader(errorBuffer.Bytes())
16230
16231	errorCode := "UnknownError"
16232	errorMessage := errorCode
16233
16234	code := response.Header.Get("X-Amzn-ErrorType")
16235	if len(code) != 0 {
16236		errorCode = restjson.SanitizeErrorCode(code)
16237	}
16238
16239	var buff [1024]byte
16240	ringBuffer := smithyio.NewRingBuffer(buff[:])
16241
16242	body := io.TeeReader(errorBody, ringBuffer)
16243	decoder := json.NewDecoder(body)
16244	decoder.UseNumber()
16245	code, message, err := restjson.GetErrorInfo(decoder)
16246	if err != nil {
16247		var snapshot bytes.Buffer
16248		io.Copy(&snapshot, ringBuffer)
16249		err = &smithy.DeserializationError{
16250			Err:      fmt.Errorf("failed to decode response body, %w", err),
16251			Snapshot: snapshot.Bytes(),
16252		}
16253		return err
16254	}
16255
16256	errorBody.Seek(0, io.SeekStart)
16257	if len(code) != 0 {
16258		errorCode = restjson.SanitizeErrorCode(code)
16259	}
16260	if len(message) != 0 {
16261		errorMessage = message
16262	}
16263
16264	switch {
16265	case strings.EqualFold("InternalFailureException", errorCode):
16266		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16267
16268	case strings.EqualFold("InvalidRequestException", errorCode):
16269		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
16270
16271	case strings.EqualFold("ResourceNotFoundException", errorCode):
16272		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16273
16274	case strings.EqualFold("ServiceUnavailableException", errorCode):
16275		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
16276
16277	case strings.EqualFold("ThrottlingException", errorCode):
16278		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16279
16280	case strings.EqualFold("UnauthorizedException", errorCode):
16281		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
16282
16283	default:
16284		genericError := &smithy.GenericAPIError{
16285			Code:    errorCode,
16286			Message: errorMessage,
16287		}
16288		return genericError
16289
16290	}
16291}
16292
16293func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, value interface{}) error {
16294	if v == nil {
16295		return fmt.Errorf("unexpected nil of type %T", v)
16296	}
16297	if value == nil {
16298		return nil
16299	}
16300
16301	shape, ok := value.(map[string]interface{})
16302	if !ok {
16303		return fmt.Errorf("unexpected JSON type %v", value)
16304	}
16305
16306	var sv *GetPolicyOutput
16307	if *v == nil {
16308		sv = &GetPolicyOutput{}
16309	} else {
16310		sv = *v
16311	}
16312
16313	for key, value := range shape {
16314		switch key {
16315		case "creationDate":
16316			if value != nil {
16317				jtv, ok := value.(json.Number)
16318				if !ok {
16319					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
16320				}
16321				f64, err := jtv.Float64()
16322				if err != nil {
16323					return err
16324				}
16325				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
16326			}
16327
16328		case "defaultVersionId":
16329			if value != nil {
16330				jtv, ok := value.(string)
16331				if !ok {
16332					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
16333				}
16334				sv.DefaultVersionId = ptr.String(jtv)
16335			}
16336
16337		case "generationId":
16338			if value != nil {
16339				jtv, ok := value.(string)
16340				if !ok {
16341					return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value)
16342				}
16343				sv.GenerationId = ptr.String(jtv)
16344			}
16345
16346		case "lastModifiedDate":
16347			if value != nil {
16348				jtv, ok := value.(json.Number)
16349				if !ok {
16350					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
16351				}
16352				f64, err := jtv.Float64()
16353				if err != nil {
16354					return err
16355				}
16356				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
16357			}
16358
16359		case "policyArn":
16360			if value != nil {
16361				jtv, ok := value.(string)
16362				if !ok {
16363					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
16364				}
16365				sv.PolicyArn = ptr.String(jtv)
16366			}
16367
16368		case "policyDocument":
16369			if value != nil {
16370				jtv, ok := value.(string)
16371				if !ok {
16372					return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
16373				}
16374				sv.PolicyDocument = ptr.String(jtv)
16375			}
16376
16377		case "policyName":
16378			if value != nil {
16379				jtv, ok := value.(string)
16380				if !ok {
16381					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
16382				}
16383				sv.PolicyName = ptr.String(jtv)
16384			}
16385
16386		default:
16387			_, _ = key, value
16388
16389		}
16390	}
16391	*v = sv
16392	return nil
16393}
16394
16395type awsRestjson1_deserializeOpGetPolicyVersion struct {
16396}
16397
16398func (*awsRestjson1_deserializeOpGetPolicyVersion) ID() string {
16399	return "OperationDeserializer"
16400}
16401
16402func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16403	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16404) {
16405	out, metadata, err = next.HandleDeserialize(ctx, in)
16406	if err != nil {
16407		return out, metadata, err
16408	}
16409
16410	response, ok := out.RawResponse.(*smithyhttp.Response)
16411	if !ok {
16412		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16413	}
16414
16415	if response.StatusCode < 200 || response.StatusCode >= 300 {
16416		return out, metadata, awsRestjson1_deserializeOpErrorGetPolicyVersion(response, &metadata)
16417	}
16418	output := &GetPolicyVersionOutput{}
16419	out.Result = output
16420
16421	var buff [1024]byte
16422	ringBuffer := smithyio.NewRingBuffer(buff[:])
16423
16424	body := io.TeeReader(response.Body, ringBuffer)
16425
16426	decoder := json.NewDecoder(body)
16427	decoder.UseNumber()
16428	var shape interface{}
16429	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16430		var snapshot bytes.Buffer
16431		io.Copy(&snapshot, ringBuffer)
16432		err = &smithy.DeserializationError{
16433			Err:      fmt.Errorf("failed to decode response body, %w", err),
16434			Snapshot: snapshot.Bytes(),
16435		}
16436		return out, metadata, err
16437	}
16438
16439	err = awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(&output, shape)
16440	if err != nil {
16441		var snapshot bytes.Buffer
16442		io.Copy(&snapshot, ringBuffer)
16443		return out, metadata, &smithy.DeserializationError{
16444			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16445			Snapshot: snapshot.Bytes(),
16446		}
16447	}
16448
16449	return out, metadata, err
16450}
16451
16452func awsRestjson1_deserializeOpErrorGetPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16453	var errorBuffer bytes.Buffer
16454	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16455		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16456	}
16457	errorBody := bytes.NewReader(errorBuffer.Bytes())
16458
16459	errorCode := "UnknownError"
16460	errorMessage := errorCode
16461
16462	code := response.Header.Get("X-Amzn-ErrorType")
16463	if len(code) != 0 {
16464		errorCode = restjson.SanitizeErrorCode(code)
16465	}
16466
16467	var buff [1024]byte
16468	ringBuffer := smithyio.NewRingBuffer(buff[:])
16469
16470	body := io.TeeReader(errorBody, ringBuffer)
16471	decoder := json.NewDecoder(body)
16472	decoder.UseNumber()
16473	code, message, err := restjson.GetErrorInfo(decoder)
16474	if err != nil {
16475		var snapshot bytes.Buffer
16476		io.Copy(&snapshot, ringBuffer)
16477		err = &smithy.DeserializationError{
16478			Err:      fmt.Errorf("failed to decode response body, %w", err),
16479			Snapshot: snapshot.Bytes(),
16480		}
16481		return err
16482	}
16483
16484	errorBody.Seek(0, io.SeekStart)
16485	if len(code) != 0 {
16486		errorCode = restjson.SanitizeErrorCode(code)
16487	}
16488	if len(message) != 0 {
16489		errorMessage = message
16490	}
16491
16492	switch {
16493	case strings.EqualFold("InternalFailureException", errorCode):
16494		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16495
16496	case strings.EqualFold("InvalidRequestException", errorCode):
16497		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
16498
16499	case strings.EqualFold("ResourceNotFoundException", errorCode):
16500		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16501
16502	case strings.EqualFold("ServiceUnavailableException", errorCode):
16503		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
16504
16505	case strings.EqualFold("ThrottlingException", errorCode):
16506		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16507
16508	case strings.EqualFold("UnauthorizedException", errorCode):
16509		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
16510
16511	default:
16512		genericError := &smithy.GenericAPIError{
16513			Code:    errorCode,
16514			Message: errorMessage,
16515		}
16516		return genericError
16517
16518	}
16519}
16520
16521func awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(v **GetPolicyVersionOutput, value interface{}) error {
16522	if v == nil {
16523		return fmt.Errorf("unexpected nil of type %T", v)
16524	}
16525	if value == nil {
16526		return nil
16527	}
16528
16529	shape, ok := value.(map[string]interface{})
16530	if !ok {
16531		return fmt.Errorf("unexpected JSON type %v", value)
16532	}
16533
16534	var sv *GetPolicyVersionOutput
16535	if *v == nil {
16536		sv = &GetPolicyVersionOutput{}
16537	} else {
16538		sv = *v
16539	}
16540
16541	for key, value := range shape {
16542		switch key {
16543		case "creationDate":
16544			if value != nil {
16545				jtv, ok := value.(json.Number)
16546				if !ok {
16547					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
16548				}
16549				f64, err := jtv.Float64()
16550				if err != nil {
16551					return err
16552				}
16553				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
16554			}
16555
16556		case "generationId":
16557			if value != nil {
16558				jtv, ok := value.(string)
16559				if !ok {
16560					return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value)
16561				}
16562				sv.GenerationId = ptr.String(jtv)
16563			}
16564
16565		case "isDefaultVersion":
16566			if value != nil {
16567				jtv, ok := value.(bool)
16568				if !ok {
16569					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
16570				}
16571				sv.IsDefaultVersion = jtv
16572			}
16573
16574		case "lastModifiedDate":
16575			if value != nil {
16576				jtv, ok := value.(json.Number)
16577				if !ok {
16578					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
16579				}
16580				f64, err := jtv.Float64()
16581				if err != nil {
16582					return err
16583				}
16584				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
16585			}
16586
16587		case "policyArn":
16588			if value != nil {
16589				jtv, ok := value.(string)
16590				if !ok {
16591					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
16592				}
16593				sv.PolicyArn = ptr.String(jtv)
16594			}
16595
16596		case "policyDocument":
16597			if value != nil {
16598				jtv, ok := value.(string)
16599				if !ok {
16600					return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
16601				}
16602				sv.PolicyDocument = ptr.String(jtv)
16603			}
16604
16605		case "policyName":
16606			if value != nil {
16607				jtv, ok := value.(string)
16608				if !ok {
16609					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
16610				}
16611				sv.PolicyName = ptr.String(jtv)
16612			}
16613
16614		case "policyVersionId":
16615			if value != nil {
16616				jtv, ok := value.(string)
16617				if !ok {
16618					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
16619				}
16620				sv.PolicyVersionId = ptr.String(jtv)
16621			}
16622
16623		default:
16624			_, _ = key, value
16625
16626		}
16627	}
16628	*v = sv
16629	return nil
16630}
16631
16632type awsRestjson1_deserializeOpGetRegistrationCode struct {
16633}
16634
16635func (*awsRestjson1_deserializeOpGetRegistrationCode) ID() string {
16636	return "OperationDeserializer"
16637}
16638
16639func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16640	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16641) {
16642	out, metadata, err = next.HandleDeserialize(ctx, in)
16643	if err != nil {
16644		return out, metadata, err
16645	}
16646
16647	response, ok := out.RawResponse.(*smithyhttp.Response)
16648	if !ok {
16649		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16650	}
16651
16652	if response.StatusCode < 200 || response.StatusCode >= 300 {
16653		return out, metadata, awsRestjson1_deserializeOpErrorGetRegistrationCode(response, &metadata)
16654	}
16655	output := &GetRegistrationCodeOutput{}
16656	out.Result = output
16657
16658	var buff [1024]byte
16659	ringBuffer := smithyio.NewRingBuffer(buff[:])
16660
16661	body := io.TeeReader(response.Body, ringBuffer)
16662
16663	decoder := json.NewDecoder(body)
16664	decoder.UseNumber()
16665	var shape interface{}
16666	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16667		var snapshot bytes.Buffer
16668		io.Copy(&snapshot, ringBuffer)
16669		err = &smithy.DeserializationError{
16670			Err:      fmt.Errorf("failed to decode response body, %w", err),
16671			Snapshot: snapshot.Bytes(),
16672		}
16673		return out, metadata, err
16674	}
16675
16676	err = awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(&output, shape)
16677	if err != nil {
16678		var snapshot bytes.Buffer
16679		io.Copy(&snapshot, ringBuffer)
16680		return out, metadata, &smithy.DeserializationError{
16681			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16682			Snapshot: snapshot.Bytes(),
16683		}
16684	}
16685
16686	return out, metadata, err
16687}
16688
16689func awsRestjson1_deserializeOpErrorGetRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16690	var errorBuffer bytes.Buffer
16691	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16692		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16693	}
16694	errorBody := bytes.NewReader(errorBuffer.Bytes())
16695
16696	errorCode := "UnknownError"
16697	errorMessage := errorCode
16698
16699	code := response.Header.Get("X-Amzn-ErrorType")
16700	if len(code) != 0 {
16701		errorCode = restjson.SanitizeErrorCode(code)
16702	}
16703
16704	var buff [1024]byte
16705	ringBuffer := smithyio.NewRingBuffer(buff[:])
16706
16707	body := io.TeeReader(errorBody, ringBuffer)
16708	decoder := json.NewDecoder(body)
16709	decoder.UseNumber()
16710	code, message, err := restjson.GetErrorInfo(decoder)
16711	if err != nil {
16712		var snapshot bytes.Buffer
16713		io.Copy(&snapshot, ringBuffer)
16714		err = &smithy.DeserializationError{
16715			Err:      fmt.Errorf("failed to decode response body, %w", err),
16716			Snapshot: snapshot.Bytes(),
16717		}
16718		return err
16719	}
16720
16721	errorBody.Seek(0, io.SeekStart)
16722	if len(code) != 0 {
16723		errorCode = restjson.SanitizeErrorCode(code)
16724	}
16725	if len(message) != 0 {
16726		errorMessage = message
16727	}
16728
16729	switch {
16730	case strings.EqualFold("InternalFailureException", errorCode):
16731		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16732
16733	case strings.EqualFold("InvalidRequestException", errorCode):
16734		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
16735
16736	case strings.EqualFold("ServiceUnavailableException", errorCode):
16737		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
16738
16739	case strings.EqualFold("ThrottlingException", errorCode):
16740		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16741
16742	case strings.EqualFold("UnauthorizedException", errorCode):
16743		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
16744
16745	default:
16746		genericError := &smithy.GenericAPIError{
16747			Code:    errorCode,
16748			Message: errorMessage,
16749		}
16750		return genericError
16751
16752	}
16753}
16754
16755func awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(v **GetRegistrationCodeOutput, value interface{}) error {
16756	if v == nil {
16757		return fmt.Errorf("unexpected nil of type %T", v)
16758	}
16759	if value == nil {
16760		return nil
16761	}
16762
16763	shape, ok := value.(map[string]interface{})
16764	if !ok {
16765		return fmt.Errorf("unexpected JSON type %v", value)
16766	}
16767
16768	var sv *GetRegistrationCodeOutput
16769	if *v == nil {
16770		sv = &GetRegistrationCodeOutput{}
16771	} else {
16772		sv = *v
16773	}
16774
16775	for key, value := range shape {
16776		switch key {
16777		case "registrationCode":
16778			if value != nil {
16779				jtv, ok := value.(string)
16780				if !ok {
16781					return fmt.Errorf("expected RegistrationCode to be of type string, got %T instead", value)
16782				}
16783				sv.RegistrationCode = ptr.String(jtv)
16784			}
16785
16786		default:
16787			_, _ = key, value
16788
16789		}
16790	}
16791	*v = sv
16792	return nil
16793}
16794
16795type awsRestjson1_deserializeOpGetStatistics struct {
16796}
16797
16798func (*awsRestjson1_deserializeOpGetStatistics) ID() string {
16799	return "OperationDeserializer"
16800}
16801
16802func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16803	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16804) {
16805	out, metadata, err = next.HandleDeserialize(ctx, in)
16806	if err != nil {
16807		return out, metadata, err
16808	}
16809
16810	response, ok := out.RawResponse.(*smithyhttp.Response)
16811	if !ok {
16812		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16813	}
16814
16815	if response.StatusCode < 200 || response.StatusCode >= 300 {
16816		return out, metadata, awsRestjson1_deserializeOpErrorGetStatistics(response, &metadata)
16817	}
16818	output := &GetStatisticsOutput{}
16819	out.Result = output
16820
16821	var buff [1024]byte
16822	ringBuffer := smithyio.NewRingBuffer(buff[:])
16823
16824	body := io.TeeReader(response.Body, ringBuffer)
16825
16826	decoder := json.NewDecoder(body)
16827	decoder.UseNumber()
16828	var shape interface{}
16829	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16830		var snapshot bytes.Buffer
16831		io.Copy(&snapshot, ringBuffer)
16832		err = &smithy.DeserializationError{
16833			Err:      fmt.Errorf("failed to decode response body, %w", err),
16834			Snapshot: snapshot.Bytes(),
16835		}
16836		return out, metadata, err
16837	}
16838
16839	err = awsRestjson1_deserializeOpDocumentGetStatisticsOutput(&output, shape)
16840	if err != nil {
16841		var snapshot bytes.Buffer
16842		io.Copy(&snapshot, ringBuffer)
16843		return out, metadata, &smithy.DeserializationError{
16844			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16845			Snapshot: snapshot.Bytes(),
16846		}
16847	}
16848
16849	return out, metadata, err
16850}
16851
16852func awsRestjson1_deserializeOpErrorGetStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16853	var errorBuffer bytes.Buffer
16854	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16855		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16856	}
16857	errorBody := bytes.NewReader(errorBuffer.Bytes())
16858
16859	errorCode := "UnknownError"
16860	errorMessage := errorCode
16861
16862	code := response.Header.Get("X-Amzn-ErrorType")
16863	if len(code) != 0 {
16864		errorCode = restjson.SanitizeErrorCode(code)
16865	}
16866
16867	var buff [1024]byte
16868	ringBuffer := smithyio.NewRingBuffer(buff[:])
16869
16870	body := io.TeeReader(errorBody, ringBuffer)
16871	decoder := json.NewDecoder(body)
16872	decoder.UseNumber()
16873	code, message, err := restjson.GetErrorInfo(decoder)
16874	if err != nil {
16875		var snapshot bytes.Buffer
16876		io.Copy(&snapshot, ringBuffer)
16877		err = &smithy.DeserializationError{
16878			Err:      fmt.Errorf("failed to decode response body, %w", err),
16879			Snapshot: snapshot.Bytes(),
16880		}
16881		return err
16882	}
16883
16884	errorBody.Seek(0, io.SeekStart)
16885	if len(code) != 0 {
16886		errorCode = restjson.SanitizeErrorCode(code)
16887	}
16888	if len(message) != 0 {
16889		errorMessage = message
16890	}
16891
16892	switch {
16893	case strings.EqualFold("IndexNotReadyException", errorCode):
16894		return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody)
16895
16896	case strings.EqualFold("InternalFailureException", errorCode):
16897		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16898
16899	case strings.EqualFold("InvalidAggregationException", errorCode):
16900		return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody)
16901
16902	case strings.EqualFold("InvalidQueryException", errorCode):
16903		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
16904
16905	case strings.EqualFold("InvalidRequestException", errorCode):
16906		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
16907
16908	case strings.EqualFold("ResourceNotFoundException", errorCode):
16909		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16910
16911	case strings.EqualFold("ServiceUnavailableException", errorCode):
16912		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
16913
16914	case strings.EqualFold("ThrottlingException", errorCode):
16915		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16916
16917	case strings.EqualFold("UnauthorizedException", errorCode):
16918		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
16919
16920	default:
16921		genericError := &smithy.GenericAPIError{
16922			Code:    errorCode,
16923			Message: errorMessage,
16924		}
16925		return genericError
16926
16927	}
16928}
16929
16930func awsRestjson1_deserializeOpDocumentGetStatisticsOutput(v **GetStatisticsOutput, value interface{}) error {
16931	if v == nil {
16932		return fmt.Errorf("unexpected nil of type %T", v)
16933	}
16934	if value == nil {
16935		return nil
16936	}
16937
16938	shape, ok := value.(map[string]interface{})
16939	if !ok {
16940		return fmt.Errorf("unexpected JSON type %v", value)
16941	}
16942
16943	var sv *GetStatisticsOutput
16944	if *v == nil {
16945		sv = &GetStatisticsOutput{}
16946	} else {
16947		sv = *v
16948	}
16949
16950	for key, value := range shape {
16951		switch key {
16952		case "statistics":
16953			if err := awsRestjson1_deserializeDocumentStatistics(&sv.Statistics, value); err != nil {
16954				return err
16955			}
16956
16957		default:
16958			_, _ = key, value
16959
16960		}
16961	}
16962	*v = sv
16963	return nil
16964}
16965
16966type awsRestjson1_deserializeOpGetTopicRule struct {
16967}
16968
16969func (*awsRestjson1_deserializeOpGetTopicRule) ID() string {
16970	return "OperationDeserializer"
16971}
16972
16973func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16974	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16975) {
16976	out, metadata, err = next.HandleDeserialize(ctx, in)
16977	if err != nil {
16978		return out, metadata, err
16979	}
16980
16981	response, ok := out.RawResponse.(*smithyhttp.Response)
16982	if !ok {
16983		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16984	}
16985
16986	if response.StatusCode < 200 || response.StatusCode >= 300 {
16987		return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRule(response, &metadata)
16988	}
16989	output := &GetTopicRuleOutput{}
16990	out.Result = output
16991
16992	var buff [1024]byte
16993	ringBuffer := smithyio.NewRingBuffer(buff[:])
16994
16995	body := io.TeeReader(response.Body, ringBuffer)
16996
16997	decoder := json.NewDecoder(body)
16998	decoder.UseNumber()
16999	var shape interface{}
17000	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17001		var snapshot bytes.Buffer
17002		io.Copy(&snapshot, ringBuffer)
17003		err = &smithy.DeserializationError{
17004			Err:      fmt.Errorf("failed to decode response body, %w", err),
17005			Snapshot: snapshot.Bytes(),
17006		}
17007		return out, metadata, err
17008	}
17009
17010	err = awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(&output, shape)
17011	if err != nil {
17012		var snapshot bytes.Buffer
17013		io.Copy(&snapshot, ringBuffer)
17014		return out, metadata, &smithy.DeserializationError{
17015			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17016			Snapshot: snapshot.Bytes(),
17017		}
17018	}
17019
17020	return out, metadata, err
17021}
17022
17023func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17024	var errorBuffer bytes.Buffer
17025	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17026		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17027	}
17028	errorBody := bytes.NewReader(errorBuffer.Bytes())
17029
17030	errorCode := "UnknownError"
17031	errorMessage := errorCode
17032
17033	code := response.Header.Get("X-Amzn-ErrorType")
17034	if len(code) != 0 {
17035		errorCode = restjson.SanitizeErrorCode(code)
17036	}
17037
17038	var buff [1024]byte
17039	ringBuffer := smithyio.NewRingBuffer(buff[:])
17040
17041	body := io.TeeReader(errorBody, ringBuffer)
17042	decoder := json.NewDecoder(body)
17043	decoder.UseNumber()
17044	code, message, err := restjson.GetErrorInfo(decoder)
17045	if err != nil {
17046		var snapshot bytes.Buffer
17047		io.Copy(&snapshot, ringBuffer)
17048		err = &smithy.DeserializationError{
17049			Err:      fmt.Errorf("failed to decode response body, %w", err),
17050			Snapshot: snapshot.Bytes(),
17051		}
17052		return err
17053	}
17054
17055	errorBody.Seek(0, io.SeekStart)
17056	if len(code) != 0 {
17057		errorCode = restjson.SanitizeErrorCode(code)
17058	}
17059	if len(message) != 0 {
17060		errorMessage = message
17061	}
17062
17063	switch {
17064	case strings.EqualFold("InternalException", errorCode):
17065		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
17066
17067	case strings.EqualFold("InvalidRequestException", errorCode):
17068		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
17069
17070	case strings.EqualFold("ServiceUnavailableException", errorCode):
17071		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
17072
17073	case strings.EqualFold("UnauthorizedException", errorCode):
17074		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
17075
17076	default:
17077		genericError := &smithy.GenericAPIError{
17078			Code:    errorCode,
17079			Message: errorMessage,
17080		}
17081		return genericError
17082
17083	}
17084}
17085
17086func awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(v **GetTopicRuleOutput, value interface{}) error {
17087	if v == nil {
17088		return fmt.Errorf("unexpected nil of type %T", v)
17089	}
17090	if value == nil {
17091		return nil
17092	}
17093
17094	shape, ok := value.(map[string]interface{})
17095	if !ok {
17096		return fmt.Errorf("unexpected JSON type %v", value)
17097	}
17098
17099	var sv *GetTopicRuleOutput
17100	if *v == nil {
17101		sv = &GetTopicRuleOutput{}
17102	} else {
17103		sv = *v
17104	}
17105
17106	for key, value := range shape {
17107		switch key {
17108		case "rule":
17109			if err := awsRestjson1_deserializeDocumentTopicRule(&sv.Rule, value); err != nil {
17110				return err
17111			}
17112
17113		case "ruleArn":
17114			if value != nil {
17115				jtv, ok := value.(string)
17116				if !ok {
17117					return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value)
17118				}
17119				sv.RuleArn = ptr.String(jtv)
17120			}
17121
17122		default:
17123			_, _ = key, value
17124
17125		}
17126	}
17127	*v = sv
17128	return nil
17129}
17130
17131type awsRestjson1_deserializeOpGetTopicRuleDestination struct {
17132}
17133
17134func (*awsRestjson1_deserializeOpGetTopicRuleDestination) ID() string {
17135	return "OperationDeserializer"
17136}
17137
17138func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17139	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17140) {
17141	out, metadata, err = next.HandleDeserialize(ctx, in)
17142	if err != nil {
17143		return out, metadata, err
17144	}
17145
17146	response, ok := out.RawResponse.(*smithyhttp.Response)
17147	if !ok {
17148		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17149	}
17150
17151	if response.StatusCode < 200 || response.StatusCode >= 300 {
17152		return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response, &metadata)
17153	}
17154	output := &GetTopicRuleDestinationOutput{}
17155	out.Result = output
17156
17157	var buff [1024]byte
17158	ringBuffer := smithyio.NewRingBuffer(buff[:])
17159
17160	body := io.TeeReader(response.Body, ringBuffer)
17161
17162	decoder := json.NewDecoder(body)
17163	decoder.UseNumber()
17164	var shape interface{}
17165	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17166		var snapshot bytes.Buffer
17167		io.Copy(&snapshot, ringBuffer)
17168		err = &smithy.DeserializationError{
17169			Err:      fmt.Errorf("failed to decode response body, %w", err),
17170			Snapshot: snapshot.Bytes(),
17171		}
17172		return out, metadata, err
17173	}
17174
17175	err = awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(&output, shape)
17176	if err != nil {
17177		var snapshot bytes.Buffer
17178		io.Copy(&snapshot, ringBuffer)
17179		return out, metadata, &smithy.DeserializationError{
17180			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17181			Snapshot: snapshot.Bytes(),
17182		}
17183	}
17184
17185	return out, metadata, err
17186}
17187
17188func awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17189	var errorBuffer bytes.Buffer
17190	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17191		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17192	}
17193	errorBody := bytes.NewReader(errorBuffer.Bytes())
17194
17195	errorCode := "UnknownError"
17196	errorMessage := errorCode
17197
17198	code := response.Header.Get("X-Amzn-ErrorType")
17199	if len(code) != 0 {
17200		errorCode = restjson.SanitizeErrorCode(code)
17201	}
17202
17203	var buff [1024]byte
17204	ringBuffer := smithyio.NewRingBuffer(buff[:])
17205
17206	body := io.TeeReader(errorBody, ringBuffer)
17207	decoder := json.NewDecoder(body)
17208	decoder.UseNumber()
17209	code, message, err := restjson.GetErrorInfo(decoder)
17210	if err != nil {
17211		var snapshot bytes.Buffer
17212		io.Copy(&snapshot, ringBuffer)
17213		err = &smithy.DeserializationError{
17214			Err:      fmt.Errorf("failed to decode response body, %w", err),
17215			Snapshot: snapshot.Bytes(),
17216		}
17217		return err
17218	}
17219
17220	errorBody.Seek(0, io.SeekStart)
17221	if len(code) != 0 {
17222		errorCode = restjson.SanitizeErrorCode(code)
17223	}
17224	if len(message) != 0 {
17225		errorMessage = message
17226	}
17227
17228	switch {
17229	case strings.EqualFold("InternalException", errorCode):
17230		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
17231
17232	case strings.EqualFold("InvalidRequestException", errorCode):
17233		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
17234
17235	case strings.EqualFold("ServiceUnavailableException", errorCode):
17236		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
17237
17238	case strings.EqualFold("UnauthorizedException", errorCode):
17239		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
17240
17241	default:
17242		genericError := &smithy.GenericAPIError{
17243			Code:    errorCode,
17244			Message: errorMessage,
17245		}
17246		return genericError
17247
17248	}
17249}
17250
17251func awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(v **GetTopicRuleDestinationOutput, value interface{}) error {
17252	if v == nil {
17253		return fmt.Errorf("unexpected nil of type %T", v)
17254	}
17255	if value == nil {
17256		return nil
17257	}
17258
17259	shape, ok := value.(map[string]interface{})
17260	if !ok {
17261		return fmt.Errorf("unexpected JSON type %v", value)
17262	}
17263
17264	var sv *GetTopicRuleDestinationOutput
17265	if *v == nil {
17266		sv = &GetTopicRuleDestinationOutput{}
17267	} else {
17268		sv = *v
17269	}
17270
17271	for key, value := range shape {
17272		switch key {
17273		case "topicRuleDestination":
17274			if err := awsRestjson1_deserializeDocumentTopicRuleDestination(&sv.TopicRuleDestination, value); err != nil {
17275				return err
17276			}
17277
17278		default:
17279			_, _ = key, value
17280
17281		}
17282	}
17283	*v = sv
17284	return nil
17285}
17286
17287type awsRestjson1_deserializeOpGetV2LoggingOptions struct {
17288}
17289
17290func (*awsRestjson1_deserializeOpGetV2LoggingOptions) ID() string {
17291	return "OperationDeserializer"
17292}
17293
17294func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17295	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17296) {
17297	out, metadata, err = next.HandleDeserialize(ctx, in)
17298	if err != nil {
17299		return out, metadata, err
17300	}
17301
17302	response, ok := out.RawResponse.(*smithyhttp.Response)
17303	if !ok {
17304		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17305	}
17306
17307	if response.StatusCode < 200 || response.StatusCode >= 300 {
17308		return out, metadata, awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response, &metadata)
17309	}
17310	output := &GetV2LoggingOptionsOutput{}
17311	out.Result = output
17312
17313	var buff [1024]byte
17314	ringBuffer := smithyio.NewRingBuffer(buff[:])
17315
17316	body := io.TeeReader(response.Body, ringBuffer)
17317
17318	decoder := json.NewDecoder(body)
17319	decoder.UseNumber()
17320	var shape interface{}
17321	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17322		var snapshot bytes.Buffer
17323		io.Copy(&snapshot, ringBuffer)
17324		err = &smithy.DeserializationError{
17325			Err:      fmt.Errorf("failed to decode response body, %w", err),
17326			Snapshot: snapshot.Bytes(),
17327		}
17328		return out, metadata, err
17329	}
17330
17331	err = awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(&output, shape)
17332	if err != nil {
17333		var snapshot bytes.Buffer
17334		io.Copy(&snapshot, ringBuffer)
17335		return out, metadata, &smithy.DeserializationError{
17336			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17337			Snapshot: snapshot.Bytes(),
17338		}
17339	}
17340
17341	return out, metadata, err
17342}
17343
17344func awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17345	var errorBuffer bytes.Buffer
17346	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17347		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17348	}
17349	errorBody := bytes.NewReader(errorBuffer.Bytes())
17350
17351	errorCode := "UnknownError"
17352	errorMessage := errorCode
17353
17354	code := response.Header.Get("X-Amzn-ErrorType")
17355	if len(code) != 0 {
17356		errorCode = restjson.SanitizeErrorCode(code)
17357	}
17358
17359	var buff [1024]byte
17360	ringBuffer := smithyio.NewRingBuffer(buff[:])
17361
17362	body := io.TeeReader(errorBody, ringBuffer)
17363	decoder := json.NewDecoder(body)
17364	decoder.UseNumber()
17365	code, message, err := restjson.GetErrorInfo(decoder)
17366	if err != nil {
17367		var snapshot bytes.Buffer
17368		io.Copy(&snapshot, ringBuffer)
17369		err = &smithy.DeserializationError{
17370			Err:      fmt.Errorf("failed to decode response body, %w", err),
17371			Snapshot: snapshot.Bytes(),
17372		}
17373		return err
17374	}
17375
17376	errorBody.Seek(0, io.SeekStart)
17377	if len(code) != 0 {
17378		errorCode = restjson.SanitizeErrorCode(code)
17379	}
17380	if len(message) != 0 {
17381		errorMessage = message
17382	}
17383
17384	switch {
17385	case strings.EqualFold("InternalException", errorCode):
17386		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
17387
17388	case strings.EqualFold("NotConfiguredException", errorCode):
17389		return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody)
17390
17391	case strings.EqualFold("ServiceUnavailableException", errorCode):
17392		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
17393
17394	default:
17395		genericError := &smithy.GenericAPIError{
17396			Code:    errorCode,
17397			Message: errorMessage,
17398		}
17399		return genericError
17400
17401	}
17402}
17403
17404func awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(v **GetV2LoggingOptionsOutput, value interface{}) error {
17405	if v == nil {
17406		return fmt.Errorf("unexpected nil of type %T", v)
17407	}
17408	if value == nil {
17409		return nil
17410	}
17411
17412	shape, ok := value.(map[string]interface{})
17413	if !ok {
17414		return fmt.Errorf("unexpected JSON type %v", value)
17415	}
17416
17417	var sv *GetV2LoggingOptionsOutput
17418	if *v == nil {
17419		sv = &GetV2LoggingOptionsOutput{}
17420	} else {
17421		sv = *v
17422	}
17423
17424	for key, value := range shape {
17425		switch key {
17426		case "defaultLogLevel":
17427			if value != nil {
17428				jtv, ok := value.(string)
17429				if !ok {
17430					return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value)
17431				}
17432				sv.DefaultLogLevel = types.LogLevel(jtv)
17433			}
17434
17435		case "disableAllLogs":
17436			if value != nil {
17437				jtv, ok := value.(bool)
17438				if !ok {
17439					return fmt.Errorf("expected DisableAllLogs to be of type *bool, got %T instead", value)
17440				}
17441				sv.DisableAllLogs = jtv
17442			}
17443
17444		case "roleArn":
17445			if value != nil {
17446				jtv, ok := value.(string)
17447				if !ok {
17448					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
17449				}
17450				sv.RoleArn = ptr.String(jtv)
17451			}
17452
17453		default:
17454			_, _ = key, value
17455
17456		}
17457	}
17458	*v = sv
17459	return nil
17460}
17461
17462type awsRestjson1_deserializeOpListActiveViolations struct {
17463}
17464
17465func (*awsRestjson1_deserializeOpListActiveViolations) ID() string {
17466	return "OperationDeserializer"
17467}
17468
17469func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17470	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17471) {
17472	out, metadata, err = next.HandleDeserialize(ctx, in)
17473	if err != nil {
17474		return out, metadata, err
17475	}
17476
17477	response, ok := out.RawResponse.(*smithyhttp.Response)
17478	if !ok {
17479		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17480	}
17481
17482	if response.StatusCode < 200 || response.StatusCode >= 300 {
17483		return out, metadata, awsRestjson1_deserializeOpErrorListActiveViolations(response, &metadata)
17484	}
17485	output := &ListActiveViolationsOutput{}
17486	out.Result = output
17487
17488	var buff [1024]byte
17489	ringBuffer := smithyio.NewRingBuffer(buff[:])
17490
17491	body := io.TeeReader(response.Body, ringBuffer)
17492
17493	decoder := json.NewDecoder(body)
17494	decoder.UseNumber()
17495	var shape interface{}
17496	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17497		var snapshot bytes.Buffer
17498		io.Copy(&snapshot, ringBuffer)
17499		err = &smithy.DeserializationError{
17500			Err:      fmt.Errorf("failed to decode response body, %w", err),
17501			Snapshot: snapshot.Bytes(),
17502		}
17503		return out, metadata, err
17504	}
17505
17506	err = awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(&output, shape)
17507	if err != nil {
17508		var snapshot bytes.Buffer
17509		io.Copy(&snapshot, ringBuffer)
17510		return out, metadata, &smithy.DeserializationError{
17511			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17512			Snapshot: snapshot.Bytes(),
17513		}
17514	}
17515
17516	return out, metadata, err
17517}
17518
17519func awsRestjson1_deserializeOpErrorListActiveViolations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17520	var errorBuffer bytes.Buffer
17521	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17522		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17523	}
17524	errorBody := bytes.NewReader(errorBuffer.Bytes())
17525
17526	errorCode := "UnknownError"
17527	errorMessage := errorCode
17528
17529	code := response.Header.Get("X-Amzn-ErrorType")
17530	if len(code) != 0 {
17531		errorCode = restjson.SanitizeErrorCode(code)
17532	}
17533
17534	var buff [1024]byte
17535	ringBuffer := smithyio.NewRingBuffer(buff[:])
17536
17537	body := io.TeeReader(errorBody, ringBuffer)
17538	decoder := json.NewDecoder(body)
17539	decoder.UseNumber()
17540	code, message, err := restjson.GetErrorInfo(decoder)
17541	if err != nil {
17542		var snapshot bytes.Buffer
17543		io.Copy(&snapshot, ringBuffer)
17544		err = &smithy.DeserializationError{
17545			Err:      fmt.Errorf("failed to decode response body, %w", err),
17546			Snapshot: snapshot.Bytes(),
17547		}
17548		return err
17549	}
17550
17551	errorBody.Seek(0, io.SeekStart)
17552	if len(code) != 0 {
17553		errorCode = restjson.SanitizeErrorCode(code)
17554	}
17555	if len(message) != 0 {
17556		errorMessage = message
17557	}
17558
17559	switch {
17560	case strings.EqualFold("InternalFailureException", errorCode):
17561		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17562
17563	case strings.EqualFold("InvalidRequestException", errorCode):
17564		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
17565
17566	case strings.EqualFold("ResourceNotFoundException", errorCode):
17567		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17568
17569	case strings.EqualFold("ThrottlingException", errorCode):
17570		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17571
17572	default:
17573		genericError := &smithy.GenericAPIError{
17574			Code:    errorCode,
17575			Message: errorMessage,
17576		}
17577		return genericError
17578
17579	}
17580}
17581
17582func awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(v **ListActiveViolationsOutput, value interface{}) error {
17583	if v == nil {
17584		return fmt.Errorf("unexpected nil of type %T", v)
17585	}
17586	if value == nil {
17587		return nil
17588	}
17589
17590	shape, ok := value.(map[string]interface{})
17591	if !ok {
17592		return fmt.Errorf("unexpected JSON type %v", value)
17593	}
17594
17595	var sv *ListActiveViolationsOutput
17596	if *v == nil {
17597		sv = &ListActiveViolationsOutput{}
17598	} else {
17599		sv = *v
17600	}
17601
17602	for key, value := range shape {
17603		switch key {
17604		case "activeViolations":
17605			if err := awsRestjson1_deserializeDocumentActiveViolations(&sv.ActiveViolations, value); err != nil {
17606				return err
17607			}
17608
17609		case "nextToken":
17610			if value != nil {
17611				jtv, ok := value.(string)
17612				if !ok {
17613					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
17614				}
17615				sv.NextToken = ptr.String(jtv)
17616			}
17617
17618		default:
17619			_, _ = key, value
17620
17621		}
17622	}
17623	*v = sv
17624	return nil
17625}
17626
17627type awsRestjson1_deserializeOpListAttachedPolicies struct {
17628}
17629
17630func (*awsRestjson1_deserializeOpListAttachedPolicies) ID() string {
17631	return "OperationDeserializer"
17632}
17633
17634func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17635	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17636) {
17637	out, metadata, err = next.HandleDeserialize(ctx, in)
17638	if err != nil {
17639		return out, metadata, err
17640	}
17641
17642	response, ok := out.RawResponse.(*smithyhttp.Response)
17643	if !ok {
17644		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17645	}
17646
17647	if response.StatusCode < 200 || response.StatusCode >= 300 {
17648		return out, metadata, awsRestjson1_deserializeOpErrorListAttachedPolicies(response, &metadata)
17649	}
17650	output := &ListAttachedPoliciesOutput{}
17651	out.Result = output
17652
17653	var buff [1024]byte
17654	ringBuffer := smithyio.NewRingBuffer(buff[:])
17655
17656	body := io.TeeReader(response.Body, ringBuffer)
17657
17658	decoder := json.NewDecoder(body)
17659	decoder.UseNumber()
17660	var shape interface{}
17661	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17662		var snapshot bytes.Buffer
17663		io.Copy(&snapshot, ringBuffer)
17664		err = &smithy.DeserializationError{
17665			Err:      fmt.Errorf("failed to decode response body, %w", err),
17666			Snapshot: snapshot.Bytes(),
17667		}
17668		return out, metadata, err
17669	}
17670
17671	err = awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(&output, shape)
17672	if err != nil {
17673		var snapshot bytes.Buffer
17674		io.Copy(&snapshot, ringBuffer)
17675		return out, metadata, &smithy.DeserializationError{
17676			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17677			Snapshot: snapshot.Bytes(),
17678		}
17679	}
17680
17681	return out, metadata, err
17682}
17683
17684func awsRestjson1_deserializeOpErrorListAttachedPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17685	var errorBuffer bytes.Buffer
17686	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17687		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17688	}
17689	errorBody := bytes.NewReader(errorBuffer.Bytes())
17690
17691	errorCode := "UnknownError"
17692	errorMessage := errorCode
17693
17694	code := response.Header.Get("X-Amzn-ErrorType")
17695	if len(code) != 0 {
17696		errorCode = restjson.SanitizeErrorCode(code)
17697	}
17698
17699	var buff [1024]byte
17700	ringBuffer := smithyio.NewRingBuffer(buff[:])
17701
17702	body := io.TeeReader(errorBody, ringBuffer)
17703	decoder := json.NewDecoder(body)
17704	decoder.UseNumber()
17705	code, message, err := restjson.GetErrorInfo(decoder)
17706	if err != nil {
17707		var snapshot bytes.Buffer
17708		io.Copy(&snapshot, ringBuffer)
17709		err = &smithy.DeserializationError{
17710			Err:      fmt.Errorf("failed to decode response body, %w", err),
17711			Snapshot: snapshot.Bytes(),
17712		}
17713		return err
17714	}
17715
17716	errorBody.Seek(0, io.SeekStart)
17717	if len(code) != 0 {
17718		errorCode = restjson.SanitizeErrorCode(code)
17719	}
17720	if len(message) != 0 {
17721		errorMessage = message
17722	}
17723
17724	switch {
17725	case strings.EqualFold("InternalFailureException", errorCode):
17726		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17727
17728	case strings.EqualFold("InvalidRequestException", errorCode):
17729		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
17730
17731	case strings.EqualFold("LimitExceededException", errorCode):
17732		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
17733
17734	case strings.EqualFold("ResourceNotFoundException", errorCode):
17735		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17736
17737	case strings.EqualFold("ServiceUnavailableException", errorCode):
17738		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
17739
17740	case strings.EqualFold("ThrottlingException", errorCode):
17741		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17742
17743	case strings.EqualFold("UnauthorizedException", errorCode):
17744		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
17745
17746	default:
17747		genericError := &smithy.GenericAPIError{
17748			Code:    errorCode,
17749			Message: errorMessage,
17750		}
17751		return genericError
17752
17753	}
17754}
17755
17756func awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(v **ListAttachedPoliciesOutput, value interface{}) error {
17757	if v == nil {
17758		return fmt.Errorf("unexpected nil of type %T", v)
17759	}
17760	if value == nil {
17761		return nil
17762	}
17763
17764	shape, ok := value.(map[string]interface{})
17765	if !ok {
17766		return fmt.Errorf("unexpected JSON type %v", value)
17767	}
17768
17769	var sv *ListAttachedPoliciesOutput
17770	if *v == nil {
17771		sv = &ListAttachedPoliciesOutput{}
17772	} else {
17773		sv = *v
17774	}
17775
17776	for key, value := range shape {
17777		switch key {
17778		case "nextMarker":
17779			if value != nil {
17780				jtv, ok := value.(string)
17781				if !ok {
17782					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
17783				}
17784				sv.NextMarker = ptr.String(jtv)
17785			}
17786
17787		case "policies":
17788			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
17789				return err
17790			}
17791
17792		default:
17793			_, _ = key, value
17794
17795		}
17796	}
17797	*v = sv
17798	return nil
17799}
17800
17801type awsRestjson1_deserializeOpListAuditFindings struct {
17802}
17803
17804func (*awsRestjson1_deserializeOpListAuditFindings) ID() string {
17805	return "OperationDeserializer"
17806}
17807
17808func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17809	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17810) {
17811	out, metadata, err = next.HandleDeserialize(ctx, in)
17812	if err != nil {
17813		return out, metadata, err
17814	}
17815
17816	response, ok := out.RawResponse.(*smithyhttp.Response)
17817	if !ok {
17818		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17819	}
17820
17821	if response.StatusCode < 200 || response.StatusCode >= 300 {
17822		return out, metadata, awsRestjson1_deserializeOpErrorListAuditFindings(response, &metadata)
17823	}
17824	output := &ListAuditFindingsOutput{}
17825	out.Result = output
17826
17827	var buff [1024]byte
17828	ringBuffer := smithyio.NewRingBuffer(buff[:])
17829
17830	body := io.TeeReader(response.Body, ringBuffer)
17831
17832	decoder := json.NewDecoder(body)
17833	decoder.UseNumber()
17834	var shape interface{}
17835	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17836		var snapshot bytes.Buffer
17837		io.Copy(&snapshot, ringBuffer)
17838		err = &smithy.DeserializationError{
17839			Err:      fmt.Errorf("failed to decode response body, %w", err),
17840			Snapshot: snapshot.Bytes(),
17841		}
17842		return out, metadata, err
17843	}
17844
17845	err = awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(&output, shape)
17846	if err != nil {
17847		var snapshot bytes.Buffer
17848		io.Copy(&snapshot, ringBuffer)
17849		return out, metadata, &smithy.DeserializationError{
17850			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17851			Snapshot: snapshot.Bytes(),
17852		}
17853	}
17854
17855	return out, metadata, err
17856}
17857
17858func awsRestjson1_deserializeOpErrorListAuditFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17859	var errorBuffer bytes.Buffer
17860	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17861		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17862	}
17863	errorBody := bytes.NewReader(errorBuffer.Bytes())
17864
17865	errorCode := "UnknownError"
17866	errorMessage := errorCode
17867
17868	code := response.Header.Get("X-Amzn-ErrorType")
17869	if len(code) != 0 {
17870		errorCode = restjson.SanitizeErrorCode(code)
17871	}
17872
17873	var buff [1024]byte
17874	ringBuffer := smithyio.NewRingBuffer(buff[:])
17875
17876	body := io.TeeReader(errorBody, ringBuffer)
17877	decoder := json.NewDecoder(body)
17878	decoder.UseNumber()
17879	code, message, err := restjson.GetErrorInfo(decoder)
17880	if err != nil {
17881		var snapshot bytes.Buffer
17882		io.Copy(&snapshot, ringBuffer)
17883		err = &smithy.DeserializationError{
17884			Err:      fmt.Errorf("failed to decode response body, %w", err),
17885			Snapshot: snapshot.Bytes(),
17886		}
17887		return err
17888	}
17889
17890	errorBody.Seek(0, io.SeekStart)
17891	if len(code) != 0 {
17892		errorCode = restjson.SanitizeErrorCode(code)
17893	}
17894	if len(message) != 0 {
17895		errorMessage = message
17896	}
17897
17898	switch {
17899	case strings.EqualFold("InternalFailureException", errorCode):
17900		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17901
17902	case strings.EqualFold("InvalidRequestException", errorCode):
17903		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
17904
17905	case strings.EqualFold("ThrottlingException", errorCode):
17906		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17907
17908	default:
17909		genericError := &smithy.GenericAPIError{
17910			Code:    errorCode,
17911			Message: errorMessage,
17912		}
17913		return genericError
17914
17915	}
17916}
17917
17918func awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(v **ListAuditFindingsOutput, value interface{}) error {
17919	if v == nil {
17920		return fmt.Errorf("unexpected nil of type %T", v)
17921	}
17922	if value == nil {
17923		return nil
17924	}
17925
17926	shape, ok := value.(map[string]interface{})
17927	if !ok {
17928		return fmt.Errorf("unexpected JSON type %v", value)
17929	}
17930
17931	var sv *ListAuditFindingsOutput
17932	if *v == nil {
17933		sv = &ListAuditFindingsOutput{}
17934	} else {
17935		sv = *v
17936	}
17937
17938	for key, value := range shape {
17939		switch key {
17940		case "findings":
17941			if err := awsRestjson1_deserializeDocumentAuditFindings(&sv.Findings, value); err != nil {
17942				return err
17943			}
17944
17945		case "nextToken":
17946			if value != nil {
17947				jtv, ok := value.(string)
17948				if !ok {
17949					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
17950				}
17951				sv.NextToken = ptr.String(jtv)
17952			}
17953
17954		default:
17955			_, _ = key, value
17956
17957		}
17958	}
17959	*v = sv
17960	return nil
17961}
17962
17963type awsRestjson1_deserializeOpListAuditMitigationActionsExecutions struct {
17964}
17965
17966func (*awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) ID() string {
17967	return "OperationDeserializer"
17968}
17969
17970func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17971	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17972) {
17973	out, metadata, err = next.HandleDeserialize(ctx, in)
17974	if err != nil {
17975		return out, metadata, err
17976	}
17977
17978	response, ok := out.RawResponse.(*smithyhttp.Response)
17979	if !ok {
17980		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17981	}
17982
17983	if response.StatusCode < 200 || response.StatusCode >= 300 {
17984		return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response, &metadata)
17985	}
17986	output := &ListAuditMitigationActionsExecutionsOutput{}
17987	out.Result = output
17988
17989	var buff [1024]byte
17990	ringBuffer := smithyio.NewRingBuffer(buff[:])
17991
17992	body := io.TeeReader(response.Body, ringBuffer)
17993
17994	decoder := json.NewDecoder(body)
17995	decoder.UseNumber()
17996	var shape interface{}
17997	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17998		var snapshot bytes.Buffer
17999		io.Copy(&snapshot, ringBuffer)
18000		err = &smithy.DeserializationError{
18001			Err:      fmt.Errorf("failed to decode response body, %w", err),
18002			Snapshot: snapshot.Bytes(),
18003		}
18004		return out, metadata, err
18005	}
18006
18007	err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(&output, shape)
18008	if err != nil {
18009		var snapshot bytes.Buffer
18010		io.Copy(&snapshot, ringBuffer)
18011		return out, metadata, &smithy.DeserializationError{
18012			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18013			Snapshot: snapshot.Bytes(),
18014		}
18015	}
18016
18017	return out, metadata, err
18018}
18019
18020func awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18021	var errorBuffer bytes.Buffer
18022	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18023		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18024	}
18025	errorBody := bytes.NewReader(errorBuffer.Bytes())
18026
18027	errorCode := "UnknownError"
18028	errorMessage := errorCode
18029
18030	code := response.Header.Get("X-Amzn-ErrorType")
18031	if len(code) != 0 {
18032		errorCode = restjson.SanitizeErrorCode(code)
18033	}
18034
18035	var buff [1024]byte
18036	ringBuffer := smithyio.NewRingBuffer(buff[:])
18037
18038	body := io.TeeReader(errorBody, ringBuffer)
18039	decoder := json.NewDecoder(body)
18040	decoder.UseNumber()
18041	code, message, err := restjson.GetErrorInfo(decoder)
18042	if err != nil {
18043		var snapshot bytes.Buffer
18044		io.Copy(&snapshot, ringBuffer)
18045		err = &smithy.DeserializationError{
18046			Err:      fmt.Errorf("failed to decode response body, %w", err),
18047			Snapshot: snapshot.Bytes(),
18048		}
18049		return err
18050	}
18051
18052	errorBody.Seek(0, io.SeekStart)
18053	if len(code) != 0 {
18054		errorCode = restjson.SanitizeErrorCode(code)
18055	}
18056	if len(message) != 0 {
18057		errorMessage = message
18058	}
18059
18060	switch {
18061	case strings.EqualFold("InternalFailureException", errorCode):
18062		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18063
18064	case strings.EqualFold("InvalidRequestException", errorCode):
18065		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18066
18067	case strings.EqualFold("ThrottlingException", errorCode):
18068		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18069
18070	default:
18071		genericError := &smithy.GenericAPIError{
18072			Code:    errorCode,
18073			Message: errorMessage,
18074		}
18075		return genericError
18076
18077	}
18078}
18079
18080func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(v **ListAuditMitigationActionsExecutionsOutput, value interface{}) error {
18081	if v == nil {
18082		return fmt.Errorf("unexpected nil of type %T", v)
18083	}
18084	if value == nil {
18085		return nil
18086	}
18087
18088	shape, ok := value.(map[string]interface{})
18089	if !ok {
18090		return fmt.Errorf("unexpected JSON type %v", value)
18091	}
18092
18093	var sv *ListAuditMitigationActionsExecutionsOutput
18094	if *v == nil {
18095		sv = &ListAuditMitigationActionsExecutionsOutput{}
18096	} else {
18097		sv = *v
18098	}
18099
18100	for key, value := range shape {
18101		switch key {
18102		case "actionsExecutions":
18103			if err := awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadataList(&sv.ActionsExecutions, value); err != nil {
18104				return err
18105			}
18106
18107		case "nextToken":
18108			if value != nil {
18109				jtv, ok := value.(string)
18110				if !ok {
18111					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
18112				}
18113				sv.NextToken = ptr.String(jtv)
18114			}
18115
18116		default:
18117			_, _ = key, value
18118
18119		}
18120	}
18121	*v = sv
18122	return nil
18123}
18124
18125type awsRestjson1_deserializeOpListAuditMitigationActionsTasks struct {
18126}
18127
18128func (*awsRestjson1_deserializeOpListAuditMitigationActionsTasks) ID() string {
18129	return "OperationDeserializer"
18130}
18131
18132func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18133	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18134) {
18135	out, metadata, err = next.HandleDeserialize(ctx, in)
18136	if err != nil {
18137		return out, metadata, err
18138	}
18139
18140	response, ok := out.RawResponse.(*smithyhttp.Response)
18141	if !ok {
18142		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18143	}
18144
18145	if response.StatusCode < 200 || response.StatusCode >= 300 {
18146		return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response, &metadata)
18147	}
18148	output := &ListAuditMitigationActionsTasksOutput{}
18149	out.Result = output
18150
18151	var buff [1024]byte
18152	ringBuffer := smithyio.NewRingBuffer(buff[:])
18153
18154	body := io.TeeReader(response.Body, ringBuffer)
18155
18156	decoder := json.NewDecoder(body)
18157	decoder.UseNumber()
18158	var shape interface{}
18159	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18160		var snapshot bytes.Buffer
18161		io.Copy(&snapshot, ringBuffer)
18162		err = &smithy.DeserializationError{
18163			Err:      fmt.Errorf("failed to decode response body, %w", err),
18164			Snapshot: snapshot.Bytes(),
18165		}
18166		return out, metadata, err
18167	}
18168
18169	err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(&output, shape)
18170	if err != nil {
18171		var snapshot bytes.Buffer
18172		io.Copy(&snapshot, ringBuffer)
18173		return out, metadata, &smithy.DeserializationError{
18174			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18175			Snapshot: snapshot.Bytes(),
18176		}
18177	}
18178
18179	return out, metadata, err
18180}
18181
18182func awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18183	var errorBuffer bytes.Buffer
18184	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18185		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18186	}
18187	errorBody := bytes.NewReader(errorBuffer.Bytes())
18188
18189	errorCode := "UnknownError"
18190	errorMessage := errorCode
18191
18192	code := response.Header.Get("X-Amzn-ErrorType")
18193	if len(code) != 0 {
18194		errorCode = restjson.SanitizeErrorCode(code)
18195	}
18196
18197	var buff [1024]byte
18198	ringBuffer := smithyio.NewRingBuffer(buff[:])
18199
18200	body := io.TeeReader(errorBody, ringBuffer)
18201	decoder := json.NewDecoder(body)
18202	decoder.UseNumber()
18203	code, message, err := restjson.GetErrorInfo(decoder)
18204	if err != nil {
18205		var snapshot bytes.Buffer
18206		io.Copy(&snapshot, ringBuffer)
18207		err = &smithy.DeserializationError{
18208			Err:      fmt.Errorf("failed to decode response body, %w", err),
18209			Snapshot: snapshot.Bytes(),
18210		}
18211		return err
18212	}
18213
18214	errorBody.Seek(0, io.SeekStart)
18215	if len(code) != 0 {
18216		errorCode = restjson.SanitizeErrorCode(code)
18217	}
18218	if len(message) != 0 {
18219		errorMessage = message
18220	}
18221
18222	switch {
18223	case strings.EqualFold("InternalFailureException", errorCode):
18224		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18225
18226	case strings.EqualFold("InvalidRequestException", errorCode):
18227		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18228
18229	case strings.EqualFold("ThrottlingException", errorCode):
18230		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18231
18232	default:
18233		genericError := &smithy.GenericAPIError{
18234			Code:    errorCode,
18235			Message: errorMessage,
18236		}
18237		return genericError
18238
18239	}
18240}
18241
18242func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v **ListAuditMitigationActionsTasksOutput, value interface{}) error {
18243	if v == nil {
18244		return fmt.Errorf("unexpected nil of type %T", v)
18245	}
18246	if value == nil {
18247		return nil
18248	}
18249
18250	shape, ok := value.(map[string]interface{})
18251	if !ok {
18252		return fmt.Errorf("unexpected JSON type %v", value)
18253	}
18254
18255	var sv *ListAuditMitigationActionsTasksOutput
18256	if *v == nil {
18257		sv = &ListAuditMitigationActionsTasksOutput{}
18258	} else {
18259		sv = *v
18260	}
18261
18262	for key, value := range shape {
18263		switch key {
18264		case "nextToken":
18265			if value != nil {
18266				jtv, ok := value.(string)
18267				if !ok {
18268					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
18269				}
18270				sv.NextToken = ptr.String(jtv)
18271			}
18272
18273		case "tasks":
18274			if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(&sv.Tasks, value); err != nil {
18275				return err
18276			}
18277
18278		default:
18279			_, _ = key, value
18280
18281		}
18282	}
18283	*v = sv
18284	return nil
18285}
18286
18287type awsRestjson1_deserializeOpListAuditSuppressions struct {
18288}
18289
18290func (*awsRestjson1_deserializeOpListAuditSuppressions) ID() string {
18291	return "OperationDeserializer"
18292}
18293
18294func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18295	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18296) {
18297	out, metadata, err = next.HandleDeserialize(ctx, in)
18298	if err != nil {
18299		return out, metadata, err
18300	}
18301
18302	response, ok := out.RawResponse.(*smithyhttp.Response)
18303	if !ok {
18304		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18305	}
18306
18307	if response.StatusCode < 200 || response.StatusCode >= 300 {
18308		return out, metadata, awsRestjson1_deserializeOpErrorListAuditSuppressions(response, &metadata)
18309	}
18310	output := &ListAuditSuppressionsOutput{}
18311	out.Result = output
18312
18313	var buff [1024]byte
18314	ringBuffer := smithyio.NewRingBuffer(buff[:])
18315
18316	body := io.TeeReader(response.Body, ringBuffer)
18317
18318	decoder := json.NewDecoder(body)
18319	decoder.UseNumber()
18320	var shape interface{}
18321	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18322		var snapshot bytes.Buffer
18323		io.Copy(&snapshot, ringBuffer)
18324		err = &smithy.DeserializationError{
18325			Err:      fmt.Errorf("failed to decode response body, %w", err),
18326			Snapshot: snapshot.Bytes(),
18327		}
18328		return out, metadata, err
18329	}
18330
18331	err = awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(&output, shape)
18332	if err != nil {
18333		var snapshot bytes.Buffer
18334		io.Copy(&snapshot, ringBuffer)
18335		return out, metadata, &smithy.DeserializationError{
18336			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18337			Snapshot: snapshot.Bytes(),
18338		}
18339	}
18340
18341	return out, metadata, err
18342}
18343
18344func awsRestjson1_deserializeOpErrorListAuditSuppressions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18345	var errorBuffer bytes.Buffer
18346	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18347		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18348	}
18349	errorBody := bytes.NewReader(errorBuffer.Bytes())
18350
18351	errorCode := "UnknownError"
18352	errorMessage := errorCode
18353
18354	code := response.Header.Get("X-Amzn-ErrorType")
18355	if len(code) != 0 {
18356		errorCode = restjson.SanitizeErrorCode(code)
18357	}
18358
18359	var buff [1024]byte
18360	ringBuffer := smithyio.NewRingBuffer(buff[:])
18361
18362	body := io.TeeReader(errorBody, ringBuffer)
18363	decoder := json.NewDecoder(body)
18364	decoder.UseNumber()
18365	code, message, err := restjson.GetErrorInfo(decoder)
18366	if err != nil {
18367		var snapshot bytes.Buffer
18368		io.Copy(&snapshot, ringBuffer)
18369		err = &smithy.DeserializationError{
18370			Err:      fmt.Errorf("failed to decode response body, %w", err),
18371			Snapshot: snapshot.Bytes(),
18372		}
18373		return err
18374	}
18375
18376	errorBody.Seek(0, io.SeekStart)
18377	if len(code) != 0 {
18378		errorCode = restjson.SanitizeErrorCode(code)
18379	}
18380	if len(message) != 0 {
18381		errorMessage = message
18382	}
18383
18384	switch {
18385	case strings.EqualFold("InternalFailureException", errorCode):
18386		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18387
18388	case strings.EqualFold("InvalidRequestException", errorCode):
18389		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18390
18391	case strings.EqualFold("ThrottlingException", errorCode):
18392		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18393
18394	default:
18395		genericError := &smithy.GenericAPIError{
18396			Code:    errorCode,
18397			Message: errorMessage,
18398		}
18399		return genericError
18400
18401	}
18402}
18403
18404func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAuditSuppressionsOutput, value interface{}) error {
18405	if v == nil {
18406		return fmt.Errorf("unexpected nil of type %T", v)
18407	}
18408	if value == nil {
18409		return nil
18410	}
18411
18412	shape, ok := value.(map[string]interface{})
18413	if !ok {
18414		return fmt.Errorf("unexpected JSON type %v", value)
18415	}
18416
18417	var sv *ListAuditSuppressionsOutput
18418	if *v == nil {
18419		sv = &ListAuditSuppressionsOutput{}
18420	} else {
18421		sv = *v
18422	}
18423
18424	for key, value := range shape {
18425		switch key {
18426		case "nextToken":
18427			if value != nil {
18428				jtv, ok := value.(string)
18429				if !ok {
18430					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
18431				}
18432				sv.NextToken = ptr.String(jtv)
18433			}
18434
18435		case "suppressions":
18436			if err := awsRestjson1_deserializeDocumentAuditSuppressionList(&sv.Suppressions, value); err != nil {
18437				return err
18438			}
18439
18440		default:
18441			_, _ = key, value
18442
18443		}
18444	}
18445	*v = sv
18446	return nil
18447}
18448
18449type awsRestjson1_deserializeOpListAuditTasks struct {
18450}
18451
18452func (*awsRestjson1_deserializeOpListAuditTasks) ID() string {
18453	return "OperationDeserializer"
18454}
18455
18456func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18457	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18458) {
18459	out, metadata, err = next.HandleDeserialize(ctx, in)
18460	if err != nil {
18461		return out, metadata, err
18462	}
18463
18464	response, ok := out.RawResponse.(*smithyhttp.Response)
18465	if !ok {
18466		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18467	}
18468
18469	if response.StatusCode < 200 || response.StatusCode >= 300 {
18470		return out, metadata, awsRestjson1_deserializeOpErrorListAuditTasks(response, &metadata)
18471	}
18472	output := &ListAuditTasksOutput{}
18473	out.Result = output
18474
18475	var buff [1024]byte
18476	ringBuffer := smithyio.NewRingBuffer(buff[:])
18477
18478	body := io.TeeReader(response.Body, ringBuffer)
18479
18480	decoder := json.NewDecoder(body)
18481	decoder.UseNumber()
18482	var shape interface{}
18483	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18484		var snapshot bytes.Buffer
18485		io.Copy(&snapshot, ringBuffer)
18486		err = &smithy.DeserializationError{
18487			Err:      fmt.Errorf("failed to decode response body, %w", err),
18488			Snapshot: snapshot.Bytes(),
18489		}
18490		return out, metadata, err
18491	}
18492
18493	err = awsRestjson1_deserializeOpDocumentListAuditTasksOutput(&output, shape)
18494	if err != nil {
18495		var snapshot bytes.Buffer
18496		io.Copy(&snapshot, ringBuffer)
18497		return out, metadata, &smithy.DeserializationError{
18498			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18499			Snapshot: snapshot.Bytes(),
18500		}
18501	}
18502
18503	return out, metadata, err
18504}
18505
18506func awsRestjson1_deserializeOpErrorListAuditTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18507	var errorBuffer bytes.Buffer
18508	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18509		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18510	}
18511	errorBody := bytes.NewReader(errorBuffer.Bytes())
18512
18513	errorCode := "UnknownError"
18514	errorMessage := errorCode
18515
18516	code := response.Header.Get("X-Amzn-ErrorType")
18517	if len(code) != 0 {
18518		errorCode = restjson.SanitizeErrorCode(code)
18519	}
18520
18521	var buff [1024]byte
18522	ringBuffer := smithyio.NewRingBuffer(buff[:])
18523
18524	body := io.TeeReader(errorBody, ringBuffer)
18525	decoder := json.NewDecoder(body)
18526	decoder.UseNumber()
18527	code, message, err := restjson.GetErrorInfo(decoder)
18528	if err != nil {
18529		var snapshot bytes.Buffer
18530		io.Copy(&snapshot, ringBuffer)
18531		err = &smithy.DeserializationError{
18532			Err:      fmt.Errorf("failed to decode response body, %w", err),
18533			Snapshot: snapshot.Bytes(),
18534		}
18535		return err
18536	}
18537
18538	errorBody.Seek(0, io.SeekStart)
18539	if len(code) != 0 {
18540		errorCode = restjson.SanitizeErrorCode(code)
18541	}
18542	if len(message) != 0 {
18543		errorMessage = message
18544	}
18545
18546	switch {
18547	case strings.EqualFold("InternalFailureException", errorCode):
18548		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18549
18550	case strings.EqualFold("InvalidRequestException", errorCode):
18551		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18552
18553	case strings.EqualFold("ThrottlingException", errorCode):
18554		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18555
18556	default:
18557		genericError := &smithy.GenericAPIError{
18558			Code:    errorCode,
18559			Message: errorMessage,
18560		}
18561		return genericError
18562
18563	}
18564}
18565
18566func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOutput, value interface{}) error {
18567	if v == nil {
18568		return fmt.Errorf("unexpected nil of type %T", v)
18569	}
18570	if value == nil {
18571		return nil
18572	}
18573
18574	shape, ok := value.(map[string]interface{})
18575	if !ok {
18576		return fmt.Errorf("unexpected JSON type %v", value)
18577	}
18578
18579	var sv *ListAuditTasksOutput
18580	if *v == nil {
18581		sv = &ListAuditTasksOutput{}
18582	} else {
18583		sv = *v
18584	}
18585
18586	for key, value := range shape {
18587		switch key {
18588		case "nextToken":
18589			if value != nil {
18590				jtv, ok := value.(string)
18591				if !ok {
18592					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
18593				}
18594				sv.NextToken = ptr.String(jtv)
18595			}
18596
18597		case "tasks":
18598			if err := awsRestjson1_deserializeDocumentAuditTaskMetadataList(&sv.Tasks, value); err != nil {
18599				return err
18600			}
18601
18602		default:
18603			_, _ = key, value
18604
18605		}
18606	}
18607	*v = sv
18608	return nil
18609}
18610
18611type awsRestjson1_deserializeOpListAuthorizers struct {
18612}
18613
18614func (*awsRestjson1_deserializeOpListAuthorizers) ID() string {
18615	return "OperationDeserializer"
18616}
18617
18618func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18619	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18620) {
18621	out, metadata, err = next.HandleDeserialize(ctx, in)
18622	if err != nil {
18623		return out, metadata, err
18624	}
18625
18626	response, ok := out.RawResponse.(*smithyhttp.Response)
18627	if !ok {
18628		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18629	}
18630
18631	if response.StatusCode < 200 || response.StatusCode >= 300 {
18632		return out, metadata, awsRestjson1_deserializeOpErrorListAuthorizers(response, &metadata)
18633	}
18634	output := &ListAuthorizersOutput{}
18635	out.Result = output
18636
18637	var buff [1024]byte
18638	ringBuffer := smithyio.NewRingBuffer(buff[:])
18639
18640	body := io.TeeReader(response.Body, ringBuffer)
18641
18642	decoder := json.NewDecoder(body)
18643	decoder.UseNumber()
18644	var shape interface{}
18645	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18646		var snapshot bytes.Buffer
18647		io.Copy(&snapshot, ringBuffer)
18648		err = &smithy.DeserializationError{
18649			Err:      fmt.Errorf("failed to decode response body, %w", err),
18650			Snapshot: snapshot.Bytes(),
18651		}
18652		return out, metadata, err
18653	}
18654
18655	err = awsRestjson1_deserializeOpDocumentListAuthorizersOutput(&output, shape)
18656	if err != nil {
18657		var snapshot bytes.Buffer
18658		io.Copy(&snapshot, ringBuffer)
18659		return out, metadata, &smithy.DeserializationError{
18660			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18661			Snapshot: snapshot.Bytes(),
18662		}
18663	}
18664
18665	return out, metadata, err
18666}
18667
18668func awsRestjson1_deserializeOpErrorListAuthorizers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18669	var errorBuffer bytes.Buffer
18670	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18671		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18672	}
18673	errorBody := bytes.NewReader(errorBuffer.Bytes())
18674
18675	errorCode := "UnknownError"
18676	errorMessage := errorCode
18677
18678	code := response.Header.Get("X-Amzn-ErrorType")
18679	if len(code) != 0 {
18680		errorCode = restjson.SanitizeErrorCode(code)
18681	}
18682
18683	var buff [1024]byte
18684	ringBuffer := smithyio.NewRingBuffer(buff[:])
18685
18686	body := io.TeeReader(errorBody, ringBuffer)
18687	decoder := json.NewDecoder(body)
18688	decoder.UseNumber()
18689	code, message, err := restjson.GetErrorInfo(decoder)
18690	if err != nil {
18691		var snapshot bytes.Buffer
18692		io.Copy(&snapshot, ringBuffer)
18693		err = &smithy.DeserializationError{
18694			Err:      fmt.Errorf("failed to decode response body, %w", err),
18695			Snapshot: snapshot.Bytes(),
18696		}
18697		return err
18698	}
18699
18700	errorBody.Seek(0, io.SeekStart)
18701	if len(code) != 0 {
18702		errorCode = restjson.SanitizeErrorCode(code)
18703	}
18704	if len(message) != 0 {
18705		errorMessage = message
18706	}
18707
18708	switch {
18709	case strings.EqualFold("InternalFailureException", errorCode):
18710		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18711
18712	case strings.EqualFold("InvalidRequestException", errorCode):
18713		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18714
18715	case strings.EqualFold("ServiceUnavailableException", errorCode):
18716		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
18717
18718	case strings.EqualFold("ThrottlingException", errorCode):
18719		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18720
18721	case strings.EqualFold("UnauthorizedException", errorCode):
18722		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
18723
18724	default:
18725		genericError := &smithy.GenericAPIError{
18726			Code:    errorCode,
18727			Message: errorMessage,
18728		}
18729		return genericError
18730
18731	}
18732}
18733
18734func awsRestjson1_deserializeOpDocumentListAuthorizersOutput(v **ListAuthorizersOutput, value interface{}) error {
18735	if v == nil {
18736		return fmt.Errorf("unexpected nil of type %T", v)
18737	}
18738	if value == nil {
18739		return nil
18740	}
18741
18742	shape, ok := value.(map[string]interface{})
18743	if !ok {
18744		return fmt.Errorf("unexpected JSON type %v", value)
18745	}
18746
18747	var sv *ListAuthorizersOutput
18748	if *v == nil {
18749		sv = &ListAuthorizersOutput{}
18750	} else {
18751		sv = *v
18752	}
18753
18754	for key, value := range shape {
18755		switch key {
18756		case "authorizers":
18757			if err := awsRestjson1_deserializeDocumentAuthorizers(&sv.Authorizers, value); err != nil {
18758				return err
18759			}
18760
18761		case "nextMarker":
18762			if value != nil {
18763				jtv, ok := value.(string)
18764				if !ok {
18765					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
18766				}
18767				sv.NextMarker = ptr.String(jtv)
18768			}
18769
18770		default:
18771			_, _ = key, value
18772
18773		}
18774	}
18775	*v = sv
18776	return nil
18777}
18778
18779type awsRestjson1_deserializeOpListBillingGroups struct {
18780}
18781
18782func (*awsRestjson1_deserializeOpListBillingGroups) ID() string {
18783	return "OperationDeserializer"
18784}
18785
18786func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18787	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18788) {
18789	out, metadata, err = next.HandleDeserialize(ctx, in)
18790	if err != nil {
18791		return out, metadata, err
18792	}
18793
18794	response, ok := out.RawResponse.(*smithyhttp.Response)
18795	if !ok {
18796		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18797	}
18798
18799	if response.StatusCode < 200 || response.StatusCode >= 300 {
18800		return out, metadata, awsRestjson1_deserializeOpErrorListBillingGroups(response, &metadata)
18801	}
18802	output := &ListBillingGroupsOutput{}
18803	out.Result = output
18804
18805	var buff [1024]byte
18806	ringBuffer := smithyio.NewRingBuffer(buff[:])
18807
18808	body := io.TeeReader(response.Body, ringBuffer)
18809
18810	decoder := json.NewDecoder(body)
18811	decoder.UseNumber()
18812	var shape interface{}
18813	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18814		var snapshot bytes.Buffer
18815		io.Copy(&snapshot, ringBuffer)
18816		err = &smithy.DeserializationError{
18817			Err:      fmt.Errorf("failed to decode response body, %w", err),
18818			Snapshot: snapshot.Bytes(),
18819		}
18820		return out, metadata, err
18821	}
18822
18823	err = awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(&output, shape)
18824	if err != nil {
18825		var snapshot bytes.Buffer
18826		io.Copy(&snapshot, ringBuffer)
18827		return out, metadata, &smithy.DeserializationError{
18828			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18829			Snapshot: snapshot.Bytes(),
18830		}
18831	}
18832
18833	return out, metadata, err
18834}
18835
18836func awsRestjson1_deserializeOpErrorListBillingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18837	var errorBuffer bytes.Buffer
18838	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18839		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18840	}
18841	errorBody := bytes.NewReader(errorBuffer.Bytes())
18842
18843	errorCode := "UnknownError"
18844	errorMessage := errorCode
18845
18846	code := response.Header.Get("X-Amzn-ErrorType")
18847	if len(code) != 0 {
18848		errorCode = restjson.SanitizeErrorCode(code)
18849	}
18850
18851	var buff [1024]byte
18852	ringBuffer := smithyio.NewRingBuffer(buff[:])
18853
18854	body := io.TeeReader(errorBody, ringBuffer)
18855	decoder := json.NewDecoder(body)
18856	decoder.UseNumber()
18857	code, message, err := restjson.GetErrorInfo(decoder)
18858	if err != nil {
18859		var snapshot bytes.Buffer
18860		io.Copy(&snapshot, ringBuffer)
18861		err = &smithy.DeserializationError{
18862			Err:      fmt.Errorf("failed to decode response body, %w", err),
18863			Snapshot: snapshot.Bytes(),
18864		}
18865		return err
18866	}
18867
18868	errorBody.Seek(0, io.SeekStart)
18869	if len(code) != 0 {
18870		errorCode = restjson.SanitizeErrorCode(code)
18871	}
18872	if len(message) != 0 {
18873		errorMessage = message
18874	}
18875
18876	switch {
18877	case strings.EqualFold("InternalFailureException", errorCode):
18878		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18879
18880	case strings.EqualFold("InvalidRequestException", errorCode):
18881		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
18882
18883	case strings.EqualFold("ResourceNotFoundException", errorCode):
18884		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18885
18886	case strings.EqualFold("ThrottlingException", errorCode):
18887		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18888
18889	default:
18890		genericError := &smithy.GenericAPIError{
18891			Code:    errorCode,
18892			Message: errorMessage,
18893		}
18894		return genericError
18895
18896	}
18897}
18898
18899func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGroupsOutput, value interface{}) error {
18900	if v == nil {
18901		return fmt.Errorf("unexpected nil of type %T", v)
18902	}
18903	if value == nil {
18904		return nil
18905	}
18906
18907	shape, ok := value.(map[string]interface{})
18908	if !ok {
18909		return fmt.Errorf("unexpected JSON type %v", value)
18910	}
18911
18912	var sv *ListBillingGroupsOutput
18913	if *v == nil {
18914		sv = &ListBillingGroupsOutput{}
18915	} else {
18916		sv = *v
18917	}
18918
18919	for key, value := range shape {
18920		switch key {
18921		case "billingGroups":
18922			if err := awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(&sv.BillingGroups, value); err != nil {
18923				return err
18924			}
18925
18926		case "nextToken":
18927			if value != nil {
18928				jtv, ok := value.(string)
18929				if !ok {
18930					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
18931				}
18932				sv.NextToken = ptr.String(jtv)
18933			}
18934
18935		default:
18936			_, _ = key, value
18937
18938		}
18939	}
18940	*v = sv
18941	return nil
18942}
18943
18944type awsRestjson1_deserializeOpListCACertificates struct {
18945}
18946
18947func (*awsRestjson1_deserializeOpListCACertificates) ID() string {
18948	return "OperationDeserializer"
18949}
18950
18951func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18952	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18953) {
18954	out, metadata, err = next.HandleDeserialize(ctx, in)
18955	if err != nil {
18956		return out, metadata, err
18957	}
18958
18959	response, ok := out.RawResponse.(*smithyhttp.Response)
18960	if !ok {
18961		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18962	}
18963
18964	if response.StatusCode < 200 || response.StatusCode >= 300 {
18965		return out, metadata, awsRestjson1_deserializeOpErrorListCACertificates(response, &metadata)
18966	}
18967	output := &ListCACertificatesOutput{}
18968	out.Result = output
18969
18970	var buff [1024]byte
18971	ringBuffer := smithyio.NewRingBuffer(buff[:])
18972
18973	body := io.TeeReader(response.Body, ringBuffer)
18974
18975	decoder := json.NewDecoder(body)
18976	decoder.UseNumber()
18977	var shape interface{}
18978	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18979		var snapshot bytes.Buffer
18980		io.Copy(&snapshot, ringBuffer)
18981		err = &smithy.DeserializationError{
18982			Err:      fmt.Errorf("failed to decode response body, %w", err),
18983			Snapshot: snapshot.Bytes(),
18984		}
18985		return out, metadata, err
18986	}
18987
18988	err = awsRestjson1_deserializeOpDocumentListCACertificatesOutput(&output, shape)
18989	if err != nil {
18990		var snapshot bytes.Buffer
18991		io.Copy(&snapshot, ringBuffer)
18992		return out, metadata, &smithy.DeserializationError{
18993			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18994			Snapshot: snapshot.Bytes(),
18995		}
18996	}
18997
18998	return out, metadata, err
18999}
19000
19001func awsRestjson1_deserializeOpErrorListCACertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19002	var errorBuffer bytes.Buffer
19003	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19004		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19005	}
19006	errorBody := bytes.NewReader(errorBuffer.Bytes())
19007
19008	errorCode := "UnknownError"
19009	errorMessage := errorCode
19010
19011	code := response.Header.Get("X-Amzn-ErrorType")
19012	if len(code) != 0 {
19013		errorCode = restjson.SanitizeErrorCode(code)
19014	}
19015
19016	var buff [1024]byte
19017	ringBuffer := smithyio.NewRingBuffer(buff[:])
19018
19019	body := io.TeeReader(errorBody, ringBuffer)
19020	decoder := json.NewDecoder(body)
19021	decoder.UseNumber()
19022	code, message, err := restjson.GetErrorInfo(decoder)
19023	if err != nil {
19024		var snapshot bytes.Buffer
19025		io.Copy(&snapshot, ringBuffer)
19026		err = &smithy.DeserializationError{
19027			Err:      fmt.Errorf("failed to decode response body, %w", err),
19028			Snapshot: snapshot.Bytes(),
19029		}
19030		return err
19031	}
19032
19033	errorBody.Seek(0, io.SeekStart)
19034	if len(code) != 0 {
19035		errorCode = restjson.SanitizeErrorCode(code)
19036	}
19037	if len(message) != 0 {
19038		errorMessage = message
19039	}
19040
19041	switch {
19042	case strings.EqualFold("InternalFailureException", errorCode):
19043		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19044
19045	case strings.EqualFold("InvalidRequestException", errorCode):
19046		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19047
19048	case strings.EqualFold("ServiceUnavailableException", errorCode):
19049		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
19050
19051	case strings.EqualFold("ThrottlingException", errorCode):
19052		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19053
19054	case strings.EqualFold("UnauthorizedException", errorCode):
19055		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
19056
19057	default:
19058		genericError := &smithy.GenericAPIError{
19059			Code:    errorCode,
19060			Message: errorMessage,
19061		}
19062		return genericError
19063
19064	}
19065}
19066
19067func awsRestjson1_deserializeOpDocumentListCACertificatesOutput(v **ListCACertificatesOutput, value interface{}) error {
19068	if v == nil {
19069		return fmt.Errorf("unexpected nil of type %T", v)
19070	}
19071	if value == nil {
19072		return nil
19073	}
19074
19075	shape, ok := value.(map[string]interface{})
19076	if !ok {
19077		return fmt.Errorf("unexpected JSON type %v", value)
19078	}
19079
19080	var sv *ListCACertificatesOutput
19081	if *v == nil {
19082		sv = &ListCACertificatesOutput{}
19083	} else {
19084		sv = *v
19085	}
19086
19087	for key, value := range shape {
19088		switch key {
19089		case "certificates":
19090			if err := awsRestjson1_deserializeDocumentCACertificates(&sv.Certificates, value); err != nil {
19091				return err
19092			}
19093
19094		case "nextMarker":
19095			if value != nil {
19096				jtv, ok := value.(string)
19097				if !ok {
19098					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
19099				}
19100				sv.NextMarker = ptr.String(jtv)
19101			}
19102
19103		default:
19104			_, _ = key, value
19105
19106		}
19107	}
19108	*v = sv
19109	return nil
19110}
19111
19112type awsRestjson1_deserializeOpListCertificates struct {
19113}
19114
19115func (*awsRestjson1_deserializeOpListCertificates) ID() string {
19116	return "OperationDeserializer"
19117}
19118
19119func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19120	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19121) {
19122	out, metadata, err = next.HandleDeserialize(ctx, in)
19123	if err != nil {
19124		return out, metadata, err
19125	}
19126
19127	response, ok := out.RawResponse.(*smithyhttp.Response)
19128	if !ok {
19129		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19130	}
19131
19132	if response.StatusCode < 200 || response.StatusCode >= 300 {
19133		return out, metadata, awsRestjson1_deserializeOpErrorListCertificates(response, &metadata)
19134	}
19135	output := &ListCertificatesOutput{}
19136	out.Result = output
19137
19138	var buff [1024]byte
19139	ringBuffer := smithyio.NewRingBuffer(buff[:])
19140
19141	body := io.TeeReader(response.Body, ringBuffer)
19142
19143	decoder := json.NewDecoder(body)
19144	decoder.UseNumber()
19145	var shape interface{}
19146	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19147		var snapshot bytes.Buffer
19148		io.Copy(&snapshot, ringBuffer)
19149		err = &smithy.DeserializationError{
19150			Err:      fmt.Errorf("failed to decode response body, %w", err),
19151			Snapshot: snapshot.Bytes(),
19152		}
19153		return out, metadata, err
19154	}
19155
19156	err = awsRestjson1_deserializeOpDocumentListCertificatesOutput(&output, shape)
19157	if err != nil {
19158		var snapshot bytes.Buffer
19159		io.Copy(&snapshot, ringBuffer)
19160		return out, metadata, &smithy.DeserializationError{
19161			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19162			Snapshot: snapshot.Bytes(),
19163		}
19164	}
19165
19166	return out, metadata, err
19167}
19168
19169func awsRestjson1_deserializeOpErrorListCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19170	var errorBuffer bytes.Buffer
19171	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19172		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19173	}
19174	errorBody := bytes.NewReader(errorBuffer.Bytes())
19175
19176	errorCode := "UnknownError"
19177	errorMessage := errorCode
19178
19179	code := response.Header.Get("X-Amzn-ErrorType")
19180	if len(code) != 0 {
19181		errorCode = restjson.SanitizeErrorCode(code)
19182	}
19183
19184	var buff [1024]byte
19185	ringBuffer := smithyio.NewRingBuffer(buff[:])
19186
19187	body := io.TeeReader(errorBody, ringBuffer)
19188	decoder := json.NewDecoder(body)
19189	decoder.UseNumber()
19190	code, message, err := restjson.GetErrorInfo(decoder)
19191	if err != nil {
19192		var snapshot bytes.Buffer
19193		io.Copy(&snapshot, ringBuffer)
19194		err = &smithy.DeserializationError{
19195			Err:      fmt.Errorf("failed to decode response body, %w", err),
19196			Snapshot: snapshot.Bytes(),
19197		}
19198		return err
19199	}
19200
19201	errorBody.Seek(0, io.SeekStart)
19202	if len(code) != 0 {
19203		errorCode = restjson.SanitizeErrorCode(code)
19204	}
19205	if len(message) != 0 {
19206		errorMessage = message
19207	}
19208
19209	switch {
19210	case strings.EqualFold("InternalFailureException", errorCode):
19211		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19212
19213	case strings.EqualFold("InvalidRequestException", errorCode):
19214		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19215
19216	case strings.EqualFold("ServiceUnavailableException", errorCode):
19217		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
19218
19219	case strings.EqualFold("ThrottlingException", errorCode):
19220		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19221
19222	case strings.EqualFold("UnauthorizedException", errorCode):
19223		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
19224
19225	default:
19226		genericError := &smithy.GenericAPIError{
19227			Code:    errorCode,
19228			Message: errorMessage,
19229		}
19230		return genericError
19231
19232	}
19233}
19234
19235func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificatesOutput, value interface{}) error {
19236	if v == nil {
19237		return fmt.Errorf("unexpected nil of type %T", v)
19238	}
19239	if value == nil {
19240		return nil
19241	}
19242
19243	shape, ok := value.(map[string]interface{})
19244	if !ok {
19245		return fmt.Errorf("unexpected JSON type %v", value)
19246	}
19247
19248	var sv *ListCertificatesOutput
19249	if *v == nil {
19250		sv = &ListCertificatesOutput{}
19251	} else {
19252		sv = *v
19253	}
19254
19255	for key, value := range shape {
19256		switch key {
19257		case "certificates":
19258			if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil {
19259				return err
19260			}
19261
19262		case "nextMarker":
19263			if value != nil {
19264				jtv, ok := value.(string)
19265				if !ok {
19266					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
19267				}
19268				sv.NextMarker = ptr.String(jtv)
19269			}
19270
19271		default:
19272			_, _ = key, value
19273
19274		}
19275	}
19276	*v = sv
19277	return nil
19278}
19279
19280type awsRestjson1_deserializeOpListCertificatesByCA struct {
19281}
19282
19283func (*awsRestjson1_deserializeOpListCertificatesByCA) ID() string {
19284	return "OperationDeserializer"
19285}
19286
19287func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19288	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19289) {
19290	out, metadata, err = next.HandleDeserialize(ctx, in)
19291	if err != nil {
19292		return out, metadata, err
19293	}
19294
19295	response, ok := out.RawResponse.(*smithyhttp.Response)
19296	if !ok {
19297		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19298	}
19299
19300	if response.StatusCode < 200 || response.StatusCode >= 300 {
19301		return out, metadata, awsRestjson1_deserializeOpErrorListCertificatesByCA(response, &metadata)
19302	}
19303	output := &ListCertificatesByCAOutput{}
19304	out.Result = output
19305
19306	var buff [1024]byte
19307	ringBuffer := smithyio.NewRingBuffer(buff[:])
19308
19309	body := io.TeeReader(response.Body, ringBuffer)
19310
19311	decoder := json.NewDecoder(body)
19312	decoder.UseNumber()
19313	var shape interface{}
19314	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19315		var snapshot bytes.Buffer
19316		io.Copy(&snapshot, ringBuffer)
19317		err = &smithy.DeserializationError{
19318			Err:      fmt.Errorf("failed to decode response body, %w", err),
19319			Snapshot: snapshot.Bytes(),
19320		}
19321		return out, metadata, err
19322	}
19323
19324	err = awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(&output, shape)
19325	if err != nil {
19326		var snapshot bytes.Buffer
19327		io.Copy(&snapshot, ringBuffer)
19328		return out, metadata, &smithy.DeserializationError{
19329			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19330			Snapshot: snapshot.Bytes(),
19331		}
19332	}
19333
19334	return out, metadata, err
19335}
19336
19337func awsRestjson1_deserializeOpErrorListCertificatesByCA(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19338	var errorBuffer bytes.Buffer
19339	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19340		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19341	}
19342	errorBody := bytes.NewReader(errorBuffer.Bytes())
19343
19344	errorCode := "UnknownError"
19345	errorMessage := errorCode
19346
19347	code := response.Header.Get("X-Amzn-ErrorType")
19348	if len(code) != 0 {
19349		errorCode = restjson.SanitizeErrorCode(code)
19350	}
19351
19352	var buff [1024]byte
19353	ringBuffer := smithyio.NewRingBuffer(buff[:])
19354
19355	body := io.TeeReader(errorBody, ringBuffer)
19356	decoder := json.NewDecoder(body)
19357	decoder.UseNumber()
19358	code, message, err := restjson.GetErrorInfo(decoder)
19359	if err != nil {
19360		var snapshot bytes.Buffer
19361		io.Copy(&snapshot, ringBuffer)
19362		err = &smithy.DeserializationError{
19363			Err:      fmt.Errorf("failed to decode response body, %w", err),
19364			Snapshot: snapshot.Bytes(),
19365		}
19366		return err
19367	}
19368
19369	errorBody.Seek(0, io.SeekStart)
19370	if len(code) != 0 {
19371		errorCode = restjson.SanitizeErrorCode(code)
19372	}
19373	if len(message) != 0 {
19374		errorMessage = message
19375	}
19376
19377	switch {
19378	case strings.EqualFold("InternalFailureException", errorCode):
19379		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19380
19381	case strings.EqualFold("InvalidRequestException", errorCode):
19382		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19383
19384	case strings.EqualFold("ServiceUnavailableException", errorCode):
19385		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
19386
19387	case strings.EqualFold("ThrottlingException", errorCode):
19388		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19389
19390	case strings.EqualFold("UnauthorizedException", errorCode):
19391		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
19392
19393	default:
19394		genericError := &smithy.GenericAPIError{
19395			Code:    errorCode,
19396			Message: errorMessage,
19397		}
19398		return genericError
19399
19400	}
19401}
19402
19403func awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(v **ListCertificatesByCAOutput, value interface{}) error {
19404	if v == nil {
19405		return fmt.Errorf("unexpected nil of type %T", v)
19406	}
19407	if value == nil {
19408		return nil
19409	}
19410
19411	shape, ok := value.(map[string]interface{})
19412	if !ok {
19413		return fmt.Errorf("unexpected JSON type %v", value)
19414	}
19415
19416	var sv *ListCertificatesByCAOutput
19417	if *v == nil {
19418		sv = &ListCertificatesByCAOutput{}
19419	} else {
19420		sv = *v
19421	}
19422
19423	for key, value := range shape {
19424		switch key {
19425		case "certificates":
19426			if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil {
19427				return err
19428			}
19429
19430		case "nextMarker":
19431			if value != nil {
19432				jtv, ok := value.(string)
19433				if !ok {
19434					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
19435				}
19436				sv.NextMarker = ptr.String(jtv)
19437			}
19438
19439		default:
19440			_, _ = key, value
19441
19442		}
19443	}
19444	*v = sv
19445	return nil
19446}
19447
19448type awsRestjson1_deserializeOpListDimensions struct {
19449}
19450
19451func (*awsRestjson1_deserializeOpListDimensions) ID() string {
19452	return "OperationDeserializer"
19453}
19454
19455func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19456	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19457) {
19458	out, metadata, err = next.HandleDeserialize(ctx, in)
19459	if err != nil {
19460		return out, metadata, err
19461	}
19462
19463	response, ok := out.RawResponse.(*smithyhttp.Response)
19464	if !ok {
19465		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19466	}
19467
19468	if response.StatusCode < 200 || response.StatusCode >= 300 {
19469		return out, metadata, awsRestjson1_deserializeOpErrorListDimensions(response, &metadata)
19470	}
19471	output := &ListDimensionsOutput{}
19472	out.Result = output
19473
19474	var buff [1024]byte
19475	ringBuffer := smithyio.NewRingBuffer(buff[:])
19476
19477	body := io.TeeReader(response.Body, ringBuffer)
19478
19479	decoder := json.NewDecoder(body)
19480	decoder.UseNumber()
19481	var shape interface{}
19482	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19483		var snapshot bytes.Buffer
19484		io.Copy(&snapshot, ringBuffer)
19485		err = &smithy.DeserializationError{
19486			Err:      fmt.Errorf("failed to decode response body, %w", err),
19487			Snapshot: snapshot.Bytes(),
19488		}
19489		return out, metadata, err
19490	}
19491
19492	err = awsRestjson1_deserializeOpDocumentListDimensionsOutput(&output, shape)
19493	if err != nil {
19494		var snapshot bytes.Buffer
19495		io.Copy(&snapshot, ringBuffer)
19496		return out, metadata, &smithy.DeserializationError{
19497			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19498			Snapshot: snapshot.Bytes(),
19499		}
19500	}
19501
19502	return out, metadata, err
19503}
19504
19505func awsRestjson1_deserializeOpErrorListDimensions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19506	var errorBuffer bytes.Buffer
19507	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19508		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19509	}
19510	errorBody := bytes.NewReader(errorBuffer.Bytes())
19511
19512	errorCode := "UnknownError"
19513	errorMessage := errorCode
19514
19515	code := response.Header.Get("X-Amzn-ErrorType")
19516	if len(code) != 0 {
19517		errorCode = restjson.SanitizeErrorCode(code)
19518	}
19519
19520	var buff [1024]byte
19521	ringBuffer := smithyio.NewRingBuffer(buff[:])
19522
19523	body := io.TeeReader(errorBody, ringBuffer)
19524	decoder := json.NewDecoder(body)
19525	decoder.UseNumber()
19526	code, message, err := restjson.GetErrorInfo(decoder)
19527	if err != nil {
19528		var snapshot bytes.Buffer
19529		io.Copy(&snapshot, ringBuffer)
19530		err = &smithy.DeserializationError{
19531			Err:      fmt.Errorf("failed to decode response body, %w", err),
19532			Snapshot: snapshot.Bytes(),
19533		}
19534		return err
19535	}
19536
19537	errorBody.Seek(0, io.SeekStart)
19538	if len(code) != 0 {
19539		errorCode = restjson.SanitizeErrorCode(code)
19540	}
19541	if len(message) != 0 {
19542		errorMessage = message
19543	}
19544
19545	switch {
19546	case strings.EqualFold("InternalFailureException", errorCode):
19547		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19548
19549	case strings.EqualFold("InvalidRequestException", errorCode):
19550		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19551
19552	case strings.EqualFold("ThrottlingException", errorCode):
19553		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19554
19555	default:
19556		genericError := &smithy.GenericAPIError{
19557			Code:    errorCode,
19558			Message: errorMessage,
19559		}
19560		return genericError
19561
19562	}
19563}
19564
19565func awsRestjson1_deserializeOpDocumentListDimensionsOutput(v **ListDimensionsOutput, value interface{}) error {
19566	if v == nil {
19567		return fmt.Errorf("unexpected nil of type %T", v)
19568	}
19569	if value == nil {
19570		return nil
19571	}
19572
19573	shape, ok := value.(map[string]interface{})
19574	if !ok {
19575		return fmt.Errorf("unexpected JSON type %v", value)
19576	}
19577
19578	var sv *ListDimensionsOutput
19579	if *v == nil {
19580		sv = &ListDimensionsOutput{}
19581	} else {
19582		sv = *v
19583	}
19584
19585	for key, value := range shape {
19586		switch key {
19587		case "dimensionNames":
19588			if err := awsRestjson1_deserializeDocumentDimensionNames(&sv.DimensionNames, value); err != nil {
19589				return err
19590			}
19591
19592		case "nextToken":
19593			if value != nil {
19594				jtv, ok := value.(string)
19595				if !ok {
19596					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
19597				}
19598				sv.NextToken = ptr.String(jtv)
19599			}
19600
19601		default:
19602			_, _ = key, value
19603
19604		}
19605	}
19606	*v = sv
19607	return nil
19608}
19609
19610type awsRestjson1_deserializeOpListDomainConfigurations struct {
19611}
19612
19613func (*awsRestjson1_deserializeOpListDomainConfigurations) ID() string {
19614	return "OperationDeserializer"
19615}
19616
19617func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19618	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19619) {
19620	out, metadata, err = next.HandleDeserialize(ctx, in)
19621	if err != nil {
19622		return out, metadata, err
19623	}
19624
19625	response, ok := out.RawResponse.(*smithyhttp.Response)
19626	if !ok {
19627		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19628	}
19629
19630	if response.StatusCode < 200 || response.StatusCode >= 300 {
19631		return out, metadata, awsRestjson1_deserializeOpErrorListDomainConfigurations(response, &metadata)
19632	}
19633	output := &ListDomainConfigurationsOutput{}
19634	out.Result = output
19635
19636	var buff [1024]byte
19637	ringBuffer := smithyio.NewRingBuffer(buff[:])
19638
19639	body := io.TeeReader(response.Body, ringBuffer)
19640
19641	decoder := json.NewDecoder(body)
19642	decoder.UseNumber()
19643	var shape interface{}
19644	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19645		var snapshot bytes.Buffer
19646		io.Copy(&snapshot, ringBuffer)
19647		err = &smithy.DeserializationError{
19648			Err:      fmt.Errorf("failed to decode response body, %w", err),
19649			Snapshot: snapshot.Bytes(),
19650		}
19651		return out, metadata, err
19652	}
19653
19654	err = awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(&output, shape)
19655	if err != nil {
19656		var snapshot bytes.Buffer
19657		io.Copy(&snapshot, ringBuffer)
19658		return out, metadata, &smithy.DeserializationError{
19659			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19660			Snapshot: snapshot.Bytes(),
19661		}
19662	}
19663
19664	return out, metadata, err
19665}
19666
19667func awsRestjson1_deserializeOpErrorListDomainConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19668	var errorBuffer bytes.Buffer
19669	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19670		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19671	}
19672	errorBody := bytes.NewReader(errorBuffer.Bytes())
19673
19674	errorCode := "UnknownError"
19675	errorMessage := errorCode
19676
19677	code := response.Header.Get("X-Amzn-ErrorType")
19678	if len(code) != 0 {
19679		errorCode = restjson.SanitizeErrorCode(code)
19680	}
19681
19682	var buff [1024]byte
19683	ringBuffer := smithyio.NewRingBuffer(buff[:])
19684
19685	body := io.TeeReader(errorBody, ringBuffer)
19686	decoder := json.NewDecoder(body)
19687	decoder.UseNumber()
19688	code, message, err := restjson.GetErrorInfo(decoder)
19689	if err != nil {
19690		var snapshot bytes.Buffer
19691		io.Copy(&snapshot, ringBuffer)
19692		err = &smithy.DeserializationError{
19693			Err:      fmt.Errorf("failed to decode response body, %w", err),
19694			Snapshot: snapshot.Bytes(),
19695		}
19696		return err
19697	}
19698
19699	errorBody.Seek(0, io.SeekStart)
19700	if len(code) != 0 {
19701		errorCode = restjson.SanitizeErrorCode(code)
19702	}
19703	if len(message) != 0 {
19704		errorMessage = message
19705	}
19706
19707	switch {
19708	case strings.EqualFold("InternalFailureException", errorCode):
19709		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19710
19711	case strings.EqualFold("InvalidRequestException", errorCode):
19712		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19713
19714	case strings.EqualFold("ServiceUnavailableException", errorCode):
19715		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
19716
19717	case strings.EqualFold("ThrottlingException", errorCode):
19718		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19719
19720	case strings.EqualFold("UnauthorizedException", errorCode):
19721		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
19722
19723	default:
19724		genericError := &smithy.GenericAPIError{
19725			Code:    errorCode,
19726			Message: errorMessage,
19727		}
19728		return genericError
19729
19730	}
19731}
19732
19733func awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(v **ListDomainConfigurationsOutput, value interface{}) error {
19734	if v == nil {
19735		return fmt.Errorf("unexpected nil of type %T", v)
19736	}
19737	if value == nil {
19738		return nil
19739	}
19740
19741	shape, ok := value.(map[string]interface{})
19742	if !ok {
19743		return fmt.Errorf("unexpected JSON type %v", value)
19744	}
19745
19746	var sv *ListDomainConfigurationsOutput
19747	if *v == nil {
19748		sv = &ListDomainConfigurationsOutput{}
19749	} else {
19750		sv = *v
19751	}
19752
19753	for key, value := range shape {
19754		switch key {
19755		case "domainConfigurations":
19756			if err := awsRestjson1_deserializeDocumentDomainConfigurations(&sv.DomainConfigurations, value); err != nil {
19757				return err
19758			}
19759
19760		case "nextMarker":
19761			if value != nil {
19762				jtv, ok := value.(string)
19763				if !ok {
19764					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
19765				}
19766				sv.NextMarker = ptr.String(jtv)
19767			}
19768
19769		default:
19770			_, _ = key, value
19771
19772		}
19773	}
19774	*v = sv
19775	return nil
19776}
19777
19778type awsRestjson1_deserializeOpListIndices struct {
19779}
19780
19781func (*awsRestjson1_deserializeOpListIndices) ID() string {
19782	return "OperationDeserializer"
19783}
19784
19785func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19786	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19787) {
19788	out, metadata, err = next.HandleDeserialize(ctx, in)
19789	if err != nil {
19790		return out, metadata, err
19791	}
19792
19793	response, ok := out.RawResponse.(*smithyhttp.Response)
19794	if !ok {
19795		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19796	}
19797
19798	if response.StatusCode < 200 || response.StatusCode >= 300 {
19799		return out, metadata, awsRestjson1_deserializeOpErrorListIndices(response, &metadata)
19800	}
19801	output := &ListIndicesOutput{}
19802	out.Result = output
19803
19804	var buff [1024]byte
19805	ringBuffer := smithyio.NewRingBuffer(buff[:])
19806
19807	body := io.TeeReader(response.Body, ringBuffer)
19808
19809	decoder := json.NewDecoder(body)
19810	decoder.UseNumber()
19811	var shape interface{}
19812	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19813		var snapshot bytes.Buffer
19814		io.Copy(&snapshot, ringBuffer)
19815		err = &smithy.DeserializationError{
19816			Err:      fmt.Errorf("failed to decode response body, %w", err),
19817			Snapshot: snapshot.Bytes(),
19818		}
19819		return out, metadata, err
19820	}
19821
19822	err = awsRestjson1_deserializeOpDocumentListIndicesOutput(&output, shape)
19823	if err != nil {
19824		var snapshot bytes.Buffer
19825		io.Copy(&snapshot, ringBuffer)
19826		return out, metadata, &smithy.DeserializationError{
19827			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19828			Snapshot: snapshot.Bytes(),
19829		}
19830	}
19831
19832	return out, metadata, err
19833}
19834
19835func awsRestjson1_deserializeOpErrorListIndices(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19836	var errorBuffer bytes.Buffer
19837	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19838		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19839	}
19840	errorBody := bytes.NewReader(errorBuffer.Bytes())
19841
19842	errorCode := "UnknownError"
19843	errorMessage := errorCode
19844
19845	code := response.Header.Get("X-Amzn-ErrorType")
19846	if len(code) != 0 {
19847		errorCode = restjson.SanitizeErrorCode(code)
19848	}
19849
19850	var buff [1024]byte
19851	ringBuffer := smithyio.NewRingBuffer(buff[:])
19852
19853	body := io.TeeReader(errorBody, ringBuffer)
19854	decoder := json.NewDecoder(body)
19855	decoder.UseNumber()
19856	code, message, err := restjson.GetErrorInfo(decoder)
19857	if err != nil {
19858		var snapshot bytes.Buffer
19859		io.Copy(&snapshot, ringBuffer)
19860		err = &smithy.DeserializationError{
19861			Err:      fmt.Errorf("failed to decode response body, %w", err),
19862			Snapshot: snapshot.Bytes(),
19863		}
19864		return err
19865	}
19866
19867	errorBody.Seek(0, io.SeekStart)
19868	if len(code) != 0 {
19869		errorCode = restjson.SanitizeErrorCode(code)
19870	}
19871	if len(message) != 0 {
19872		errorMessage = message
19873	}
19874
19875	switch {
19876	case strings.EqualFold("InternalFailureException", errorCode):
19877		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19878
19879	case strings.EqualFold("InvalidRequestException", errorCode):
19880		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
19881
19882	case strings.EqualFold("ServiceUnavailableException", errorCode):
19883		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
19884
19885	case strings.EqualFold("ThrottlingException", errorCode):
19886		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19887
19888	case strings.EqualFold("UnauthorizedException", errorCode):
19889		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
19890
19891	default:
19892		genericError := &smithy.GenericAPIError{
19893			Code:    errorCode,
19894			Message: errorMessage,
19895		}
19896		return genericError
19897
19898	}
19899}
19900
19901func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, value interface{}) error {
19902	if v == nil {
19903		return fmt.Errorf("unexpected nil of type %T", v)
19904	}
19905	if value == nil {
19906		return nil
19907	}
19908
19909	shape, ok := value.(map[string]interface{})
19910	if !ok {
19911		return fmt.Errorf("unexpected JSON type %v", value)
19912	}
19913
19914	var sv *ListIndicesOutput
19915	if *v == nil {
19916		sv = &ListIndicesOutput{}
19917	} else {
19918		sv = *v
19919	}
19920
19921	for key, value := range shape {
19922		switch key {
19923		case "indexNames":
19924			if err := awsRestjson1_deserializeDocumentIndexNamesList(&sv.IndexNames, value); err != nil {
19925				return err
19926			}
19927
19928		case "nextToken":
19929			if value != nil {
19930				jtv, ok := value.(string)
19931				if !ok {
19932					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
19933				}
19934				sv.NextToken = ptr.String(jtv)
19935			}
19936
19937		default:
19938			_, _ = key, value
19939
19940		}
19941	}
19942	*v = sv
19943	return nil
19944}
19945
19946type awsRestjson1_deserializeOpListJobExecutionsForJob struct {
19947}
19948
19949func (*awsRestjson1_deserializeOpListJobExecutionsForJob) ID() string {
19950	return "OperationDeserializer"
19951}
19952
19953func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19954	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19955) {
19956	out, metadata, err = next.HandleDeserialize(ctx, in)
19957	if err != nil {
19958		return out, metadata, err
19959	}
19960
19961	response, ok := out.RawResponse.(*smithyhttp.Response)
19962	if !ok {
19963		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19964	}
19965
19966	if response.StatusCode < 200 || response.StatusCode >= 300 {
19967		return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response, &metadata)
19968	}
19969	output := &ListJobExecutionsForJobOutput{}
19970	out.Result = output
19971
19972	var buff [1024]byte
19973	ringBuffer := smithyio.NewRingBuffer(buff[:])
19974
19975	body := io.TeeReader(response.Body, ringBuffer)
19976
19977	decoder := json.NewDecoder(body)
19978	decoder.UseNumber()
19979	var shape interface{}
19980	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19981		var snapshot bytes.Buffer
19982		io.Copy(&snapshot, ringBuffer)
19983		err = &smithy.DeserializationError{
19984			Err:      fmt.Errorf("failed to decode response body, %w", err),
19985			Snapshot: snapshot.Bytes(),
19986		}
19987		return out, metadata, err
19988	}
19989
19990	err = awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(&output, shape)
19991	if err != nil {
19992		var snapshot bytes.Buffer
19993		io.Copy(&snapshot, ringBuffer)
19994		return out, metadata, &smithy.DeserializationError{
19995			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19996			Snapshot: snapshot.Bytes(),
19997		}
19998	}
19999
20000	return out, metadata, err
20001}
20002
20003func awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20004	var errorBuffer bytes.Buffer
20005	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20006		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20007	}
20008	errorBody := bytes.NewReader(errorBuffer.Bytes())
20009
20010	errorCode := "UnknownError"
20011	errorMessage := errorCode
20012
20013	code := response.Header.Get("X-Amzn-ErrorType")
20014	if len(code) != 0 {
20015		errorCode = restjson.SanitizeErrorCode(code)
20016	}
20017
20018	var buff [1024]byte
20019	ringBuffer := smithyio.NewRingBuffer(buff[:])
20020
20021	body := io.TeeReader(errorBody, ringBuffer)
20022	decoder := json.NewDecoder(body)
20023	decoder.UseNumber()
20024	code, message, err := restjson.GetErrorInfo(decoder)
20025	if err != nil {
20026		var snapshot bytes.Buffer
20027		io.Copy(&snapshot, ringBuffer)
20028		err = &smithy.DeserializationError{
20029			Err:      fmt.Errorf("failed to decode response body, %w", err),
20030			Snapshot: snapshot.Bytes(),
20031		}
20032		return err
20033	}
20034
20035	errorBody.Seek(0, io.SeekStart)
20036	if len(code) != 0 {
20037		errorCode = restjson.SanitizeErrorCode(code)
20038	}
20039	if len(message) != 0 {
20040		errorMessage = message
20041	}
20042
20043	switch {
20044	case strings.EqualFold("InvalidRequestException", errorCode):
20045		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20046
20047	case strings.EqualFold("ResourceNotFoundException", errorCode):
20048		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
20049
20050	case strings.EqualFold("ServiceUnavailableException", errorCode):
20051		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
20052
20053	case strings.EqualFold("ThrottlingException", errorCode):
20054		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20055
20056	default:
20057		genericError := &smithy.GenericAPIError{
20058			Code:    errorCode,
20059			Message: errorMessage,
20060		}
20061		return genericError
20062
20063	}
20064}
20065
20066func awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(v **ListJobExecutionsForJobOutput, value interface{}) error {
20067	if v == nil {
20068		return fmt.Errorf("unexpected nil of type %T", v)
20069	}
20070	if value == nil {
20071		return nil
20072	}
20073
20074	shape, ok := value.(map[string]interface{})
20075	if !ok {
20076		return fmt.Errorf("unexpected JSON type %v", value)
20077	}
20078
20079	var sv *ListJobExecutionsForJobOutput
20080	if *v == nil {
20081		sv = &ListJobExecutionsForJobOutput{}
20082	} else {
20083		sv = *v
20084	}
20085
20086	for key, value := range shape {
20087		switch key {
20088		case "executionSummaries":
20089			if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForJobList(&sv.ExecutionSummaries, value); err != nil {
20090				return err
20091			}
20092
20093		case "nextToken":
20094			if value != nil {
20095				jtv, ok := value.(string)
20096				if !ok {
20097					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
20098				}
20099				sv.NextToken = ptr.String(jtv)
20100			}
20101
20102		default:
20103			_, _ = key, value
20104
20105		}
20106	}
20107	*v = sv
20108	return nil
20109}
20110
20111type awsRestjson1_deserializeOpListJobExecutionsForThing struct {
20112}
20113
20114func (*awsRestjson1_deserializeOpListJobExecutionsForThing) ID() string {
20115	return "OperationDeserializer"
20116}
20117
20118func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20119	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20120) {
20121	out, metadata, err = next.HandleDeserialize(ctx, in)
20122	if err != nil {
20123		return out, metadata, err
20124	}
20125
20126	response, ok := out.RawResponse.(*smithyhttp.Response)
20127	if !ok {
20128		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20129	}
20130
20131	if response.StatusCode < 200 || response.StatusCode >= 300 {
20132		return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response, &metadata)
20133	}
20134	output := &ListJobExecutionsForThingOutput{}
20135	out.Result = output
20136
20137	var buff [1024]byte
20138	ringBuffer := smithyio.NewRingBuffer(buff[:])
20139
20140	body := io.TeeReader(response.Body, ringBuffer)
20141
20142	decoder := json.NewDecoder(body)
20143	decoder.UseNumber()
20144	var shape interface{}
20145	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20146		var snapshot bytes.Buffer
20147		io.Copy(&snapshot, ringBuffer)
20148		err = &smithy.DeserializationError{
20149			Err:      fmt.Errorf("failed to decode response body, %w", err),
20150			Snapshot: snapshot.Bytes(),
20151		}
20152		return out, metadata, err
20153	}
20154
20155	err = awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(&output, shape)
20156	if err != nil {
20157		var snapshot bytes.Buffer
20158		io.Copy(&snapshot, ringBuffer)
20159		return out, metadata, &smithy.DeserializationError{
20160			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20161			Snapshot: snapshot.Bytes(),
20162		}
20163	}
20164
20165	return out, metadata, err
20166}
20167
20168func awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20169	var errorBuffer bytes.Buffer
20170	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20171		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20172	}
20173	errorBody := bytes.NewReader(errorBuffer.Bytes())
20174
20175	errorCode := "UnknownError"
20176	errorMessage := errorCode
20177
20178	code := response.Header.Get("X-Amzn-ErrorType")
20179	if len(code) != 0 {
20180		errorCode = restjson.SanitizeErrorCode(code)
20181	}
20182
20183	var buff [1024]byte
20184	ringBuffer := smithyio.NewRingBuffer(buff[:])
20185
20186	body := io.TeeReader(errorBody, ringBuffer)
20187	decoder := json.NewDecoder(body)
20188	decoder.UseNumber()
20189	code, message, err := restjson.GetErrorInfo(decoder)
20190	if err != nil {
20191		var snapshot bytes.Buffer
20192		io.Copy(&snapshot, ringBuffer)
20193		err = &smithy.DeserializationError{
20194			Err:      fmt.Errorf("failed to decode response body, %w", err),
20195			Snapshot: snapshot.Bytes(),
20196		}
20197		return err
20198	}
20199
20200	errorBody.Seek(0, io.SeekStart)
20201	if len(code) != 0 {
20202		errorCode = restjson.SanitizeErrorCode(code)
20203	}
20204	if len(message) != 0 {
20205		errorMessage = message
20206	}
20207
20208	switch {
20209	case strings.EqualFold("InvalidRequestException", errorCode):
20210		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20211
20212	case strings.EqualFold("ResourceNotFoundException", errorCode):
20213		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
20214
20215	case strings.EqualFold("ServiceUnavailableException", errorCode):
20216		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
20217
20218	case strings.EqualFold("ThrottlingException", errorCode):
20219		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20220
20221	default:
20222		genericError := &smithy.GenericAPIError{
20223			Code:    errorCode,
20224			Message: errorMessage,
20225		}
20226		return genericError
20227
20228	}
20229}
20230
20231func awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(v **ListJobExecutionsForThingOutput, value interface{}) error {
20232	if v == nil {
20233		return fmt.Errorf("unexpected nil of type %T", v)
20234	}
20235	if value == nil {
20236		return nil
20237	}
20238
20239	shape, ok := value.(map[string]interface{})
20240	if !ok {
20241		return fmt.Errorf("unexpected JSON type %v", value)
20242	}
20243
20244	var sv *ListJobExecutionsForThingOutput
20245	if *v == nil {
20246		sv = &ListJobExecutionsForThingOutput{}
20247	} else {
20248		sv = *v
20249	}
20250
20251	for key, value := range shape {
20252		switch key {
20253		case "executionSummaries":
20254			if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForThingList(&sv.ExecutionSummaries, value); err != nil {
20255				return err
20256			}
20257
20258		case "nextToken":
20259			if value != nil {
20260				jtv, ok := value.(string)
20261				if !ok {
20262					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
20263				}
20264				sv.NextToken = ptr.String(jtv)
20265			}
20266
20267		default:
20268			_, _ = key, value
20269
20270		}
20271	}
20272	*v = sv
20273	return nil
20274}
20275
20276type awsRestjson1_deserializeOpListJobs struct {
20277}
20278
20279func (*awsRestjson1_deserializeOpListJobs) ID() string {
20280	return "OperationDeserializer"
20281}
20282
20283func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20284	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20285) {
20286	out, metadata, err = next.HandleDeserialize(ctx, in)
20287	if err != nil {
20288		return out, metadata, err
20289	}
20290
20291	response, ok := out.RawResponse.(*smithyhttp.Response)
20292	if !ok {
20293		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20294	}
20295
20296	if response.StatusCode < 200 || response.StatusCode >= 300 {
20297		return out, metadata, awsRestjson1_deserializeOpErrorListJobs(response, &metadata)
20298	}
20299	output := &ListJobsOutput{}
20300	out.Result = output
20301
20302	var buff [1024]byte
20303	ringBuffer := smithyio.NewRingBuffer(buff[:])
20304
20305	body := io.TeeReader(response.Body, ringBuffer)
20306
20307	decoder := json.NewDecoder(body)
20308	decoder.UseNumber()
20309	var shape interface{}
20310	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20311		var snapshot bytes.Buffer
20312		io.Copy(&snapshot, ringBuffer)
20313		err = &smithy.DeserializationError{
20314			Err:      fmt.Errorf("failed to decode response body, %w", err),
20315			Snapshot: snapshot.Bytes(),
20316		}
20317		return out, metadata, err
20318	}
20319
20320	err = awsRestjson1_deserializeOpDocumentListJobsOutput(&output, shape)
20321	if err != nil {
20322		var snapshot bytes.Buffer
20323		io.Copy(&snapshot, ringBuffer)
20324		return out, metadata, &smithy.DeserializationError{
20325			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20326			Snapshot: snapshot.Bytes(),
20327		}
20328	}
20329
20330	return out, metadata, err
20331}
20332
20333func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20334	var errorBuffer bytes.Buffer
20335	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20336		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20337	}
20338	errorBody := bytes.NewReader(errorBuffer.Bytes())
20339
20340	errorCode := "UnknownError"
20341	errorMessage := errorCode
20342
20343	code := response.Header.Get("X-Amzn-ErrorType")
20344	if len(code) != 0 {
20345		errorCode = restjson.SanitizeErrorCode(code)
20346	}
20347
20348	var buff [1024]byte
20349	ringBuffer := smithyio.NewRingBuffer(buff[:])
20350
20351	body := io.TeeReader(errorBody, ringBuffer)
20352	decoder := json.NewDecoder(body)
20353	decoder.UseNumber()
20354	code, message, err := restjson.GetErrorInfo(decoder)
20355	if err != nil {
20356		var snapshot bytes.Buffer
20357		io.Copy(&snapshot, ringBuffer)
20358		err = &smithy.DeserializationError{
20359			Err:      fmt.Errorf("failed to decode response body, %w", err),
20360			Snapshot: snapshot.Bytes(),
20361		}
20362		return err
20363	}
20364
20365	errorBody.Seek(0, io.SeekStart)
20366	if len(code) != 0 {
20367		errorCode = restjson.SanitizeErrorCode(code)
20368	}
20369	if len(message) != 0 {
20370		errorMessage = message
20371	}
20372
20373	switch {
20374	case strings.EqualFold("InvalidRequestException", errorCode):
20375		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20376
20377	case strings.EqualFold("ResourceNotFoundException", errorCode):
20378		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
20379
20380	case strings.EqualFold("ServiceUnavailableException", errorCode):
20381		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
20382
20383	case strings.EqualFold("ThrottlingException", errorCode):
20384		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20385
20386	default:
20387		genericError := &smithy.GenericAPIError{
20388			Code:    errorCode,
20389			Message: errorMessage,
20390		}
20391		return genericError
20392
20393	}
20394}
20395
20396func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value interface{}) error {
20397	if v == nil {
20398		return fmt.Errorf("unexpected nil of type %T", v)
20399	}
20400	if value == nil {
20401		return nil
20402	}
20403
20404	shape, ok := value.(map[string]interface{})
20405	if !ok {
20406		return fmt.Errorf("unexpected JSON type %v", value)
20407	}
20408
20409	var sv *ListJobsOutput
20410	if *v == nil {
20411		sv = &ListJobsOutput{}
20412	} else {
20413		sv = *v
20414	}
20415
20416	for key, value := range shape {
20417		switch key {
20418		case "jobs":
20419			if err := awsRestjson1_deserializeDocumentJobSummaryList(&sv.Jobs, value); err != nil {
20420				return err
20421			}
20422
20423		case "nextToken":
20424			if value != nil {
20425				jtv, ok := value.(string)
20426				if !ok {
20427					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
20428				}
20429				sv.NextToken = ptr.String(jtv)
20430			}
20431
20432		default:
20433			_, _ = key, value
20434
20435		}
20436	}
20437	*v = sv
20438	return nil
20439}
20440
20441type awsRestjson1_deserializeOpListMitigationActions struct {
20442}
20443
20444func (*awsRestjson1_deserializeOpListMitigationActions) ID() string {
20445	return "OperationDeserializer"
20446}
20447
20448func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20449	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20450) {
20451	out, metadata, err = next.HandleDeserialize(ctx, in)
20452	if err != nil {
20453		return out, metadata, err
20454	}
20455
20456	response, ok := out.RawResponse.(*smithyhttp.Response)
20457	if !ok {
20458		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20459	}
20460
20461	if response.StatusCode < 200 || response.StatusCode >= 300 {
20462		return out, metadata, awsRestjson1_deserializeOpErrorListMitigationActions(response, &metadata)
20463	}
20464	output := &ListMitigationActionsOutput{}
20465	out.Result = output
20466
20467	var buff [1024]byte
20468	ringBuffer := smithyio.NewRingBuffer(buff[:])
20469
20470	body := io.TeeReader(response.Body, ringBuffer)
20471
20472	decoder := json.NewDecoder(body)
20473	decoder.UseNumber()
20474	var shape interface{}
20475	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20476		var snapshot bytes.Buffer
20477		io.Copy(&snapshot, ringBuffer)
20478		err = &smithy.DeserializationError{
20479			Err:      fmt.Errorf("failed to decode response body, %w", err),
20480			Snapshot: snapshot.Bytes(),
20481		}
20482		return out, metadata, err
20483	}
20484
20485	err = awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(&output, shape)
20486	if err != nil {
20487		var snapshot bytes.Buffer
20488		io.Copy(&snapshot, ringBuffer)
20489		return out, metadata, &smithy.DeserializationError{
20490			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20491			Snapshot: snapshot.Bytes(),
20492		}
20493	}
20494
20495	return out, metadata, err
20496}
20497
20498func awsRestjson1_deserializeOpErrorListMitigationActions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20499	var errorBuffer bytes.Buffer
20500	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20501		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20502	}
20503	errorBody := bytes.NewReader(errorBuffer.Bytes())
20504
20505	errorCode := "UnknownError"
20506	errorMessage := errorCode
20507
20508	code := response.Header.Get("X-Amzn-ErrorType")
20509	if len(code) != 0 {
20510		errorCode = restjson.SanitizeErrorCode(code)
20511	}
20512
20513	var buff [1024]byte
20514	ringBuffer := smithyio.NewRingBuffer(buff[:])
20515
20516	body := io.TeeReader(errorBody, ringBuffer)
20517	decoder := json.NewDecoder(body)
20518	decoder.UseNumber()
20519	code, message, err := restjson.GetErrorInfo(decoder)
20520	if err != nil {
20521		var snapshot bytes.Buffer
20522		io.Copy(&snapshot, ringBuffer)
20523		err = &smithy.DeserializationError{
20524			Err:      fmt.Errorf("failed to decode response body, %w", err),
20525			Snapshot: snapshot.Bytes(),
20526		}
20527		return err
20528	}
20529
20530	errorBody.Seek(0, io.SeekStart)
20531	if len(code) != 0 {
20532		errorCode = restjson.SanitizeErrorCode(code)
20533	}
20534	if len(message) != 0 {
20535		errorMessage = message
20536	}
20537
20538	switch {
20539	case strings.EqualFold("InternalFailureException", errorCode):
20540		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
20541
20542	case strings.EqualFold("InvalidRequestException", errorCode):
20543		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20544
20545	case strings.EqualFold("ThrottlingException", errorCode):
20546		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20547
20548	default:
20549		genericError := &smithy.GenericAPIError{
20550			Code:    errorCode,
20551			Message: errorMessage,
20552		}
20553		return genericError
20554
20555	}
20556}
20557
20558func awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(v **ListMitigationActionsOutput, value interface{}) error {
20559	if v == nil {
20560		return fmt.Errorf("unexpected nil of type %T", v)
20561	}
20562	if value == nil {
20563		return nil
20564	}
20565
20566	shape, ok := value.(map[string]interface{})
20567	if !ok {
20568		return fmt.Errorf("unexpected JSON type %v", value)
20569	}
20570
20571	var sv *ListMitigationActionsOutput
20572	if *v == nil {
20573		sv = &ListMitigationActionsOutput{}
20574	} else {
20575		sv = *v
20576	}
20577
20578	for key, value := range shape {
20579		switch key {
20580		case "actionIdentifiers":
20581			if err := awsRestjson1_deserializeDocumentMitigationActionIdentifierList(&sv.ActionIdentifiers, value); err != nil {
20582				return err
20583			}
20584
20585		case "nextToken":
20586			if value != nil {
20587				jtv, ok := value.(string)
20588				if !ok {
20589					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
20590				}
20591				sv.NextToken = ptr.String(jtv)
20592			}
20593
20594		default:
20595			_, _ = key, value
20596
20597		}
20598	}
20599	*v = sv
20600	return nil
20601}
20602
20603type awsRestjson1_deserializeOpListOTAUpdates struct {
20604}
20605
20606func (*awsRestjson1_deserializeOpListOTAUpdates) ID() string {
20607	return "OperationDeserializer"
20608}
20609
20610func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20611	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20612) {
20613	out, metadata, err = next.HandleDeserialize(ctx, in)
20614	if err != nil {
20615		return out, metadata, err
20616	}
20617
20618	response, ok := out.RawResponse.(*smithyhttp.Response)
20619	if !ok {
20620		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20621	}
20622
20623	if response.StatusCode < 200 || response.StatusCode >= 300 {
20624		return out, metadata, awsRestjson1_deserializeOpErrorListOTAUpdates(response, &metadata)
20625	}
20626	output := &ListOTAUpdatesOutput{}
20627	out.Result = output
20628
20629	var buff [1024]byte
20630	ringBuffer := smithyio.NewRingBuffer(buff[:])
20631
20632	body := io.TeeReader(response.Body, ringBuffer)
20633
20634	decoder := json.NewDecoder(body)
20635	decoder.UseNumber()
20636	var shape interface{}
20637	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20638		var snapshot bytes.Buffer
20639		io.Copy(&snapshot, ringBuffer)
20640		err = &smithy.DeserializationError{
20641			Err:      fmt.Errorf("failed to decode response body, %w", err),
20642			Snapshot: snapshot.Bytes(),
20643		}
20644		return out, metadata, err
20645	}
20646
20647	err = awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(&output, shape)
20648	if err != nil {
20649		var snapshot bytes.Buffer
20650		io.Copy(&snapshot, ringBuffer)
20651		return out, metadata, &smithy.DeserializationError{
20652			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20653			Snapshot: snapshot.Bytes(),
20654		}
20655	}
20656
20657	return out, metadata, err
20658}
20659
20660func awsRestjson1_deserializeOpErrorListOTAUpdates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20661	var errorBuffer bytes.Buffer
20662	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20663		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20664	}
20665	errorBody := bytes.NewReader(errorBuffer.Bytes())
20666
20667	errorCode := "UnknownError"
20668	errorMessage := errorCode
20669
20670	code := response.Header.Get("X-Amzn-ErrorType")
20671	if len(code) != 0 {
20672		errorCode = restjson.SanitizeErrorCode(code)
20673	}
20674
20675	var buff [1024]byte
20676	ringBuffer := smithyio.NewRingBuffer(buff[:])
20677
20678	body := io.TeeReader(errorBody, ringBuffer)
20679	decoder := json.NewDecoder(body)
20680	decoder.UseNumber()
20681	code, message, err := restjson.GetErrorInfo(decoder)
20682	if err != nil {
20683		var snapshot bytes.Buffer
20684		io.Copy(&snapshot, ringBuffer)
20685		err = &smithy.DeserializationError{
20686			Err:      fmt.Errorf("failed to decode response body, %w", err),
20687			Snapshot: snapshot.Bytes(),
20688		}
20689		return err
20690	}
20691
20692	errorBody.Seek(0, io.SeekStart)
20693	if len(code) != 0 {
20694		errorCode = restjson.SanitizeErrorCode(code)
20695	}
20696	if len(message) != 0 {
20697		errorMessage = message
20698	}
20699
20700	switch {
20701	case strings.EqualFold("InternalFailureException", errorCode):
20702		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
20703
20704	case strings.EqualFold("InvalidRequestException", errorCode):
20705		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20706
20707	case strings.EqualFold("ServiceUnavailableException", errorCode):
20708		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
20709
20710	case strings.EqualFold("ThrottlingException", errorCode):
20711		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20712
20713	case strings.EqualFold("UnauthorizedException", errorCode):
20714		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
20715
20716	default:
20717		genericError := &smithy.GenericAPIError{
20718			Code:    errorCode,
20719			Message: errorMessage,
20720		}
20721		return genericError
20722
20723	}
20724}
20725
20726func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOutput, value interface{}) error {
20727	if v == nil {
20728		return fmt.Errorf("unexpected nil of type %T", v)
20729	}
20730	if value == nil {
20731		return nil
20732	}
20733
20734	shape, ok := value.(map[string]interface{})
20735	if !ok {
20736		return fmt.Errorf("unexpected JSON type %v", value)
20737	}
20738
20739	var sv *ListOTAUpdatesOutput
20740	if *v == nil {
20741		sv = &ListOTAUpdatesOutput{}
20742	} else {
20743		sv = *v
20744	}
20745
20746	for key, value := range shape {
20747		switch key {
20748		case "nextToken":
20749			if value != nil {
20750				jtv, ok := value.(string)
20751				if !ok {
20752					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
20753				}
20754				sv.NextToken = ptr.String(jtv)
20755			}
20756
20757		case "otaUpdates":
20758			if err := awsRestjson1_deserializeDocumentOTAUpdatesSummary(&sv.OtaUpdates, value); err != nil {
20759				return err
20760			}
20761
20762		default:
20763			_, _ = key, value
20764
20765		}
20766	}
20767	*v = sv
20768	return nil
20769}
20770
20771type awsRestjson1_deserializeOpListOutgoingCertificates struct {
20772}
20773
20774func (*awsRestjson1_deserializeOpListOutgoingCertificates) ID() string {
20775	return "OperationDeserializer"
20776}
20777
20778func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20779	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20780) {
20781	out, metadata, err = next.HandleDeserialize(ctx, in)
20782	if err != nil {
20783		return out, metadata, err
20784	}
20785
20786	response, ok := out.RawResponse.(*smithyhttp.Response)
20787	if !ok {
20788		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20789	}
20790
20791	if response.StatusCode < 200 || response.StatusCode >= 300 {
20792		return out, metadata, awsRestjson1_deserializeOpErrorListOutgoingCertificates(response, &metadata)
20793	}
20794	output := &ListOutgoingCertificatesOutput{}
20795	out.Result = output
20796
20797	var buff [1024]byte
20798	ringBuffer := smithyio.NewRingBuffer(buff[:])
20799
20800	body := io.TeeReader(response.Body, ringBuffer)
20801
20802	decoder := json.NewDecoder(body)
20803	decoder.UseNumber()
20804	var shape interface{}
20805	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20806		var snapshot bytes.Buffer
20807		io.Copy(&snapshot, ringBuffer)
20808		err = &smithy.DeserializationError{
20809			Err:      fmt.Errorf("failed to decode response body, %w", err),
20810			Snapshot: snapshot.Bytes(),
20811		}
20812		return out, metadata, err
20813	}
20814
20815	err = awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(&output, shape)
20816	if err != nil {
20817		var snapshot bytes.Buffer
20818		io.Copy(&snapshot, ringBuffer)
20819		return out, metadata, &smithy.DeserializationError{
20820			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20821			Snapshot: snapshot.Bytes(),
20822		}
20823	}
20824
20825	return out, metadata, err
20826}
20827
20828func awsRestjson1_deserializeOpErrorListOutgoingCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20829	var errorBuffer bytes.Buffer
20830	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20831		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
20832	}
20833	errorBody := bytes.NewReader(errorBuffer.Bytes())
20834
20835	errorCode := "UnknownError"
20836	errorMessage := errorCode
20837
20838	code := response.Header.Get("X-Amzn-ErrorType")
20839	if len(code) != 0 {
20840		errorCode = restjson.SanitizeErrorCode(code)
20841	}
20842
20843	var buff [1024]byte
20844	ringBuffer := smithyio.NewRingBuffer(buff[:])
20845
20846	body := io.TeeReader(errorBody, ringBuffer)
20847	decoder := json.NewDecoder(body)
20848	decoder.UseNumber()
20849	code, message, err := restjson.GetErrorInfo(decoder)
20850	if err != nil {
20851		var snapshot bytes.Buffer
20852		io.Copy(&snapshot, ringBuffer)
20853		err = &smithy.DeserializationError{
20854			Err:      fmt.Errorf("failed to decode response body, %w", err),
20855			Snapshot: snapshot.Bytes(),
20856		}
20857		return err
20858	}
20859
20860	errorBody.Seek(0, io.SeekStart)
20861	if len(code) != 0 {
20862		errorCode = restjson.SanitizeErrorCode(code)
20863	}
20864	if len(message) != 0 {
20865		errorMessage = message
20866	}
20867
20868	switch {
20869	case strings.EqualFold("InternalFailureException", errorCode):
20870		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
20871
20872	case strings.EqualFold("InvalidRequestException", errorCode):
20873		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
20874
20875	case strings.EqualFold("ServiceUnavailableException", errorCode):
20876		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
20877
20878	case strings.EqualFold("ThrottlingException", errorCode):
20879		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
20880
20881	case strings.EqualFold("UnauthorizedException", errorCode):
20882		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
20883
20884	default:
20885		genericError := &smithy.GenericAPIError{
20886			Code:    errorCode,
20887			Message: errorMessage,
20888		}
20889		return genericError
20890
20891	}
20892}
20893
20894func awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(v **ListOutgoingCertificatesOutput, value interface{}) error {
20895	if v == nil {
20896		return fmt.Errorf("unexpected nil of type %T", v)
20897	}
20898	if value == nil {
20899		return nil
20900	}
20901
20902	shape, ok := value.(map[string]interface{})
20903	if !ok {
20904		return fmt.Errorf("unexpected JSON type %v", value)
20905	}
20906
20907	var sv *ListOutgoingCertificatesOutput
20908	if *v == nil {
20909		sv = &ListOutgoingCertificatesOutput{}
20910	} else {
20911		sv = *v
20912	}
20913
20914	for key, value := range shape {
20915		switch key {
20916		case "nextMarker":
20917			if value != nil {
20918				jtv, ok := value.(string)
20919				if !ok {
20920					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
20921				}
20922				sv.NextMarker = ptr.String(jtv)
20923			}
20924
20925		case "outgoingCertificates":
20926			if err := awsRestjson1_deserializeDocumentOutgoingCertificates(&sv.OutgoingCertificates, value); err != nil {
20927				return err
20928			}
20929
20930		default:
20931			_, _ = key, value
20932
20933		}
20934	}
20935	*v = sv
20936	return nil
20937}
20938
20939type awsRestjson1_deserializeOpListPolicies struct {
20940}
20941
20942func (*awsRestjson1_deserializeOpListPolicies) ID() string {
20943	return "OperationDeserializer"
20944}
20945
20946func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
20947	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
20948) {
20949	out, metadata, err = next.HandleDeserialize(ctx, in)
20950	if err != nil {
20951		return out, metadata, err
20952	}
20953
20954	response, ok := out.RawResponse.(*smithyhttp.Response)
20955	if !ok {
20956		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
20957	}
20958
20959	if response.StatusCode < 200 || response.StatusCode >= 300 {
20960		return out, metadata, awsRestjson1_deserializeOpErrorListPolicies(response, &metadata)
20961	}
20962	output := &ListPoliciesOutput{}
20963	out.Result = output
20964
20965	var buff [1024]byte
20966	ringBuffer := smithyio.NewRingBuffer(buff[:])
20967
20968	body := io.TeeReader(response.Body, ringBuffer)
20969
20970	decoder := json.NewDecoder(body)
20971	decoder.UseNumber()
20972	var shape interface{}
20973	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20974		var snapshot bytes.Buffer
20975		io.Copy(&snapshot, ringBuffer)
20976		err = &smithy.DeserializationError{
20977			Err:      fmt.Errorf("failed to decode response body, %w", err),
20978			Snapshot: snapshot.Bytes(),
20979		}
20980		return out, metadata, err
20981	}
20982
20983	err = awsRestjson1_deserializeOpDocumentListPoliciesOutput(&output, shape)
20984	if err != nil {
20985		var snapshot bytes.Buffer
20986		io.Copy(&snapshot, ringBuffer)
20987		return out, metadata, &smithy.DeserializationError{
20988			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
20989			Snapshot: snapshot.Bytes(),
20990		}
20991	}
20992
20993	return out, metadata, err
20994}
20995
20996func awsRestjson1_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
20997	var errorBuffer bytes.Buffer
20998	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
20999		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21000	}
21001	errorBody := bytes.NewReader(errorBuffer.Bytes())
21002
21003	errorCode := "UnknownError"
21004	errorMessage := errorCode
21005
21006	code := response.Header.Get("X-Amzn-ErrorType")
21007	if len(code) != 0 {
21008		errorCode = restjson.SanitizeErrorCode(code)
21009	}
21010
21011	var buff [1024]byte
21012	ringBuffer := smithyio.NewRingBuffer(buff[:])
21013
21014	body := io.TeeReader(errorBody, ringBuffer)
21015	decoder := json.NewDecoder(body)
21016	decoder.UseNumber()
21017	code, message, err := restjson.GetErrorInfo(decoder)
21018	if err != nil {
21019		var snapshot bytes.Buffer
21020		io.Copy(&snapshot, ringBuffer)
21021		err = &smithy.DeserializationError{
21022			Err:      fmt.Errorf("failed to decode response body, %w", err),
21023			Snapshot: snapshot.Bytes(),
21024		}
21025		return err
21026	}
21027
21028	errorBody.Seek(0, io.SeekStart)
21029	if len(code) != 0 {
21030		errorCode = restjson.SanitizeErrorCode(code)
21031	}
21032	if len(message) != 0 {
21033		errorMessage = message
21034	}
21035
21036	switch {
21037	case strings.EqualFold("InternalFailureException", errorCode):
21038		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21039
21040	case strings.EqualFold("InvalidRequestException", errorCode):
21041		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21042
21043	case strings.EqualFold("ServiceUnavailableException", errorCode):
21044		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
21045
21046	case strings.EqualFold("ThrottlingException", errorCode):
21047		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21048
21049	case strings.EqualFold("UnauthorizedException", errorCode):
21050		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21051
21052	default:
21053		genericError := &smithy.GenericAPIError{
21054			Code:    errorCode,
21055			Message: errorMessage,
21056		}
21057		return genericError
21058
21059	}
21060}
21061
21062func awsRestjson1_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error {
21063	if v == nil {
21064		return fmt.Errorf("unexpected nil of type %T", v)
21065	}
21066	if value == nil {
21067		return nil
21068	}
21069
21070	shape, ok := value.(map[string]interface{})
21071	if !ok {
21072		return fmt.Errorf("unexpected JSON type %v", value)
21073	}
21074
21075	var sv *ListPoliciesOutput
21076	if *v == nil {
21077		sv = &ListPoliciesOutput{}
21078	} else {
21079		sv = *v
21080	}
21081
21082	for key, value := range shape {
21083		switch key {
21084		case "nextMarker":
21085			if value != nil {
21086				jtv, ok := value.(string)
21087				if !ok {
21088					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
21089				}
21090				sv.NextMarker = ptr.String(jtv)
21091			}
21092
21093		case "policies":
21094			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
21095				return err
21096			}
21097
21098		default:
21099			_, _ = key, value
21100
21101		}
21102	}
21103	*v = sv
21104	return nil
21105}
21106
21107type awsRestjson1_deserializeOpListPolicyPrincipals struct {
21108}
21109
21110func (*awsRestjson1_deserializeOpListPolicyPrincipals) ID() string {
21111	return "OperationDeserializer"
21112}
21113
21114func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21115	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21116) {
21117	out, metadata, err = next.HandleDeserialize(ctx, in)
21118	if err != nil {
21119		return out, metadata, err
21120	}
21121
21122	response, ok := out.RawResponse.(*smithyhttp.Response)
21123	if !ok {
21124		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21125	}
21126
21127	if response.StatusCode < 200 || response.StatusCode >= 300 {
21128		return out, metadata, awsRestjson1_deserializeOpErrorListPolicyPrincipals(response, &metadata)
21129	}
21130	output := &ListPolicyPrincipalsOutput{}
21131	out.Result = output
21132
21133	var buff [1024]byte
21134	ringBuffer := smithyio.NewRingBuffer(buff[:])
21135
21136	body := io.TeeReader(response.Body, ringBuffer)
21137
21138	decoder := json.NewDecoder(body)
21139	decoder.UseNumber()
21140	var shape interface{}
21141	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21142		var snapshot bytes.Buffer
21143		io.Copy(&snapshot, ringBuffer)
21144		err = &smithy.DeserializationError{
21145			Err:      fmt.Errorf("failed to decode response body, %w", err),
21146			Snapshot: snapshot.Bytes(),
21147		}
21148		return out, metadata, err
21149	}
21150
21151	err = awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(&output, shape)
21152	if err != nil {
21153		var snapshot bytes.Buffer
21154		io.Copy(&snapshot, ringBuffer)
21155		return out, metadata, &smithy.DeserializationError{
21156			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21157			Snapshot: snapshot.Bytes(),
21158		}
21159	}
21160
21161	return out, metadata, err
21162}
21163
21164func awsRestjson1_deserializeOpErrorListPolicyPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error {
21165	var errorBuffer bytes.Buffer
21166	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
21167		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21168	}
21169	errorBody := bytes.NewReader(errorBuffer.Bytes())
21170
21171	errorCode := "UnknownError"
21172	errorMessage := errorCode
21173
21174	code := response.Header.Get("X-Amzn-ErrorType")
21175	if len(code) != 0 {
21176		errorCode = restjson.SanitizeErrorCode(code)
21177	}
21178
21179	var buff [1024]byte
21180	ringBuffer := smithyio.NewRingBuffer(buff[:])
21181
21182	body := io.TeeReader(errorBody, ringBuffer)
21183	decoder := json.NewDecoder(body)
21184	decoder.UseNumber()
21185	code, message, err := restjson.GetErrorInfo(decoder)
21186	if err != nil {
21187		var snapshot bytes.Buffer
21188		io.Copy(&snapshot, ringBuffer)
21189		err = &smithy.DeserializationError{
21190			Err:      fmt.Errorf("failed to decode response body, %w", err),
21191			Snapshot: snapshot.Bytes(),
21192		}
21193		return err
21194	}
21195
21196	errorBody.Seek(0, io.SeekStart)
21197	if len(code) != 0 {
21198		errorCode = restjson.SanitizeErrorCode(code)
21199	}
21200	if len(message) != 0 {
21201		errorMessage = message
21202	}
21203
21204	switch {
21205	case strings.EqualFold("InternalFailureException", errorCode):
21206		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21207
21208	case strings.EqualFold("InvalidRequestException", errorCode):
21209		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21210
21211	case strings.EqualFold("ResourceNotFoundException", errorCode):
21212		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
21213
21214	case strings.EqualFold("ServiceUnavailableException", errorCode):
21215		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
21216
21217	case strings.EqualFold("ThrottlingException", errorCode):
21218		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21219
21220	case strings.EqualFold("UnauthorizedException", errorCode):
21221		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21222
21223	default:
21224		genericError := &smithy.GenericAPIError{
21225			Code:    errorCode,
21226			Message: errorMessage,
21227		}
21228		return genericError
21229
21230	}
21231}
21232
21233func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicyPrincipalsOutput, value interface{}) error {
21234	if v == nil {
21235		return fmt.Errorf("unexpected nil of type %T", v)
21236	}
21237	if value == nil {
21238		return nil
21239	}
21240
21241	shape, ok := value.(map[string]interface{})
21242	if !ok {
21243		return fmt.Errorf("unexpected JSON type %v", value)
21244	}
21245
21246	var sv *ListPolicyPrincipalsOutput
21247	if *v == nil {
21248		sv = &ListPolicyPrincipalsOutput{}
21249	} else {
21250		sv = *v
21251	}
21252
21253	for key, value := range shape {
21254		switch key {
21255		case "nextMarker":
21256			if value != nil {
21257				jtv, ok := value.(string)
21258				if !ok {
21259					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
21260				}
21261				sv.NextMarker = ptr.String(jtv)
21262			}
21263
21264		case "principals":
21265			if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil {
21266				return err
21267			}
21268
21269		default:
21270			_, _ = key, value
21271
21272		}
21273	}
21274	*v = sv
21275	return nil
21276}
21277
21278type awsRestjson1_deserializeOpListPolicyVersions struct {
21279}
21280
21281func (*awsRestjson1_deserializeOpListPolicyVersions) ID() string {
21282	return "OperationDeserializer"
21283}
21284
21285func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21286	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21287) {
21288	out, metadata, err = next.HandleDeserialize(ctx, in)
21289	if err != nil {
21290		return out, metadata, err
21291	}
21292
21293	response, ok := out.RawResponse.(*smithyhttp.Response)
21294	if !ok {
21295		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21296	}
21297
21298	if response.StatusCode < 200 || response.StatusCode >= 300 {
21299		return out, metadata, awsRestjson1_deserializeOpErrorListPolicyVersions(response, &metadata)
21300	}
21301	output := &ListPolicyVersionsOutput{}
21302	out.Result = output
21303
21304	var buff [1024]byte
21305	ringBuffer := smithyio.NewRingBuffer(buff[:])
21306
21307	body := io.TeeReader(response.Body, ringBuffer)
21308
21309	decoder := json.NewDecoder(body)
21310	decoder.UseNumber()
21311	var shape interface{}
21312	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21313		var snapshot bytes.Buffer
21314		io.Copy(&snapshot, ringBuffer)
21315		err = &smithy.DeserializationError{
21316			Err:      fmt.Errorf("failed to decode response body, %w", err),
21317			Snapshot: snapshot.Bytes(),
21318		}
21319		return out, metadata, err
21320	}
21321
21322	err = awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(&output, shape)
21323	if err != nil {
21324		var snapshot bytes.Buffer
21325		io.Copy(&snapshot, ringBuffer)
21326		return out, metadata, &smithy.DeserializationError{
21327			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21328			Snapshot: snapshot.Bytes(),
21329		}
21330	}
21331
21332	return out, metadata, err
21333}
21334
21335func awsRestjson1_deserializeOpErrorListPolicyVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
21336	var errorBuffer bytes.Buffer
21337	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
21338		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21339	}
21340	errorBody := bytes.NewReader(errorBuffer.Bytes())
21341
21342	errorCode := "UnknownError"
21343	errorMessage := errorCode
21344
21345	code := response.Header.Get("X-Amzn-ErrorType")
21346	if len(code) != 0 {
21347		errorCode = restjson.SanitizeErrorCode(code)
21348	}
21349
21350	var buff [1024]byte
21351	ringBuffer := smithyio.NewRingBuffer(buff[:])
21352
21353	body := io.TeeReader(errorBody, ringBuffer)
21354	decoder := json.NewDecoder(body)
21355	decoder.UseNumber()
21356	code, message, err := restjson.GetErrorInfo(decoder)
21357	if err != nil {
21358		var snapshot bytes.Buffer
21359		io.Copy(&snapshot, ringBuffer)
21360		err = &smithy.DeserializationError{
21361			Err:      fmt.Errorf("failed to decode response body, %w", err),
21362			Snapshot: snapshot.Bytes(),
21363		}
21364		return err
21365	}
21366
21367	errorBody.Seek(0, io.SeekStart)
21368	if len(code) != 0 {
21369		errorCode = restjson.SanitizeErrorCode(code)
21370	}
21371	if len(message) != 0 {
21372		errorMessage = message
21373	}
21374
21375	switch {
21376	case strings.EqualFold("InternalFailureException", errorCode):
21377		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21378
21379	case strings.EqualFold("InvalidRequestException", errorCode):
21380		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21381
21382	case strings.EqualFold("ResourceNotFoundException", errorCode):
21383		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
21384
21385	case strings.EqualFold("ServiceUnavailableException", errorCode):
21386		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
21387
21388	case strings.EqualFold("ThrottlingException", errorCode):
21389		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21390
21391	case strings.EqualFold("UnauthorizedException", errorCode):
21392		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21393
21394	default:
21395		genericError := &smithy.GenericAPIError{
21396			Code:    errorCode,
21397			Message: errorMessage,
21398		}
21399		return genericError
21400
21401	}
21402}
21403
21404func awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(v **ListPolicyVersionsOutput, value interface{}) error {
21405	if v == nil {
21406		return fmt.Errorf("unexpected nil of type %T", v)
21407	}
21408	if value == nil {
21409		return nil
21410	}
21411
21412	shape, ok := value.(map[string]interface{})
21413	if !ok {
21414		return fmt.Errorf("unexpected JSON type %v", value)
21415	}
21416
21417	var sv *ListPolicyVersionsOutput
21418	if *v == nil {
21419		sv = &ListPolicyVersionsOutput{}
21420	} else {
21421		sv = *v
21422	}
21423
21424	for key, value := range shape {
21425		switch key {
21426		case "policyVersions":
21427			if err := awsRestjson1_deserializeDocumentPolicyVersions(&sv.PolicyVersions, value); err != nil {
21428				return err
21429			}
21430
21431		default:
21432			_, _ = key, value
21433
21434		}
21435	}
21436	*v = sv
21437	return nil
21438}
21439
21440type awsRestjson1_deserializeOpListPrincipalPolicies struct {
21441}
21442
21443func (*awsRestjson1_deserializeOpListPrincipalPolicies) ID() string {
21444	return "OperationDeserializer"
21445}
21446
21447func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21448	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21449) {
21450	out, metadata, err = next.HandleDeserialize(ctx, in)
21451	if err != nil {
21452		return out, metadata, err
21453	}
21454
21455	response, ok := out.RawResponse.(*smithyhttp.Response)
21456	if !ok {
21457		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21458	}
21459
21460	if response.StatusCode < 200 || response.StatusCode >= 300 {
21461		return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalPolicies(response, &metadata)
21462	}
21463	output := &ListPrincipalPoliciesOutput{}
21464	out.Result = output
21465
21466	var buff [1024]byte
21467	ringBuffer := smithyio.NewRingBuffer(buff[:])
21468
21469	body := io.TeeReader(response.Body, ringBuffer)
21470
21471	decoder := json.NewDecoder(body)
21472	decoder.UseNumber()
21473	var shape interface{}
21474	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21475		var snapshot bytes.Buffer
21476		io.Copy(&snapshot, ringBuffer)
21477		err = &smithy.DeserializationError{
21478			Err:      fmt.Errorf("failed to decode response body, %w", err),
21479			Snapshot: snapshot.Bytes(),
21480		}
21481		return out, metadata, err
21482	}
21483
21484	err = awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(&output, shape)
21485	if err != nil {
21486		var snapshot bytes.Buffer
21487		io.Copy(&snapshot, ringBuffer)
21488		return out, metadata, &smithy.DeserializationError{
21489			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21490			Snapshot: snapshot.Bytes(),
21491		}
21492	}
21493
21494	return out, metadata, err
21495}
21496
21497func awsRestjson1_deserializeOpErrorListPrincipalPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
21498	var errorBuffer bytes.Buffer
21499	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
21500		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21501	}
21502	errorBody := bytes.NewReader(errorBuffer.Bytes())
21503
21504	errorCode := "UnknownError"
21505	errorMessage := errorCode
21506
21507	code := response.Header.Get("X-Amzn-ErrorType")
21508	if len(code) != 0 {
21509		errorCode = restjson.SanitizeErrorCode(code)
21510	}
21511
21512	var buff [1024]byte
21513	ringBuffer := smithyio.NewRingBuffer(buff[:])
21514
21515	body := io.TeeReader(errorBody, ringBuffer)
21516	decoder := json.NewDecoder(body)
21517	decoder.UseNumber()
21518	code, message, err := restjson.GetErrorInfo(decoder)
21519	if err != nil {
21520		var snapshot bytes.Buffer
21521		io.Copy(&snapshot, ringBuffer)
21522		err = &smithy.DeserializationError{
21523			Err:      fmt.Errorf("failed to decode response body, %w", err),
21524			Snapshot: snapshot.Bytes(),
21525		}
21526		return err
21527	}
21528
21529	errorBody.Seek(0, io.SeekStart)
21530	if len(code) != 0 {
21531		errorCode = restjson.SanitizeErrorCode(code)
21532	}
21533	if len(message) != 0 {
21534		errorMessage = message
21535	}
21536
21537	switch {
21538	case strings.EqualFold("InternalFailureException", errorCode):
21539		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21540
21541	case strings.EqualFold("InvalidRequestException", errorCode):
21542		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21543
21544	case strings.EqualFold("ResourceNotFoundException", errorCode):
21545		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
21546
21547	case strings.EqualFold("ServiceUnavailableException", errorCode):
21548		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
21549
21550	case strings.EqualFold("ThrottlingException", errorCode):
21551		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21552
21553	case strings.EqualFold("UnauthorizedException", errorCode):
21554		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21555
21556	default:
21557		genericError := &smithy.GenericAPIError{
21558			Code:    errorCode,
21559			Message: errorMessage,
21560		}
21561		return genericError
21562
21563	}
21564}
21565
21566func awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(v **ListPrincipalPoliciesOutput, value interface{}) error {
21567	if v == nil {
21568		return fmt.Errorf("unexpected nil of type %T", v)
21569	}
21570	if value == nil {
21571		return nil
21572	}
21573
21574	shape, ok := value.(map[string]interface{})
21575	if !ok {
21576		return fmt.Errorf("unexpected JSON type %v", value)
21577	}
21578
21579	var sv *ListPrincipalPoliciesOutput
21580	if *v == nil {
21581		sv = &ListPrincipalPoliciesOutput{}
21582	} else {
21583		sv = *v
21584	}
21585
21586	for key, value := range shape {
21587		switch key {
21588		case "nextMarker":
21589			if value != nil {
21590				jtv, ok := value.(string)
21591				if !ok {
21592					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
21593				}
21594				sv.NextMarker = ptr.String(jtv)
21595			}
21596
21597		case "policies":
21598			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
21599				return err
21600			}
21601
21602		default:
21603			_, _ = key, value
21604
21605		}
21606	}
21607	*v = sv
21608	return nil
21609}
21610
21611type awsRestjson1_deserializeOpListPrincipalThings struct {
21612}
21613
21614func (*awsRestjson1_deserializeOpListPrincipalThings) ID() string {
21615	return "OperationDeserializer"
21616}
21617
21618func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21619	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21620) {
21621	out, metadata, err = next.HandleDeserialize(ctx, in)
21622	if err != nil {
21623		return out, metadata, err
21624	}
21625
21626	response, ok := out.RawResponse.(*smithyhttp.Response)
21627	if !ok {
21628		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21629	}
21630
21631	if response.StatusCode < 200 || response.StatusCode >= 300 {
21632		return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThings(response, &metadata)
21633	}
21634	output := &ListPrincipalThingsOutput{}
21635	out.Result = output
21636
21637	var buff [1024]byte
21638	ringBuffer := smithyio.NewRingBuffer(buff[:])
21639
21640	body := io.TeeReader(response.Body, ringBuffer)
21641
21642	decoder := json.NewDecoder(body)
21643	decoder.UseNumber()
21644	var shape interface{}
21645	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21646		var snapshot bytes.Buffer
21647		io.Copy(&snapshot, ringBuffer)
21648		err = &smithy.DeserializationError{
21649			Err:      fmt.Errorf("failed to decode response body, %w", err),
21650			Snapshot: snapshot.Bytes(),
21651		}
21652		return out, metadata, err
21653	}
21654
21655	err = awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(&output, shape)
21656	if err != nil {
21657		var snapshot bytes.Buffer
21658		io.Copy(&snapshot, ringBuffer)
21659		return out, metadata, &smithy.DeserializationError{
21660			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21661			Snapshot: snapshot.Bytes(),
21662		}
21663	}
21664
21665	return out, metadata, err
21666}
21667
21668func awsRestjson1_deserializeOpErrorListPrincipalThings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
21669	var errorBuffer bytes.Buffer
21670	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
21671		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21672	}
21673	errorBody := bytes.NewReader(errorBuffer.Bytes())
21674
21675	errorCode := "UnknownError"
21676	errorMessage := errorCode
21677
21678	code := response.Header.Get("X-Amzn-ErrorType")
21679	if len(code) != 0 {
21680		errorCode = restjson.SanitizeErrorCode(code)
21681	}
21682
21683	var buff [1024]byte
21684	ringBuffer := smithyio.NewRingBuffer(buff[:])
21685
21686	body := io.TeeReader(errorBody, ringBuffer)
21687	decoder := json.NewDecoder(body)
21688	decoder.UseNumber()
21689	code, message, err := restjson.GetErrorInfo(decoder)
21690	if err != nil {
21691		var snapshot bytes.Buffer
21692		io.Copy(&snapshot, ringBuffer)
21693		err = &smithy.DeserializationError{
21694			Err:      fmt.Errorf("failed to decode response body, %w", err),
21695			Snapshot: snapshot.Bytes(),
21696		}
21697		return err
21698	}
21699
21700	errorBody.Seek(0, io.SeekStart)
21701	if len(code) != 0 {
21702		errorCode = restjson.SanitizeErrorCode(code)
21703	}
21704	if len(message) != 0 {
21705		errorMessage = message
21706	}
21707
21708	switch {
21709	case strings.EqualFold("InternalFailureException", errorCode):
21710		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21711
21712	case strings.EqualFold("InvalidRequestException", errorCode):
21713		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21714
21715	case strings.EqualFold("ResourceNotFoundException", errorCode):
21716		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
21717
21718	case strings.EqualFold("ServiceUnavailableException", errorCode):
21719		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
21720
21721	case strings.EqualFold("ThrottlingException", errorCode):
21722		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21723
21724	case strings.EqualFold("UnauthorizedException", errorCode):
21725		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21726
21727	default:
21728		genericError := &smithy.GenericAPIError{
21729			Code:    errorCode,
21730			Message: errorMessage,
21731		}
21732		return genericError
21733
21734	}
21735}
21736
21737func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincipalThingsOutput, value interface{}) error {
21738	if v == nil {
21739		return fmt.Errorf("unexpected nil of type %T", v)
21740	}
21741	if value == nil {
21742		return nil
21743	}
21744
21745	shape, ok := value.(map[string]interface{})
21746	if !ok {
21747		return fmt.Errorf("unexpected JSON type %v", value)
21748	}
21749
21750	var sv *ListPrincipalThingsOutput
21751	if *v == nil {
21752		sv = &ListPrincipalThingsOutput{}
21753	} else {
21754		sv = *v
21755	}
21756
21757	for key, value := range shape {
21758		switch key {
21759		case "nextToken":
21760			if value != nil {
21761				jtv, ok := value.(string)
21762				if !ok {
21763					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
21764				}
21765				sv.NextToken = ptr.String(jtv)
21766			}
21767
21768		case "things":
21769			if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil {
21770				return err
21771			}
21772
21773		default:
21774			_, _ = key, value
21775
21776		}
21777	}
21778	*v = sv
21779	return nil
21780}
21781
21782type awsRestjson1_deserializeOpListProvisioningTemplates struct {
21783}
21784
21785func (*awsRestjson1_deserializeOpListProvisioningTemplates) ID() string {
21786	return "OperationDeserializer"
21787}
21788
21789func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21790	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21791) {
21792	out, metadata, err = next.HandleDeserialize(ctx, in)
21793	if err != nil {
21794		return out, metadata, err
21795	}
21796
21797	response, ok := out.RawResponse.(*smithyhttp.Response)
21798	if !ok {
21799		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21800	}
21801
21802	if response.StatusCode < 200 || response.StatusCode >= 300 {
21803		return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplates(response, &metadata)
21804	}
21805	output := &ListProvisioningTemplatesOutput{}
21806	out.Result = output
21807
21808	var buff [1024]byte
21809	ringBuffer := smithyio.NewRingBuffer(buff[:])
21810
21811	body := io.TeeReader(response.Body, ringBuffer)
21812
21813	decoder := json.NewDecoder(body)
21814	decoder.UseNumber()
21815	var shape interface{}
21816	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21817		var snapshot bytes.Buffer
21818		io.Copy(&snapshot, ringBuffer)
21819		err = &smithy.DeserializationError{
21820			Err:      fmt.Errorf("failed to decode response body, %w", err),
21821			Snapshot: snapshot.Bytes(),
21822		}
21823		return out, metadata, err
21824	}
21825
21826	err = awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(&output, shape)
21827	if err != nil {
21828		var snapshot bytes.Buffer
21829		io.Copy(&snapshot, ringBuffer)
21830		return out, metadata, &smithy.DeserializationError{
21831			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21832			Snapshot: snapshot.Bytes(),
21833		}
21834	}
21835
21836	return out, metadata, err
21837}
21838
21839func awsRestjson1_deserializeOpErrorListProvisioningTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
21840	var errorBuffer bytes.Buffer
21841	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
21842		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
21843	}
21844	errorBody := bytes.NewReader(errorBuffer.Bytes())
21845
21846	errorCode := "UnknownError"
21847	errorMessage := errorCode
21848
21849	code := response.Header.Get("X-Amzn-ErrorType")
21850	if len(code) != 0 {
21851		errorCode = restjson.SanitizeErrorCode(code)
21852	}
21853
21854	var buff [1024]byte
21855	ringBuffer := smithyio.NewRingBuffer(buff[:])
21856
21857	body := io.TeeReader(errorBody, ringBuffer)
21858	decoder := json.NewDecoder(body)
21859	decoder.UseNumber()
21860	code, message, err := restjson.GetErrorInfo(decoder)
21861	if err != nil {
21862		var snapshot bytes.Buffer
21863		io.Copy(&snapshot, ringBuffer)
21864		err = &smithy.DeserializationError{
21865			Err:      fmt.Errorf("failed to decode response body, %w", err),
21866			Snapshot: snapshot.Bytes(),
21867		}
21868		return err
21869	}
21870
21871	errorBody.Seek(0, io.SeekStart)
21872	if len(code) != 0 {
21873		errorCode = restjson.SanitizeErrorCode(code)
21874	}
21875	if len(message) != 0 {
21876		errorMessage = message
21877	}
21878
21879	switch {
21880	case strings.EqualFold("InternalFailureException", errorCode):
21881		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
21882
21883	case strings.EqualFold("InvalidRequestException", errorCode):
21884		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
21885
21886	case strings.EqualFold("ThrottlingException", errorCode):
21887		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
21888
21889	case strings.EqualFold("UnauthorizedException", errorCode):
21890		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
21891
21892	default:
21893		genericError := &smithy.GenericAPIError{
21894			Code:    errorCode,
21895			Message: errorMessage,
21896		}
21897		return genericError
21898
21899	}
21900}
21901
21902func awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(v **ListProvisioningTemplatesOutput, value interface{}) error {
21903	if v == nil {
21904		return fmt.Errorf("unexpected nil of type %T", v)
21905	}
21906	if value == nil {
21907		return nil
21908	}
21909
21910	shape, ok := value.(map[string]interface{})
21911	if !ok {
21912		return fmt.Errorf("unexpected JSON type %v", value)
21913	}
21914
21915	var sv *ListProvisioningTemplatesOutput
21916	if *v == nil {
21917		sv = &ListProvisioningTemplatesOutput{}
21918	} else {
21919		sv = *v
21920	}
21921
21922	for key, value := range shape {
21923		switch key {
21924		case "nextToken":
21925			if value != nil {
21926				jtv, ok := value.(string)
21927				if !ok {
21928					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
21929				}
21930				sv.NextToken = ptr.String(jtv)
21931			}
21932
21933		case "templates":
21934			if err := awsRestjson1_deserializeDocumentProvisioningTemplateListing(&sv.Templates, value); err != nil {
21935				return err
21936			}
21937
21938		default:
21939			_, _ = key, value
21940
21941		}
21942	}
21943	*v = sv
21944	return nil
21945}
21946
21947type awsRestjson1_deserializeOpListProvisioningTemplateVersions struct {
21948}
21949
21950func (*awsRestjson1_deserializeOpListProvisioningTemplateVersions) ID() string {
21951	return "OperationDeserializer"
21952}
21953
21954func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
21955	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
21956) {
21957	out, metadata, err = next.HandleDeserialize(ctx, in)
21958	if err != nil {
21959		return out, metadata, err
21960	}
21961
21962	response, ok := out.RawResponse.(*smithyhttp.Response)
21963	if !ok {
21964		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
21965	}
21966
21967	if response.StatusCode < 200 || response.StatusCode >= 300 {
21968		return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response, &metadata)
21969	}
21970	output := &ListProvisioningTemplateVersionsOutput{}
21971	out.Result = output
21972
21973	var buff [1024]byte
21974	ringBuffer := smithyio.NewRingBuffer(buff[:])
21975
21976	body := io.TeeReader(response.Body, ringBuffer)
21977
21978	decoder := json.NewDecoder(body)
21979	decoder.UseNumber()
21980	var shape interface{}
21981	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
21982		var snapshot bytes.Buffer
21983		io.Copy(&snapshot, ringBuffer)
21984		err = &smithy.DeserializationError{
21985			Err:      fmt.Errorf("failed to decode response body, %w", err),
21986			Snapshot: snapshot.Bytes(),
21987		}
21988		return out, metadata, err
21989	}
21990
21991	err = awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(&output, shape)
21992	if err != nil {
21993		var snapshot bytes.Buffer
21994		io.Copy(&snapshot, ringBuffer)
21995		return out, metadata, &smithy.DeserializationError{
21996			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
21997			Snapshot: snapshot.Bytes(),
21998		}
21999	}
22000
22001	return out, metadata, err
22002}
22003
22004func awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22005	var errorBuffer bytes.Buffer
22006	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22007		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22008	}
22009	errorBody := bytes.NewReader(errorBuffer.Bytes())
22010
22011	errorCode := "UnknownError"
22012	errorMessage := errorCode
22013
22014	code := response.Header.Get("X-Amzn-ErrorType")
22015	if len(code) != 0 {
22016		errorCode = restjson.SanitizeErrorCode(code)
22017	}
22018
22019	var buff [1024]byte
22020	ringBuffer := smithyio.NewRingBuffer(buff[:])
22021
22022	body := io.TeeReader(errorBody, ringBuffer)
22023	decoder := json.NewDecoder(body)
22024	decoder.UseNumber()
22025	code, message, err := restjson.GetErrorInfo(decoder)
22026	if err != nil {
22027		var snapshot bytes.Buffer
22028		io.Copy(&snapshot, ringBuffer)
22029		err = &smithy.DeserializationError{
22030			Err:      fmt.Errorf("failed to decode response body, %w", err),
22031			Snapshot: snapshot.Bytes(),
22032		}
22033		return err
22034	}
22035
22036	errorBody.Seek(0, io.SeekStart)
22037	if len(code) != 0 {
22038		errorCode = restjson.SanitizeErrorCode(code)
22039	}
22040	if len(message) != 0 {
22041		errorMessage = message
22042	}
22043
22044	switch {
22045	case strings.EqualFold("InternalFailureException", errorCode):
22046		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22047
22048	case strings.EqualFold("InvalidRequestException", errorCode):
22049		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22050
22051	case strings.EqualFold("ResourceNotFoundException", errorCode):
22052		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
22053
22054	case strings.EqualFold("ThrottlingException", errorCode):
22055		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22056
22057	case strings.EqualFold("UnauthorizedException", errorCode):
22058		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
22059
22060	default:
22061		genericError := &smithy.GenericAPIError{
22062			Code:    errorCode,
22063			Message: errorMessage,
22064		}
22065		return genericError
22066
22067	}
22068}
22069
22070func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v **ListProvisioningTemplateVersionsOutput, value interface{}) error {
22071	if v == nil {
22072		return fmt.Errorf("unexpected nil of type %T", v)
22073	}
22074	if value == nil {
22075		return nil
22076	}
22077
22078	shape, ok := value.(map[string]interface{})
22079	if !ok {
22080		return fmt.Errorf("unexpected JSON type %v", value)
22081	}
22082
22083	var sv *ListProvisioningTemplateVersionsOutput
22084	if *v == nil {
22085		sv = &ListProvisioningTemplateVersionsOutput{}
22086	} else {
22087		sv = *v
22088	}
22089
22090	for key, value := range shape {
22091		switch key {
22092		case "nextToken":
22093			if value != nil {
22094				jtv, ok := value.(string)
22095				if !ok {
22096					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
22097				}
22098				sv.NextToken = ptr.String(jtv)
22099			}
22100
22101		case "versions":
22102			if err := awsRestjson1_deserializeDocumentProvisioningTemplateVersionListing(&sv.Versions, value); err != nil {
22103				return err
22104			}
22105
22106		default:
22107			_, _ = key, value
22108
22109		}
22110	}
22111	*v = sv
22112	return nil
22113}
22114
22115type awsRestjson1_deserializeOpListRoleAliases struct {
22116}
22117
22118func (*awsRestjson1_deserializeOpListRoleAliases) ID() string {
22119	return "OperationDeserializer"
22120}
22121
22122func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22123	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22124) {
22125	out, metadata, err = next.HandleDeserialize(ctx, in)
22126	if err != nil {
22127		return out, metadata, err
22128	}
22129
22130	response, ok := out.RawResponse.(*smithyhttp.Response)
22131	if !ok {
22132		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22133	}
22134
22135	if response.StatusCode < 200 || response.StatusCode >= 300 {
22136		return out, metadata, awsRestjson1_deserializeOpErrorListRoleAliases(response, &metadata)
22137	}
22138	output := &ListRoleAliasesOutput{}
22139	out.Result = output
22140
22141	var buff [1024]byte
22142	ringBuffer := smithyio.NewRingBuffer(buff[:])
22143
22144	body := io.TeeReader(response.Body, ringBuffer)
22145
22146	decoder := json.NewDecoder(body)
22147	decoder.UseNumber()
22148	var shape interface{}
22149	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22150		var snapshot bytes.Buffer
22151		io.Copy(&snapshot, ringBuffer)
22152		err = &smithy.DeserializationError{
22153			Err:      fmt.Errorf("failed to decode response body, %w", err),
22154			Snapshot: snapshot.Bytes(),
22155		}
22156		return out, metadata, err
22157	}
22158
22159	err = awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(&output, shape)
22160	if err != nil {
22161		var snapshot bytes.Buffer
22162		io.Copy(&snapshot, ringBuffer)
22163		return out, metadata, &smithy.DeserializationError{
22164			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22165			Snapshot: snapshot.Bytes(),
22166		}
22167	}
22168
22169	return out, metadata, err
22170}
22171
22172func awsRestjson1_deserializeOpErrorListRoleAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22173	var errorBuffer bytes.Buffer
22174	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22175		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22176	}
22177	errorBody := bytes.NewReader(errorBuffer.Bytes())
22178
22179	errorCode := "UnknownError"
22180	errorMessage := errorCode
22181
22182	code := response.Header.Get("X-Amzn-ErrorType")
22183	if len(code) != 0 {
22184		errorCode = restjson.SanitizeErrorCode(code)
22185	}
22186
22187	var buff [1024]byte
22188	ringBuffer := smithyio.NewRingBuffer(buff[:])
22189
22190	body := io.TeeReader(errorBody, ringBuffer)
22191	decoder := json.NewDecoder(body)
22192	decoder.UseNumber()
22193	code, message, err := restjson.GetErrorInfo(decoder)
22194	if err != nil {
22195		var snapshot bytes.Buffer
22196		io.Copy(&snapshot, ringBuffer)
22197		err = &smithy.DeserializationError{
22198			Err:      fmt.Errorf("failed to decode response body, %w", err),
22199			Snapshot: snapshot.Bytes(),
22200		}
22201		return err
22202	}
22203
22204	errorBody.Seek(0, io.SeekStart)
22205	if len(code) != 0 {
22206		errorCode = restjson.SanitizeErrorCode(code)
22207	}
22208	if len(message) != 0 {
22209		errorMessage = message
22210	}
22211
22212	switch {
22213	case strings.EqualFold("InternalFailureException", errorCode):
22214		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22215
22216	case strings.EqualFold("InvalidRequestException", errorCode):
22217		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22218
22219	case strings.EqualFold("ServiceUnavailableException", errorCode):
22220		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
22221
22222	case strings.EqualFold("ThrottlingException", errorCode):
22223		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22224
22225	case strings.EqualFold("UnauthorizedException", errorCode):
22226		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
22227
22228	default:
22229		genericError := &smithy.GenericAPIError{
22230			Code:    errorCode,
22231			Message: errorMessage,
22232		}
22233		return genericError
22234
22235	}
22236}
22237
22238func awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(v **ListRoleAliasesOutput, value interface{}) error {
22239	if v == nil {
22240		return fmt.Errorf("unexpected nil of type %T", v)
22241	}
22242	if value == nil {
22243		return nil
22244	}
22245
22246	shape, ok := value.(map[string]interface{})
22247	if !ok {
22248		return fmt.Errorf("unexpected JSON type %v", value)
22249	}
22250
22251	var sv *ListRoleAliasesOutput
22252	if *v == nil {
22253		sv = &ListRoleAliasesOutput{}
22254	} else {
22255		sv = *v
22256	}
22257
22258	for key, value := range shape {
22259		switch key {
22260		case "nextMarker":
22261			if value != nil {
22262				jtv, ok := value.(string)
22263				if !ok {
22264					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
22265				}
22266				sv.NextMarker = ptr.String(jtv)
22267			}
22268
22269		case "roleAliases":
22270			if err := awsRestjson1_deserializeDocumentRoleAliases(&sv.RoleAliases, value); err != nil {
22271				return err
22272			}
22273
22274		default:
22275			_, _ = key, value
22276
22277		}
22278	}
22279	*v = sv
22280	return nil
22281}
22282
22283type awsRestjson1_deserializeOpListScheduledAudits struct {
22284}
22285
22286func (*awsRestjson1_deserializeOpListScheduledAudits) ID() string {
22287	return "OperationDeserializer"
22288}
22289
22290func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22291	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22292) {
22293	out, metadata, err = next.HandleDeserialize(ctx, in)
22294	if err != nil {
22295		return out, metadata, err
22296	}
22297
22298	response, ok := out.RawResponse.(*smithyhttp.Response)
22299	if !ok {
22300		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22301	}
22302
22303	if response.StatusCode < 200 || response.StatusCode >= 300 {
22304		return out, metadata, awsRestjson1_deserializeOpErrorListScheduledAudits(response, &metadata)
22305	}
22306	output := &ListScheduledAuditsOutput{}
22307	out.Result = output
22308
22309	var buff [1024]byte
22310	ringBuffer := smithyio.NewRingBuffer(buff[:])
22311
22312	body := io.TeeReader(response.Body, ringBuffer)
22313
22314	decoder := json.NewDecoder(body)
22315	decoder.UseNumber()
22316	var shape interface{}
22317	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22318		var snapshot bytes.Buffer
22319		io.Copy(&snapshot, ringBuffer)
22320		err = &smithy.DeserializationError{
22321			Err:      fmt.Errorf("failed to decode response body, %w", err),
22322			Snapshot: snapshot.Bytes(),
22323		}
22324		return out, metadata, err
22325	}
22326
22327	err = awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(&output, shape)
22328	if err != nil {
22329		var snapshot bytes.Buffer
22330		io.Copy(&snapshot, ringBuffer)
22331		return out, metadata, &smithy.DeserializationError{
22332			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22333			Snapshot: snapshot.Bytes(),
22334		}
22335	}
22336
22337	return out, metadata, err
22338}
22339
22340func awsRestjson1_deserializeOpErrorListScheduledAudits(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22341	var errorBuffer bytes.Buffer
22342	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22343		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22344	}
22345	errorBody := bytes.NewReader(errorBuffer.Bytes())
22346
22347	errorCode := "UnknownError"
22348	errorMessage := errorCode
22349
22350	code := response.Header.Get("X-Amzn-ErrorType")
22351	if len(code) != 0 {
22352		errorCode = restjson.SanitizeErrorCode(code)
22353	}
22354
22355	var buff [1024]byte
22356	ringBuffer := smithyio.NewRingBuffer(buff[:])
22357
22358	body := io.TeeReader(errorBody, ringBuffer)
22359	decoder := json.NewDecoder(body)
22360	decoder.UseNumber()
22361	code, message, err := restjson.GetErrorInfo(decoder)
22362	if err != nil {
22363		var snapshot bytes.Buffer
22364		io.Copy(&snapshot, ringBuffer)
22365		err = &smithy.DeserializationError{
22366			Err:      fmt.Errorf("failed to decode response body, %w", err),
22367			Snapshot: snapshot.Bytes(),
22368		}
22369		return err
22370	}
22371
22372	errorBody.Seek(0, io.SeekStart)
22373	if len(code) != 0 {
22374		errorCode = restjson.SanitizeErrorCode(code)
22375	}
22376	if len(message) != 0 {
22377		errorMessage = message
22378	}
22379
22380	switch {
22381	case strings.EqualFold("InternalFailureException", errorCode):
22382		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22383
22384	case strings.EqualFold("InvalidRequestException", errorCode):
22385		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22386
22387	case strings.EqualFold("ThrottlingException", errorCode):
22388		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22389
22390	default:
22391		genericError := &smithy.GenericAPIError{
22392			Code:    errorCode,
22393			Message: errorMessage,
22394		}
22395		return genericError
22396
22397	}
22398}
22399
22400func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListScheduledAuditsOutput, value interface{}) error {
22401	if v == nil {
22402		return fmt.Errorf("unexpected nil of type %T", v)
22403	}
22404	if value == nil {
22405		return nil
22406	}
22407
22408	shape, ok := value.(map[string]interface{})
22409	if !ok {
22410		return fmt.Errorf("unexpected JSON type %v", value)
22411	}
22412
22413	var sv *ListScheduledAuditsOutput
22414	if *v == nil {
22415		sv = &ListScheduledAuditsOutput{}
22416	} else {
22417		sv = *v
22418	}
22419
22420	for key, value := range shape {
22421		switch key {
22422		case "nextToken":
22423			if value != nil {
22424				jtv, ok := value.(string)
22425				if !ok {
22426					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
22427				}
22428				sv.NextToken = ptr.String(jtv)
22429			}
22430
22431		case "scheduledAudits":
22432			if err := awsRestjson1_deserializeDocumentScheduledAuditMetadataList(&sv.ScheduledAudits, value); err != nil {
22433				return err
22434			}
22435
22436		default:
22437			_, _ = key, value
22438
22439		}
22440	}
22441	*v = sv
22442	return nil
22443}
22444
22445type awsRestjson1_deserializeOpListSecurityProfiles struct {
22446}
22447
22448func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string {
22449	return "OperationDeserializer"
22450}
22451
22452func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22453	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22454) {
22455	out, metadata, err = next.HandleDeserialize(ctx, in)
22456	if err != nil {
22457		return out, metadata, err
22458	}
22459
22460	response, ok := out.RawResponse.(*smithyhttp.Response)
22461	if !ok {
22462		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22463	}
22464
22465	if response.StatusCode < 200 || response.StatusCode >= 300 {
22466		return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata)
22467	}
22468	output := &ListSecurityProfilesOutput{}
22469	out.Result = output
22470
22471	var buff [1024]byte
22472	ringBuffer := smithyio.NewRingBuffer(buff[:])
22473
22474	body := io.TeeReader(response.Body, ringBuffer)
22475
22476	decoder := json.NewDecoder(body)
22477	decoder.UseNumber()
22478	var shape interface{}
22479	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22480		var snapshot bytes.Buffer
22481		io.Copy(&snapshot, ringBuffer)
22482		err = &smithy.DeserializationError{
22483			Err:      fmt.Errorf("failed to decode response body, %w", err),
22484			Snapshot: snapshot.Bytes(),
22485		}
22486		return out, metadata, err
22487	}
22488
22489	err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape)
22490	if err != nil {
22491		var snapshot bytes.Buffer
22492		io.Copy(&snapshot, ringBuffer)
22493		return out, metadata, &smithy.DeserializationError{
22494			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22495			Snapshot: snapshot.Bytes(),
22496		}
22497	}
22498
22499	return out, metadata, err
22500}
22501
22502func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22503	var errorBuffer bytes.Buffer
22504	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22505		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22506	}
22507	errorBody := bytes.NewReader(errorBuffer.Bytes())
22508
22509	errorCode := "UnknownError"
22510	errorMessage := errorCode
22511
22512	code := response.Header.Get("X-Amzn-ErrorType")
22513	if len(code) != 0 {
22514		errorCode = restjson.SanitizeErrorCode(code)
22515	}
22516
22517	var buff [1024]byte
22518	ringBuffer := smithyio.NewRingBuffer(buff[:])
22519
22520	body := io.TeeReader(errorBody, ringBuffer)
22521	decoder := json.NewDecoder(body)
22522	decoder.UseNumber()
22523	code, message, err := restjson.GetErrorInfo(decoder)
22524	if err != nil {
22525		var snapshot bytes.Buffer
22526		io.Copy(&snapshot, ringBuffer)
22527		err = &smithy.DeserializationError{
22528			Err:      fmt.Errorf("failed to decode response body, %w", err),
22529			Snapshot: snapshot.Bytes(),
22530		}
22531		return err
22532	}
22533
22534	errorBody.Seek(0, io.SeekStart)
22535	if len(code) != 0 {
22536		errorCode = restjson.SanitizeErrorCode(code)
22537	}
22538	if len(message) != 0 {
22539		errorMessage = message
22540	}
22541
22542	switch {
22543	case strings.EqualFold("InternalFailureException", errorCode):
22544		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22545
22546	case strings.EqualFold("InvalidRequestException", errorCode):
22547		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22548
22549	case strings.EqualFold("ResourceNotFoundException", errorCode):
22550		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
22551
22552	case strings.EqualFold("ThrottlingException", errorCode):
22553		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22554
22555	default:
22556		genericError := &smithy.GenericAPIError{
22557			Code:    errorCode,
22558			Message: errorMessage,
22559		}
22560		return genericError
22561
22562	}
22563}
22564
22565func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error {
22566	if v == nil {
22567		return fmt.Errorf("unexpected nil of type %T", v)
22568	}
22569	if value == nil {
22570		return nil
22571	}
22572
22573	shape, ok := value.(map[string]interface{})
22574	if !ok {
22575		return fmt.Errorf("unexpected JSON type %v", value)
22576	}
22577
22578	var sv *ListSecurityProfilesOutput
22579	if *v == nil {
22580		sv = &ListSecurityProfilesOutput{}
22581	} else {
22582		sv = *v
22583	}
22584
22585	for key, value := range shape {
22586		switch key {
22587		case "nextToken":
22588			if value != nil {
22589				jtv, ok := value.(string)
22590				if !ok {
22591					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
22592				}
22593				sv.NextToken = ptr.String(jtv)
22594			}
22595
22596		case "securityProfileIdentifiers":
22597			if err := awsRestjson1_deserializeDocumentSecurityProfileIdentifiers(&sv.SecurityProfileIdentifiers, value); err != nil {
22598				return err
22599			}
22600
22601		default:
22602			_, _ = key, value
22603
22604		}
22605	}
22606	*v = sv
22607	return nil
22608}
22609
22610type awsRestjson1_deserializeOpListSecurityProfilesForTarget struct {
22611}
22612
22613func (*awsRestjson1_deserializeOpListSecurityProfilesForTarget) ID() string {
22614	return "OperationDeserializer"
22615}
22616
22617func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22618	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22619) {
22620	out, metadata, err = next.HandleDeserialize(ctx, in)
22621	if err != nil {
22622		return out, metadata, err
22623	}
22624
22625	response, ok := out.RawResponse.(*smithyhttp.Response)
22626	if !ok {
22627		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22628	}
22629
22630	if response.StatusCode < 200 || response.StatusCode >= 300 {
22631		return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response, &metadata)
22632	}
22633	output := &ListSecurityProfilesForTargetOutput{}
22634	out.Result = output
22635
22636	var buff [1024]byte
22637	ringBuffer := smithyio.NewRingBuffer(buff[:])
22638
22639	body := io.TeeReader(response.Body, ringBuffer)
22640
22641	decoder := json.NewDecoder(body)
22642	decoder.UseNumber()
22643	var shape interface{}
22644	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22645		var snapshot bytes.Buffer
22646		io.Copy(&snapshot, ringBuffer)
22647		err = &smithy.DeserializationError{
22648			Err:      fmt.Errorf("failed to decode response body, %w", err),
22649			Snapshot: snapshot.Bytes(),
22650		}
22651		return out, metadata, err
22652	}
22653
22654	err = awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(&output, shape)
22655	if err != nil {
22656		var snapshot bytes.Buffer
22657		io.Copy(&snapshot, ringBuffer)
22658		return out, metadata, &smithy.DeserializationError{
22659			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22660			Snapshot: snapshot.Bytes(),
22661		}
22662	}
22663
22664	return out, metadata, err
22665}
22666
22667func awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22668	var errorBuffer bytes.Buffer
22669	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22670		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22671	}
22672	errorBody := bytes.NewReader(errorBuffer.Bytes())
22673
22674	errorCode := "UnknownError"
22675	errorMessage := errorCode
22676
22677	code := response.Header.Get("X-Amzn-ErrorType")
22678	if len(code) != 0 {
22679		errorCode = restjson.SanitizeErrorCode(code)
22680	}
22681
22682	var buff [1024]byte
22683	ringBuffer := smithyio.NewRingBuffer(buff[:])
22684
22685	body := io.TeeReader(errorBody, ringBuffer)
22686	decoder := json.NewDecoder(body)
22687	decoder.UseNumber()
22688	code, message, err := restjson.GetErrorInfo(decoder)
22689	if err != nil {
22690		var snapshot bytes.Buffer
22691		io.Copy(&snapshot, ringBuffer)
22692		err = &smithy.DeserializationError{
22693			Err:      fmt.Errorf("failed to decode response body, %w", err),
22694			Snapshot: snapshot.Bytes(),
22695		}
22696		return err
22697	}
22698
22699	errorBody.Seek(0, io.SeekStart)
22700	if len(code) != 0 {
22701		errorCode = restjson.SanitizeErrorCode(code)
22702	}
22703	if len(message) != 0 {
22704		errorMessage = message
22705	}
22706
22707	switch {
22708	case strings.EqualFold("InternalFailureException", errorCode):
22709		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22710
22711	case strings.EqualFold("InvalidRequestException", errorCode):
22712		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22713
22714	case strings.EqualFold("ResourceNotFoundException", errorCode):
22715		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
22716
22717	case strings.EqualFold("ThrottlingException", errorCode):
22718		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22719
22720	default:
22721		genericError := &smithy.GenericAPIError{
22722			Code:    errorCode,
22723			Message: errorMessage,
22724		}
22725		return genericError
22726
22727	}
22728}
22729
22730func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **ListSecurityProfilesForTargetOutput, value interface{}) error {
22731	if v == nil {
22732		return fmt.Errorf("unexpected nil of type %T", v)
22733	}
22734	if value == nil {
22735		return nil
22736	}
22737
22738	shape, ok := value.(map[string]interface{})
22739	if !ok {
22740		return fmt.Errorf("unexpected JSON type %v", value)
22741	}
22742
22743	var sv *ListSecurityProfilesForTargetOutput
22744	if *v == nil {
22745		sv = &ListSecurityProfilesForTargetOutput{}
22746	} else {
22747		sv = *v
22748	}
22749
22750	for key, value := range shape {
22751		switch key {
22752		case "nextToken":
22753			if value != nil {
22754				jtv, ok := value.(string)
22755				if !ok {
22756					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
22757				}
22758				sv.NextToken = ptr.String(jtv)
22759			}
22760
22761		case "securityProfileTargetMappings":
22762			if err := awsRestjson1_deserializeDocumentSecurityProfileTargetMappings(&sv.SecurityProfileTargetMappings, value); err != nil {
22763				return err
22764			}
22765
22766		default:
22767			_, _ = key, value
22768
22769		}
22770	}
22771	*v = sv
22772	return nil
22773}
22774
22775type awsRestjson1_deserializeOpListStreams struct {
22776}
22777
22778func (*awsRestjson1_deserializeOpListStreams) ID() string {
22779	return "OperationDeserializer"
22780}
22781
22782func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22783	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22784) {
22785	out, metadata, err = next.HandleDeserialize(ctx, in)
22786	if err != nil {
22787		return out, metadata, err
22788	}
22789
22790	response, ok := out.RawResponse.(*smithyhttp.Response)
22791	if !ok {
22792		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22793	}
22794
22795	if response.StatusCode < 200 || response.StatusCode >= 300 {
22796		return out, metadata, awsRestjson1_deserializeOpErrorListStreams(response, &metadata)
22797	}
22798	output := &ListStreamsOutput{}
22799	out.Result = output
22800
22801	var buff [1024]byte
22802	ringBuffer := smithyio.NewRingBuffer(buff[:])
22803
22804	body := io.TeeReader(response.Body, ringBuffer)
22805
22806	decoder := json.NewDecoder(body)
22807	decoder.UseNumber()
22808	var shape interface{}
22809	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22810		var snapshot bytes.Buffer
22811		io.Copy(&snapshot, ringBuffer)
22812		err = &smithy.DeserializationError{
22813			Err:      fmt.Errorf("failed to decode response body, %w", err),
22814			Snapshot: snapshot.Bytes(),
22815		}
22816		return out, metadata, err
22817	}
22818
22819	err = awsRestjson1_deserializeOpDocumentListStreamsOutput(&output, shape)
22820	if err != nil {
22821		var snapshot bytes.Buffer
22822		io.Copy(&snapshot, ringBuffer)
22823		return out, metadata, &smithy.DeserializationError{
22824			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22825			Snapshot: snapshot.Bytes(),
22826		}
22827	}
22828
22829	return out, metadata, err
22830}
22831
22832func awsRestjson1_deserializeOpErrorListStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error {
22833	var errorBuffer bytes.Buffer
22834	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
22835		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
22836	}
22837	errorBody := bytes.NewReader(errorBuffer.Bytes())
22838
22839	errorCode := "UnknownError"
22840	errorMessage := errorCode
22841
22842	code := response.Header.Get("X-Amzn-ErrorType")
22843	if len(code) != 0 {
22844		errorCode = restjson.SanitizeErrorCode(code)
22845	}
22846
22847	var buff [1024]byte
22848	ringBuffer := smithyio.NewRingBuffer(buff[:])
22849
22850	body := io.TeeReader(errorBody, ringBuffer)
22851	decoder := json.NewDecoder(body)
22852	decoder.UseNumber()
22853	code, message, err := restjson.GetErrorInfo(decoder)
22854	if err != nil {
22855		var snapshot bytes.Buffer
22856		io.Copy(&snapshot, ringBuffer)
22857		err = &smithy.DeserializationError{
22858			Err:      fmt.Errorf("failed to decode response body, %w", err),
22859			Snapshot: snapshot.Bytes(),
22860		}
22861		return err
22862	}
22863
22864	errorBody.Seek(0, io.SeekStart)
22865	if len(code) != 0 {
22866		errorCode = restjson.SanitizeErrorCode(code)
22867	}
22868	if len(message) != 0 {
22869		errorMessage = message
22870	}
22871
22872	switch {
22873	case strings.EqualFold("InternalFailureException", errorCode):
22874		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
22875
22876	case strings.EqualFold("InvalidRequestException", errorCode):
22877		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
22878
22879	case strings.EqualFold("ServiceUnavailableException", errorCode):
22880		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
22881
22882	case strings.EqualFold("ThrottlingException", errorCode):
22883		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
22884
22885	case strings.EqualFold("UnauthorizedException", errorCode):
22886		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
22887
22888	default:
22889		genericError := &smithy.GenericAPIError{
22890			Code:    errorCode,
22891			Message: errorMessage,
22892		}
22893		return genericError
22894
22895	}
22896}
22897
22898func awsRestjson1_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, value interface{}) error {
22899	if v == nil {
22900		return fmt.Errorf("unexpected nil of type %T", v)
22901	}
22902	if value == nil {
22903		return nil
22904	}
22905
22906	shape, ok := value.(map[string]interface{})
22907	if !ok {
22908		return fmt.Errorf("unexpected JSON type %v", value)
22909	}
22910
22911	var sv *ListStreamsOutput
22912	if *v == nil {
22913		sv = &ListStreamsOutput{}
22914	} else {
22915		sv = *v
22916	}
22917
22918	for key, value := range shape {
22919		switch key {
22920		case "nextToken":
22921			if value != nil {
22922				jtv, ok := value.(string)
22923				if !ok {
22924					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
22925				}
22926				sv.NextToken = ptr.String(jtv)
22927			}
22928
22929		case "streams":
22930			if err := awsRestjson1_deserializeDocumentStreamsSummary(&sv.Streams, value); err != nil {
22931				return err
22932			}
22933
22934		default:
22935			_, _ = key, value
22936
22937		}
22938	}
22939	*v = sv
22940	return nil
22941}
22942
22943type awsRestjson1_deserializeOpListTagsForResource struct {
22944}
22945
22946func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
22947	return "OperationDeserializer"
22948}
22949
22950func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
22951	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
22952) {
22953	out, metadata, err = next.HandleDeserialize(ctx, in)
22954	if err != nil {
22955		return out, metadata, err
22956	}
22957
22958	response, ok := out.RawResponse.(*smithyhttp.Response)
22959	if !ok {
22960		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
22961	}
22962
22963	if response.StatusCode < 200 || response.StatusCode >= 300 {
22964		return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
22965	}
22966	output := &ListTagsForResourceOutput{}
22967	out.Result = output
22968
22969	var buff [1024]byte
22970	ringBuffer := smithyio.NewRingBuffer(buff[:])
22971
22972	body := io.TeeReader(response.Body, ringBuffer)
22973
22974	decoder := json.NewDecoder(body)
22975	decoder.UseNumber()
22976	var shape interface{}
22977	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
22978		var snapshot bytes.Buffer
22979		io.Copy(&snapshot, ringBuffer)
22980		err = &smithy.DeserializationError{
22981			Err:      fmt.Errorf("failed to decode response body, %w", err),
22982			Snapshot: snapshot.Bytes(),
22983		}
22984		return out, metadata, err
22985	}
22986
22987	err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
22988	if err != nil {
22989		var snapshot bytes.Buffer
22990		io.Copy(&snapshot, ringBuffer)
22991		return out, metadata, &smithy.DeserializationError{
22992			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
22993			Snapshot: snapshot.Bytes(),
22994		}
22995	}
22996
22997	return out, metadata, err
22998}
22999
23000func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23001	var errorBuffer bytes.Buffer
23002	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23003		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23004	}
23005	errorBody := bytes.NewReader(errorBuffer.Bytes())
23006
23007	errorCode := "UnknownError"
23008	errorMessage := errorCode
23009
23010	code := response.Header.Get("X-Amzn-ErrorType")
23011	if len(code) != 0 {
23012		errorCode = restjson.SanitizeErrorCode(code)
23013	}
23014
23015	var buff [1024]byte
23016	ringBuffer := smithyio.NewRingBuffer(buff[:])
23017
23018	body := io.TeeReader(errorBody, ringBuffer)
23019	decoder := json.NewDecoder(body)
23020	decoder.UseNumber()
23021	code, message, err := restjson.GetErrorInfo(decoder)
23022	if err != nil {
23023		var snapshot bytes.Buffer
23024		io.Copy(&snapshot, ringBuffer)
23025		err = &smithy.DeserializationError{
23026			Err:      fmt.Errorf("failed to decode response body, %w", err),
23027			Snapshot: snapshot.Bytes(),
23028		}
23029		return err
23030	}
23031
23032	errorBody.Seek(0, io.SeekStart)
23033	if len(code) != 0 {
23034		errorCode = restjson.SanitizeErrorCode(code)
23035	}
23036	if len(message) != 0 {
23037		errorMessage = message
23038	}
23039
23040	switch {
23041	case strings.EqualFold("InternalFailureException", errorCode):
23042		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23043
23044	case strings.EqualFold("InvalidRequestException", errorCode):
23045		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23046
23047	case strings.EqualFold("ResourceNotFoundException", errorCode):
23048		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23049
23050	case strings.EqualFold("ThrottlingException", errorCode):
23051		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23052
23053	default:
23054		genericError := &smithy.GenericAPIError{
23055			Code:    errorCode,
23056			Message: errorMessage,
23057		}
23058		return genericError
23059
23060	}
23061}
23062
23063func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
23064	if v == nil {
23065		return fmt.Errorf("unexpected nil of type %T", v)
23066	}
23067	if value == nil {
23068		return nil
23069	}
23070
23071	shape, ok := value.(map[string]interface{})
23072	if !ok {
23073		return fmt.Errorf("unexpected JSON type %v", value)
23074	}
23075
23076	var sv *ListTagsForResourceOutput
23077	if *v == nil {
23078		sv = &ListTagsForResourceOutput{}
23079	} else {
23080		sv = *v
23081	}
23082
23083	for key, value := range shape {
23084		switch key {
23085		case "nextToken":
23086			if value != nil {
23087				jtv, ok := value.(string)
23088				if !ok {
23089					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
23090				}
23091				sv.NextToken = ptr.String(jtv)
23092			}
23093
23094		case "tags":
23095			if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
23096				return err
23097			}
23098
23099		default:
23100			_, _ = key, value
23101
23102		}
23103	}
23104	*v = sv
23105	return nil
23106}
23107
23108type awsRestjson1_deserializeOpListTargetsForPolicy struct {
23109}
23110
23111func (*awsRestjson1_deserializeOpListTargetsForPolicy) ID() string {
23112	return "OperationDeserializer"
23113}
23114
23115func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23116	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23117) {
23118	out, metadata, err = next.HandleDeserialize(ctx, in)
23119	if err != nil {
23120		return out, metadata, err
23121	}
23122
23123	response, ok := out.RawResponse.(*smithyhttp.Response)
23124	if !ok {
23125		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23126	}
23127
23128	if response.StatusCode < 200 || response.StatusCode >= 300 {
23129		return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForPolicy(response, &metadata)
23130	}
23131	output := &ListTargetsForPolicyOutput{}
23132	out.Result = output
23133
23134	var buff [1024]byte
23135	ringBuffer := smithyio.NewRingBuffer(buff[:])
23136
23137	body := io.TeeReader(response.Body, ringBuffer)
23138
23139	decoder := json.NewDecoder(body)
23140	decoder.UseNumber()
23141	var shape interface{}
23142	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23143		var snapshot bytes.Buffer
23144		io.Copy(&snapshot, ringBuffer)
23145		err = &smithy.DeserializationError{
23146			Err:      fmt.Errorf("failed to decode response body, %w", err),
23147			Snapshot: snapshot.Bytes(),
23148		}
23149		return out, metadata, err
23150	}
23151
23152	err = awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(&output, shape)
23153	if err != nil {
23154		var snapshot bytes.Buffer
23155		io.Copy(&snapshot, ringBuffer)
23156		return out, metadata, &smithy.DeserializationError{
23157			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23158			Snapshot: snapshot.Bytes(),
23159		}
23160	}
23161
23162	return out, metadata, err
23163}
23164
23165func awsRestjson1_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23166	var errorBuffer bytes.Buffer
23167	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23168		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23169	}
23170	errorBody := bytes.NewReader(errorBuffer.Bytes())
23171
23172	errorCode := "UnknownError"
23173	errorMessage := errorCode
23174
23175	code := response.Header.Get("X-Amzn-ErrorType")
23176	if len(code) != 0 {
23177		errorCode = restjson.SanitizeErrorCode(code)
23178	}
23179
23180	var buff [1024]byte
23181	ringBuffer := smithyio.NewRingBuffer(buff[:])
23182
23183	body := io.TeeReader(errorBody, ringBuffer)
23184	decoder := json.NewDecoder(body)
23185	decoder.UseNumber()
23186	code, message, err := restjson.GetErrorInfo(decoder)
23187	if err != nil {
23188		var snapshot bytes.Buffer
23189		io.Copy(&snapshot, ringBuffer)
23190		err = &smithy.DeserializationError{
23191			Err:      fmt.Errorf("failed to decode response body, %w", err),
23192			Snapshot: snapshot.Bytes(),
23193		}
23194		return err
23195	}
23196
23197	errorBody.Seek(0, io.SeekStart)
23198	if len(code) != 0 {
23199		errorCode = restjson.SanitizeErrorCode(code)
23200	}
23201	if len(message) != 0 {
23202		errorMessage = message
23203	}
23204
23205	switch {
23206	case strings.EqualFold("InternalFailureException", errorCode):
23207		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23208
23209	case strings.EqualFold("InvalidRequestException", errorCode):
23210		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23211
23212	case strings.EqualFold("LimitExceededException", errorCode):
23213		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
23214
23215	case strings.EqualFold("ResourceNotFoundException", errorCode):
23216		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23217
23218	case strings.EqualFold("ServiceUnavailableException", errorCode):
23219		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
23220
23221	case strings.EqualFold("ThrottlingException", errorCode):
23222		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23223
23224	case strings.EqualFold("UnauthorizedException", errorCode):
23225		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
23226
23227	default:
23228		genericError := &smithy.GenericAPIError{
23229			Code:    errorCode,
23230			Message: errorMessage,
23231		}
23232		return genericError
23233
23234	}
23235}
23236
23237func awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTargetsForPolicyOutput, value interface{}) error {
23238	if v == nil {
23239		return fmt.Errorf("unexpected nil of type %T", v)
23240	}
23241	if value == nil {
23242		return nil
23243	}
23244
23245	shape, ok := value.(map[string]interface{})
23246	if !ok {
23247		return fmt.Errorf("unexpected JSON type %v", value)
23248	}
23249
23250	var sv *ListTargetsForPolicyOutput
23251	if *v == nil {
23252		sv = &ListTargetsForPolicyOutput{}
23253	} else {
23254		sv = *v
23255	}
23256
23257	for key, value := range shape {
23258		switch key {
23259		case "nextMarker":
23260			if value != nil {
23261				jtv, ok := value.(string)
23262				if !ok {
23263					return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
23264				}
23265				sv.NextMarker = ptr.String(jtv)
23266			}
23267
23268		case "targets":
23269			if err := awsRestjson1_deserializeDocumentPolicyTargets(&sv.Targets, value); err != nil {
23270				return err
23271			}
23272
23273		default:
23274			_, _ = key, value
23275
23276		}
23277	}
23278	*v = sv
23279	return nil
23280}
23281
23282type awsRestjson1_deserializeOpListTargetsForSecurityProfile struct {
23283}
23284
23285func (*awsRestjson1_deserializeOpListTargetsForSecurityProfile) ID() string {
23286	return "OperationDeserializer"
23287}
23288
23289func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23290	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23291) {
23292	out, metadata, err = next.HandleDeserialize(ctx, in)
23293	if err != nil {
23294		return out, metadata, err
23295	}
23296
23297	response, ok := out.RawResponse.(*smithyhttp.Response)
23298	if !ok {
23299		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23300	}
23301
23302	if response.StatusCode < 200 || response.StatusCode >= 300 {
23303		return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response, &metadata)
23304	}
23305	output := &ListTargetsForSecurityProfileOutput{}
23306	out.Result = output
23307
23308	var buff [1024]byte
23309	ringBuffer := smithyio.NewRingBuffer(buff[:])
23310
23311	body := io.TeeReader(response.Body, ringBuffer)
23312
23313	decoder := json.NewDecoder(body)
23314	decoder.UseNumber()
23315	var shape interface{}
23316	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23317		var snapshot bytes.Buffer
23318		io.Copy(&snapshot, ringBuffer)
23319		err = &smithy.DeserializationError{
23320			Err:      fmt.Errorf("failed to decode response body, %w", err),
23321			Snapshot: snapshot.Bytes(),
23322		}
23323		return out, metadata, err
23324	}
23325
23326	err = awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(&output, shape)
23327	if err != nil {
23328		var snapshot bytes.Buffer
23329		io.Copy(&snapshot, ringBuffer)
23330		return out, metadata, &smithy.DeserializationError{
23331			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23332			Snapshot: snapshot.Bytes(),
23333		}
23334	}
23335
23336	return out, metadata, err
23337}
23338
23339func awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23340	var errorBuffer bytes.Buffer
23341	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23342		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23343	}
23344	errorBody := bytes.NewReader(errorBuffer.Bytes())
23345
23346	errorCode := "UnknownError"
23347	errorMessage := errorCode
23348
23349	code := response.Header.Get("X-Amzn-ErrorType")
23350	if len(code) != 0 {
23351		errorCode = restjson.SanitizeErrorCode(code)
23352	}
23353
23354	var buff [1024]byte
23355	ringBuffer := smithyio.NewRingBuffer(buff[:])
23356
23357	body := io.TeeReader(errorBody, ringBuffer)
23358	decoder := json.NewDecoder(body)
23359	decoder.UseNumber()
23360	code, message, err := restjson.GetErrorInfo(decoder)
23361	if err != nil {
23362		var snapshot bytes.Buffer
23363		io.Copy(&snapshot, ringBuffer)
23364		err = &smithy.DeserializationError{
23365			Err:      fmt.Errorf("failed to decode response body, %w", err),
23366			Snapshot: snapshot.Bytes(),
23367		}
23368		return err
23369	}
23370
23371	errorBody.Seek(0, io.SeekStart)
23372	if len(code) != 0 {
23373		errorCode = restjson.SanitizeErrorCode(code)
23374	}
23375	if len(message) != 0 {
23376		errorMessage = message
23377	}
23378
23379	switch {
23380	case strings.EqualFold("InternalFailureException", errorCode):
23381		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23382
23383	case strings.EqualFold("InvalidRequestException", errorCode):
23384		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23385
23386	case strings.EqualFold("ResourceNotFoundException", errorCode):
23387		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23388
23389	case strings.EqualFold("ThrottlingException", errorCode):
23390		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23391
23392	default:
23393		genericError := &smithy.GenericAPIError{
23394			Code:    errorCode,
23395			Message: errorMessage,
23396		}
23397		return genericError
23398
23399	}
23400}
23401
23402func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **ListTargetsForSecurityProfileOutput, value interface{}) error {
23403	if v == nil {
23404		return fmt.Errorf("unexpected nil of type %T", v)
23405	}
23406	if value == nil {
23407		return nil
23408	}
23409
23410	shape, ok := value.(map[string]interface{})
23411	if !ok {
23412		return fmt.Errorf("unexpected JSON type %v", value)
23413	}
23414
23415	var sv *ListTargetsForSecurityProfileOutput
23416	if *v == nil {
23417		sv = &ListTargetsForSecurityProfileOutput{}
23418	} else {
23419		sv = *v
23420	}
23421
23422	for key, value := range shape {
23423		switch key {
23424		case "nextToken":
23425			if value != nil {
23426				jtv, ok := value.(string)
23427				if !ok {
23428					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
23429				}
23430				sv.NextToken = ptr.String(jtv)
23431			}
23432
23433		case "securityProfileTargets":
23434			if err := awsRestjson1_deserializeDocumentSecurityProfileTargets(&sv.SecurityProfileTargets, value); err != nil {
23435				return err
23436			}
23437
23438		default:
23439			_, _ = key, value
23440
23441		}
23442	}
23443	*v = sv
23444	return nil
23445}
23446
23447type awsRestjson1_deserializeOpListThingGroups struct {
23448}
23449
23450func (*awsRestjson1_deserializeOpListThingGroups) ID() string {
23451	return "OperationDeserializer"
23452}
23453
23454func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23455	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23456) {
23457	out, metadata, err = next.HandleDeserialize(ctx, in)
23458	if err != nil {
23459		return out, metadata, err
23460	}
23461
23462	response, ok := out.RawResponse.(*smithyhttp.Response)
23463	if !ok {
23464		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23465	}
23466
23467	if response.StatusCode < 200 || response.StatusCode >= 300 {
23468		return out, metadata, awsRestjson1_deserializeOpErrorListThingGroups(response, &metadata)
23469	}
23470	output := &ListThingGroupsOutput{}
23471	out.Result = output
23472
23473	var buff [1024]byte
23474	ringBuffer := smithyio.NewRingBuffer(buff[:])
23475
23476	body := io.TeeReader(response.Body, ringBuffer)
23477
23478	decoder := json.NewDecoder(body)
23479	decoder.UseNumber()
23480	var shape interface{}
23481	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23482		var snapshot bytes.Buffer
23483		io.Copy(&snapshot, ringBuffer)
23484		err = &smithy.DeserializationError{
23485			Err:      fmt.Errorf("failed to decode response body, %w", err),
23486			Snapshot: snapshot.Bytes(),
23487		}
23488		return out, metadata, err
23489	}
23490
23491	err = awsRestjson1_deserializeOpDocumentListThingGroupsOutput(&output, shape)
23492	if err != nil {
23493		var snapshot bytes.Buffer
23494		io.Copy(&snapshot, ringBuffer)
23495		return out, metadata, &smithy.DeserializationError{
23496			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23497			Snapshot: snapshot.Bytes(),
23498		}
23499	}
23500
23501	return out, metadata, err
23502}
23503
23504func awsRestjson1_deserializeOpErrorListThingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23505	var errorBuffer bytes.Buffer
23506	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23507		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23508	}
23509	errorBody := bytes.NewReader(errorBuffer.Bytes())
23510
23511	errorCode := "UnknownError"
23512	errorMessage := errorCode
23513
23514	code := response.Header.Get("X-Amzn-ErrorType")
23515	if len(code) != 0 {
23516		errorCode = restjson.SanitizeErrorCode(code)
23517	}
23518
23519	var buff [1024]byte
23520	ringBuffer := smithyio.NewRingBuffer(buff[:])
23521
23522	body := io.TeeReader(errorBody, ringBuffer)
23523	decoder := json.NewDecoder(body)
23524	decoder.UseNumber()
23525	code, message, err := restjson.GetErrorInfo(decoder)
23526	if err != nil {
23527		var snapshot bytes.Buffer
23528		io.Copy(&snapshot, ringBuffer)
23529		err = &smithy.DeserializationError{
23530			Err:      fmt.Errorf("failed to decode response body, %w", err),
23531			Snapshot: snapshot.Bytes(),
23532		}
23533		return err
23534	}
23535
23536	errorBody.Seek(0, io.SeekStart)
23537	if len(code) != 0 {
23538		errorCode = restjson.SanitizeErrorCode(code)
23539	}
23540	if len(message) != 0 {
23541		errorMessage = message
23542	}
23543
23544	switch {
23545	case strings.EqualFold("InternalFailureException", errorCode):
23546		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23547
23548	case strings.EqualFold("InvalidRequestException", errorCode):
23549		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23550
23551	case strings.EqualFold("ResourceNotFoundException", errorCode):
23552		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23553
23554	case strings.EqualFold("ThrottlingException", errorCode):
23555		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23556
23557	default:
23558		genericError := &smithy.GenericAPIError{
23559			Code:    errorCode,
23560			Message: errorMessage,
23561		}
23562		return genericError
23563
23564	}
23565}
23566
23567func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroupsOutput, value interface{}) error {
23568	if v == nil {
23569		return fmt.Errorf("unexpected nil of type %T", v)
23570	}
23571	if value == nil {
23572		return nil
23573	}
23574
23575	shape, ok := value.(map[string]interface{})
23576	if !ok {
23577		return fmt.Errorf("unexpected JSON type %v", value)
23578	}
23579
23580	var sv *ListThingGroupsOutput
23581	if *v == nil {
23582		sv = &ListThingGroupsOutput{}
23583	} else {
23584		sv = *v
23585	}
23586
23587	for key, value := range shape {
23588		switch key {
23589		case "nextToken":
23590			if value != nil {
23591				jtv, ok := value.(string)
23592				if !ok {
23593					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
23594				}
23595				sv.NextToken = ptr.String(jtv)
23596			}
23597
23598		case "thingGroups":
23599			if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil {
23600				return err
23601			}
23602
23603		default:
23604			_, _ = key, value
23605
23606		}
23607	}
23608	*v = sv
23609	return nil
23610}
23611
23612type awsRestjson1_deserializeOpListThingGroupsForThing struct {
23613}
23614
23615func (*awsRestjson1_deserializeOpListThingGroupsForThing) ID() string {
23616	return "OperationDeserializer"
23617}
23618
23619func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23620	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23621) {
23622	out, metadata, err = next.HandleDeserialize(ctx, in)
23623	if err != nil {
23624		return out, metadata, err
23625	}
23626
23627	response, ok := out.RawResponse.(*smithyhttp.Response)
23628	if !ok {
23629		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23630	}
23631
23632	if response.StatusCode < 200 || response.StatusCode >= 300 {
23633		return out, metadata, awsRestjson1_deserializeOpErrorListThingGroupsForThing(response, &metadata)
23634	}
23635	output := &ListThingGroupsForThingOutput{}
23636	out.Result = output
23637
23638	var buff [1024]byte
23639	ringBuffer := smithyio.NewRingBuffer(buff[:])
23640
23641	body := io.TeeReader(response.Body, ringBuffer)
23642
23643	decoder := json.NewDecoder(body)
23644	decoder.UseNumber()
23645	var shape interface{}
23646	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23647		var snapshot bytes.Buffer
23648		io.Copy(&snapshot, ringBuffer)
23649		err = &smithy.DeserializationError{
23650			Err:      fmt.Errorf("failed to decode response body, %w", err),
23651			Snapshot: snapshot.Bytes(),
23652		}
23653		return out, metadata, err
23654	}
23655
23656	err = awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(&output, shape)
23657	if err != nil {
23658		var snapshot bytes.Buffer
23659		io.Copy(&snapshot, ringBuffer)
23660		return out, metadata, &smithy.DeserializationError{
23661			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23662			Snapshot: snapshot.Bytes(),
23663		}
23664	}
23665
23666	return out, metadata, err
23667}
23668
23669func awsRestjson1_deserializeOpErrorListThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23670	var errorBuffer bytes.Buffer
23671	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23672		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23673	}
23674	errorBody := bytes.NewReader(errorBuffer.Bytes())
23675
23676	errorCode := "UnknownError"
23677	errorMessage := errorCode
23678
23679	code := response.Header.Get("X-Amzn-ErrorType")
23680	if len(code) != 0 {
23681		errorCode = restjson.SanitizeErrorCode(code)
23682	}
23683
23684	var buff [1024]byte
23685	ringBuffer := smithyio.NewRingBuffer(buff[:])
23686
23687	body := io.TeeReader(errorBody, ringBuffer)
23688	decoder := json.NewDecoder(body)
23689	decoder.UseNumber()
23690	code, message, err := restjson.GetErrorInfo(decoder)
23691	if err != nil {
23692		var snapshot bytes.Buffer
23693		io.Copy(&snapshot, ringBuffer)
23694		err = &smithy.DeserializationError{
23695			Err:      fmt.Errorf("failed to decode response body, %w", err),
23696			Snapshot: snapshot.Bytes(),
23697		}
23698		return err
23699	}
23700
23701	errorBody.Seek(0, io.SeekStart)
23702	if len(code) != 0 {
23703		errorCode = restjson.SanitizeErrorCode(code)
23704	}
23705	if len(message) != 0 {
23706		errorMessage = message
23707	}
23708
23709	switch {
23710	case strings.EqualFold("InternalFailureException", errorCode):
23711		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23712
23713	case strings.EqualFold("InvalidRequestException", errorCode):
23714		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23715
23716	case strings.EqualFold("ResourceNotFoundException", errorCode):
23717		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23718
23719	case strings.EqualFold("ThrottlingException", errorCode):
23720		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23721
23722	default:
23723		genericError := &smithy.GenericAPIError{
23724			Code:    errorCode,
23725			Message: errorMessage,
23726		}
23727		return genericError
23728
23729	}
23730}
23731
23732func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThingGroupsForThingOutput, value interface{}) error {
23733	if v == nil {
23734		return fmt.Errorf("unexpected nil of type %T", v)
23735	}
23736	if value == nil {
23737		return nil
23738	}
23739
23740	shape, ok := value.(map[string]interface{})
23741	if !ok {
23742		return fmt.Errorf("unexpected JSON type %v", value)
23743	}
23744
23745	var sv *ListThingGroupsForThingOutput
23746	if *v == nil {
23747		sv = &ListThingGroupsForThingOutput{}
23748	} else {
23749		sv = *v
23750	}
23751
23752	for key, value := range shape {
23753		switch key {
23754		case "nextToken":
23755			if value != nil {
23756				jtv, ok := value.(string)
23757				if !ok {
23758					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
23759				}
23760				sv.NextToken = ptr.String(jtv)
23761			}
23762
23763		case "thingGroups":
23764			if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil {
23765				return err
23766			}
23767
23768		default:
23769			_, _ = key, value
23770
23771		}
23772	}
23773	*v = sv
23774	return nil
23775}
23776
23777type awsRestjson1_deserializeOpListThingPrincipals struct {
23778}
23779
23780func (*awsRestjson1_deserializeOpListThingPrincipals) ID() string {
23781	return "OperationDeserializer"
23782}
23783
23784func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23785	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23786) {
23787	out, metadata, err = next.HandleDeserialize(ctx, in)
23788	if err != nil {
23789		return out, metadata, err
23790	}
23791
23792	response, ok := out.RawResponse.(*smithyhttp.Response)
23793	if !ok {
23794		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23795	}
23796
23797	if response.StatusCode < 200 || response.StatusCode >= 300 {
23798		return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipals(response, &metadata)
23799	}
23800	output := &ListThingPrincipalsOutput{}
23801	out.Result = output
23802
23803	var buff [1024]byte
23804	ringBuffer := smithyio.NewRingBuffer(buff[:])
23805
23806	body := io.TeeReader(response.Body, ringBuffer)
23807
23808	decoder := json.NewDecoder(body)
23809	decoder.UseNumber()
23810	var shape interface{}
23811	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23812		var snapshot bytes.Buffer
23813		io.Copy(&snapshot, ringBuffer)
23814		err = &smithy.DeserializationError{
23815			Err:      fmt.Errorf("failed to decode response body, %w", err),
23816			Snapshot: snapshot.Bytes(),
23817		}
23818		return out, metadata, err
23819	}
23820
23821	err = awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(&output, shape)
23822	if err != nil {
23823		var snapshot bytes.Buffer
23824		io.Copy(&snapshot, ringBuffer)
23825		return out, metadata, &smithy.DeserializationError{
23826			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23827			Snapshot: snapshot.Bytes(),
23828		}
23829	}
23830
23831	return out, metadata, err
23832}
23833
23834func awsRestjson1_deserializeOpErrorListThingPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error {
23835	var errorBuffer bytes.Buffer
23836	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
23837		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
23838	}
23839	errorBody := bytes.NewReader(errorBuffer.Bytes())
23840
23841	errorCode := "UnknownError"
23842	errorMessage := errorCode
23843
23844	code := response.Header.Get("X-Amzn-ErrorType")
23845	if len(code) != 0 {
23846		errorCode = restjson.SanitizeErrorCode(code)
23847	}
23848
23849	var buff [1024]byte
23850	ringBuffer := smithyio.NewRingBuffer(buff[:])
23851
23852	body := io.TeeReader(errorBody, ringBuffer)
23853	decoder := json.NewDecoder(body)
23854	decoder.UseNumber()
23855	code, message, err := restjson.GetErrorInfo(decoder)
23856	if err != nil {
23857		var snapshot bytes.Buffer
23858		io.Copy(&snapshot, ringBuffer)
23859		err = &smithy.DeserializationError{
23860			Err:      fmt.Errorf("failed to decode response body, %w", err),
23861			Snapshot: snapshot.Bytes(),
23862		}
23863		return err
23864	}
23865
23866	errorBody.Seek(0, io.SeekStart)
23867	if len(code) != 0 {
23868		errorCode = restjson.SanitizeErrorCode(code)
23869	}
23870	if len(message) != 0 {
23871		errorMessage = message
23872	}
23873
23874	switch {
23875	case strings.EqualFold("InternalFailureException", errorCode):
23876		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
23877
23878	case strings.EqualFold("InvalidRequestException", errorCode):
23879		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
23880
23881	case strings.EqualFold("ResourceNotFoundException", errorCode):
23882		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
23883
23884	case strings.EqualFold("ServiceUnavailableException", errorCode):
23885		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
23886
23887	case strings.EqualFold("ThrottlingException", errorCode):
23888		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
23889
23890	case strings.EqualFold("UnauthorizedException", errorCode):
23891		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
23892
23893	default:
23894		genericError := &smithy.GenericAPIError{
23895			Code:    errorCode,
23896			Message: errorMessage,
23897		}
23898		return genericError
23899
23900	}
23901}
23902
23903func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPrincipalsOutput, value interface{}) error {
23904	if v == nil {
23905		return fmt.Errorf("unexpected nil of type %T", v)
23906	}
23907	if value == nil {
23908		return nil
23909	}
23910
23911	shape, ok := value.(map[string]interface{})
23912	if !ok {
23913		return fmt.Errorf("unexpected JSON type %v", value)
23914	}
23915
23916	var sv *ListThingPrincipalsOutput
23917	if *v == nil {
23918		sv = &ListThingPrincipalsOutput{}
23919	} else {
23920		sv = *v
23921	}
23922
23923	for key, value := range shape {
23924		switch key {
23925		case "nextToken":
23926			if value != nil {
23927				jtv, ok := value.(string)
23928				if !ok {
23929					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
23930				}
23931				sv.NextToken = ptr.String(jtv)
23932			}
23933
23934		case "principals":
23935			if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil {
23936				return err
23937			}
23938
23939		default:
23940			_, _ = key, value
23941
23942		}
23943	}
23944	*v = sv
23945	return nil
23946}
23947
23948type awsRestjson1_deserializeOpListThingRegistrationTaskReports struct {
23949}
23950
23951func (*awsRestjson1_deserializeOpListThingRegistrationTaskReports) ID() string {
23952	return "OperationDeserializer"
23953}
23954
23955func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
23956	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
23957) {
23958	out, metadata, err = next.HandleDeserialize(ctx, in)
23959	if err != nil {
23960		return out, metadata, err
23961	}
23962
23963	response, ok := out.RawResponse.(*smithyhttp.Response)
23964	if !ok {
23965		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
23966	}
23967
23968	if response.StatusCode < 200 || response.StatusCode >= 300 {
23969		return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response, &metadata)
23970	}
23971	output := &ListThingRegistrationTaskReportsOutput{}
23972	out.Result = output
23973
23974	var buff [1024]byte
23975	ringBuffer := smithyio.NewRingBuffer(buff[:])
23976
23977	body := io.TeeReader(response.Body, ringBuffer)
23978
23979	decoder := json.NewDecoder(body)
23980	decoder.UseNumber()
23981	var shape interface{}
23982	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
23983		var snapshot bytes.Buffer
23984		io.Copy(&snapshot, ringBuffer)
23985		err = &smithy.DeserializationError{
23986			Err:      fmt.Errorf("failed to decode response body, %w", err),
23987			Snapshot: snapshot.Bytes(),
23988		}
23989		return out, metadata, err
23990	}
23991
23992	err = awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(&output, shape)
23993	if err != nil {
23994		var snapshot bytes.Buffer
23995		io.Copy(&snapshot, ringBuffer)
23996		return out, metadata, &smithy.DeserializationError{
23997			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
23998			Snapshot: snapshot.Bytes(),
23999		}
24000	}
24001
24002	return out, metadata, err
24003}
24004
24005func awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24006	var errorBuffer bytes.Buffer
24007	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24008		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24009	}
24010	errorBody := bytes.NewReader(errorBuffer.Bytes())
24011
24012	errorCode := "UnknownError"
24013	errorMessage := errorCode
24014
24015	code := response.Header.Get("X-Amzn-ErrorType")
24016	if len(code) != 0 {
24017		errorCode = restjson.SanitizeErrorCode(code)
24018	}
24019
24020	var buff [1024]byte
24021	ringBuffer := smithyio.NewRingBuffer(buff[:])
24022
24023	body := io.TeeReader(errorBody, ringBuffer)
24024	decoder := json.NewDecoder(body)
24025	decoder.UseNumber()
24026	code, message, err := restjson.GetErrorInfo(decoder)
24027	if err != nil {
24028		var snapshot bytes.Buffer
24029		io.Copy(&snapshot, ringBuffer)
24030		err = &smithy.DeserializationError{
24031			Err:      fmt.Errorf("failed to decode response body, %w", err),
24032			Snapshot: snapshot.Bytes(),
24033		}
24034		return err
24035	}
24036
24037	errorBody.Seek(0, io.SeekStart)
24038	if len(code) != 0 {
24039		errorCode = restjson.SanitizeErrorCode(code)
24040	}
24041	if len(message) != 0 {
24042		errorMessage = message
24043	}
24044
24045	switch {
24046	case strings.EqualFold("InternalFailureException", errorCode):
24047		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24048
24049	case strings.EqualFold("InvalidRequestException", errorCode):
24050		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24051
24052	case strings.EqualFold("ThrottlingException", errorCode):
24053		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24054
24055	case strings.EqualFold("UnauthorizedException", errorCode):
24056		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
24057
24058	default:
24059		genericError := &smithy.GenericAPIError{
24060			Code:    errorCode,
24061			Message: errorMessage,
24062		}
24063		return genericError
24064
24065	}
24066}
24067
24068func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v **ListThingRegistrationTaskReportsOutput, value interface{}) error {
24069	if v == nil {
24070		return fmt.Errorf("unexpected nil of type %T", v)
24071	}
24072	if value == nil {
24073		return nil
24074	}
24075
24076	shape, ok := value.(map[string]interface{})
24077	if !ok {
24078		return fmt.Errorf("unexpected JSON type %v", value)
24079	}
24080
24081	var sv *ListThingRegistrationTaskReportsOutput
24082	if *v == nil {
24083		sv = &ListThingRegistrationTaskReportsOutput{}
24084	} else {
24085		sv = *v
24086	}
24087
24088	for key, value := range shape {
24089		switch key {
24090		case "nextToken":
24091			if value != nil {
24092				jtv, ok := value.(string)
24093				if !ok {
24094					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24095				}
24096				sv.NextToken = ptr.String(jtv)
24097			}
24098
24099		case "reportType":
24100			if value != nil {
24101				jtv, ok := value.(string)
24102				if !ok {
24103					return fmt.Errorf("expected ReportType to be of type string, got %T instead", value)
24104				}
24105				sv.ReportType = types.ReportType(jtv)
24106			}
24107
24108		case "resourceLinks":
24109			if err := awsRestjson1_deserializeDocumentS3FileUrlList(&sv.ResourceLinks, value); err != nil {
24110				return err
24111			}
24112
24113		default:
24114			_, _ = key, value
24115
24116		}
24117	}
24118	*v = sv
24119	return nil
24120}
24121
24122type awsRestjson1_deserializeOpListThingRegistrationTasks struct {
24123}
24124
24125func (*awsRestjson1_deserializeOpListThingRegistrationTasks) ID() string {
24126	return "OperationDeserializer"
24127}
24128
24129func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24130	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24131) {
24132	out, metadata, err = next.HandleDeserialize(ctx, in)
24133	if err != nil {
24134		return out, metadata, err
24135	}
24136
24137	response, ok := out.RawResponse.(*smithyhttp.Response)
24138	if !ok {
24139		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24140	}
24141
24142	if response.StatusCode < 200 || response.StatusCode >= 300 {
24143		return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response, &metadata)
24144	}
24145	output := &ListThingRegistrationTasksOutput{}
24146	out.Result = output
24147
24148	var buff [1024]byte
24149	ringBuffer := smithyio.NewRingBuffer(buff[:])
24150
24151	body := io.TeeReader(response.Body, ringBuffer)
24152
24153	decoder := json.NewDecoder(body)
24154	decoder.UseNumber()
24155	var shape interface{}
24156	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24157		var snapshot bytes.Buffer
24158		io.Copy(&snapshot, ringBuffer)
24159		err = &smithy.DeserializationError{
24160			Err:      fmt.Errorf("failed to decode response body, %w", err),
24161			Snapshot: snapshot.Bytes(),
24162		}
24163		return out, metadata, err
24164	}
24165
24166	err = awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(&output, shape)
24167	if err != nil {
24168		var snapshot bytes.Buffer
24169		io.Copy(&snapshot, ringBuffer)
24170		return out, metadata, &smithy.DeserializationError{
24171			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
24172			Snapshot: snapshot.Bytes(),
24173		}
24174	}
24175
24176	return out, metadata, err
24177}
24178
24179func awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24180	var errorBuffer bytes.Buffer
24181	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24182		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24183	}
24184	errorBody := bytes.NewReader(errorBuffer.Bytes())
24185
24186	errorCode := "UnknownError"
24187	errorMessage := errorCode
24188
24189	code := response.Header.Get("X-Amzn-ErrorType")
24190	if len(code) != 0 {
24191		errorCode = restjson.SanitizeErrorCode(code)
24192	}
24193
24194	var buff [1024]byte
24195	ringBuffer := smithyio.NewRingBuffer(buff[:])
24196
24197	body := io.TeeReader(errorBody, ringBuffer)
24198	decoder := json.NewDecoder(body)
24199	decoder.UseNumber()
24200	code, message, err := restjson.GetErrorInfo(decoder)
24201	if err != nil {
24202		var snapshot bytes.Buffer
24203		io.Copy(&snapshot, ringBuffer)
24204		err = &smithy.DeserializationError{
24205			Err:      fmt.Errorf("failed to decode response body, %w", err),
24206			Snapshot: snapshot.Bytes(),
24207		}
24208		return err
24209	}
24210
24211	errorBody.Seek(0, io.SeekStart)
24212	if len(code) != 0 {
24213		errorCode = restjson.SanitizeErrorCode(code)
24214	}
24215	if len(message) != 0 {
24216		errorMessage = message
24217	}
24218
24219	switch {
24220	case strings.EqualFold("InternalFailureException", errorCode):
24221		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24222
24223	case strings.EqualFold("InvalidRequestException", errorCode):
24224		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24225
24226	case strings.EqualFold("ThrottlingException", errorCode):
24227		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24228
24229	case strings.EqualFold("UnauthorizedException", errorCode):
24230		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
24231
24232	default:
24233		genericError := &smithy.GenericAPIError{
24234			Code:    errorCode,
24235			Message: errorMessage,
24236		}
24237		return genericError
24238
24239	}
24240}
24241
24242func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **ListThingRegistrationTasksOutput, value interface{}) error {
24243	if v == nil {
24244		return fmt.Errorf("unexpected nil of type %T", v)
24245	}
24246	if value == nil {
24247		return nil
24248	}
24249
24250	shape, ok := value.(map[string]interface{})
24251	if !ok {
24252		return fmt.Errorf("unexpected JSON type %v", value)
24253	}
24254
24255	var sv *ListThingRegistrationTasksOutput
24256	if *v == nil {
24257		sv = &ListThingRegistrationTasksOutput{}
24258	} else {
24259		sv = *v
24260	}
24261
24262	for key, value := range shape {
24263		switch key {
24264		case "nextToken":
24265			if value != nil {
24266				jtv, ok := value.(string)
24267				if !ok {
24268					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24269				}
24270				sv.NextToken = ptr.String(jtv)
24271			}
24272
24273		case "taskIds":
24274			if err := awsRestjson1_deserializeDocumentTaskIdList(&sv.TaskIds, value); err != nil {
24275				return err
24276			}
24277
24278		default:
24279			_, _ = key, value
24280
24281		}
24282	}
24283	*v = sv
24284	return nil
24285}
24286
24287type awsRestjson1_deserializeOpListThings struct {
24288}
24289
24290func (*awsRestjson1_deserializeOpListThings) ID() string {
24291	return "OperationDeserializer"
24292}
24293
24294func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24295	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24296) {
24297	out, metadata, err = next.HandleDeserialize(ctx, in)
24298	if err != nil {
24299		return out, metadata, err
24300	}
24301
24302	response, ok := out.RawResponse.(*smithyhttp.Response)
24303	if !ok {
24304		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24305	}
24306
24307	if response.StatusCode < 200 || response.StatusCode >= 300 {
24308		return out, metadata, awsRestjson1_deserializeOpErrorListThings(response, &metadata)
24309	}
24310	output := &ListThingsOutput{}
24311	out.Result = output
24312
24313	var buff [1024]byte
24314	ringBuffer := smithyio.NewRingBuffer(buff[:])
24315
24316	body := io.TeeReader(response.Body, ringBuffer)
24317
24318	decoder := json.NewDecoder(body)
24319	decoder.UseNumber()
24320	var shape interface{}
24321	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24322		var snapshot bytes.Buffer
24323		io.Copy(&snapshot, ringBuffer)
24324		err = &smithy.DeserializationError{
24325			Err:      fmt.Errorf("failed to decode response body, %w", err),
24326			Snapshot: snapshot.Bytes(),
24327		}
24328		return out, metadata, err
24329	}
24330
24331	err = awsRestjson1_deserializeOpDocumentListThingsOutput(&output, shape)
24332	if err != nil {
24333		var snapshot bytes.Buffer
24334		io.Copy(&snapshot, ringBuffer)
24335		return out, metadata, &smithy.DeserializationError{
24336			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
24337			Snapshot: snapshot.Bytes(),
24338		}
24339	}
24340
24341	return out, metadata, err
24342}
24343
24344func awsRestjson1_deserializeOpErrorListThings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24345	var errorBuffer bytes.Buffer
24346	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24347		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24348	}
24349	errorBody := bytes.NewReader(errorBuffer.Bytes())
24350
24351	errorCode := "UnknownError"
24352	errorMessage := errorCode
24353
24354	code := response.Header.Get("X-Amzn-ErrorType")
24355	if len(code) != 0 {
24356		errorCode = restjson.SanitizeErrorCode(code)
24357	}
24358
24359	var buff [1024]byte
24360	ringBuffer := smithyio.NewRingBuffer(buff[:])
24361
24362	body := io.TeeReader(errorBody, ringBuffer)
24363	decoder := json.NewDecoder(body)
24364	decoder.UseNumber()
24365	code, message, err := restjson.GetErrorInfo(decoder)
24366	if err != nil {
24367		var snapshot bytes.Buffer
24368		io.Copy(&snapshot, ringBuffer)
24369		err = &smithy.DeserializationError{
24370			Err:      fmt.Errorf("failed to decode response body, %w", err),
24371			Snapshot: snapshot.Bytes(),
24372		}
24373		return err
24374	}
24375
24376	errorBody.Seek(0, io.SeekStart)
24377	if len(code) != 0 {
24378		errorCode = restjson.SanitizeErrorCode(code)
24379	}
24380	if len(message) != 0 {
24381		errorMessage = message
24382	}
24383
24384	switch {
24385	case strings.EqualFold("InternalFailureException", errorCode):
24386		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24387
24388	case strings.EqualFold("InvalidRequestException", errorCode):
24389		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24390
24391	case strings.EqualFold("ServiceUnavailableException", errorCode):
24392		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
24393
24394	case strings.EqualFold("ThrottlingException", errorCode):
24395		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24396
24397	case strings.EqualFold("UnauthorizedException", errorCode):
24398		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
24399
24400	default:
24401		genericError := &smithy.GenericAPIError{
24402			Code:    errorCode,
24403			Message: errorMessage,
24404		}
24405		return genericError
24406
24407	}
24408}
24409
24410func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, value interface{}) error {
24411	if v == nil {
24412		return fmt.Errorf("unexpected nil of type %T", v)
24413	}
24414	if value == nil {
24415		return nil
24416	}
24417
24418	shape, ok := value.(map[string]interface{})
24419	if !ok {
24420		return fmt.Errorf("unexpected JSON type %v", value)
24421	}
24422
24423	var sv *ListThingsOutput
24424	if *v == nil {
24425		sv = &ListThingsOutput{}
24426	} else {
24427		sv = *v
24428	}
24429
24430	for key, value := range shape {
24431		switch key {
24432		case "nextToken":
24433			if value != nil {
24434				jtv, ok := value.(string)
24435				if !ok {
24436					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24437				}
24438				sv.NextToken = ptr.String(jtv)
24439			}
24440
24441		case "things":
24442			if err := awsRestjson1_deserializeDocumentThingAttributeList(&sv.Things, value); err != nil {
24443				return err
24444			}
24445
24446		default:
24447			_, _ = key, value
24448
24449		}
24450	}
24451	*v = sv
24452	return nil
24453}
24454
24455type awsRestjson1_deserializeOpListThingsInBillingGroup struct {
24456}
24457
24458func (*awsRestjson1_deserializeOpListThingsInBillingGroup) ID() string {
24459	return "OperationDeserializer"
24460}
24461
24462func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24463	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24464) {
24465	out, metadata, err = next.HandleDeserialize(ctx, in)
24466	if err != nil {
24467		return out, metadata, err
24468	}
24469
24470	response, ok := out.RawResponse.(*smithyhttp.Response)
24471	if !ok {
24472		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24473	}
24474
24475	if response.StatusCode < 200 || response.StatusCode >= 300 {
24476		return out, metadata, awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response, &metadata)
24477	}
24478	output := &ListThingsInBillingGroupOutput{}
24479	out.Result = output
24480
24481	var buff [1024]byte
24482	ringBuffer := smithyio.NewRingBuffer(buff[:])
24483
24484	body := io.TeeReader(response.Body, ringBuffer)
24485
24486	decoder := json.NewDecoder(body)
24487	decoder.UseNumber()
24488	var shape interface{}
24489	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24490		var snapshot bytes.Buffer
24491		io.Copy(&snapshot, ringBuffer)
24492		err = &smithy.DeserializationError{
24493			Err:      fmt.Errorf("failed to decode response body, %w", err),
24494			Snapshot: snapshot.Bytes(),
24495		}
24496		return out, metadata, err
24497	}
24498
24499	err = awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(&output, shape)
24500	if err != nil {
24501		var snapshot bytes.Buffer
24502		io.Copy(&snapshot, ringBuffer)
24503		return out, metadata, &smithy.DeserializationError{
24504			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
24505			Snapshot: snapshot.Bytes(),
24506		}
24507	}
24508
24509	return out, metadata, err
24510}
24511
24512func awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24513	var errorBuffer bytes.Buffer
24514	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24515		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24516	}
24517	errorBody := bytes.NewReader(errorBuffer.Bytes())
24518
24519	errorCode := "UnknownError"
24520	errorMessage := errorCode
24521
24522	code := response.Header.Get("X-Amzn-ErrorType")
24523	if len(code) != 0 {
24524		errorCode = restjson.SanitizeErrorCode(code)
24525	}
24526
24527	var buff [1024]byte
24528	ringBuffer := smithyio.NewRingBuffer(buff[:])
24529
24530	body := io.TeeReader(errorBody, ringBuffer)
24531	decoder := json.NewDecoder(body)
24532	decoder.UseNumber()
24533	code, message, err := restjson.GetErrorInfo(decoder)
24534	if err != nil {
24535		var snapshot bytes.Buffer
24536		io.Copy(&snapshot, ringBuffer)
24537		err = &smithy.DeserializationError{
24538			Err:      fmt.Errorf("failed to decode response body, %w", err),
24539			Snapshot: snapshot.Bytes(),
24540		}
24541		return err
24542	}
24543
24544	errorBody.Seek(0, io.SeekStart)
24545	if len(code) != 0 {
24546		errorCode = restjson.SanitizeErrorCode(code)
24547	}
24548	if len(message) != 0 {
24549		errorMessage = message
24550	}
24551
24552	switch {
24553	case strings.EqualFold("InternalFailureException", errorCode):
24554		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24555
24556	case strings.EqualFold("InvalidRequestException", errorCode):
24557		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24558
24559	case strings.EqualFold("ResourceNotFoundException", errorCode):
24560		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
24561
24562	case strings.EqualFold("ThrottlingException", errorCode):
24563		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24564
24565	default:
24566		genericError := &smithy.GenericAPIError{
24567			Code:    errorCode,
24568			Message: errorMessage,
24569		}
24570		return genericError
24571
24572	}
24573}
24574
24575func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListThingsInBillingGroupOutput, value interface{}) error {
24576	if v == nil {
24577		return fmt.Errorf("unexpected nil of type %T", v)
24578	}
24579	if value == nil {
24580		return nil
24581	}
24582
24583	shape, ok := value.(map[string]interface{})
24584	if !ok {
24585		return fmt.Errorf("unexpected JSON type %v", value)
24586	}
24587
24588	var sv *ListThingsInBillingGroupOutput
24589	if *v == nil {
24590		sv = &ListThingsInBillingGroupOutput{}
24591	} else {
24592		sv = *v
24593	}
24594
24595	for key, value := range shape {
24596		switch key {
24597		case "nextToken":
24598			if value != nil {
24599				jtv, ok := value.(string)
24600				if !ok {
24601					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24602				}
24603				sv.NextToken = ptr.String(jtv)
24604			}
24605
24606		case "things":
24607			if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil {
24608				return err
24609			}
24610
24611		default:
24612			_, _ = key, value
24613
24614		}
24615	}
24616	*v = sv
24617	return nil
24618}
24619
24620type awsRestjson1_deserializeOpListThingsInThingGroup struct {
24621}
24622
24623func (*awsRestjson1_deserializeOpListThingsInThingGroup) ID() string {
24624	return "OperationDeserializer"
24625}
24626
24627func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24628	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24629) {
24630	out, metadata, err = next.HandleDeserialize(ctx, in)
24631	if err != nil {
24632		return out, metadata, err
24633	}
24634
24635	response, ok := out.RawResponse.(*smithyhttp.Response)
24636	if !ok {
24637		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24638	}
24639
24640	if response.StatusCode < 200 || response.StatusCode >= 300 {
24641		return out, metadata, awsRestjson1_deserializeOpErrorListThingsInThingGroup(response, &metadata)
24642	}
24643	output := &ListThingsInThingGroupOutput{}
24644	out.Result = output
24645
24646	var buff [1024]byte
24647	ringBuffer := smithyio.NewRingBuffer(buff[:])
24648
24649	body := io.TeeReader(response.Body, ringBuffer)
24650
24651	decoder := json.NewDecoder(body)
24652	decoder.UseNumber()
24653	var shape interface{}
24654	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24655		var snapshot bytes.Buffer
24656		io.Copy(&snapshot, ringBuffer)
24657		err = &smithy.DeserializationError{
24658			Err:      fmt.Errorf("failed to decode response body, %w", err),
24659			Snapshot: snapshot.Bytes(),
24660		}
24661		return out, metadata, err
24662	}
24663
24664	err = awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(&output, shape)
24665	if err != nil {
24666		var snapshot bytes.Buffer
24667		io.Copy(&snapshot, ringBuffer)
24668		return out, metadata, &smithy.DeserializationError{
24669			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
24670			Snapshot: snapshot.Bytes(),
24671		}
24672	}
24673
24674	return out, metadata, err
24675}
24676
24677func awsRestjson1_deserializeOpErrorListThingsInThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24678	var errorBuffer bytes.Buffer
24679	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24680		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24681	}
24682	errorBody := bytes.NewReader(errorBuffer.Bytes())
24683
24684	errorCode := "UnknownError"
24685	errorMessage := errorCode
24686
24687	code := response.Header.Get("X-Amzn-ErrorType")
24688	if len(code) != 0 {
24689		errorCode = restjson.SanitizeErrorCode(code)
24690	}
24691
24692	var buff [1024]byte
24693	ringBuffer := smithyio.NewRingBuffer(buff[:])
24694
24695	body := io.TeeReader(errorBody, ringBuffer)
24696	decoder := json.NewDecoder(body)
24697	decoder.UseNumber()
24698	code, message, err := restjson.GetErrorInfo(decoder)
24699	if err != nil {
24700		var snapshot bytes.Buffer
24701		io.Copy(&snapshot, ringBuffer)
24702		err = &smithy.DeserializationError{
24703			Err:      fmt.Errorf("failed to decode response body, %w", err),
24704			Snapshot: snapshot.Bytes(),
24705		}
24706		return err
24707	}
24708
24709	errorBody.Seek(0, io.SeekStart)
24710	if len(code) != 0 {
24711		errorCode = restjson.SanitizeErrorCode(code)
24712	}
24713	if len(message) != 0 {
24714		errorMessage = message
24715	}
24716
24717	switch {
24718	case strings.EqualFold("InternalFailureException", errorCode):
24719		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24720
24721	case strings.EqualFold("InvalidRequestException", errorCode):
24722		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24723
24724	case strings.EqualFold("ResourceNotFoundException", errorCode):
24725		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
24726
24727	case strings.EqualFold("ThrottlingException", errorCode):
24728		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24729
24730	default:
24731		genericError := &smithy.GenericAPIError{
24732			Code:    errorCode,
24733			Message: errorMessage,
24734		}
24735		return genericError
24736
24737	}
24738}
24739
24740func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThingsInThingGroupOutput, value interface{}) error {
24741	if v == nil {
24742		return fmt.Errorf("unexpected nil of type %T", v)
24743	}
24744	if value == nil {
24745		return nil
24746	}
24747
24748	shape, ok := value.(map[string]interface{})
24749	if !ok {
24750		return fmt.Errorf("unexpected JSON type %v", value)
24751	}
24752
24753	var sv *ListThingsInThingGroupOutput
24754	if *v == nil {
24755		sv = &ListThingsInThingGroupOutput{}
24756	} else {
24757		sv = *v
24758	}
24759
24760	for key, value := range shape {
24761		switch key {
24762		case "nextToken":
24763			if value != nil {
24764				jtv, ok := value.(string)
24765				if !ok {
24766					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24767				}
24768				sv.NextToken = ptr.String(jtv)
24769			}
24770
24771		case "things":
24772			if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil {
24773				return err
24774			}
24775
24776		default:
24777			_, _ = key, value
24778
24779		}
24780	}
24781	*v = sv
24782	return nil
24783}
24784
24785type awsRestjson1_deserializeOpListThingTypes struct {
24786}
24787
24788func (*awsRestjson1_deserializeOpListThingTypes) ID() string {
24789	return "OperationDeserializer"
24790}
24791
24792func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24793	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24794) {
24795	out, metadata, err = next.HandleDeserialize(ctx, in)
24796	if err != nil {
24797		return out, metadata, err
24798	}
24799
24800	response, ok := out.RawResponse.(*smithyhttp.Response)
24801	if !ok {
24802		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24803	}
24804
24805	if response.StatusCode < 200 || response.StatusCode >= 300 {
24806		return out, metadata, awsRestjson1_deserializeOpErrorListThingTypes(response, &metadata)
24807	}
24808	output := &ListThingTypesOutput{}
24809	out.Result = output
24810
24811	var buff [1024]byte
24812	ringBuffer := smithyio.NewRingBuffer(buff[:])
24813
24814	body := io.TeeReader(response.Body, ringBuffer)
24815
24816	decoder := json.NewDecoder(body)
24817	decoder.UseNumber()
24818	var shape interface{}
24819	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24820		var snapshot bytes.Buffer
24821		io.Copy(&snapshot, ringBuffer)
24822		err = &smithy.DeserializationError{
24823			Err:      fmt.Errorf("failed to decode response body, %w", err),
24824			Snapshot: snapshot.Bytes(),
24825		}
24826		return out, metadata, err
24827	}
24828
24829	err = awsRestjson1_deserializeOpDocumentListThingTypesOutput(&output, shape)
24830	if err != nil {
24831		var snapshot bytes.Buffer
24832		io.Copy(&snapshot, ringBuffer)
24833		return out, metadata, &smithy.DeserializationError{
24834			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
24835			Snapshot: snapshot.Bytes(),
24836		}
24837	}
24838
24839	return out, metadata, err
24840}
24841
24842func awsRestjson1_deserializeOpErrorListThingTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
24843	var errorBuffer bytes.Buffer
24844	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
24845		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
24846	}
24847	errorBody := bytes.NewReader(errorBuffer.Bytes())
24848
24849	errorCode := "UnknownError"
24850	errorMessage := errorCode
24851
24852	code := response.Header.Get("X-Amzn-ErrorType")
24853	if len(code) != 0 {
24854		errorCode = restjson.SanitizeErrorCode(code)
24855	}
24856
24857	var buff [1024]byte
24858	ringBuffer := smithyio.NewRingBuffer(buff[:])
24859
24860	body := io.TeeReader(errorBody, ringBuffer)
24861	decoder := json.NewDecoder(body)
24862	decoder.UseNumber()
24863	code, message, err := restjson.GetErrorInfo(decoder)
24864	if err != nil {
24865		var snapshot bytes.Buffer
24866		io.Copy(&snapshot, ringBuffer)
24867		err = &smithy.DeserializationError{
24868			Err:      fmt.Errorf("failed to decode response body, %w", err),
24869			Snapshot: snapshot.Bytes(),
24870		}
24871		return err
24872	}
24873
24874	errorBody.Seek(0, io.SeekStart)
24875	if len(code) != 0 {
24876		errorCode = restjson.SanitizeErrorCode(code)
24877	}
24878	if len(message) != 0 {
24879		errorMessage = message
24880	}
24881
24882	switch {
24883	case strings.EqualFold("InternalFailureException", errorCode):
24884		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
24885
24886	case strings.EqualFold("InvalidRequestException", errorCode):
24887		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
24888
24889	case strings.EqualFold("ServiceUnavailableException", errorCode):
24890		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
24891
24892	case strings.EqualFold("ThrottlingException", errorCode):
24893		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
24894
24895	case strings.EqualFold("UnauthorizedException", errorCode):
24896		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
24897
24898	default:
24899		genericError := &smithy.GenericAPIError{
24900			Code:    errorCode,
24901			Message: errorMessage,
24902		}
24903		return genericError
24904
24905	}
24906}
24907
24908func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOutput, value interface{}) error {
24909	if v == nil {
24910		return fmt.Errorf("unexpected nil of type %T", v)
24911	}
24912	if value == nil {
24913		return nil
24914	}
24915
24916	shape, ok := value.(map[string]interface{})
24917	if !ok {
24918		return fmt.Errorf("unexpected JSON type %v", value)
24919	}
24920
24921	var sv *ListThingTypesOutput
24922	if *v == nil {
24923		sv = &ListThingTypesOutput{}
24924	} else {
24925		sv = *v
24926	}
24927
24928	for key, value := range shape {
24929		switch key {
24930		case "nextToken":
24931			if value != nil {
24932				jtv, ok := value.(string)
24933				if !ok {
24934					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
24935				}
24936				sv.NextToken = ptr.String(jtv)
24937			}
24938
24939		case "thingTypes":
24940			if err := awsRestjson1_deserializeDocumentThingTypeList(&sv.ThingTypes, value); err != nil {
24941				return err
24942			}
24943
24944		default:
24945			_, _ = key, value
24946
24947		}
24948	}
24949	*v = sv
24950	return nil
24951}
24952
24953type awsRestjson1_deserializeOpListTopicRuleDestinations struct {
24954}
24955
24956func (*awsRestjson1_deserializeOpListTopicRuleDestinations) ID() string {
24957	return "OperationDeserializer"
24958}
24959
24960func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
24961	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
24962) {
24963	out, metadata, err = next.HandleDeserialize(ctx, in)
24964	if err != nil {
24965		return out, metadata, err
24966	}
24967
24968	response, ok := out.RawResponse.(*smithyhttp.Response)
24969	if !ok {
24970		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
24971	}
24972
24973	if response.StatusCode < 200 || response.StatusCode >= 300 {
24974		return out, metadata, awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response, &metadata)
24975	}
24976	output := &ListTopicRuleDestinationsOutput{}
24977	out.Result = output
24978
24979	var buff [1024]byte
24980	ringBuffer := smithyio.NewRingBuffer(buff[:])
24981
24982	body := io.TeeReader(response.Body, ringBuffer)
24983
24984	decoder := json.NewDecoder(body)
24985	decoder.UseNumber()
24986	var shape interface{}
24987	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
24988		var snapshot bytes.Buffer
24989		io.Copy(&snapshot, ringBuffer)
24990		err = &smithy.DeserializationError{
24991			Err:      fmt.Errorf("failed to decode response body, %w", err),
24992			Snapshot: snapshot.Bytes(),
24993		}
24994		return out, metadata, err
24995	}
24996
24997	err = awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(&output, shape)
24998	if err != nil {
24999		var snapshot bytes.Buffer
25000		io.Copy(&snapshot, ringBuffer)
25001		return out, metadata, &smithy.DeserializationError{
25002			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25003			Snapshot: snapshot.Bytes(),
25004		}
25005	}
25006
25007	return out, metadata, err
25008}
25009
25010func awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25011	var errorBuffer bytes.Buffer
25012	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25013		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25014	}
25015	errorBody := bytes.NewReader(errorBuffer.Bytes())
25016
25017	errorCode := "UnknownError"
25018	errorMessage := errorCode
25019
25020	code := response.Header.Get("X-Amzn-ErrorType")
25021	if len(code) != 0 {
25022		errorCode = restjson.SanitizeErrorCode(code)
25023	}
25024
25025	var buff [1024]byte
25026	ringBuffer := smithyio.NewRingBuffer(buff[:])
25027
25028	body := io.TeeReader(errorBody, ringBuffer)
25029	decoder := json.NewDecoder(body)
25030	decoder.UseNumber()
25031	code, message, err := restjson.GetErrorInfo(decoder)
25032	if err != nil {
25033		var snapshot bytes.Buffer
25034		io.Copy(&snapshot, ringBuffer)
25035		err = &smithy.DeserializationError{
25036			Err:      fmt.Errorf("failed to decode response body, %w", err),
25037			Snapshot: snapshot.Bytes(),
25038		}
25039		return err
25040	}
25041
25042	errorBody.Seek(0, io.SeekStart)
25043	if len(code) != 0 {
25044		errorCode = restjson.SanitizeErrorCode(code)
25045	}
25046	if len(message) != 0 {
25047		errorMessage = message
25048	}
25049
25050	switch {
25051	case strings.EqualFold("InternalException", errorCode):
25052		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
25053
25054	case strings.EqualFold("InvalidRequestException", errorCode):
25055		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25056
25057	case strings.EqualFold("ServiceUnavailableException", errorCode):
25058		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
25059
25060	case strings.EqualFold("UnauthorizedException", errorCode):
25061		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
25062
25063	default:
25064		genericError := &smithy.GenericAPIError{
25065			Code:    errorCode,
25066			Message: errorMessage,
25067		}
25068		return genericError
25069
25070	}
25071}
25072
25073func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListTopicRuleDestinationsOutput, value interface{}) error {
25074	if v == nil {
25075		return fmt.Errorf("unexpected nil of type %T", v)
25076	}
25077	if value == nil {
25078		return nil
25079	}
25080
25081	shape, ok := value.(map[string]interface{})
25082	if !ok {
25083		return fmt.Errorf("unexpected JSON type %v", value)
25084	}
25085
25086	var sv *ListTopicRuleDestinationsOutput
25087	if *v == nil {
25088		sv = &ListTopicRuleDestinationsOutput{}
25089	} else {
25090		sv = *v
25091	}
25092
25093	for key, value := range shape {
25094		switch key {
25095		case "destinationSummaries":
25096			if err := awsRestjson1_deserializeDocumentTopicRuleDestinationSummaries(&sv.DestinationSummaries, value); err != nil {
25097				return err
25098			}
25099
25100		case "nextToken":
25101			if value != nil {
25102				jtv, ok := value.(string)
25103				if !ok {
25104					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
25105				}
25106				sv.NextToken = ptr.String(jtv)
25107			}
25108
25109		default:
25110			_, _ = key, value
25111
25112		}
25113	}
25114	*v = sv
25115	return nil
25116}
25117
25118type awsRestjson1_deserializeOpListTopicRules struct {
25119}
25120
25121func (*awsRestjson1_deserializeOpListTopicRules) ID() string {
25122	return "OperationDeserializer"
25123}
25124
25125func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25126	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25127) {
25128	out, metadata, err = next.HandleDeserialize(ctx, in)
25129	if err != nil {
25130		return out, metadata, err
25131	}
25132
25133	response, ok := out.RawResponse.(*smithyhttp.Response)
25134	if !ok {
25135		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25136	}
25137
25138	if response.StatusCode < 200 || response.StatusCode >= 300 {
25139		return out, metadata, awsRestjson1_deserializeOpErrorListTopicRules(response, &metadata)
25140	}
25141	output := &ListTopicRulesOutput{}
25142	out.Result = output
25143
25144	var buff [1024]byte
25145	ringBuffer := smithyio.NewRingBuffer(buff[:])
25146
25147	body := io.TeeReader(response.Body, ringBuffer)
25148
25149	decoder := json.NewDecoder(body)
25150	decoder.UseNumber()
25151	var shape interface{}
25152	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
25153		var snapshot bytes.Buffer
25154		io.Copy(&snapshot, ringBuffer)
25155		err = &smithy.DeserializationError{
25156			Err:      fmt.Errorf("failed to decode response body, %w", err),
25157			Snapshot: snapshot.Bytes(),
25158		}
25159		return out, metadata, err
25160	}
25161
25162	err = awsRestjson1_deserializeOpDocumentListTopicRulesOutput(&output, shape)
25163	if err != nil {
25164		var snapshot bytes.Buffer
25165		io.Copy(&snapshot, ringBuffer)
25166		return out, metadata, &smithy.DeserializationError{
25167			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25168			Snapshot: snapshot.Bytes(),
25169		}
25170	}
25171
25172	return out, metadata, err
25173}
25174
25175func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25176	var errorBuffer bytes.Buffer
25177	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25178		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25179	}
25180	errorBody := bytes.NewReader(errorBuffer.Bytes())
25181
25182	errorCode := "UnknownError"
25183	errorMessage := errorCode
25184
25185	code := response.Header.Get("X-Amzn-ErrorType")
25186	if len(code) != 0 {
25187		errorCode = restjson.SanitizeErrorCode(code)
25188	}
25189
25190	var buff [1024]byte
25191	ringBuffer := smithyio.NewRingBuffer(buff[:])
25192
25193	body := io.TeeReader(errorBody, ringBuffer)
25194	decoder := json.NewDecoder(body)
25195	decoder.UseNumber()
25196	code, message, err := restjson.GetErrorInfo(decoder)
25197	if err != nil {
25198		var snapshot bytes.Buffer
25199		io.Copy(&snapshot, ringBuffer)
25200		err = &smithy.DeserializationError{
25201			Err:      fmt.Errorf("failed to decode response body, %w", err),
25202			Snapshot: snapshot.Bytes(),
25203		}
25204		return err
25205	}
25206
25207	errorBody.Seek(0, io.SeekStart)
25208	if len(code) != 0 {
25209		errorCode = restjson.SanitizeErrorCode(code)
25210	}
25211	if len(message) != 0 {
25212		errorMessage = message
25213	}
25214
25215	switch {
25216	case strings.EqualFold("InternalException", errorCode):
25217		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
25218
25219	case strings.EqualFold("InvalidRequestException", errorCode):
25220		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25221
25222	case strings.EqualFold("ServiceUnavailableException", errorCode):
25223		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
25224
25225	default:
25226		genericError := &smithy.GenericAPIError{
25227			Code:    errorCode,
25228			Message: errorMessage,
25229		}
25230		return genericError
25231
25232	}
25233}
25234
25235func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOutput, value interface{}) error {
25236	if v == nil {
25237		return fmt.Errorf("unexpected nil of type %T", v)
25238	}
25239	if value == nil {
25240		return nil
25241	}
25242
25243	shape, ok := value.(map[string]interface{})
25244	if !ok {
25245		return fmt.Errorf("unexpected JSON type %v", value)
25246	}
25247
25248	var sv *ListTopicRulesOutput
25249	if *v == nil {
25250		sv = &ListTopicRulesOutput{}
25251	} else {
25252		sv = *v
25253	}
25254
25255	for key, value := range shape {
25256		switch key {
25257		case "nextToken":
25258			if value != nil {
25259				jtv, ok := value.(string)
25260				if !ok {
25261					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
25262				}
25263				sv.NextToken = ptr.String(jtv)
25264			}
25265
25266		case "rules":
25267			if err := awsRestjson1_deserializeDocumentTopicRuleList(&sv.Rules, value); err != nil {
25268				return err
25269			}
25270
25271		default:
25272			_, _ = key, value
25273
25274		}
25275	}
25276	*v = sv
25277	return nil
25278}
25279
25280type awsRestjson1_deserializeOpListV2LoggingLevels struct {
25281}
25282
25283func (*awsRestjson1_deserializeOpListV2LoggingLevels) ID() string {
25284	return "OperationDeserializer"
25285}
25286
25287func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25288	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25289) {
25290	out, metadata, err = next.HandleDeserialize(ctx, in)
25291	if err != nil {
25292		return out, metadata, err
25293	}
25294
25295	response, ok := out.RawResponse.(*smithyhttp.Response)
25296	if !ok {
25297		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25298	}
25299
25300	if response.StatusCode < 200 || response.StatusCode >= 300 {
25301		return out, metadata, awsRestjson1_deserializeOpErrorListV2LoggingLevels(response, &metadata)
25302	}
25303	output := &ListV2LoggingLevelsOutput{}
25304	out.Result = output
25305
25306	var buff [1024]byte
25307	ringBuffer := smithyio.NewRingBuffer(buff[:])
25308
25309	body := io.TeeReader(response.Body, ringBuffer)
25310
25311	decoder := json.NewDecoder(body)
25312	decoder.UseNumber()
25313	var shape interface{}
25314	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
25315		var snapshot bytes.Buffer
25316		io.Copy(&snapshot, ringBuffer)
25317		err = &smithy.DeserializationError{
25318			Err:      fmt.Errorf("failed to decode response body, %w", err),
25319			Snapshot: snapshot.Bytes(),
25320		}
25321		return out, metadata, err
25322	}
25323
25324	err = awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(&output, shape)
25325	if err != nil {
25326		var snapshot bytes.Buffer
25327		io.Copy(&snapshot, ringBuffer)
25328		return out, metadata, &smithy.DeserializationError{
25329			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25330			Snapshot: snapshot.Bytes(),
25331		}
25332	}
25333
25334	return out, metadata, err
25335}
25336
25337func awsRestjson1_deserializeOpErrorListV2LoggingLevels(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25338	var errorBuffer bytes.Buffer
25339	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25340		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25341	}
25342	errorBody := bytes.NewReader(errorBuffer.Bytes())
25343
25344	errorCode := "UnknownError"
25345	errorMessage := errorCode
25346
25347	code := response.Header.Get("X-Amzn-ErrorType")
25348	if len(code) != 0 {
25349		errorCode = restjson.SanitizeErrorCode(code)
25350	}
25351
25352	var buff [1024]byte
25353	ringBuffer := smithyio.NewRingBuffer(buff[:])
25354
25355	body := io.TeeReader(errorBody, ringBuffer)
25356	decoder := json.NewDecoder(body)
25357	decoder.UseNumber()
25358	code, message, err := restjson.GetErrorInfo(decoder)
25359	if err != nil {
25360		var snapshot bytes.Buffer
25361		io.Copy(&snapshot, ringBuffer)
25362		err = &smithy.DeserializationError{
25363			Err:      fmt.Errorf("failed to decode response body, %w", err),
25364			Snapshot: snapshot.Bytes(),
25365		}
25366		return err
25367	}
25368
25369	errorBody.Seek(0, io.SeekStart)
25370	if len(code) != 0 {
25371		errorCode = restjson.SanitizeErrorCode(code)
25372	}
25373	if len(message) != 0 {
25374		errorMessage = message
25375	}
25376
25377	switch {
25378	case strings.EqualFold("InternalException", errorCode):
25379		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
25380
25381	case strings.EqualFold("InvalidRequestException", errorCode):
25382		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25383
25384	case strings.EqualFold("NotConfiguredException", errorCode):
25385		return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody)
25386
25387	case strings.EqualFold("ServiceUnavailableException", errorCode):
25388		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
25389
25390	default:
25391		genericError := &smithy.GenericAPIError{
25392			Code:    errorCode,
25393			Message: errorMessage,
25394		}
25395		return genericError
25396
25397	}
25398}
25399
25400func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2LoggingLevelsOutput, value interface{}) error {
25401	if v == nil {
25402		return fmt.Errorf("unexpected nil of type %T", v)
25403	}
25404	if value == nil {
25405		return nil
25406	}
25407
25408	shape, ok := value.(map[string]interface{})
25409	if !ok {
25410		return fmt.Errorf("unexpected JSON type %v", value)
25411	}
25412
25413	var sv *ListV2LoggingLevelsOutput
25414	if *v == nil {
25415		sv = &ListV2LoggingLevelsOutput{}
25416	} else {
25417		sv = *v
25418	}
25419
25420	for key, value := range shape {
25421		switch key {
25422		case "logTargetConfigurations":
25423			if err := awsRestjson1_deserializeDocumentLogTargetConfigurations(&sv.LogTargetConfigurations, value); err != nil {
25424				return err
25425			}
25426
25427		case "nextToken":
25428			if value != nil {
25429				jtv, ok := value.(string)
25430				if !ok {
25431					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
25432				}
25433				sv.NextToken = ptr.String(jtv)
25434			}
25435
25436		default:
25437			_, _ = key, value
25438
25439		}
25440	}
25441	*v = sv
25442	return nil
25443}
25444
25445type awsRestjson1_deserializeOpListViolationEvents struct {
25446}
25447
25448func (*awsRestjson1_deserializeOpListViolationEvents) ID() string {
25449	return "OperationDeserializer"
25450}
25451
25452func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25453	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25454) {
25455	out, metadata, err = next.HandleDeserialize(ctx, in)
25456	if err != nil {
25457		return out, metadata, err
25458	}
25459
25460	response, ok := out.RawResponse.(*smithyhttp.Response)
25461	if !ok {
25462		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25463	}
25464
25465	if response.StatusCode < 200 || response.StatusCode >= 300 {
25466		return out, metadata, awsRestjson1_deserializeOpErrorListViolationEvents(response, &metadata)
25467	}
25468	output := &ListViolationEventsOutput{}
25469	out.Result = output
25470
25471	var buff [1024]byte
25472	ringBuffer := smithyio.NewRingBuffer(buff[:])
25473
25474	body := io.TeeReader(response.Body, ringBuffer)
25475
25476	decoder := json.NewDecoder(body)
25477	decoder.UseNumber()
25478	var shape interface{}
25479	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
25480		var snapshot bytes.Buffer
25481		io.Copy(&snapshot, ringBuffer)
25482		err = &smithy.DeserializationError{
25483			Err:      fmt.Errorf("failed to decode response body, %w", err),
25484			Snapshot: snapshot.Bytes(),
25485		}
25486		return out, metadata, err
25487	}
25488
25489	err = awsRestjson1_deserializeOpDocumentListViolationEventsOutput(&output, shape)
25490	if err != nil {
25491		var snapshot bytes.Buffer
25492		io.Copy(&snapshot, ringBuffer)
25493		return out, metadata, &smithy.DeserializationError{
25494			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25495			Snapshot: snapshot.Bytes(),
25496		}
25497	}
25498
25499	return out, metadata, err
25500}
25501
25502func awsRestjson1_deserializeOpErrorListViolationEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25503	var errorBuffer bytes.Buffer
25504	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25505		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25506	}
25507	errorBody := bytes.NewReader(errorBuffer.Bytes())
25508
25509	errorCode := "UnknownError"
25510	errorMessage := errorCode
25511
25512	code := response.Header.Get("X-Amzn-ErrorType")
25513	if len(code) != 0 {
25514		errorCode = restjson.SanitizeErrorCode(code)
25515	}
25516
25517	var buff [1024]byte
25518	ringBuffer := smithyio.NewRingBuffer(buff[:])
25519
25520	body := io.TeeReader(errorBody, ringBuffer)
25521	decoder := json.NewDecoder(body)
25522	decoder.UseNumber()
25523	code, message, err := restjson.GetErrorInfo(decoder)
25524	if err != nil {
25525		var snapshot bytes.Buffer
25526		io.Copy(&snapshot, ringBuffer)
25527		err = &smithy.DeserializationError{
25528			Err:      fmt.Errorf("failed to decode response body, %w", err),
25529			Snapshot: snapshot.Bytes(),
25530		}
25531		return err
25532	}
25533
25534	errorBody.Seek(0, io.SeekStart)
25535	if len(code) != 0 {
25536		errorCode = restjson.SanitizeErrorCode(code)
25537	}
25538	if len(message) != 0 {
25539		errorMessage = message
25540	}
25541
25542	switch {
25543	case strings.EqualFold("InternalFailureException", errorCode):
25544		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
25545
25546	case strings.EqualFold("InvalidRequestException", errorCode):
25547		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25548
25549	case strings.EqualFold("ThrottlingException", errorCode):
25550		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
25551
25552	default:
25553		genericError := &smithy.GenericAPIError{
25554			Code:    errorCode,
25555			Message: errorMessage,
25556		}
25557		return genericError
25558
25559	}
25560}
25561
25562func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolationEventsOutput, value interface{}) error {
25563	if v == nil {
25564		return fmt.Errorf("unexpected nil of type %T", v)
25565	}
25566	if value == nil {
25567		return nil
25568	}
25569
25570	shape, ok := value.(map[string]interface{})
25571	if !ok {
25572		return fmt.Errorf("unexpected JSON type %v", value)
25573	}
25574
25575	var sv *ListViolationEventsOutput
25576	if *v == nil {
25577		sv = &ListViolationEventsOutput{}
25578	} else {
25579		sv = *v
25580	}
25581
25582	for key, value := range shape {
25583		switch key {
25584		case "nextToken":
25585			if value != nil {
25586				jtv, ok := value.(string)
25587				if !ok {
25588					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
25589				}
25590				sv.NextToken = ptr.String(jtv)
25591			}
25592
25593		case "violationEvents":
25594			if err := awsRestjson1_deserializeDocumentViolationEvents(&sv.ViolationEvents, value); err != nil {
25595				return err
25596			}
25597
25598		default:
25599			_, _ = key, value
25600
25601		}
25602	}
25603	*v = sv
25604	return nil
25605}
25606
25607type awsRestjson1_deserializeOpRegisterCACertificate struct {
25608}
25609
25610func (*awsRestjson1_deserializeOpRegisterCACertificate) ID() string {
25611	return "OperationDeserializer"
25612}
25613
25614func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25615	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25616) {
25617	out, metadata, err = next.HandleDeserialize(ctx, in)
25618	if err != nil {
25619		return out, metadata, err
25620	}
25621
25622	response, ok := out.RawResponse.(*smithyhttp.Response)
25623	if !ok {
25624		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25625	}
25626
25627	if response.StatusCode < 200 || response.StatusCode >= 300 {
25628		return out, metadata, awsRestjson1_deserializeOpErrorRegisterCACertificate(response, &metadata)
25629	}
25630	output := &RegisterCACertificateOutput{}
25631	out.Result = output
25632
25633	var buff [1024]byte
25634	ringBuffer := smithyio.NewRingBuffer(buff[:])
25635
25636	body := io.TeeReader(response.Body, ringBuffer)
25637
25638	decoder := json.NewDecoder(body)
25639	decoder.UseNumber()
25640	var shape interface{}
25641	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
25642		var snapshot bytes.Buffer
25643		io.Copy(&snapshot, ringBuffer)
25644		err = &smithy.DeserializationError{
25645			Err:      fmt.Errorf("failed to decode response body, %w", err),
25646			Snapshot: snapshot.Bytes(),
25647		}
25648		return out, metadata, err
25649	}
25650
25651	err = awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(&output, shape)
25652	if err != nil {
25653		var snapshot bytes.Buffer
25654		io.Copy(&snapshot, ringBuffer)
25655		return out, metadata, &smithy.DeserializationError{
25656			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25657			Snapshot: snapshot.Bytes(),
25658		}
25659	}
25660
25661	return out, metadata, err
25662}
25663
25664func awsRestjson1_deserializeOpErrorRegisterCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25665	var errorBuffer bytes.Buffer
25666	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25667		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25668	}
25669	errorBody := bytes.NewReader(errorBuffer.Bytes())
25670
25671	errorCode := "UnknownError"
25672	errorMessage := errorCode
25673
25674	code := response.Header.Get("X-Amzn-ErrorType")
25675	if len(code) != 0 {
25676		errorCode = restjson.SanitizeErrorCode(code)
25677	}
25678
25679	var buff [1024]byte
25680	ringBuffer := smithyio.NewRingBuffer(buff[:])
25681
25682	body := io.TeeReader(errorBody, ringBuffer)
25683	decoder := json.NewDecoder(body)
25684	decoder.UseNumber()
25685	code, message, err := restjson.GetErrorInfo(decoder)
25686	if err != nil {
25687		var snapshot bytes.Buffer
25688		io.Copy(&snapshot, ringBuffer)
25689		err = &smithy.DeserializationError{
25690			Err:      fmt.Errorf("failed to decode response body, %w", err),
25691			Snapshot: snapshot.Bytes(),
25692		}
25693		return err
25694	}
25695
25696	errorBody.Seek(0, io.SeekStart)
25697	if len(code) != 0 {
25698		errorCode = restjson.SanitizeErrorCode(code)
25699	}
25700	if len(message) != 0 {
25701		errorMessage = message
25702	}
25703
25704	switch {
25705	case strings.EqualFold("CertificateValidationException", errorCode):
25706		return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody)
25707
25708	case strings.EqualFold("InternalFailureException", errorCode):
25709		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
25710
25711	case strings.EqualFold("InvalidRequestException", errorCode):
25712		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25713
25714	case strings.EqualFold("LimitExceededException", errorCode):
25715		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
25716
25717	case strings.EqualFold("RegistrationCodeValidationException", errorCode):
25718		return awsRestjson1_deserializeErrorRegistrationCodeValidationException(response, errorBody)
25719
25720	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
25721		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
25722
25723	case strings.EqualFold("ServiceUnavailableException", errorCode):
25724		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
25725
25726	case strings.EqualFold("ThrottlingException", errorCode):
25727		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
25728
25729	case strings.EqualFold("UnauthorizedException", errorCode):
25730		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
25731
25732	default:
25733		genericError := &smithy.GenericAPIError{
25734			Code:    errorCode,
25735			Message: errorMessage,
25736		}
25737		return genericError
25738
25739	}
25740}
25741
25742func awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(v **RegisterCACertificateOutput, value interface{}) error {
25743	if v == nil {
25744		return fmt.Errorf("unexpected nil of type %T", v)
25745	}
25746	if value == nil {
25747		return nil
25748	}
25749
25750	shape, ok := value.(map[string]interface{})
25751	if !ok {
25752		return fmt.Errorf("unexpected JSON type %v", value)
25753	}
25754
25755	var sv *RegisterCACertificateOutput
25756	if *v == nil {
25757		sv = &RegisterCACertificateOutput{}
25758	} else {
25759		sv = *v
25760	}
25761
25762	for key, value := range shape {
25763		switch key {
25764		case "certificateArn":
25765			if value != nil {
25766				jtv, ok := value.(string)
25767				if !ok {
25768					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
25769				}
25770				sv.CertificateArn = ptr.String(jtv)
25771			}
25772
25773		case "certificateId":
25774			if value != nil {
25775				jtv, ok := value.(string)
25776				if !ok {
25777					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
25778				}
25779				sv.CertificateId = ptr.String(jtv)
25780			}
25781
25782		default:
25783			_, _ = key, value
25784
25785		}
25786	}
25787	*v = sv
25788	return nil
25789}
25790
25791type awsRestjson1_deserializeOpRegisterCertificate struct {
25792}
25793
25794func (*awsRestjson1_deserializeOpRegisterCertificate) ID() string {
25795	return "OperationDeserializer"
25796}
25797
25798func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25799	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25800) {
25801	out, metadata, err = next.HandleDeserialize(ctx, in)
25802	if err != nil {
25803		return out, metadata, err
25804	}
25805
25806	response, ok := out.RawResponse.(*smithyhttp.Response)
25807	if !ok {
25808		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25809	}
25810
25811	if response.StatusCode < 200 || response.StatusCode >= 300 {
25812		return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificate(response, &metadata)
25813	}
25814	output := &RegisterCertificateOutput{}
25815	out.Result = output
25816
25817	var buff [1024]byte
25818	ringBuffer := smithyio.NewRingBuffer(buff[:])
25819
25820	body := io.TeeReader(response.Body, ringBuffer)
25821
25822	decoder := json.NewDecoder(body)
25823	decoder.UseNumber()
25824	var shape interface{}
25825	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
25826		var snapshot bytes.Buffer
25827		io.Copy(&snapshot, ringBuffer)
25828		err = &smithy.DeserializationError{
25829			Err:      fmt.Errorf("failed to decode response body, %w", err),
25830			Snapshot: snapshot.Bytes(),
25831		}
25832		return out, metadata, err
25833	}
25834
25835	err = awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(&output, shape)
25836	if err != nil {
25837		var snapshot bytes.Buffer
25838		io.Copy(&snapshot, ringBuffer)
25839		return out, metadata, &smithy.DeserializationError{
25840			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
25841			Snapshot: snapshot.Bytes(),
25842		}
25843	}
25844
25845	return out, metadata, err
25846}
25847
25848func awsRestjson1_deserializeOpErrorRegisterCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
25849	var errorBuffer bytes.Buffer
25850	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
25851		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
25852	}
25853	errorBody := bytes.NewReader(errorBuffer.Bytes())
25854
25855	errorCode := "UnknownError"
25856	errorMessage := errorCode
25857
25858	code := response.Header.Get("X-Amzn-ErrorType")
25859	if len(code) != 0 {
25860		errorCode = restjson.SanitizeErrorCode(code)
25861	}
25862
25863	var buff [1024]byte
25864	ringBuffer := smithyio.NewRingBuffer(buff[:])
25865
25866	body := io.TeeReader(errorBody, ringBuffer)
25867	decoder := json.NewDecoder(body)
25868	decoder.UseNumber()
25869	code, message, err := restjson.GetErrorInfo(decoder)
25870	if err != nil {
25871		var snapshot bytes.Buffer
25872		io.Copy(&snapshot, ringBuffer)
25873		err = &smithy.DeserializationError{
25874			Err:      fmt.Errorf("failed to decode response body, %w", err),
25875			Snapshot: snapshot.Bytes(),
25876		}
25877		return err
25878	}
25879
25880	errorBody.Seek(0, io.SeekStart)
25881	if len(code) != 0 {
25882		errorCode = restjson.SanitizeErrorCode(code)
25883	}
25884	if len(message) != 0 {
25885		errorMessage = message
25886	}
25887
25888	switch {
25889	case strings.EqualFold("CertificateConflictException", errorCode):
25890		return awsRestjson1_deserializeErrorCertificateConflictException(response, errorBody)
25891
25892	case strings.EqualFold("CertificateStateException", errorCode):
25893		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
25894
25895	case strings.EqualFold("CertificateValidationException", errorCode):
25896		return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody)
25897
25898	case strings.EqualFold("InternalFailureException", errorCode):
25899		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
25900
25901	case strings.EqualFold("InvalidRequestException", errorCode):
25902		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
25903
25904	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
25905		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
25906
25907	case strings.EqualFold("ServiceUnavailableException", errorCode):
25908		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
25909
25910	case strings.EqualFold("ThrottlingException", errorCode):
25911		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
25912
25913	case strings.EqualFold("UnauthorizedException", errorCode):
25914		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
25915
25916	default:
25917		genericError := &smithy.GenericAPIError{
25918			Code:    errorCode,
25919			Message: errorMessage,
25920		}
25921		return genericError
25922
25923	}
25924}
25925
25926func awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(v **RegisterCertificateOutput, value interface{}) error {
25927	if v == nil {
25928		return fmt.Errorf("unexpected nil of type %T", v)
25929	}
25930	if value == nil {
25931		return nil
25932	}
25933
25934	shape, ok := value.(map[string]interface{})
25935	if !ok {
25936		return fmt.Errorf("unexpected JSON type %v", value)
25937	}
25938
25939	var sv *RegisterCertificateOutput
25940	if *v == nil {
25941		sv = &RegisterCertificateOutput{}
25942	} else {
25943		sv = *v
25944	}
25945
25946	for key, value := range shape {
25947		switch key {
25948		case "certificateArn":
25949			if value != nil {
25950				jtv, ok := value.(string)
25951				if !ok {
25952					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
25953				}
25954				sv.CertificateArn = ptr.String(jtv)
25955			}
25956
25957		case "certificateId":
25958			if value != nil {
25959				jtv, ok := value.(string)
25960				if !ok {
25961					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
25962				}
25963				sv.CertificateId = ptr.String(jtv)
25964			}
25965
25966		default:
25967			_, _ = key, value
25968
25969		}
25970	}
25971	*v = sv
25972	return nil
25973}
25974
25975type awsRestjson1_deserializeOpRegisterCertificateWithoutCA struct {
25976}
25977
25978func (*awsRestjson1_deserializeOpRegisterCertificateWithoutCA) ID() string {
25979	return "OperationDeserializer"
25980}
25981
25982func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
25983	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
25984) {
25985	out, metadata, err = next.HandleDeserialize(ctx, in)
25986	if err != nil {
25987		return out, metadata, err
25988	}
25989
25990	response, ok := out.RawResponse.(*smithyhttp.Response)
25991	if !ok {
25992		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
25993	}
25994
25995	if response.StatusCode < 200 || response.StatusCode >= 300 {
25996		return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response, &metadata)
25997	}
25998	output := &RegisterCertificateWithoutCAOutput{}
25999	out.Result = output
26000
26001	var buff [1024]byte
26002	ringBuffer := smithyio.NewRingBuffer(buff[:])
26003
26004	body := io.TeeReader(response.Body, ringBuffer)
26005
26006	decoder := json.NewDecoder(body)
26007	decoder.UseNumber()
26008	var shape interface{}
26009	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
26010		var snapshot bytes.Buffer
26011		io.Copy(&snapshot, ringBuffer)
26012		err = &smithy.DeserializationError{
26013			Err:      fmt.Errorf("failed to decode response body, %w", err),
26014			Snapshot: snapshot.Bytes(),
26015		}
26016		return out, metadata, err
26017	}
26018
26019	err = awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(&output, shape)
26020	if err != nil {
26021		var snapshot bytes.Buffer
26022		io.Copy(&snapshot, ringBuffer)
26023		return out, metadata, &smithy.DeserializationError{
26024			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
26025			Snapshot: snapshot.Bytes(),
26026		}
26027	}
26028
26029	return out, metadata, err
26030}
26031
26032func awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26033	var errorBuffer bytes.Buffer
26034	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26035		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26036	}
26037	errorBody := bytes.NewReader(errorBuffer.Bytes())
26038
26039	errorCode := "UnknownError"
26040	errorMessage := errorCode
26041
26042	code := response.Header.Get("X-Amzn-ErrorType")
26043	if len(code) != 0 {
26044		errorCode = restjson.SanitizeErrorCode(code)
26045	}
26046
26047	var buff [1024]byte
26048	ringBuffer := smithyio.NewRingBuffer(buff[:])
26049
26050	body := io.TeeReader(errorBody, ringBuffer)
26051	decoder := json.NewDecoder(body)
26052	decoder.UseNumber()
26053	code, message, err := restjson.GetErrorInfo(decoder)
26054	if err != nil {
26055		var snapshot bytes.Buffer
26056		io.Copy(&snapshot, ringBuffer)
26057		err = &smithy.DeserializationError{
26058			Err:      fmt.Errorf("failed to decode response body, %w", err),
26059			Snapshot: snapshot.Bytes(),
26060		}
26061		return err
26062	}
26063
26064	errorBody.Seek(0, io.SeekStart)
26065	if len(code) != 0 {
26066		errorCode = restjson.SanitizeErrorCode(code)
26067	}
26068	if len(message) != 0 {
26069		errorMessage = message
26070	}
26071
26072	switch {
26073	case strings.EqualFold("CertificateStateException", errorCode):
26074		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
26075
26076	case strings.EqualFold("CertificateValidationException", errorCode):
26077		return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody)
26078
26079	case strings.EqualFold("InternalFailureException", errorCode):
26080		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26081
26082	case strings.EqualFold("InvalidRequestException", errorCode):
26083		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26084
26085	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
26086		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
26087
26088	case strings.EqualFold("ServiceUnavailableException", errorCode):
26089		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
26090
26091	case strings.EqualFold("ThrottlingException", errorCode):
26092		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26093
26094	case strings.EqualFold("UnauthorizedException", errorCode):
26095		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
26096
26097	default:
26098		genericError := &smithy.GenericAPIError{
26099			Code:    errorCode,
26100			Message: errorMessage,
26101		}
26102		return genericError
26103
26104	}
26105}
26106
26107func awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(v **RegisterCertificateWithoutCAOutput, value interface{}) error {
26108	if v == nil {
26109		return fmt.Errorf("unexpected nil of type %T", v)
26110	}
26111	if value == nil {
26112		return nil
26113	}
26114
26115	shape, ok := value.(map[string]interface{})
26116	if !ok {
26117		return fmt.Errorf("unexpected JSON type %v", value)
26118	}
26119
26120	var sv *RegisterCertificateWithoutCAOutput
26121	if *v == nil {
26122		sv = &RegisterCertificateWithoutCAOutput{}
26123	} else {
26124		sv = *v
26125	}
26126
26127	for key, value := range shape {
26128		switch key {
26129		case "certificateArn":
26130			if value != nil {
26131				jtv, ok := value.(string)
26132				if !ok {
26133					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
26134				}
26135				sv.CertificateArn = ptr.String(jtv)
26136			}
26137
26138		case "certificateId":
26139			if value != nil {
26140				jtv, ok := value.(string)
26141				if !ok {
26142					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
26143				}
26144				sv.CertificateId = ptr.String(jtv)
26145			}
26146
26147		default:
26148			_, _ = key, value
26149
26150		}
26151	}
26152	*v = sv
26153	return nil
26154}
26155
26156type awsRestjson1_deserializeOpRegisterThing struct {
26157}
26158
26159func (*awsRestjson1_deserializeOpRegisterThing) ID() string {
26160	return "OperationDeserializer"
26161}
26162
26163func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26164	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26165) {
26166	out, metadata, err = next.HandleDeserialize(ctx, in)
26167	if err != nil {
26168		return out, metadata, err
26169	}
26170
26171	response, ok := out.RawResponse.(*smithyhttp.Response)
26172	if !ok {
26173		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26174	}
26175
26176	if response.StatusCode < 200 || response.StatusCode >= 300 {
26177		return out, metadata, awsRestjson1_deserializeOpErrorRegisterThing(response, &metadata)
26178	}
26179	output := &RegisterThingOutput{}
26180	out.Result = output
26181
26182	var buff [1024]byte
26183	ringBuffer := smithyio.NewRingBuffer(buff[:])
26184
26185	body := io.TeeReader(response.Body, ringBuffer)
26186
26187	decoder := json.NewDecoder(body)
26188	decoder.UseNumber()
26189	var shape interface{}
26190	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
26191		var snapshot bytes.Buffer
26192		io.Copy(&snapshot, ringBuffer)
26193		err = &smithy.DeserializationError{
26194			Err:      fmt.Errorf("failed to decode response body, %w", err),
26195			Snapshot: snapshot.Bytes(),
26196		}
26197		return out, metadata, err
26198	}
26199
26200	err = awsRestjson1_deserializeOpDocumentRegisterThingOutput(&output, shape)
26201	if err != nil {
26202		var snapshot bytes.Buffer
26203		io.Copy(&snapshot, ringBuffer)
26204		return out, metadata, &smithy.DeserializationError{
26205			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
26206			Snapshot: snapshot.Bytes(),
26207		}
26208	}
26209
26210	return out, metadata, err
26211}
26212
26213func awsRestjson1_deserializeOpErrorRegisterThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26214	var errorBuffer bytes.Buffer
26215	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26216		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26217	}
26218	errorBody := bytes.NewReader(errorBuffer.Bytes())
26219
26220	errorCode := "UnknownError"
26221	errorMessage := errorCode
26222
26223	code := response.Header.Get("X-Amzn-ErrorType")
26224	if len(code) != 0 {
26225		errorCode = restjson.SanitizeErrorCode(code)
26226	}
26227
26228	var buff [1024]byte
26229	ringBuffer := smithyio.NewRingBuffer(buff[:])
26230
26231	body := io.TeeReader(errorBody, ringBuffer)
26232	decoder := json.NewDecoder(body)
26233	decoder.UseNumber()
26234	code, message, err := restjson.GetErrorInfo(decoder)
26235	if err != nil {
26236		var snapshot bytes.Buffer
26237		io.Copy(&snapshot, ringBuffer)
26238		err = &smithy.DeserializationError{
26239			Err:      fmt.Errorf("failed to decode response body, %w", err),
26240			Snapshot: snapshot.Bytes(),
26241		}
26242		return err
26243	}
26244
26245	errorBody.Seek(0, io.SeekStart)
26246	if len(code) != 0 {
26247		errorCode = restjson.SanitizeErrorCode(code)
26248	}
26249	if len(message) != 0 {
26250		errorMessage = message
26251	}
26252
26253	switch {
26254	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
26255		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
26256
26257	case strings.EqualFold("InternalFailureException", errorCode):
26258		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26259
26260	case strings.EqualFold("InvalidRequestException", errorCode):
26261		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26262
26263	case strings.EqualFold("ResourceRegistrationFailureException", errorCode):
26264		return awsRestjson1_deserializeErrorResourceRegistrationFailureException(response, errorBody)
26265
26266	case strings.EqualFold("ServiceUnavailableException", errorCode):
26267		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
26268
26269	case strings.EqualFold("ThrottlingException", errorCode):
26270		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26271
26272	case strings.EqualFold("UnauthorizedException", errorCode):
26273		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
26274
26275	default:
26276		genericError := &smithy.GenericAPIError{
26277			Code:    errorCode,
26278			Message: errorMessage,
26279		}
26280		return genericError
26281
26282	}
26283}
26284
26285func awsRestjson1_deserializeOpDocumentRegisterThingOutput(v **RegisterThingOutput, value interface{}) error {
26286	if v == nil {
26287		return fmt.Errorf("unexpected nil of type %T", v)
26288	}
26289	if value == nil {
26290		return nil
26291	}
26292
26293	shape, ok := value.(map[string]interface{})
26294	if !ok {
26295		return fmt.Errorf("unexpected JSON type %v", value)
26296	}
26297
26298	var sv *RegisterThingOutput
26299	if *v == nil {
26300		sv = &RegisterThingOutput{}
26301	} else {
26302		sv = *v
26303	}
26304
26305	for key, value := range shape {
26306		switch key {
26307		case "certificatePem":
26308			if value != nil {
26309				jtv, ok := value.(string)
26310				if !ok {
26311					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
26312				}
26313				sv.CertificatePem = ptr.String(jtv)
26314			}
26315
26316		case "resourceArns":
26317			if err := awsRestjson1_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil {
26318				return err
26319			}
26320
26321		default:
26322			_, _ = key, value
26323
26324		}
26325	}
26326	*v = sv
26327	return nil
26328}
26329
26330type awsRestjson1_deserializeOpRejectCertificateTransfer struct {
26331}
26332
26333func (*awsRestjson1_deserializeOpRejectCertificateTransfer) ID() string {
26334	return "OperationDeserializer"
26335}
26336
26337func (m *awsRestjson1_deserializeOpRejectCertificateTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26338	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26339) {
26340	out, metadata, err = next.HandleDeserialize(ctx, in)
26341	if err != nil {
26342		return out, metadata, err
26343	}
26344
26345	response, ok := out.RawResponse.(*smithyhttp.Response)
26346	if !ok {
26347		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26348	}
26349
26350	if response.StatusCode < 200 || response.StatusCode >= 300 {
26351		return out, metadata, awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response, &metadata)
26352	}
26353	output := &RejectCertificateTransferOutput{}
26354	out.Result = output
26355
26356	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
26357		return out, metadata, &smithy.DeserializationError{
26358			Err: fmt.Errorf("failed to discard response body, %w", err),
26359		}
26360	}
26361
26362	return out, metadata, err
26363}
26364
26365func awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26366	var errorBuffer bytes.Buffer
26367	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26368		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26369	}
26370	errorBody := bytes.NewReader(errorBuffer.Bytes())
26371
26372	errorCode := "UnknownError"
26373	errorMessage := errorCode
26374
26375	code := response.Header.Get("X-Amzn-ErrorType")
26376	if len(code) != 0 {
26377		errorCode = restjson.SanitizeErrorCode(code)
26378	}
26379
26380	var buff [1024]byte
26381	ringBuffer := smithyio.NewRingBuffer(buff[:])
26382
26383	body := io.TeeReader(errorBody, ringBuffer)
26384	decoder := json.NewDecoder(body)
26385	decoder.UseNumber()
26386	code, message, err := restjson.GetErrorInfo(decoder)
26387	if err != nil {
26388		var snapshot bytes.Buffer
26389		io.Copy(&snapshot, ringBuffer)
26390		err = &smithy.DeserializationError{
26391			Err:      fmt.Errorf("failed to decode response body, %w", err),
26392			Snapshot: snapshot.Bytes(),
26393		}
26394		return err
26395	}
26396
26397	errorBody.Seek(0, io.SeekStart)
26398	if len(code) != 0 {
26399		errorCode = restjson.SanitizeErrorCode(code)
26400	}
26401	if len(message) != 0 {
26402		errorMessage = message
26403	}
26404
26405	switch {
26406	case strings.EqualFold("InternalFailureException", errorCode):
26407		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26408
26409	case strings.EqualFold("InvalidRequestException", errorCode):
26410		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26411
26412	case strings.EqualFold("ResourceNotFoundException", errorCode):
26413		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
26414
26415	case strings.EqualFold("ServiceUnavailableException", errorCode):
26416		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
26417
26418	case strings.EqualFold("ThrottlingException", errorCode):
26419		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26420
26421	case strings.EqualFold("TransferAlreadyCompletedException", errorCode):
26422		return awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response, errorBody)
26423
26424	case strings.EqualFold("UnauthorizedException", errorCode):
26425		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
26426
26427	default:
26428		genericError := &smithy.GenericAPIError{
26429			Code:    errorCode,
26430			Message: errorMessage,
26431		}
26432		return genericError
26433
26434	}
26435}
26436
26437type awsRestjson1_deserializeOpRemoveThingFromBillingGroup struct {
26438}
26439
26440func (*awsRestjson1_deserializeOpRemoveThingFromBillingGroup) ID() string {
26441	return "OperationDeserializer"
26442}
26443
26444func (m *awsRestjson1_deserializeOpRemoveThingFromBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26445	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26446) {
26447	out, metadata, err = next.HandleDeserialize(ctx, in)
26448	if err != nil {
26449		return out, metadata, err
26450	}
26451
26452	response, ok := out.RawResponse.(*smithyhttp.Response)
26453	if !ok {
26454		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26455	}
26456
26457	if response.StatusCode < 200 || response.StatusCode >= 300 {
26458		return out, metadata, awsRestjson1_deserializeOpErrorRemoveThingFromBillingGroup(response, &metadata)
26459	}
26460	output := &RemoveThingFromBillingGroupOutput{}
26461	out.Result = output
26462
26463	return out, metadata, err
26464}
26465
26466func awsRestjson1_deserializeOpErrorRemoveThingFromBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26467	var errorBuffer bytes.Buffer
26468	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26469		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26470	}
26471	errorBody := bytes.NewReader(errorBuffer.Bytes())
26472
26473	errorCode := "UnknownError"
26474	errorMessage := errorCode
26475
26476	code := response.Header.Get("X-Amzn-ErrorType")
26477	if len(code) != 0 {
26478		errorCode = restjson.SanitizeErrorCode(code)
26479	}
26480
26481	var buff [1024]byte
26482	ringBuffer := smithyio.NewRingBuffer(buff[:])
26483
26484	body := io.TeeReader(errorBody, ringBuffer)
26485	decoder := json.NewDecoder(body)
26486	decoder.UseNumber()
26487	code, message, err := restjson.GetErrorInfo(decoder)
26488	if err != nil {
26489		var snapshot bytes.Buffer
26490		io.Copy(&snapshot, ringBuffer)
26491		err = &smithy.DeserializationError{
26492			Err:      fmt.Errorf("failed to decode response body, %w", err),
26493			Snapshot: snapshot.Bytes(),
26494		}
26495		return err
26496	}
26497
26498	errorBody.Seek(0, io.SeekStart)
26499	if len(code) != 0 {
26500		errorCode = restjson.SanitizeErrorCode(code)
26501	}
26502	if len(message) != 0 {
26503		errorMessage = message
26504	}
26505
26506	switch {
26507	case strings.EqualFold("InternalFailureException", errorCode):
26508		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26509
26510	case strings.EqualFold("InvalidRequestException", errorCode):
26511		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26512
26513	case strings.EqualFold("ResourceNotFoundException", errorCode):
26514		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
26515
26516	case strings.EqualFold("ThrottlingException", errorCode):
26517		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26518
26519	default:
26520		genericError := &smithy.GenericAPIError{
26521			Code:    errorCode,
26522			Message: errorMessage,
26523		}
26524		return genericError
26525
26526	}
26527}
26528
26529type awsRestjson1_deserializeOpRemoveThingFromThingGroup struct {
26530}
26531
26532func (*awsRestjson1_deserializeOpRemoveThingFromThingGroup) ID() string {
26533	return "OperationDeserializer"
26534}
26535
26536func (m *awsRestjson1_deserializeOpRemoveThingFromThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26537	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26538) {
26539	out, metadata, err = next.HandleDeserialize(ctx, in)
26540	if err != nil {
26541		return out, metadata, err
26542	}
26543
26544	response, ok := out.RawResponse.(*smithyhttp.Response)
26545	if !ok {
26546		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26547	}
26548
26549	if response.StatusCode < 200 || response.StatusCode >= 300 {
26550		return out, metadata, awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response, &metadata)
26551	}
26552	output := &RemoveThingFromThingGroupOutput{}
26553	out.Result = output
26554
26555	return out, metadata, err
26556}
26557
26558func awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26559	var errorBuffer bytes.Buffer
26560	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26561		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26562	}
26563	errorBody := bytes.NewReader(errorBuffer.Bytes())
26564
26565	errorCode := "UnknownError"
26566	errorMessage := errorCode
26567
26568	code := response.Header.Get("X-Amzn-ErrorType")
26569	if len(code) != 0 {
26570		errorCode = restjson.SanitizeErrorCode(code)
26571	}
26572
26573	var buff [1024]byte
26574	ringBuffer := smithyio.NewRingBuffer(buff[:])
26575
26576	body := io.TeeReader(errorBody, ringBuffer)
26577	decoder := json.NewDecoder(body)
26578	decoder.UseNumber()
26579	code, message, err := restjson.GetErrorInfo(decoder)
26580	if err != nil {
26581		var snapshot bytes.Buffer
26582		io.Copy(&snapshot, ringBuffer)
26583		err = &smithy.DeserializationError{
26584			Err:      fmt.Errorf("failed to decode response body, %w", err),
26585			Snapshot: snapshot.Bytes(),
26586		}
26587		return err
26588	}
26589
26590	errorBody.Seek(0, io.SeekStart)
26591	if len(code) != 0 {
26592		errorCode = restjson.SanitizeErrorCode(code)
26593	}
26594	if len(message) != 0 {
26595		errorMessage = message
26596	}
26597
26598	switch {
26599	case strings.EqualFold("InternalFailureException", errorCode):
26600		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26601
26602	case strings.EqualFold("InvalidRequestException", errorCode):
26603		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26604
26605	case strings.EqualFold("ResourceNotFoundException", errorCode):
26606		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
26607
26608	case strings.EqualFold("ThrottlingException", errorCode):
26609		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26610
26611	default:
26612		genericError := &smithy.GenericAPIError{
26613			Code:    errorCode,
26614			Message: errorMessage,
26615		}
26616		return genericError
26617
26618	}
26619}
26620
26621type awsRestjson1_deserializeOpReplaceTopicRule struct {
26622}
26623
26624func (*awsRestjson1_deserializeOpReplaceTopicRule) ID() string {
26625	return "OperationDeserializer"
26626}
26627
26628func (m *awsRestjson1_deserializeOpReplaceTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26629	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26630) {
26631	out, metadata, err = next.HandleDeserialize(ctx, in)
26632	if err != nil {
26633		return out, metadata, err
26634	}
26635
26636	response, ok := out.RawResponse.(*smithyhttp.Response)
26637	if !ok {
26638		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26639	}
26640
26641	if response.StatusCode < 200 || response.StatusCode >= 300 {
26642		return out, metadata, awsRestjson1_deserializeOpErrorReplaceTopicRule(response, &metadata)
26643	}
26644	output := &ReplaceTopicRuleOutput{}
26645	out.Result = output
26646
26647	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
26648		return out, metadata, &smithy.DeserializationError{
26649			Err: fmt.Errorf("failed to discard response body, %w", err),
26650		}
26651	}
26652
26653	return out, metadata, err
26654}
26655
26656func awsRestjson1_deserializeOpErrorReplaceTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26657	var errorBuffer bytes.Buffer
26658	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26659		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26660	}
26661	errorBody := bytes.NewReader(errorBuffer.Bytes())
26662
26663	errorCode := "UnknownError"
26664	errorMessage := errorCode
26665
26666	code := response.Header.Get("X-Amzn-ErrorType")
26667	if len(code) != 0 {
26668		errorCode = restjson.SanitizeErrorCode(code)
26669	}
26670
26671	var buff [1024]byte
26672	ringBuffer := smithyio.NewRingBuffer(buff[:])
26673
26674	body := io.TeeReader(errorBody, ringBuffer)
26675	decoder := json.NewDecoder(body)
26676	decoder.UseNumber()
26677	code, message, err := restjson.GetErrorInfo(decoder)
26678	if err != nil {
26679		var snapshot bytes.Buffer
26680		io.Copy(&snapshot, ringBuffer)
26681		err = &smithy.DeserializationError{
26682			Err:      fmt.Errorf("failed to decode response body, %w", err),
26683			Snapshot: snapshot.Bytes(),
26684		}
26685		return err
26686	}
26687
26688	errorBody.Seek(0, io.SeekStart)
26689	if len(code) != 0 {
26690		errorCode = restjson.SanitizeErrorCode(code)
26691	}
26692	if len(message) != 0 {
26693		errorMessage = message
26694	}
26695
26696	switch {
26697	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
26698		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
26699
26700	case strings.EqualFold("InternalException", errorCode):
26701		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
26702
26703	case strings.EqualFold("InvalidRequestException", errorCode):
26704		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26705
26706	case strings.EqualFold("ServiceUnavailableException", errorCode):
26707		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
26708
26709	case strings.EqualFold("SqlParseException", errorCode):
26710		return awsRestjson1_deserializeErrorSqlParseException(response, errorBody)
26711
26712	case strings.EqualFold("UnauthorizedException", errorCode):
26713		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
26714
26715	default:
26716		genericError := &smithy.GenericAPIError{
26717			Code:    errorCode,
26718			Message: errorMessage,
26719		}
26720		return genericError
26721
26722	}
26723}
26724
26725type awsRestjson1_deserializeOpSearchIndex struct {
26726}
26727
26728func (*awsRestjson1_deserializeOpSearchIndex) ID() string {
26729	return "OperationDeserializer"
26730}
26731
26732func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26733	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26734) {
26735	out, metadata, err = next.HandleDeserialize(ctx, in)
26736	if err != nil {
26737		return out, metadata, err
26738	}
26739
26740	response, ok := out.RawResponse.(*smithyhttp.Response)
26741	if !ok {
26742		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26743	}
26744
26745	if response.StatusCode < 200 || response.StatusCode >= 300 {
26746		return out, metadata, awsRestjson1_deserializeOpErrorSearchIndex(response, &metadata)
26747	}
26748	output := &SearchIndexOutput{}
26749	out.Result = output
26750
26751	var buff [1024]byte
26752	ringBuffer := smithyio.NewRingBuffer(buff[:])
26753
26754	body := io.TeeReader(response.Body, ringBuffer)
26755
26756	decoder := json.NewDecoder(body)
26757	decoder.UseNumber()
26758	var shape interface{}
26759	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
26760		var snapshot bytes.Buffer
26761		io.Copy(&snapshot, ringBuffer)
26762		err = &smithy.DeserializationError{
26763			Err:      fmt.Errorf("failed to decode response body, %w", err),
26764			Snapshot: snapshot.Bytes(),
26765		}
26766		return out, metadata, err
26767	}
26768
26769	err = awsRestjson1_deserializeOpDocumentSearchIndexOutput(&output, shape)
26770	if err != nil {
26771		var snapshot bytes.Buffer
26772		io.Copy(&snapshot, ringBuffer)
26773		return out, metadata, &smithy.DeserializationError{
26774			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
26775			Snapshot: snapshot.Bytes(),
26776		}
26777	}
26778
26779	return out, metadata, err
26780}
26781
26782func awsRestjson1_deserializeOpErrorSearchIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26783	var errorBuffer bytes.Buffer
26784	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26785		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26786	}
26787	errorBody := bytes.NewReader(errorBuffer.Bytes())
26788
26789	errorCode := "UnknownError"
26790	errorMessage := errorCode
26791
26792	code := response.Header.Get("X-Amzn-ErrorType")
26793	if len(code) != 0 {
26794		errorCode = restjson.SanitizeErrorCode(code)
26795	}
26796
26797	var buff [1024]byte
26798	ringBuffer := smithyio.NewRingBuffer(buff[:])
26799
26800	body := io.TeeReader(errorBody, ringBuffer)
26801	decoder := json.NewDecoder(body)
26802	decoder.UseNumber()
26803	code, message, err := restjson.GetErrorInfo(decoder)
26804	if err != nil {
26805		var snapshot bytes.Buffer
26806		io.Copy(&snapshot, ringBuffer)
26807		err = &smithy.DeserializationError{
26808			Err:      fmt.Errorf("failed to decode response body, %w", err),
26809			Snapshot: snapshot.Bytes(),
26810		}
26811		return err
26812	}
26813
26814	errorBody.Seek(0, io.SeekStart)
26815	if len(code) != 0 {
26816		errorCode = restjson.SanitizeErrorCode(code)
26817	}
26818	if len(message) != 0 {
26819		errorMessage = message
26820	}
26821
26822	switch {
26823	case strings.EqualFold("IndexNotReadyException", errorCode):
26824		return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody)
26825
26826	case strings.EqualFold("InternalFailureException", errorCode):
26827		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
26828
26829	case strings.EqualFold("InvalidQueryException", errorCode):
26830		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
26831
26832	case strings.EqualFold("InvalidRequestException", errorCode):
26833		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
26834
26835	case strings.EqualFold("ResourceNotFoundException", errorCode):
26836		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
26837
26838	case strings.EqualFold("ServiceUnavailableException", errorCode):
26839		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
26840
26841	case strings.EqualFold("ThrottlingException", errorCode):
26842		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
26843
26844	case strings.EqualFold("UnauthorizedException", errorCode):
26845		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
26846
26847	default:
26848		genericError := &smithy.GenericAPIError{
26849			Code:    errorCode,
26850			Message: errorMessage,
26851		}
26852		return genericError
26853
26854	}
26855}
26856
26857func awsRestjson1_deserializeOpDocumentSearchIndexOutput(v **SearchIndexOutput, value interface{}) error {
26858	if v == nil {
26859		return fmt.Errorf("unexpected nil of type %T", v)
26860	}
26861	if value == nil {
26862		return nil
26863	}
26864
26865	shape, ok := value.(map[string]interface{})
26866	if !ok {
26867		return fmt.Errorf("unexpected JSON type %v", value)
26868	}
26869
26870	var sv *SearchIndexOutput
26871	if *v == nil {
26872		sv = &SearchIndexOutput{}
26873	} else {
26874		sv = *v
26875	}
26876
26877	for key, value := range shape {
26878		switch key {
26879		case "nextToken":
26880			if value != nil {
26881				jtv, ok := value.(string)
26882				if !ok {
26883					return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
26884				}
26885				sv.NextToken = ptr.String(jtv)
26886			}
26887
26888		case "thingGroups":
26889			if err := awsRestjson1_deserializeDocumentThingGroupDocumentList(&sv.ThingGroups, value); err != nil {
26890				return err
26891			}
26892
26893		case "things":
26894			if err := awsRestjson1_deserializeDocumentThingDocumentList(&sv.Things, value); err != nil {
26895				return err
26896			}
26897
26898		default:
26899			_, _ = key, value
26900
26901		}
26902	}
26903	*v = sv
26904	return nil
26905}
26906
26907type awsRestjson1_deserializeOpSetDefaultAuthorizer struct {
26908}
26909
26910func (*awsRestjson1_deserializeOpSetDefaultAuthorizer) ID() string {
26911	return "OperationDeserializer"
26912}
26913
26914func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
26915	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
26916) {
26917	out, metadata, err = next.HandleDeserialize(ctx, in)
26918	if err != nil {
26919		return out, metadata, err
26920	}
26921
26922	response, ok := out.RawResponse.(*smithyhttp.Response)
26923	if !ok {
26924		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
26925	}
26926
26927	if response.StatusCode < 200 || response.StatusCode >= 300 {
26928		return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response, &metadata)
26929	}
26930	output := &SetDefaultAuthorizerOutput{}
26931	out.Result = output
26932
26933	var buff [1024]byte
26934	ringBuffer := smithyio.NewRingBuffer(buff[:])
26935
26936	body := io.TeeReader(response.Body, ringBuffer)
26937
26938	decoder := json.NewDecoder(body)
26939	decoder.UseNumber()
26940	var shape interface{}
26941	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
26942		var snapshot bytes.Buffer
26943		io.Copy(&snapshot, ringBuffer)
26944		err = &smithy.DeserializationError{
26945			Err:      fmt.Errorf("failed to decode response body, %w", err),
26946			Snapshot: snapshot.Bytes(),
26947		}
26948		return out, metadata, err
26949	}
26950
26951	err = awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(&output, shape)
26952	if err != nil {
26953		var snapshot bytes.Buffer
26954		io.Copy(&snapshot, ringBuffer)
26955		return out, metadata, &smithy.DeserializationError{
26956			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
26957			Snapshot: snapshot.Bytes(),
26958		}
26959	}
26960
26961	return out, metadata, err
26962}
26963
26964func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
26965	var errorBuffer bytes.Buffer
26966	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
26967		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
26968	}
26969	errorBody := bytes.NewReader(errorBuffer.Bytes())
26970
26971	errorCode := "UnknownError"
26972	errorMessage := errorCode
26973
26974	code := response.Header.Get("X-Amzn-ErrorType")
26975	if len(code) != 0 {
26976		errorCode = restjson.SanitizeErrorCode(code)
26977	}
26978
26979	var buff [1024]byte
26980	ringBuffer := smithyio.NewRingBuffer(buff[:])
26981
26982	body := io.TeeReader(errorBody, ringBuffer)
26983	decoder := json.NewDecoder(body)
26984	decoder.UseNumber()
26985	code, message, err := restjson.GetErrorInfo(decoder)
26986	if err != nil {
26987		var snapshot bytes.Buffer
26988		io.Copy(&snapshot, ringBuffer)
26989		err = &smithy.DeserializationError{
26990			Err:      fmt.Errorf("failed to decode response body, %w", err),
26991			Snapshot: snapshot.Bytes(),
26992		}
26993		return err
26994	}
26995
26996	errorBody.Seek(0, io.SeekStart)
26997	if len(code) != 0 {
26998		errorCode = restjson.SanitizeErrorCode(code)
26999	}
27000	if len(message) != 0 {
27001		errorMessage = message
27002	}
27003
27004	switch {
27005	case strings.EqualFold("InternalFailureException", errorCode):
27006		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
27007
27008	case strings.EqualFold("InvalidRequestException", errorCode):
27009		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27010
27011	case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
27012		return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody)
27013
27014	case strings.EqualFold("ResourceNotFoundException", errorCode):
27015		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
27016
27017	case strings.EqualFold("ServiceUnavailableException", errorCode):
27018		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
27019
27020	case strings.EqualFold("ThrottlingException", errorCode):
27021		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
27022
27023	case strings.EqualFold("UnauthorizedException", errorCode):
27024		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
27025
27026	default:
27027		genericError := &smithy.GenericAPIError{
27028			Code:    errorCode,
27029			Message: errorMessage,
27030		}
27031		return genericError
27032
27033	}
27034}
27035
27036func awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(v **SetDefaultAuthorizerOutput, value interface{}) error {
27037	if v == nil {
27038		return fmt.Errorf("unexpected nil of type %T", v)
27039	}
27040	if value == nil {
27041		return nil
27042	}
27043
27044	shape, ok := value.(map[string]interface{})
27045	if !ok {
27046		return fmt.Errorf("unexpected JSON type %v", value)
27047	}
27048
27049	var sv *SetDefaultAuthorizerOutput
27050	if *v == nil {
27051		sv = &SetDefaultAuthorizerOutput{}
27052	} else {
27053		sv = *v
27054	}
27055
27056	for key, value := range shape {
27057		switch key {
27058		case "authorizerArn":
27059			if value != nil {
27060				jtv, ok := value.(string)
27061				if !ok {
27062					return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value)
27063				}
27064				sv.AuthorizerArn = ptr.String(jtv)
27065			}
27066
27067		case "authorizerName":
27068			if value != nil {
27069				jtv, ok := value.(string)
27070				if !ok {
27071					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
27072				}
27073				sv.AuthorizerName = ptr.String(jtv)
27074			}
27075
27076		default:
27077			_, _ = key, value
27078
27079		}
27080	}
27081	*v = sv
27082	return nil
27083}
27084
27085type awsRestjson1_deserializeOpSetDefaultPolicyVersion struct {
27086}
27087
27088func (*awsRestjson1_deserializeOpSetDefaultPolicyVersion) ID() string {
27089	return "OperationDeserializer"
27090}
27091
27092func (m *awsRestjson1_deserializeOpSetDefaultPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27093	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27094) {
27095	out, metadata, err = next.HandleDeserialize(ctx, in)
27096	if err != nil {
27097		return out, metadata, err
27098	}
27099
27100	response, ok := out.RawResponse.(*smithyhttp.Response)
27101	if !ok {
27102		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27103	}
27104
27105	if response.StatusCode < 200 || response.StatusCode >= 300 {
27106		return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response, &metadata)
27107	}
27108	output := &SetDefaultPolicyVersionOutput{}
27109	out.Result = output
27110
27111	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
27112		return out, metadata, &smithy.DeserializationError{
27113			Err: fmt.Errorf("failed to discard response body, %w", err),
27114		}
27115	}
27116
27117	return out, metadata, err
27118}
27119
27120func awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27121	var errorBuffer bytes.Buffer
27122	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27123		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27124	}
27125	errorBody := bytes.NewReader(errorBuffer.Bytes())
27126
27127	errorCode := "UnknownError"
27128	errorMessage := errorCode
27129
27130	code := response.Header.Get("X-Amzn-ErrorType")
27131	if len(code) != 0 {
27132		errorCode = restjson.SanitizeErrorCode(code)
27133	}
27134
27135	var buff [1024]byte
27136	ringBuffer := smithyio.NewRingBuffer(buff[:])
27137
27138	body := io.TeeReader(errorBody, ringBuffer)
27139	decoder := json.NewDecoder(body)
27140	decoder.UseNumber()
27141	code, message, err := restjson.GetErrorInfo(decoder)
27142	if err != nil {
27143		var snapshot bytes.Buffer
27144		io.Copy(&snapshot, ringBuffer)
27145		err = &smithy.DeserializationError{
27146			Err:      fmt.Errorf("failed to decode response body, %w", err),
27147			Snapshot: snapshot.Bytes(),
27148		}
27149		return err
27150	}
27151
27152	errorBody.Seek(0, io.SeekStart)
27153	if len(code) != 0 {
27154		errorCode = restjson.SanitizeErrorCode(code)
27155	}
27156	if len(message) != 0 {
27157		errorMessage = message
27158	}
27159
27160	switch {
27161	case strings.EqualFold("InternalFailureException", errorCode):
27162		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
27163
27164	case strings.EqualFold("InvalidRequestException", errorCode):
27165		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27166
27167	case strings.EqualFold("ResourceNotFoundException", errorCode):
27168		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
27169
27170	case strings.EqualFold("ServiceUnavailableException", errorCode):
27171		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
27172
27173	case strings.EqualFold("ThrottlingException", errorCode):
27174		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
27175
27176	case strings.EqualFold("UnauthorizedException", errorCode):
27177		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
27178
27179	default:
27180		genericError := &smithy.GenericAPIError{
27181			Code:    errorCode,
27182			Message: errorMessage,
27183		}
27184		return genericError
27185
27186	}
27187}
27188
27189type awsRestjson1_deserializeOpSetLoggingOptions struct {
27190}
27191
27192func (*awsRestjson1_deserializeOpSetLoggingOptions) ID() string {
27193	return "OperationDeserializer"
27194}
27195
27196func (m *awsRestjson1_deserializeOpSetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27197	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27198) {
27199	out, metadata, err = next.HandleDeserialize(ctx, in)
27200	if err != nil {
27201		return out, metadata, err
27202	}
27203
27204	response, ok := out.RawResponse.(*smithyhttp.Response)
27205	if !ok {
27206		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27207	}
27208
27209	if response.StatusCode < 200 || response.StatusCode >= 300 {
27210		return out, metadata, awsRestjson1_deserializeOpErrorSetLoggingOptions(response, &metadata)
27211	}
27212	output := &SetLoggingOptionsOutput{}
27213	out.Result = output
27214
27215	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
27216		return out, metadata, &smithy.DeserializationError{
27217			Err: fmt.Errorf("failed to discard response body, %w", err),
27218		}
27219	}
27220
27221	return out, metadata, err
27222}
27223
27224func awsRestjson1_deserializeOpErrorSetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27225	var errorBuffer bytes.Buffer
27226	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27227		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27228	}
27229	errorBody := bytes.NewReader(errorBuffer.Bytes())
27230
27231	errorCode := "UnknownError"
27232	errorMessage := errorCode
27233
27234	code := response.Header.Get("X-Amzn-ErrorType")
27235	if len(code) != 0 {
27236		errorCode = restjson.SanitizeErrorCode(code)
27237	}
27238
27239	var buff [1024]byte
27240	ringBuffer := smithyio.NewRingBuffer(buff[:])
27241
27242	body := io.TeeReader(errorBody, ringBuffer)
27243	decoder := json.NewDecoder(body)
27244	decoder.UseNumber()
27245	code, message, err := restjson.GetErrorInfo(decoder)
27246	if err != nil {
27247		var snapshot bytes.Buffer
27248		io.Copy(&snapshot, ringBuffer)
27249		err = &smithy.DeserializationError{
27250			Err:      fmt.Errorf("failed to decode response body, %w", err),
27251			Snapshot: snapshot.Bytes(),
27252		}
27253		return err
27254	}
27255
27256	errorBody.Seek(0, io.SeekStart)
27257	if len(code) != 0 {
27258		errorCode = restjson.SanitizeErrorCode(code)
27259	}
27260	if len(message) != 0 {
27261		errorMessage = message
27262	}
27263
27264	switch {
27265	case strings.EqualFold("InternalException", errorCode):
27266		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
27267
27268	case strings.EqualFold("InvalidRequestException", errorCode):
27269		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27270
27271	case strings.EqualFold("ServiceUnavailableException", errorCode):
27272		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
27273
27274	default:
27275		genericError := &smithy.GenericAPIError{
27276			Code:    errorCode,
27277			Message: errorMessage,
27278		}
27279		return genericError
27280
27281	}
27282}
27283
27284type awsRestjson1_deserializeOpSetV2LoggingLevel struct {
27285}
27286
27287func (*awsRestjson1_deserializeOpSetV2LoggingLevel) ID() string {
27288	return "OperationDeserializer"
27289}
27290
27291func (m *awsRestjson1_deserializeOpSetV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27292	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27293) {
27294	out, metadata, err = next.HandleDeserialize(ctx, in)
27295	if err != nil {
27296		return out, metadata, err
27297	}
27298
27299	response, ok := out.RawResponse.(*smithyhttp.Response)
27300	if !ok {
27301		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27302	}
27303
27304	if response.StatusCode < 200 || response.StatusCode >= 300 {
27305		return out, metadata, awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response, &metadata)
27306	}
27307	output := &SetV2LoggingLevelOutput{}
27308	out.Result = output
27309
27310	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
27311		return out, metadata, &smithy.DeserializationError{
27312			Err: fmt.Errorf("failed to discard response body, %w", err),
27313		}
27314	}
27315
27316	return out, metadata, err
27317}
27318
27319func awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27320	var errorBuffer bytes.Buffer
27321	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27322		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27323	}
27324	errorBody := bytes.NewReader(errorBuffer.Bytes())
27325
27326	errorCode := "UnknownError"
27327	errorMessage := errorCode
27328
27329	code := response.Header.Get("X-Amzn-ErrorType")
27330	if len(code) != 0 {
27331		errorCode = restjson.SanitizeErrorCode(code)
27332	}
27333
27334	var buff [1024]byte
27335	ringBuffer := smithyio.NewRingBuffer(buff[:])
27336
27337	body := io.TeeReader(errorBody, ringBuffer)
27338	decoder := json.NewDecoder(body)
27339	decoder.UseNumber()
27340	code, message, err := restjson.GetErrorInfo(decoder)
27341	if err != nil {
27342		var snapshot bytes.Buffer
27343		io.Copy(&snapshot, ringBuffer)
27344		err = &smithy.DeserializationError{
27345			Err:      fmt.Errorf("failed to decode response body, %w", err),
27346			Snapshot: snapshot.Bytes(),
27347		}
27348		return err
27349	}
27350
27351	errorBody.Seek(0, io.SeekStart)
27352	if len(code) != 0 {
27353		errorCode = restjson.SanitizeErrorCode(code)
27354	}
27355	if len(message) != 0 {
27356		errorMessage = message
27357	}
27358
27359	switch {
27360	case strings.EqualFold("InternalException", errorCode):
27361		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
27362
27363	case strings.EqualFold("InvalidRequestException", errorCode):
27364		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27365
27366	case strings.EqualFold("LimitExceededException", errorCode):
27367		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
27368
27369	case strings.EqualFold("NotConfiguredException", errorCode):
27370		return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody)
27371
27372	case strings.EqualFold("ServiceUnavailableException", errorCode):
27373		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
27374
27375	default:
27376		genericError := &smithy.GenericAPIError{
27377			Code:    errorCode,
27378			Message: errorMessage,
27379		}
27380		return genericError
27381
27382	}
27383}
27384
27385type awsRestjson1_deserializeOpSetV2LoggingOptions struct {
27386}
27387
27388func (*awsRestjson1_deserializeOpSetV2LoggingOptions) ID() string {
27389	return "OperationDeserializer"
27390}
27391
27392func (m *awsRestjson1_deserializeOpSetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27393	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27394) {
27395	out, metadata, err = next.HandleDeserialize(ctx, in)
27396	if err != nil {
27397		return out, metadata, err
27398	}
27399
27400	response, ok := out.RawResponse.(*smithyhttp.Response)
27401	if !ok {
27402		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27403	}
27404
27405	if response.StatusCode < 200 || response.StatusCode >= 300 {
27406		return out, metadata, awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response, &metadata)
27407	}
27408	output := &SetV2LoggingOptionsOutput{}
27409	out.Result = output
27410
27411	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
27412		return out, metadata, &smithy.DeserializationError{
27413			Err: fmt.Errorf("failed to discard response body, %w", err),
27414		}
27415	}
27416
27417	return out, metadata, err
27418}
27419
27420func awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27421	var errorBuffer bytes.Buffer
27422	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27423		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27424	}
27425	errorBody := bytes.NewReader(errorBuffer.Bytes())
27426
27427	errorCode := "UnknownError"
27428	errorMessage := errorCode
27429
27430	code := response.Header.Get("X-Amzn-ErrorType")
27431	if len(code) != 0 {
27432		errorCode = restjson.SanitizeErrorCode(code)
27433	}
27434
27435	var buff [1024]byte
27436	ringBuffer := smithyio.NewRingBuffer(buff[:])
27437
27438	body := io.TeeReader(errorBody, ringBuffer)
27439	decoder := json.NewDecoder(body)
27440	decoder.UseNumber()
27441	code, message, err := restjson.GetErrorInfo(decoder)
27442	if err != nil {
27443		var snapshot bytes.Buffer
27444		io.Copy(&snapshot, ringBuffer)
27445		err = &smithy.DeserializationError{
27446			Err:      fmt.Errorf("failed to decode response body, %w", err),
27447			Snapshot: snapshot.Bytes(),
27448		}
27449		return err
27450	}
27451
27452	errorBody.Seek(0, io.SeekStart)
27453	if len(code) != 0 {
27454		errorCode = restjson.SanitizeErrorCode(code)
27455	}
27456	if len(message) != 0 {
27457		errorMessage = message
27458	}
27459
27460	switch {
27461	case strings.EqualFold("InternalException", errorCode):
27462		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
27463
27464	case strings.EqualFold("InvalidRequestException", errorCode):
27465		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27466
27467	case strings.EqualFold("ServiceUnavailableException", errorCode):
27468		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
27469
27470	default:
27471		genericError := &smithy.GenericAPIError{
27472			Code:    errorCode,
27473			Message: errorMessage,
27474		}
27475		return genericError
27476
27477	}
27478}
27479
27480type awsRestjson1_deserializeOpStartAuditMitigationActionsTask struct {
27481}
27482
27483func (*awsRestjson1_deserializeOpStartAuditMitigationActionsTask) ID() string {
27484	return "OperationDeserializer"
27485}
27486
27487func (m *awsRestjson1_deserializeOpStartAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27488	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27489) {
27490	out, metadata, err = next.HandleDeserialize(ctx, in)
27491	if err != nil {
27492		return out, metadata, err
27493	}
27494
27495	response, ok := out.RawResponse.(*smithyhttp.Response)
27496	if !ok {
27497		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27498	}
27499
27500	if response.StatusCode < 200 || response.StatusCode >= 300 {
27501		return out, metadata, awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response, &metadata)
27502	}
27503	output := &StartAuditMitigationActionsTaskOutput{}
27504	out.Result = output
27505
27506	var buff [1024]byte
27507	ringBuffer := smithyio.NewRingBuffer(buff[:])
27508
27509	body := io.TeeReader(response.Body, ringBuffer)
27510
27511	decoder := json.NewDecoder(body)
27512	decoder.UseNumber()
27513	var shape interface{}
27514	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
27515		var snapshot bytes.Buffer
27516		io.Copy(&snapshot, ringBuffer)
27517		err = &smithy.DeserializationError{
27518			Err:      fmt.Errorf("failed to decode response body, %w", err),
27519			Snapshot: snapshot.Bytes(),
27520		}
27521		return out, metadata, err
27522	}
27523
27524	err = awsRestjson1_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(&output, shape)
27525	if err != nil {
27526		var snapshot bytes.Buffer
27527		io.Copy(&snapshot, ringBuffer)
27528		return out, metadata, &smithy.DeserializationError{
27529			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
27530			Snapshot: snapshot.Bytes(),
27531		}
27532	}
27533
27534	return out, metadata, err
27535}
27536
27537func awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27538	var errorBuffer bytes.Buffer
27539	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27540		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27541	}
27542	errorBody := bytes.NewReader(errorBuffer.Bytes())
27543
27544	errorCode := "UnknownError"
27545	errorMessage := errorCode
27546
27547	code := response.Header.Get("X-Amzn-ErrorType")
27548	if len(code) != 0 {
27549		errorCode = restjson.SanitizeErrorCode(code)
27550	}
27551
27552	var buff [1024]byte
27553	ringBuffer := smithyio.NewRingBuffer(buff[:])
27554
27555	body := io.TeeReader(errorBody, ringBuffer)
27556	decoder := json.NewDecoder(body)
27557	decoder.UseNumber()
27558	code, message, err := restjson.GetErrorInfo(decoder)
27559	if err != nil {
27560		var snapshot bytes.Buffer
27561		io.Copy(&snapshot, ringBuffer)
27562		err = &smithy.DeserializationError{
27563			Err:      fmt.Errorf("failed to decode response body, %w", err),
27564			Snapshot: snapshot.Bytes(),
27565		}
27566		return err
27567	}
27568
27569	errorBody.Seek(0, io.SeekStart)
27570	if len(code) != 0 {
27571		errorCode = restjson.SanitizeErrorCode(code)
27572	}
27573	if len(message) != 0 {
27574		errorMessage = message
27575	}
27576
27577	switch {
27578	case strings.EqualFold("InternalFailureException", errorCode):
27579		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
27580
27581	case strings.EqualFold("InvalidRequestException", errorCode):
27582		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27583
27584	case strings.EqualFold("LimitExceededException", errorCode):
27585		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
27586
27587	case strings.EqualFold("TaskAlreadyExistsException", errorCode):
27588		return awsRestjson1_deserializeErrorTaskAlreadyExistsException(response, errorBody)
27589
27590	case strings.EqualFold("ThrottlingException", errorCode):
27591		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
27592
27593	default:
27594		genericError := &smithy.GenericAPIError{
27595			Code:    errorCode,
27596			Message: errorMessage,
27597		}
27598		return genericError
27599
27600	}
27601}
27602
27603func awsRestjson1_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(v **StartAuditMitigationActionsTaskOutput, value interface{}) error {
27604	if v == nil {
27605		return fmt.Errorf("unexpected nil of type %T", v)
27606	}
27607	if value == nil {
27608		return nil
27609	}
27610
27611	shape, ok := value.(map[string]interface{})
27612	if !ok {
27613		return fmt.Errorf("unexpected JSON type %v", value)
27614	}
27615
27616	var sv *StartAuditMitigationActionsTaskOutput
27617	if *v == nil {
27618		sv = &StartAuditMitigationActionsTaskOutput{}
27619	} else {
27620		sv = *v
27621	}
27622
27623	for key, value := range shape {
27624		switch key {
27625		case "taskId":
27626			if value != nil {
27627				jtv, ok := value.(string)
27628				if !ok {
27629					return fmt.Errorf("expected AuditMitigationActionsTaskId to be of type string, got %T instead", value)
27630				}
27631				sv.TaskId = ptr.String(jtv)
27632			}
27633
27634		default:
27635			_, _ = key, value
27636
27637		}
27638	}
27639	*v = sv
27640	return nil
27641}
27642
27643type awsRestjson1_deserializeOpStartOnDemandAuditTask struct {
27644}
27645
27646func (*awsRestjson1_deserializeOpStartOnDemandAuditTask) ID() string {
27647	return "OperationDeserializer"
27648}
27649
27650func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27651	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27652) {
27653	out, metadata, err = next.HandleDeserialize(ctx, in)
27654	if err != nil {
27655		return out, metadata, err
27656	}
27657
27658	response, ok := out.RawResponse.(*smithyhttp.Response)
27659	if !ok {
27660		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27661	}
27662
27663	if response.StatusCode < 200 || response.StatusCode >= 300 {
27664		return out, metadata, awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response, &metadata)
27665	}
27666	output := &StartOnDemandAuditTaskOutput{}
27667	out.Result = output
27668
27669	var buff [1024]byte
27670	ringBuffer := smithyio.NewRingBuffer(buff[:])
27671
27672	body := io.TeeReader(response.Body, ringBuffer)
27673
27674	decoder := json.NewDecoder(body)
27675	decoder.UseNumber()
27676	var shape interface{}
27677	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
27678		var snapshot bytes.Buffer
27679		io.Copy(&snapshot, ringBuffer)
27680		err = &smithy.DeserializationError{
27681			Err:      fmt.Errorf("failed to decode response body, %w", err),
27682			Snapshot: snapshot.Bytes(),
27683		}
27684		return out, metadata, err
27685	}
27686
27687	err = awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(&output, shape)
27688	if err != nil {
27689		var snapshot bytes.Buffer
27690		io.Copy(&snapshot, ringBuffer)
27691		return out, metadata, &smithy.DeserializationError{
27692			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
27693			Snapshot: snapshot.Bytes(),
27694		}
27695	}
27696
27697	return out, metadata, err
27698}
27699
27700func awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27701	var errorBuffer bytes.Buffer
27702	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27703		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27704	}
27705	errorBody := bytes.NewReader(errorBuffer.Bytes())
27706
27707	errorCode := "UnknownError"
27708	errorMessage := errorCode
27709
27710	code := response.Header.Get("X-Amzn-ErrorType")
27711	if len(code) != 0 {
27712		errorCode = restjson.SanitizeErrorCode(code)
27713	}
27714
27715	var buff [1024]byte
27716	ringBuffer := smithyio.NewRingBuffer(buff[:])
27717
27718	body := io.TeeReader(errorBody, ringBuffer)
27719	decoder := json.NewDecoder(body)
27720	decoder.UseNumber()
27721	code, message, err := restjson.GetErrorInfo(decoder)
27722	if err != nil {
27723		var snapshot bytes.Buffer
27724		io.Copy(&snapshot, ringBuffer)
27725		err = &smithy.DeserializationError{
27726			Err:      fmt.Errorf("failed to decode response body, %w", err),
27727			Snapshot: snapshot.Bytes(),
27728		}
27729		return err
27730	}
27731
27732	errorBody.Seek(0, io.SeekStart)
27733	if len(code) != 0 {
27734		errorCode = restjson.SanitizeErrorCode(code)
27735	}
27736	if len(message) != 0 {
27737		errorMessage = message
27738	}
27739
27740	switch {
27741	case strings.EqualFold("InternalFailureException", errorCode):
27742		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
27743
27744	case strings.EqualFold("InvalidRequestException", errorCode):
27745		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27746
27747	case strings.EqualFold("LimitExceededException", errorCode):
27748		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
27749
27750	case strings.EqualFold("ThrottlingException", errorCode):
27751		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
27752
27753	default:
27754		genericError := &smithy.GenericAPIError{
27755			Code:    errorCode,
27756			Message: errorMessage,
27757		}
27758		return genericError
27759
27760	}
27761}
27762
27763func awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(v **StartOnDemandAuditTaskOutput, value interface{}) error {
27764	if v == nil {
27765		return fmt.Errorf("unexpected nil of type %T", v)
27766	}
27767	if value == nil {
27768		return nil
27769	}
27770
27771	shape, ok := value.(map[string]interface{})
27772	if !ok {
27773		return fmt.Errorf("unexpected JSON type %v", value)
27774	}
27775
27776	var sv *StartOnDemandAuditTaskOutput
27777	if *v == nil {
27778		sv = &StartOnDemandAuditTaskOutput{}
27779	} else {
27780		sv = *v
27781	}
27782
27783	for key, value := range shape {
27784		switch key {
27785		case "taskId":
27786			if value != nil {
27787				jtv, ok := value.(string)
27788				if !ok {
27789					return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value)
27790				}
27791				sv.TaskId = ptr.String(jtv)
27792			}
27793
27794		default:
27795			_, _ = key, value
27796
27797		}
27798	}
27799	*v = sv
27800	return nil
27801}
27802
27803type awsRestjson1_deserializeOpStartThingRegistrationTask struct {
27804}
27805
27806func (*awsRestjson1_deserializeOpStartThingRegistrationTask) ID() string {
27807	return "OperationDeserializer"
27808}
27809
27810func (m *awsRestjson1_deserializeOpStartThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27811	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27812) {
27813	out, metadata, err = next.HandleDeserialize(ctx, in)
27814	if err != nil {
27815		return out, metadata, err
27816	}
27817
27818	response, ok := out.RawResponse.(*smithyhttp.Response)
27819	if !ok {
27820		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27821	}
27822
27823	if response.StatusCode < 200 || response.StatusCode >= 300 {
27824		return out, metadata, awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response, &metadata)
27825	}
27826	output := &StartThingRegistrationTaskOutput{}
27827	out.Result = output
27828
27829	var buff [1024]byte
27830	ringBuffer := smithyio.NewRingBuffer(buff[:])
27831
27832	body := io.TeeReader(response.Body, ringBuffer)
27833
27834	decoder := json.NewDecoder(body)
27835	decoder.UseNumber()
27836	var shape interface{}
27837	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
27838		var snapshot bytes.Buffer
27839		io.Copy(&snapshot, ringBuffer)
27840		err = &smithy.DeserializationError{
27841			Err:      fmt.Errorf("failed to decode response body, %w", err),
27842			Snapshot: snapshot.Bytes(),
27843		}
27844		return out, metadata, err
27845	}
27846
27847	err = awsRestjson1_deserializeOpDocumentStartThingRegistrationTaskOutput(&output, shape)
27848	if err != nil {
27849		var snapshot bytes.Buffer
27850		io.Copy(&snapshot, ringBuffer)
27851		return out, metadata, &smithy.DeserializationError{
27852			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
27853			Snapshot: snapshot.Bytes(),
27854		}
27855	}
27856
27857	return out, metadata, err
27858}
27859
27860func awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27861	var errorBuffer bytes.Buffer
27862	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27863		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27864	}
27865	errorBody := bytes.NewReader(errorBuffer.Bytes())
27866
27867	errorCode := "UnknownError"
27868	errorMessage := errorCode
27869
27870	code := response.Header.Get("X-Amzn-ErrorType")
27871	if len(code) != 0 {
27872		errorCode = restjson.SanitizeErrorCode(code)
27873	}
27874
27875	var buff [1024]byte
27876	ringBuffer := smithyio.NewRingBuffer(buff[:])
27877
27878	body := io.TeeReader(errorBody, ringBuffer)
27879	decoder := json.NewDecoder(body)
27880	decoder.UseNumber()
27881	code, message, err := restjson.GetErrorInfo(decoder)
27882	if err != nil {
27883		var snapshot bytes.Buffer
27884		io.Copy(&snapshot, ringBuffer)
27885		err = &smithy.DeserializationError{
27886			Err:      fmt.Errorf("failed to decode response body, %w", err),
27887			Snapshot: snapshot.Bytes(),
27888		}
27889		return err
27890	}
27891
27892	errorBody.Seek(0, io.SeekStart)
27893	if len(code) != 0 {
27894		errorCode = restjson.SanitizeErrorCode(code)
27895	}
27896	if len(message) != 0 {
27897		errorMessage = message
27898	}
27899
27900	switch {
27901	case strings.EqualFold("InternalFailureException", errorCode):
27902		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
27903
27904	case strings.EqualFold("InvalidRequestException", errorCode):
27905		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
27906
27907	case strings.EqualFold("ThrottlingException", errorCode):
27908		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
27909
27910	case strings.EqualFold("UnauthorizedException", errorCode):
27911		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
27912
27913	default:
27914		genericError := &smithy.GenericAPIError{
27915			Code:    errorCode,
27916			Message: errorMessage,
27917		}
27918		return genericError
27919
27920	}
27921}
27922
27923func awsRestjson1_deserializeOpDocumentStartThingRegistrationTaskOutput(v **StartThingRegistrationTaskOutput, value interface{}) error {
27924	if v == nil {
27925		return fmt.Errorf("unexpected nil of type %T", v)
27926	}
27927	if value == nil {
27928		return nil
27929	}
27930
27931	shape, ok := value.(map[string]interface{})
27932	if !ok {
27933		return fmt.Errorf("unexpected JSON type %v", value)
27934	}
27935
27936	var sv *StartThingRegistrationTaskOutput
27937	if *v == nil {
27938		sv = &StartThingRegistrationTaskOutput{}
27939	} else {
27940		sv = *v
27941	}
27942
27943	for key, value := range shape {
27944		switch key {
27945		case "taskId":
27946			if value != nil {
27947				jtv, ok := value.(string)
27948				if !ok {
27949					return fmt.Errorf("expected TaskId to be of type string, got %T instead", value)
27950				}
27951				sv.TaskId = ptr.String(jtv)
27952			}
27953
27954		default:
27955			_, _ = key, value
27956
27957		}
27958	}
27959	*v = sv
27960	return nil
27961}
27962
27963type awsRestjson1_deserializeOpStopThingRegistrationTask struct {
27964}
27965
27966func (*awsRestjson1_deserializeOpStopThingRegistrationTask) ID() string {
27967	return "OperationDeserializer"
27968}
27969
27970func (m *awsRestjson1_deserializeOpStopThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
27971	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
27972) {
27973	out, metadata, err = next.HandleDeserialize(ctx, in)
27974	if err != nil {
27975		return out, metadata, err
27976	}
27977
27978	response, ok := out.RawResponse.(*smithyhttp.Response)
27979	if !ok {
27980		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
27981	}
27982
27983	if response.StatusCode < 200 || response.StatusCode >= 300 {
27984		return out, metadata, awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response, &metadata)
27985	}
27986	output := &StopThingRegistrationTaskOutput{}
27987	out.Result = output
27988
27989	return out, metadata, err
27990}
27991
27992func awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
27993	var errorBuffer bytes.Buffer
27994	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
27995		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
27996	}
27997	errorBody := bytes.NewReader(errorBuffer.Bytes())
27998
27999	errorCode := "UnknownError"
28000	errorMessage := errorCode
28001
28002	code := response.Header.Get("X-Amzn-ErrorType")
28003	if len(code) != 0 {
28004		errorCode = restjson.SanitizeErrorCode(code)
28005	}
28006
28007	var buff [1024]byte
28008	ringBuffer := smithyio.NewRingBuffer(buff[:])
28009
28010	body := io.TeeReader(errorBody, ringBuffer)
28011	decoder := json.NewDecoder(body)
28012	decoder.UseNumber()
28013	code, message, err := restjson.GetErrorInfo(decoder)
28014	if err != nil {
28015		var snapshot bytes.Buffer
28016		io.Copy(&snapshot, ringBuffer)
28017		err = &smithy.DeserializationError{
28018			Err:      fmt.Errorf("failed to decode response body, %w", err),
28019			Snapshot: snapshot.Bytes(),
28020		}
28021		return err
28022	}
28023
28024	errorBody.Seek(0, io.SeekStart)
28025	if len(code) != 0 {
28026		errorCode = restjson.SanitizeErrorCode(code)
28027	}
28028	if len(message) != 0 {
28029		errorMessage = message
28030	}
28031
28032	switch {
28033	case strings.EqualFold("InternalFailureException", errorCode):
28034		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28035
28036	case strings.EqualFold("InvalidRequestException", errorCode):
28037		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28038
28039	case strings.EqualFold("ResourceNotFoundException", errorCode):
28040		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28041
28042	case strings.EqualFold("ThrottlingException", errorCode):
28043		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28044
28045	case strings.EqualFold("UnauthorizedException", errorCode):
28046		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
28047
28048	default:
28049		genericError := &smithy.GenericAPIError{
28050			Code:    errorCode,
28051			Message: errorMessage,
28052		}
28053		return genericError
28054
28055	}
28056}
28057
28058type awsRestjson1_deserializeOpTagResource struct {
28059}
28060
28061func (*awsRestjson1_deserializeOpTagResource) ID() string {
28062	return "OperationDeserializer"
28063}
28064
28065func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28066	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28067) {
28068	out, metadata, err = next.HandleDeserialize(ctx, in)
28069	if err != nil {
28070		return out, metadata, err
28071	}
28072
28073	response, ok := out.RawResponse.(*smithyhttp.Response)
28074	if !ok {
28075		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28076	}
28077
28078	if response.StatusCode < 200 || response.StatusCode >= 300 {
28079		return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
28080	}
28081	output := &TagResourceOutput{}
28082	out.Result = output
28083
28084	return out, metadata, err
28085}
28086
28087func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28088	var errorBuffer bytes.Buffer
28089	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28090		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28091	}
28092	errorBody := bytes.NewReader(errorBuffer.Bytes())
28093
28094	errorCode := "UnknownError"
28095	errorMessage := errorCode
28096
28097	code := response.Header.Get("X-Amzn-ErrorType")
28098	if len(code) != 0 {
28099		errorCode = restjson.SanitizeErrorCode(code)
28100	}
28101
28102	var buff [1024]byte
28103	ringBuffer := smithyio.NewRingBuffer(buff[:])
28104
28105	body := io.TeeReader(errorBody, ringBuffer)
28106	decoder := json.NewDecoder(body)
28107	decoder.UseNumber()
28108	code, message, err := restjson.GetErrorInfo(decoder)
28109	if err != nil {
28110		var snapshot bytes.Buffer
28111		io.Copy(&snapshot, ringBuffer)
28112		err = &smithy.DeserializationError{
28113			Err:      fmt.Errorf("failed to decode response body, %w", err),
28114			Snapshot: snapshot.Bytes(),
28115		}
28116		return err
28117	}
28118
28119	errorBody.Seek(0, io.SeekStart)
28120	if len(code) != 0 {
28121		errorCode = restjson.SanitizeErrorCode(code)
28122	}
28123	if len(message) != 0 {
28124		errorMessage = message
28125	}
28126
28127	switch {
28128	case strings.EqualFold("InternalFailureException", errorCode):
28129		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28130
28131	case strings.EqualFold("InvalidRequestException", errorCode):
28132		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28133
28134	case strings.EqualFold("LimitExceededException", errorCode):
28135		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
28136
28137	case strings.EqualFold("ResourceNotFoundException", errorCode):
28138		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28139
28140	case strings.EqualFold("ThrottlingException", errorCode):
28141		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28142
28143	default:
28144		genericError := &smithy.GenericAPIError{
28145			Code:    errorCode,
28146			Message: errorMessage,
28147		}
28148		return genericError
28149
28150	}
28151}
28152
28153type awsRestjson1_deserializeOpTestAuthorization struct {
28154}
28155
28156func (*awsRestjson1_deserializeOpTestAuthorization) ID() string {
28157	return "OperationDeserializer"
28158}
28159
28160func (m *awsRestjson1_deserializeOpTestAuthorization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28161	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28162) {
28163	out, metadata, err = next.HandleDeserialize(ctx, in)
28164	if err != nil {
28165		return out, metadata, err
28166	}
28167
28168	response, ok := out.RawResponse.(*smithyhttp.Response)
28169	if !ok {
28170		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28171	}
28172
28173	if response.StatusCode < 200 || response.StatusCode >= 300 {
28174		return out, metadata, awsRestjson1_deserializeOpErrorTestAuthorization(response, &metadata)
28175	}
28176	output := &TestAuthorizationOutput{}
28177	out.Result = output
28178
28179	var buff [1024]byte
28180	ringBuffer := smithyio.NewRingBuffer(buff[:])
28181
28182	body := io.TeeReader(response.Body, ringBuffer)
28183
28184	decoder := json.NewDecoder(body)
28185	decoder.UseNumber()
28186	var shape interface{}
28187	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
28188		var snapshot bytes.Buffer
28189		io.Copy(&snapshot, ringBuffer)
28190		err = &smithy.DeserializationError{
28191			Err:      fmt.Errorf("failed to decode response body, %w", err),
28192			Snapshot: snapshot.Bytes(),
28193		}
28194		return out, metadata, err
28195	}
28196
28197	err = awsRestjson1_deserializeOpDocumentTestAuthorizationOutput(&output, shape)
28198	if err != nil {
28199		var snapshot bytes.Buffer
28200		io.Copy(&snapshot, ringBuffer)
28201		return out, metadata, &smithy.DeserializationError{
28202			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
28203			Snapshot: snapshot.Bytes(),
28204		}
28205	}
28206
28207	return out, metadata, err
28208}
28209
28210func awsRestjson1_deserializeOpErrorTestAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28211	var errorBuffer bytes.Buffer
28212	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28213		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28214	}
28215	errorBody := bytes.NewReader(errorBuffer.Bytes())
28216
28217	errorCode := "UnknownError"
28218	errorMessage := errorCode
28219
28220	code := response.Header.Get("X-Amzn-ErrorType")
28221	if len(code) != 0 {
28222		errorCode = restjson.SanitizeErrorCode(code)
28223	}
28224
28225	var buff [1024]byte
28226	ringBuffer := smithyio.NewRingBuffer(buff[:])
28227
28228	body := io.TeeReader(errorBody, ringBuffer)
28229	decoder := json.NewDecoder(body)
28230	decoder.UseNumber()
28231	code, message, err := restjson.GetErrorInfo(decoder)
28232	if err != nil {
28233		var snapshot bytes.Buffer
28234		io.Copy(&snapshot, ringBuffer)
28235		err = &smithy.DeserializationError{
28236			Err:      fmt.Errorf("failed to decode response body, %w", err),
28237			Snapshot: snapshot.Bytes(),
28238		}
28239		return err
28240	}
28241
28242	errorBody.Seek(0, io.SeekStart)
28243	if len(code) != 0 {
28244		errorCode = restjson.SanitizeErrorCode(code)
28245	}
28246	if len(message) != 0 {
28247		errorMessage = message
28248	}
28249
28250	switch {
28251	case strings.EqualFold("InternalFailureException", errorCode):
28252		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28253
28254	case strings.EqualFold("InvalidRequestException", errorCode):
28255		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28256
28257	case strings.EqualFold("LimitExceededException", errorCode):
28258		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
28259
28260	case strings.EqualFold("ResourceNotFoundException", errorCode):
28261		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28262
28263	case strings.EqualFold("ServiceUnavailableException", errorCode):
28264		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
28265
28266	case strings.EqualFold("ThrottlingException", errorCode):
28267		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28268
28269	case strings.EqualFold("UnauthorizedException", errorCode):
28270		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
28271
28272	default:
28273		genericError := &smithy.GenericAPIError{
28274			Code:    errorCode,
28275			Message: errorMessage,
28276		}
28277		return genericError
28278
28279	}
28280}
28281
28282func awsRestjson1_deserializeOpDocumentTestAuthorizationOutput(v **TestAuthorizationOutput, value interface{}) error {
28283	if v == nil {
28284		return fmt.Errorf("unexpected nil of type %T", v)
28285	}
28286	if value == nil {
28287		return nil
28288	}
28289
28290	shape, ok := value.(map[string]interface{})
28291	if !ok {
28292		return fmt.Errorf("unexpected JSON type %v", value)
28293	}
28294
28295	var sv *TestAuthorizationOutput
28296	if *v == nil {
28297		sv = &TestAuthorizationOutput{}
28298	} else {
28299		sv = *v
28300	}
28301
28302	for key, value := range shape {
28303		switch key {
28304		case "authResults":
28305			if err := awsRestjson1_deserializeDocumentAuthResults(&sv.AuthResults, value); err != nil {
28306				return err
28307			}
28308
28309		default:
28310			_, _ = key, value
28311
28312		}
28313	}
28314	*v = sv
28315	return nil
28316}
28317
28318type awsRestjson1_deserializeOpTestInvokeAuthorizer struct {
28319}
28320
28321func (*awsRestjson1_deserializeOpTestInvokeAuthorizer) ID() string {
28322	return "OperationDeserializer"
28323}
28324
28325func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28326	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28327) {
28328	out, metadata, err = next.HandleDeserialize(ctx, in)
28329	if err != nil {
28330		return out, metadata, err
28331	}
28332
28333	response, ok := out.RawResponse.(*smithyhttp.Response)
28334	if !ok {
28335		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28336	}
28337
28338	if response.StatusCode < 200 || response.StatusCode >= 300 {
28339		return out, metadata, awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response, &metadata)
28340	}
28341	output := &TestInvokeAuthorizerOutput{}
28342	out.Result = output
28343
28344	var buff [1024]byte
28345	ringBuffer := smithyio.NewRingBuffer(buff[:])
28346
28347	body := io.TeeReader(response.Body, ringBuffer)
28348
28349	decoder := json.NewDecoder(body)
28350	decoder.UseNumber()
28351	var shape interface{}
28352	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
28353		var snapshot bytes.Buffer
28354		io.Copy(&snapshot, ringBuffer)
28355		err = &smithy.DeserializationError{
28356			Err:      fmt.Errorf("failed to decode response body, %w", err),
28357			Snapshot: snapshot.Bytes(),
28358		}
28359		return out, metadata, err
28360	}
28361
28362	err = awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(&output, shape)
28363	if err != nil {
28364		var snapshot bytes.Buffer
28365		io.Copy(&snapshot, ringBuffer)
28366		return out, metadata, &smithy.DeserializationError{
28367			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
28368			Snapshot: snapshot.Bytes(),
28369		}
28370	}
28371
28372	return out, metadata, err
28373}
28374
28375func awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28376	var errorBuffer bytes.Buffer
28377	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28378		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28379	}
28380	errorBody := bytes.NewReader(errorBuffer.Bytes())
28381
28382	errorCode := "UnknownError"
28383	errorMessage := errorCode
28384
28385	code := response.Header.Get("X-Amzn-ErrorType")
28386	if len(code) != 0 {
28387		errorCode = restjson.SanitizeErrorCode(code)
28388	}
28389
28390	var buff [1024]byte
28391	ringBuffer := smithyio.NewRingBuffer(buff[:])
28392
28393	body := io.TeeReader(errorBody, ringBuffer)
28394	decoder := json.NewDecoder(body)
28395	decoder.UseNumber()
28396	code, message, err := restjson.GetErrorInfo(decoder)
28397	if err != nil {
28398		var snapshot bytes.Buffer
28399		io.Copy(&snapshot, ringBuffer)
28400		err = &smithy.DeserializationError{
28401			Err:      fmt.Errorf("failed to decode response body, %w", err),
28402			Snapshot: snapshot.Bytes(),
28403		}
28404		return err
28405	}
28406
28407	errorBody.Seek(0, io.SeekStart)
28408	if len(code) != 0 {
28409		errorCode = restjson.SanitizeErrorCode(code)
28410	}
28411	if len(message) != 0 {
28412		errorMessage = message
28413	}
28414
28415	switch {
28416	case strings.EqualFold("InternalFailureException", errorCode):
28417		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28418
28419	case strings.EqualFold("InvalidRequestException", errorCode):
28420		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28421
28422	case strings.EqualFold("InvalidResponseException", errorCode):
28423		return awsRestjson1_deserializeErrorInvalidResponseException(response, errorBody)
28424
28425	case strings.EqualFold("ResourceNotFoundException", errorCode):
28426		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28427
28428	case strings.EqualFold("ServiceUnavailableException", errorCode):
28429		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
28430
28431	case strings.EqualFold("ThrottlingException", errorCode):
28432		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28433
28434	case strings.EqualFold("UnauthorizedException", errorCode):
28435		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
28436
28437	default:
28438		genericError := &smithy.GenericAPIError{
28439			Code:    errorCode,
28440			Message: errorMessage,
28441		}
28442		return genericError
28443
28444	}
28445}
28446
28447func awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(v **TestInvokeAuthorizerOutput, value interface{}) error {
28448	if v == nil {
28449		return fmt.Errorf("unexpected nil of type %T", v)
28450	}
28451	if value == nil {
28452		return nil
28453	}
28454
28455	shape, ok := value.(map[string]interface{})
28456	if !ok {
28457		return fmt.Errorf("unexpected JSON type %v", value)
28458	}
28459
28460	var sv *TestInvokeAuthorizerOutput
28461	if *v == nil {
28462		sv = &TestInvokeAuthorizerOutput{}
28463	} else {
28464		sv = *v
28465	}
28466
28467	for key, value := range shape {
28468		switch key {
28469		case "disconnectAfterInSeconds":
28470			if value != nil {
28471				jtv, ok := value.(json.Number)
28472				if !ok {
28473					return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
28474				}
28475				i64, err := jtv.Int64()
28476				if err != nil {
28477					return err
28478				}
28479				sv.DisconnectAfterInSeconds = ptr.Int32(int32(i64))
28480			}
28481
28482		case "isAuthenticated":
28483			if value != nil {
28484				jtv, ok := value.(bool)
28485				if !ok {
28486					return fmt.Errorf("expected IsAuthenticated to be of type *bool, got %T instead", value)
28487				}
28488				sv.IsAuthenticated = ptr.Bool(jtv)
28489			}
28490
28491		case "policyDocuments":
28492			if err := awsRestjson1_deserializeDocumentPolicyDocuments(&sv.PolicyDocuments, value); err != nil {
28493				return err
28494			}
28495
28496		case "principalId":
28497			if value != nil {
28498				jtv, ok := value.(string)
28499				if !ok {
28500					return fmt.Errorf("expected PrincipalId to be of type string, got %T instead", value)
28501				}
28502				sv.PrincipalId = ptr.String(jtv)
28503			}
28504
28505		case "refreshAfterInSeconds":
28506			if value != nil {
28507				jtv, ok := value.(json.Number)
28508				if !ok {
28509					return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value)
28510				}
28511				i64, err := jtv.Int64()
28512				if err != nil {
28513					return err
28514				}
28515				sv.RefreshAfterInSeconds = ptr.Int32(int32(i64))
28516			}
28517
28518		default:
28519			_, _ = key, value
28520
28521		}
28522	}
28523	*v = sv
28524	return nil
28525}
28526
28527type awsRestjson1_deserializeOpTransferCertificate struct {
28528}
28529
28530func (*awsRestjson1_deserializeOpTransferCertificate) ID() string {
28531	return "OperationDeserializer"
28532}
28533
28534func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28535	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28536) {
28537	out, metadata, err = next.HandleDeserialize(ctx, in)
28538	if err != nil {
28539		return out, metadata, err
28540	}
28541
28542	response, ok := out.RawResponse.(*smithyhttp.Response)
28543	if !ok {
28544		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28545	}
28546
28547	if response.StatusCode < 200 || response.StatusCode >= 300 {
28548		return out, metadata, awsRestjson1_deserializeOpErrorTransferCertificate(response, &metadata)
28549	}
28550	output := &TransferCertificateOutput{}
28551	out.Result = output
28552
28553	var buff [1024]byte
28554	ringBuffer := smithyio.NewRingBuffer(buff[:])
28555
28556	body := io.TeeReader(response.Body, ringBuffer)
28557
28558	decoder := json.NewDecoder(body)
28559	decoder.UseNumber()
28560	var shape interface{}
28561	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
28562		var snapshot bytes.Buffer
28563		io.Copy(&snapshot, ringBuffer)
28564		err = &smithy.DeserializationError{
28565			Err:      fmt.Errorf("failed to decode response body, %w", err),
28566			Snapshot: snapshot.Bytes(),
28567		}
28568		return out, metadata, err
28569	}
28570
28571	err = awsRestjson1_deserializeOpDocumentTransferCertificateOutput(&output, shape)
28572	if err != nil {
28573		var snapshot bytes.Buffer
28574		io.Copy(&snapshot, ringBuffer)
28575		return out, metadata, &smithy.DeserializationError{
28576			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
28577			Snapshot: snapshot.Bytes(),
28578		}
28579	}
28580
28581	return out, metadata, err
28582}
28583
28584func awsRestjson1_deserializeOpErrorTransferCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28585	var errorBuffer bytes.Buffer
28586	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28587		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28588	}
28589	errorBody := bytes.NewReader(errorBuffer.Bytes())
28590
28591	errorCode := "UnknownError"
28592	errorMessage := errorCode
28593
28594	code := response.Header.Get("X-Amzn-ErrorType")
28595	if len(code) != 0 {
28596		errorCode = restjson.SanitizeErrorCode(code)
28597	}
28598
28599	var buff [1024]byte
28600	ringBuffer := smithyio.NewRingBuffer(buff[:])
28601
28602	body := io.TeeReader(errorBody, ringBuffer)
28603	decoder := json.NewDecoder(body)
28604	decoder.UseNumber()
28605	code, message, err := restjson.GetErrorInfo(decoder)
28606	if err != nil {
28607		var snapshot bytes.Buffer
28608		io.Copy(&snapshot, ringBuffer)
28609		err = &smithy.DeserializationError{
28610			Err:      fmt.Errorf("failed to decode response body, %w", err),
28611			Snapshot: snapshot.Bytes(),
28612		}
28613		return err
28614	}
28615
28616	errorBody.Seek(0, io.SeekStart)
28617	if len(code) != 0 {
28618		errorCode = restjson.SanitizeErrorCode(code)
28619	}
28620	if len(message) != 0 {
28621		errorMessage = message
28622	}
28623
28624	switch {
28625	case strings.EqualFold("CertificateStateException", errorCode):
28626		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
28627
28628	case strings.EqualFold("InternalFailureException", errorCode):
28629		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28630
28631	case strings.EqualFold("InvalidRequestException", errorCode):
28632		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28633
28634	case strings.EqualFold("ResourceNotFoundException", errorCode):
28635		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28636
28637	case strings.EqualFold("ServiceUnavailableException", errorCode):
28638		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
28639
28640	case strings.EqualFold("ThrottlingException", errorCode):
28641		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28642
28643	case strings.EqualFold("TransferConflictException", errorCode):
28644		return awsRestjson1_deserializeErrorTransferConflictException(response, errorBody)
28645
28646	case strings.EqualFold("UnauthorizedException", errorCode):
28647		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
28648
28649	default:
28650		genericError := &smithy.GenericAPIError{
28651			Code:    errorCode,
28652			Message: errorMessage,
28653		}
28654		return genericError
28655
28656	}
28657}
28658
28659func awsRestjson1_deserializeOpDocumentTransferCertificateOutput(v **TransferCertificateOutput, value interface{}) error {
28660	if v == nil {
28661		return fmt.Errorf("unexpected nil of type %T", v)
28662	}
28663	if value == nil {
28664		return nil
28665	}
28666
28667	shape, ok := value.(map[string]interface{})
28668	if !ok {
28669		return fmt.Errorf("unexpected JSON type %v", value)
28670	}
28671
28672	var sv *TransferCertificateOutput
28673	if *v == nil {
28674		sv = &TransferCertificateOutput{}
28675	} else {
28676		sv = *v
28677	}
28678
28679	for key, value := range shape {
28680		switch key {
28681		case "transferredCertificateArn":
28682			if value != nil {
28683				jtv, ok := value.(string)
28684				if !ok {
28685					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
28686				}
28687				sv.TransferredCertificateArn = ptr.String(jtv)
28688			}
28689
28690		default:
28691			_, _ = key, value
28692
28693		}
28694	}
28695	*v = sv
28696	return nil
28697}
28698
28699type awsRestjson1_deserializeOpUntagResource struct {
28700}
28701
28702func (*awsRestjson1_deserializeOpUntagResource) ID() string {
28703	return "OperationDeserializer"
28704}
28705
28706func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28707	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28708) {
28709	out, metadata, err = next.HandleDeserialize(ctx, in)
28710	if err != nil {
28711		return out, metadata, err
28712	}
28713
28714	response, ok := out.RawResponse.(*smithyhttp.Response)
28715	if !ok {
28716		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28717	}
28718
28719	if response.StatusCode < 200 || response.StatusCode >= 300 {
28720		return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
28721	}
28722	output := &UntagResourceOutput{}
28723	out.Result = output
28724
28725	return out, metadata, err
28726}
28727
28728func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28729	var errorBuffer bytes.Buffer
28730	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28731		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28732	}
28733	errorBody := bytes.NewReader(errorBuffer.Bytes())
28734
28735	errorCode := "UnknownError"
28736	errorMessage := errorCode
28737
28738	code := response.Header.Get("X-Amzn-ErrorType")
28739	if len(code) != 0 {
28740		errorCode = restjson.SanitizeErrorCode(code)
28741	}
28742
28743	var buff [1024]byte
28744	ringBuffer := smithyio.NewRingBuffer(buff[:])
28745
28746	body := io.TeeReader(errorBody, ringBuffer)
28747	decoder := json.NewDecoder(body)
28748	decoder.UseNumber()
28749	code, message, err := restjson.GetErrorInfo(decoder)
28750	if err != nil {
28751		var snapshot bytes.Buffer
28752		io.Copy(&snapshot, ringBuffer)
28753		err = &smithy.DeserializationError{
28754			Err:      fmt.Errorf("failed to decode response body, %w", err),
28755			Snapshot: snapshot.Bytes(),
28756		}
28757		return err
28758	}
28759
28760	errorBody.Seek(0, io.SeekStart)
28761	if len(code) != 0 {
28762		errorCode = restjson.SanitizeErrorCode(code)
28763	}
28764	if len(message) != 0 {
28765		errorMessage = message
28766	}
28767
28768	switch {
28769	case strings.EqualFold("InternalFailureException", errorCode):
28770		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28771
28772	case strings.EqualFold("InvalidRequestException", errorCode):
28773		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28774
28775	case strings.EqualFold("ResourceNotFoundException", errorCode):
28776		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28777
28778	case strings.EqualFold("ThrottlingException", errorCode):
28779		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28780
28781	default:
28782		genericError := &smithy.GenericAPIError{
28783			Code:    errorCode,
28784			Message: errorMessage,
28785		}
28786		return genericError
28787
28788	}
28789}
28790
28791type awsRestjson1_deserializeOpUpdateAccountAuditConfiguration struct {
28792}
28793
28794func (*awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) ID() string {
28795	return "OperationDeserializer"
28796}
28797
28798func (m *awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28799	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28800) {
28801	out, metadata, err = next.HandleDeserialize(ctx, in)
28802	if err != nil {
28803		return out, metadata, err
28804	}
28805
28806	response, ok := out.RawResponse.(*smithyhttp.Response)
28807	if !ok {
28808		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28809	}
28810
28811	if response.StatusCode < 200 || response.StatusCode >= 300 {
28812		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response, &metadata)
28813	}
28814	output := &UpdateAccountAuditConfigurationOutput{}
28815	out.Result = output
28816
28817	return out, metadata, err
28818}
28819
28820func awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28821	var errorBuffer bytes.Buffer
28822	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28823		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28824	}
28825	errorBody := bytes.NewReader(errorBuffer.Bytes())
28826
28827	errorCode := "UnknownError"
28828	errorMessage := errorCode
28829
28830	code := response.Header.Get("X-Amzn-ErrorType")
28831	if len(code) != 0 {
28832		errorCode = restjson.SanitizeErrorCode(code)
28833	}
28834
28835	var buff [1024]byte
28836	ringBuffer := smithyio.NewRingBuffer(buff[:])
28837
28838	body := io.TeeReader(errorBody, ringBuffer)
28839	decoder := json.NewDecoder(body)
28840	decoder.UseNumber()
28841	code, message, err := restjson.GetErrorInfo(decoder)
28842	if err != nil {
28843		var snapshot bytes.Buffer
28844		io.Copy(&snapshot, ringBuffer)
28845		err = &smithy.DeserializationError{
28846			Err:      fmt.Errorf("failed to decode response body, %w", err),
28847			Snapshot: snapshot.Bytes(),
28848		}
28849		return err
28850	}
28851
28852	errorBody.Seek(0, io.SeekStart)
28853	if len(code) != 0 {
28854		errorCode = restjson.SanitizeErrorCode(code)
28855	}
28856	if len(message) != 0 {
28857		errorMessage = message
28858	}
28859
28860	switch {
28861	case strings.EqualFold("InternalFailureException", errorCode):
28862		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28863
28864	case strings.EqualFold("InvalidRequestException", errorCode):
28865		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28866
28867	case strings.EqualFold("ThrottlingException", errorCode):
28868		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28869
28870	default:
28871		genericError := &smithy.GenericAPIError{
28872			Code:    errorCode,
28873			Message: errorMessage,
28874		}
28875		return genericError
28876
28877	}
28878}
28879
28880type awsRestjson1_deserializeOpUpdateAuditSuppression struct {
28881}
28882
28883func (*awsRestjson1_deserializeOpUpdateAuditSuppression) ID() string {
28884	return "OperationDeserializer"
28885}
28886
28887func (m *awsRestjson1_deserializeOpUpdateAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28888	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28889) {
28890	out, metadata, err = next.HandleDeserialize(ctx, in)
28891	if err != nil {
28892		return out, metadata, err
28893	}
28894
28895	response, ok := out.RawResponse.(*smithyhttp.Response)
28896	if !ok {
28897		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28898	}
28899
28900	if response.StatusCode < 200 || response.StatusCode >= 300 {
28901		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response, &metadata)
28902	}
28903	output := &UpdateAuditSuppressionOutput{}
28904	out.Result = output
28905
28906	return out, metadata, err
28907}
28908
28909func awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error {
28910	var errorBuffer bytes.Buffer
28911	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
28912		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
28913	}
28914	errorBody := bytes.NewReader(errorBuffer.Bytes())
28915
28916	errorCode := "UnknownError"
28917	errorMessage := errorCode
28918
28919	code := response.Header.Get("X-Amzn-ErrorType")
28920	if len(code) != 0 {
28921		errorCode = restjson.SanitizeErrorCode(code)
28922	}
28923
28924	var buff [1024]byte
28925	ringBuffer := smithyio.NewRingBuffer(buff[:])
28926
28927	body := io.TeeReader(errorBody, ringBuffer)
28928	decoder := json.NewDecoder(body)
28929	decoder.UseNumber()
28930	code, message, err := restjson.GetErrorInfo(decoder)
28931	if err != nil {
28932		var snapshot bytes.Buffer
28933		io.Copy(&snapshot, ringBuffer)
28934		err = &smithy.DeserializationError{
28935			Err:      fmt.Errorf("failed to decode response body, %w", err),
28936			Snapshot: snapshot.Bytes(),
28937		}
28938		return err
28939	}
28940
28941	errorBody.Seek(0, io.SeekStart)
28942	if len(code) != 0 {
28943		errorCode = restjson.SanitizeErrorCode(code)
28944	}
28945	if len(message) != 0 {
28946		errorMessage = message
28947	}
28948
28949	switch {
28950	case strings.EqualFold("InternalFailureException", errorCode):
28951		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
28952
28953	case strings.EqualFold("InvalidRequestException", errorCode):
28954		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
28955
28956	case strings.EqualFold("ResourceNotFoundException", errorCode):
28957		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
28958
28959	case strings.EqualFold("ThrottlingException", errorCode):
28960		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
28961
28962	default:
28963		genericError := &smithy.GenericAPIError{
28964			Code:    errorCode,
28965			Message: errorMessage,
28966		}
28967		return genericError
28968
28969	}
28970}
28971
28972type awsRestjson1_deserializeOpUpdateAuthorizer struct {
28973}
28974
28975func (*awsRestjson1_deserializeOpUpdateAuthorizer) ID() string {
28976	return "OperationDeserializer"
28977}
28978
28979func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
28980	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
28981) {
28982	out, metadata, err = next.HandleDeserialize(ctx, in)
28983	if err != nil {
28984		return out, metadata, err
28985	}
28986
28987	response, ok := out.RawResponse.(*smithyhttp.Response)
28988	if !ok {
28989		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
28990	}
28991
28992	if response.StatusCode < 200 || response.StatusCode >= 300 {
28993		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuthorizer(response, &metadata)
28994	}
28995	output := &UpdateAuthorizerOutput{}
28996	out.Result = output
28997
28998	var buff [1024]byte
28999	ringBuffer := smithyio.NewRingBuffer(buff[:])
29000
29001	body := io.TeeReader(response.Body, ringBuffer)
29002
29003	decoder := json.NewDecoder(body)
29004	decoder.UseNumber()
29005	var shape interface{}
29006	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
29007		var snapshot bytes.Buffer
29008		io.Copy(&snapshot, ringBuffer)
29009		err = &smithy.DeserializationError{
29010			Err:      fmt.Errorf("failed to decode response body, %w", err),
29011			Snapshot: snapshot.Bytes(),
29012		}
29013		return out, metadata, err
29014	}
29015
29016	err = awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(&output, shape)
29017	if err != nil {
29018		var snapshot bytes.Buffer
29019		io.Copy(&snapshot, ringBuffer)
29020		return out, metadata, &smithy.DeserializationError{
29021			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
29022			Snapshot: snapshot.Bytes(),
29023		}
29024	}
29025
29026	return out, metadata, err
29027}
29028
29029func awsRestjson1_deserializeOpErrorUpdateAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29030	var errorBuffer bytes.Buffer
29031	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29032		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29033	}
29034	errorBody := bytes.NewReader(errorBuffer.Bytes())
29035
29036	errorCode := "UnknownError"
29037	errorMessage := errorCode
29038
29039	code := response.Header.Get("X-Amzn-ErrorType")
29040	if len(code) != 0 {
29041		errorCode = restjson.SanitizeErrorCode(code)
29042	}
29043
29044	var buff [1024]byte
29045	ringBuffer := smithyio.NewRingBuffer(buff[:])
29046
29047	body := io.TeeReader(errorBody, ringBuffer)
29048	decoder := json.NewDecoder(body)
29049	decoder.UseNumber()
29050	code, message, err := restjson.GetErrorInfo(decoder)
29051	if err != nil {
29052		var snapshot bytes.Buffer
29053		io.Copy(&snapshot, ringBuffer)
29054		err = &smithy.DeserializationError{
29055			Err:      fmt.Errorf("failed to decode response body, %w", err),
29056			Snapshot: snapshot.Bytes(),
29057		}
29058		return err
29059	}
29060
29061	errorBody.Seek(0, io.SeekStart)
29062	if len(code) != 0 {
29063		errorCode = restjson.SanitizeErrorCode(code)
29064	}
29065	if len(message) != 0 {
29066		errorMessage = message
29067	}
29068
29069	switch {
29070	case strings.EqualFold("InternalFailureException", errorCode):
29071		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29072
29073	case strings.EqualFold("InvalidRequestException", errorCode):
29074		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29075
29076	case strings.EqualFold("LimitExceededException", errorCode):
29077		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
29078
29079	case strings.EqualFold("ResourceNotFoundException", errorCode):
29080		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29081
29082	case strings.EqualFold("ServiceUnavailableException", errorCode):
29083		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
29084
29085	case strings.EqualFold("ThrottlingException", errorCode):
29086		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29087
29088	case strings.EqualFold("UnauthorizedException", errorCode):
29089		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
29090
29091	default:
29092		genericError := &smithy.GenericAPIError{
29093			Code:    errorCode,
29094			Message: errorMessage,
29095		}
29096		return genericError
29097
29098	}
29099}
29100
29101func awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(v **UpdateAuthorizerOutput, value interface{}) error {
29102	if v == nil {
29103		return fmt.Errorf("unexpected nil of type %T", v)
29104	}
29105	if value == nil {
29106		return nil
29107	}
29108
29109	shape, ok := value.(map[string]interface{})
29110	if !ok {
29111		return fmt.Errorf("unexpected JSON type %v", value)
29112	}
29113
29114	var sv *UpdateAuthorizerOutput
29115	if *v == nil {
29116		sv = &UpdateAuthorizerOutput{}
29117	} else {
29118		sv = *v
29119	}
29120
29121	for key, value := range shape {
29122		switch key {
29123		case "authorizerArn":
29124			if value != nil {
29125				jtv, ok := value.(string)
29126				if !ok {
29127					return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value)
29128				}
29129				sv.AuthorizerArn = ptr.String(jtv)
29130			}
29131
29132		case "authorizerName":
29133			if value != nil {
29134				jtv, ok := value.(string)
29135				if !ok {
29136					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
29137				}
29138				sv.AuthorizerName = ptr.String(jtv)
29139			}
29140
29141		default:
29142			_, _ = key, value
29143
29144		}
29145	}
29146	*v = sv
29147	return nil
29148}
29149
29150type awsRestjson1_deserializeOpUpdateBillingGroup struct {
29151}
29152
29153func (*awsRestjson1_deserializeOpUpdateBillingGroup) ID() string {
29154	return "OperationDeserializer"
29155}
29156
29157func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29158	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29159) {
29160	out, metadata, err = next.HandleDeserialize(ctx, in)
29161	if err != nil {
29162		return out, metadata, err
29163	}
29164
29165	response, ok := out.RawResponse.(*smithyhttp.Response)
29166	if !ok {
29167		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29168	}
29169
29170	if response.StatusCode < 200 || response.StatusCode >= 300 {
29171		return out, metadata, awsRestjson1_deserializeOpErrorUpdateBillingGroup(response, &metadata)
29172	}
29173	output := &UpdateBillingGroupOutput{}
29174	out.Result = output
29175
29176	var buff [1024]byte
29177	ringBuffer := smithyio.NewRingBuffer(buff[:])
29178
29179	body := io.TeeReader(response.Body, ringBuffer)
29180
29181	decoder := json.NewDecoder(body)
29182	decoder.UseNumber()
29183	var shape interface{}
29184	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
29185		var snapshot bytes.Buffer
29186		io.Copy(&snapshot, ringBuffer)
29187		err = &smithy.DeserializationError{
29188			Err:      fmt.Errorf("failed to decode response body, %w", err),
29189			Snapshot: snapshot.Bytes(),
29190		}
29191		return out, metadata, err
29192	}
29193
29194	err = awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(&output, shape)
29195	if err != nil {
29196		var snapshot bytes.Buffer
29197		io.Copy(&snapshot, ringBuffer)
29198		return out, metadata, &smithy.DeserializationError{
29199			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
29200			Snapshot: snapshot.Bytes(),
29201		}
29202	}
29203
29204	return out, metadata, err
29205}
29206
29207func awsRestjson1_deserializeOpErrorUpdateBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29208	var errorBuffer bytes.Buffer
29209	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29210		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29211	}
29212	errorBody := bytes.NewReader(errorBuffer.Bytes())
29213
29214	errorCode := "UnknownError"
29215	errorMessage := errorCode
29216
29217	code := response.Header.Get("X-Amzn-ErrorType")
29218	if len(code) != 0 {
29219		errorCode = restjson.SanitizeErrorCode(code)
29220	}
29221
29222	var buff [1024]byte
29223	ringBuffer := smithyio.NewRingBuffer(buff[:])
29224
29225	body := io.TeeReader(errorBody, ringBuffer)
29226	decoder := json.NewDecoder(body)
29227	decoder.UseNumber()
29228	code, message, err := restjson.GetErrorInfo(decoder)
29229	if err != nil {
29230		var snapshot bytes.Buffer
29231		io.Copy(&snapshot, ringBuffer)
29232		err = &smithy.DeserializationError{
29233			Err:      fmt.Errorf("failed to decode response body, %w", err),
29234			Snapshot: snapshot.Bytes(),
29235		}
29236		return err
29237	}
29238
29239	errorBody.Seek(0, io.SeekStart)
29240	if len(code) != 0 {
29241		errorCode = restjson.SanitizeErrorCode(code)
29242	}
29243	if len(message) != 0 {
29244		errorMessage = message
29245	}
29246
29247	switch {
29248	case strings.EqualFold("InternalFailureException", errorCode):
29249		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29250
29251	case strings.EqualFold("InvalidRequestException", errorCode):
29252		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29253
29254	case strings.EqualFold("ResourceNotFoundException", errorCode):
29255		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29256
29257	case strings.EqualFold("ThrottlingException", errorCode):
29258		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29259
29260	case strings.EqualFold("VersionConflictException", errorCode):
29261		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
29262
29263	default:
29264		genericError := &smithy.GenericAPIError{
29265			Code:    errorCode,
29266			Message: errorMessage,
29267		}
29268		return genericError
29269
29270	}
29271}
29272
29273func awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(v **UpdateBillingGroupOutput, value interface{}) error {
29274	if v == nil {
29275		return fmt.Errorf("unexpected nil of type %T", v)
29276	}
29277	if value == nil {
29278		return nil
29279	}
29280
29281	shape, ok := value.(map[string]interface{})
29282	if !ok {
29283		return fmt.Errorf("unexpected JSON type %v", value)
29284	}
29285
29286	var sv *UpdateBillingGroupOutput
29287	if *v == nil {
29288		sv = &UpdateBillingGroupOutput{}
29289	} else {
29290		sv = *v
29291	}
29292
29293	for key, value := range shape {
29294		switch key {
29295		case "version":
29296			if value != nil {
29297				jtv, ok := value.(json.Number)
29298				if !ok {
29299					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
29300				}
29301				i64, err := jtv.Int64()
29302				if err != nil {
29303					return err
29304				}
29305				sv.Version = i64
29306			}
29307
29308		default:
29309			_, _ = key, value
29310
29311		}
29312	}
29313	*v = sv
29314	return nil
29315}
29316
29317type awsRestjson1_deserializeOpUpdateCACertificate struct {
29318}
29319
29320func (*awsRestjson1_deserializeOpUpdateCACertificate) ID() string {
29321	return "OperationDeserializer"
29322}
29323
29324func (m *awsRestjson1_deserializeOpUpdateCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29325	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29326) {
29327	out, metadata, err = next.HandleDeserialize(ctx, in)
29328	if err != nil {
29329		return out, metadata, err
29330	}
29331
29332	response, ok := out.RawResponse.(*smithyhttp.Response)
29333	if !ok {
29334		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29335	}
29336
29337	if response.StatusCode < 200 || response.StatusCode >= 300 {
29338		return out, metadata, awsRestjson1_deserializeOpErrorUpdateCACertificate(response, &metadata)
29339	}
29340	output := &UpdateCACertificateOutput{}
29341	out.Result = output
29342
29343	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
29344		return out, metadata, &smithy.DeserializationError{
29345			Err: fmt.Errorf("failed to discard response body, %w", err),
29346		}
29347	}
29348
29349	return out, metadata, err
29350}
29351
29352func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29353	var errorBuffer bytes.Buffer
29354	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29355		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29356	}
29357	errorBody := bytes.NewReader(errorBuffer.Bytes())
29358
29359	errorCode := "UnknownError"
29360	errorMessage := errorCode
29361
29362	code := response.Header.Get("X-Amzn-ErrorType")
29363	if len(code) != 0 {
29364		errorCode = restjson.SanitizeErrorCode(code)
29365	}
29366
29367	var buff [1024]byte
29368	ringBuffer := smithyio.NewRingBuffer(buff[:])
29369
29370	body := io.TeeReader(errorBody, ringBuffer)
29371	decoder := json.NewDecoder(body)
29372	decoder.UseNumber()
29373	code, message, err := restjson.GetErrorInfo(decoder)
29374	if err != nil {
29375		var snapshot bytes.Buffer
29376		io.Copy(&snapshot, ringBuffer)
29377		err = &smithy.DeserializationError{
29378			Err:      fmt.Errorf("failed to decode response body, %w", err),
29379			Snapshot: snapshot.Bytes(),
29380		}
29381		return err
29382	}
29383
29384	errorBody.Seek(0, io.SeekStart)
29385	if len(code) != 0 {
29386		errorCode = restjson.SanitizeErrorCode(code)
29387	}
29388	if len(message) != 0 {
29389		errorMessage = message
29390	}
29391
29392	switch {
29393	case strings.EqualFold("InternalFailureException", errorCode):
29394		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29395
29396	case strings.EqualFold("InvalidRequestException", errorCode):
29397		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29398
29399	case strings.EqualFold("ResourceNotFoundException", errorCode):
29400		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29401
29402	case strings.EqualFold("ServiceUnavailableException", errorCode):
29403		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
29404
29405	case strings.EqualFold("ThrottlingException", errorCode):
29406		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29407
29408	case strings.EqualFold("UnauthorizedException", errorCode):
29409		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
29410
29411	default:
29412		genericError := &smithy.GenericAPIError{
29413			Code:    errorCode,
29414			Message: errorMessage,
29415		}
29416		return genericError
29417
29418	}
29419}
29420
29421type awsRestjson1_deserializeOpUpdateCertificate struct {
29422}
29423
29424func (*awsRestjson1_deserializeOpUpdateCertificate) ID() string {
29425	return "OperationDeserializer"
29426}
29427
29428func (m *awsRestjson1_deserializeOpUpdateCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29429	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29430) {
29431	out, metadata, err = next.HandleDeserialize(ctx, in)
29432	if err != nil {
29433		return out, metadata, err
29434	}
29435
29436	response, ok := out.RawResponse.(*smithyhttp.Response)
29437	if !ok {
29438		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29439	}
29440
29441	if response.StatusCode < 200 || response.StatusCode >= 300 {
29442		return out, metadata, awsRestjson1_deserializeOpErrorUpdateCertificate(response, &metadata)
29443	}
29444	output := &UpdateCertificateOutput{}
29445	out.Result = output
29446
29447	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
29448		return out, metadata, &smithy.DeserializationError{
29449			Err: fmt.Errorf("failed to discard response body, %w", err),
29450		}
29451	}
29452
29453	return out, metadata, err
29454}
29455
29456func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29457	var errorBuffer bytes.Buffer
29458	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29459		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29460	}
29461	errorBody := bytes.NewReader(errorBuffer.Bytes())
29462
29463	errorCode := "UnknownError"
29464	errorMessage := errorCode
29465
29466	code := response.Header.Get("X-Amzn-ErrorType")
29467	if len(code) != 0 {
29468		errorCode = restjson.SanitizeErrorCode(code)
29469	}
29470
29471	var buff [1024]byte
29472	ringBuffer := smithyio.NewRingBuffer(buff[:])
29473
29474	body := io.TeeReader(errorBody, ringBuffer)
29475	decoder := json.NewDecoder(body)
29476	decoder.UseNumber()
29477	code, message, err := restjson.GetErrorInfo(decoder)
29478	if err != nil {
29479		var snapshot bytes.Buffer
29480		io.Copy(&snapshot, ringBuffer)
29481		err = &smithy.DeserializationError{
29482			Err:      fmt.Errorf("failed to decode response body, %w", err),
29483			Snapshot: snapshot.Bytes(),
29484		}
29485		return err
29486	}
29487
29488	errorBody.Seek(0, io.SeekStart)
29489	if len(code) != 0 {
29490		errorCode = restjson.SanitizeErrorCode(code)
29491	}
29492	if len(message) != 0 {
29493		errorMessage = message
29494	}
29495
29496	switch {
29497	case strings.EqualFold("CertificateStateException", errorCode):
29498		return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody)
29499
29500	case strings.EqualFold("InternalFailureException", errorCode):
29501		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29502
29503	case strings.EqualFold("InvalidRequestException", errorCode):
29504		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29505
29506	case strings.EqualFold("ResourceNotFoundException", errorCode):
29507		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29508
29509	case strings.EqualFold("ServiceUnavailableException", errorCode):
29510		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
29511
29512	case strings.EqualFold("ThrottlingException", errorCode):
29513		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29514
29515	case strings.EqualFold("UnauthorizedException", errorCode):
29516		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
29517
29518	default:
29519		genericError := &smithy.GenericAPIError{
29520			Code:    errorCode,
29521			Message: errorMessage,
29522		}
29523		return genericError
29524
29525	}
29526}
29527
29528type awsRestjson1_deserializeOpUpdateDimension struct {
29529}
29530
29531func (*awsRestjson1_deserializeOpUpdateDimension) ID() string {
29532	return "OperationDeserializer"
29533}
29534
29535func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29536	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29537) {
29538	out, metadata, err = next.HandleDeserialize(ctx, in)
29539	if err != nil {
29540		return out, metadata, err
29541	}
29542
29543	response, ok := out.RawResponse.(*smithyhttp.Response)
29544	if !ok {
29545		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29546	}
29547
29548	if response.StatusCode < 200 || response.StatusCode >= 300 {
29549		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDimension(response, &metadata)
29550	}
29551	output := &UpdateDimensionOutput{}
29552	out.Result = output
29553
29554	var buff [1024]byte
29555	ringBuffer := smithyio.NewRingBuffer(buff[:])
29556
29557	body := io.TeeReader(response.Body, ringBuffer)
29558
29559	decoder := json.NewDecoder(body)
29560	decoder.UseNumber()
29561	var shape interface{}
29562	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
29563		var snapshot bytes.Buffer
29564		io.Copy(&snapshot, ringBuffer)
29565		err = &smithy.DeserializationError{
29566			Err:      fmt.Errorf("failed to decode response body, %w", err),
29567			Snapshot: snapshot.Bytes(),
29568		}
29569		return out, metadata, err
29570	}
29571
29572	err = awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(&output, shape)
29573	if err != nil {
29574		var snapshot bytes.Buffer
29575		io.Copy(&snapshot, ringBuffer)
29576		return out, metadata, &smithy.DeserializationError{
29577			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
29578			Snapshot: snapshot.Bytes(),
29579		}
29580	}
29581
29582	return out, metadata, err
29583}
29584
29585func awsRestjson1_deserializeOpErrorUpdateDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29586	var errorBuffer bytes.Buffer
29587	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29588		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29589	}
29590	errorBody := bytes.NewReader(errorBuffer.Bytes())
29591
29592	errorCode := "UnknownError"
29593	errorMessage := errorCode
29594
29595	code := response.Header.Get("X-Amzn-ErrorType")
29596	if len(code) != 0 {
29597		errorCode = restjson.SanitizeErrorCode(code)
29598	}
29599
29600	var buff [1024]byte
29601	ringBuffer := smithyio.NewRingBuffer(buff[:])
29602
29603	body := io.TeeReader(errorBody, ringBuffer)
29604	decoder := json.NewDecoder(body)
29605	decoder.UseNumber()
29606	code, message, err := restjson.GetErrorInfo(decoder)
29607	if err != nil {
29608		var snapshot bytes.Buffer
29609		io.Copy(&snapshot, ringBuffer)
29610		err = &smithy.DeserializationError{
29611			Err:      fmt.Errorf("failed to decode response body, %w", err),
29612			Snapshot: snapshot.Bytes(),
29613		}
29614		return err
29615	}
29616
29617	errorBody.Seek(0, io.SeekStart)
29618	if len(code) != 0 {
29619		errorCode = restjson.SanitizeErrorCode(code)
29620	}
29621	if len(message) != 0 {
29622		errorMessage = message
29623	}
29624
29625	switch {
29626	case strings.EqualFold("InternalFailureException", errorCode):
29627		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29628
29629	case strings.EqualFold("InvalidRequestException", errorCode):
29630		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29631
29632	case strings.EqualFold("ResourceNotFoundException", errorCode):
29633		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29634
29635	case strings.EqualFold("ThrottlingException", errorCode):
29636		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29637
29638	default:
29639		genericError := &smithy.GenericAPIError{
29640			Code:    errorCode,
29641			Message: errorMessage,
29642		}
29643		return genericError
29644
29645	}
29646}
29647
29648func awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(v **UpdateDimensionOutput, value interface{}) error {
29649	if v == nil {
29650		return fmt.Errorf("unexpected nil of type %T", v)
29651	}
29652	if value == nil {
29653		return nil
29654	}
29655
29656	shape, ok := value.(map[string]interface{})
29657	if !ok {
29658		return fmt.Errorf("unexpected JSON type %v", value)
29659	}
29660
29661	var sv *UpdateDimensionOutput
29662	if *v == nil {
29663		sv = &UpdateDimensionOutput{}
29664	} else {
29665		sv = *v
29666	}
29667
29668	for key, value := range shape {
29669		switch key {
29670		case "arn":
29671			if value != nil {
29672				jtv, ok := value.(string)
29673				if !ok {
29674					return fmt.Errorf("expected DimensionArn to be of type string, got %T instead", value)
29675				}
29676				sv.Arn = ptr.String(jtv)
29677			}
29678
29679		case "creationDate":
29680			if value != nil {
29681				jtv, ok := value.(json.Number)
29682				if !ok {
29683					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
29684				}
29685				f64, err := jtv.Float64()
29686				if err != nil {
29687					return err
29688				}
29689				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
29690			}
29691
29692		case "lastModifiedDate":
29693			if value != nil {
29694				jtv, ok := value.(json.Number)
29695				if !ok {
29696					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
29697				}
29698				f64, err := jtv.Float64()
29699				if err != nil {
29700					return err
29701				}
29702				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
29703			}
29704
29705		case "name":
29706			if value != nil {
29707				jtv, ok := value.(string)
29708				if !ok {
29709					return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
29710				}
29711				sv.Name = ptr.String(jtv)
29712			}
29713
29714		case "stringValues":
29715			if err := awsRestjson1_deserializeDocumentDimensionStringValues(&sv.StringValues, value); err != nil {
29716				return err
29717			}
29718
29719		case "type":
29720			if value != nil {
29721				jtv, ok := value.(string)
29722				if !ok {
29723					return fmt.Errorf("expected DimensionType to be of type string, got %T instead", value)
29724				}
29725				sv.Type = types.DimensionType(jtv)
29726			}
29727
29728		default:
29729			_, _ = key, value
29730
29731		}
29732	}
29733	*v = sv
29734	return nil
29735}
29736
29737type awsRestjson1_deserializeOpUpdateDomainConfiguration struct {
29738}
29739
29740func (*awsRestjson1_deserializeOpUpdateDomainConfiguration) ID() string {
29741	return "OperationDeserializer"
29742}
29743
29744func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29745	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29746) {
29747	out, metadata, err = next.HandleDeserialize(ctx, in)
29748	if err != nil {
29749		return out, metadata, err
29750	}
29751
29752	response, ok := out.RawResponse.(*smithyhttp.Response)
29753	if !ok {
29754		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29755	}
29756
29757	if response.StatusCode < 200 || response.StatusCode >= 300 {
29758		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response, &metadata)
29759	}
29760	output := &UpdateDomainConfigurationOutput{}
29761	out.Result = output
29762
29763	var buff [1024]byte
29764	ringBuffer := smithyio.NewRingBuffer(buff[:])
29765
29766	body := io.TeeReader(response.Body, ringBuffer)
29767
29768	decoder := json.NewDecoder(body)
29769	decoder.UseNumber()
29770	var shape interface{}
29771	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
29772		var snapshot bytes.Buffer
29773		io.Copy(&snapshot, ringBuffer)
29774		err = &smithy.DeserializationError{
29775			Err:      fmt.Errorf("failed to decode response body, %w", err),
29776			Snapshot: snapshot.Bytes(),
29777		}
29778		return out, metadata, err
29779	}
29780
29781	err = awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(&output, shape)
29782	if err != nil {
29783		var snapshot bytes.Buffer
29784		io.Copy(&snapshot, ringBuffer)
29785		return out, metadata, &smithy.DeserializationError{
29786			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
29787			Snapshot: snapshot.Bytes(),
29788		}
29789	}
29790
29791	return out, metadata, err
29792}
29793
29794func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29795	var errorBuffer bytes.Buffer
29796	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29797		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29798	}
29799	errorBody := bytes.NewReader(errorBuffer.Bytes())
29800
29801	errorCode := "UnknownError"
29802	errorMessage := errorCode
29803
29804	code := response.Header.Get("X-Amzn-ErrorType")
29805	if len(code) != 0 {
29806		errorCode = restjson.SanitizeErrorCode(code)
29807	}
29808
29809	var buff [1024]byte
29810	ringBuffer := smithyio.NewRingBuffer(buff[:])
29811
29812	body := io.TeeReader(errorBody, ringBuffer)
29813	decoder := json.NewDecoder(body)
29814	decoder.UseNumber()
29815	code, message, err := restjson.GetErrorInfo(decoder)
29816	if err != nil {
29817		var snapshot bytes.Buffer
29818		io.Copy(&snapshot, ringBuffer)
29819		err = &smithy.DeserializationError{
29820			Err:      fmt.Errorf("failed to decode response body, %w", err),
29821			Snapshot: snapshot.Bytes(),
29822		}
29823		return err
29824	}
29825
29826	errorBody.Seek(0, io.SeekStart)
29827	if len(code) != 0 {
29828		errorCode = restjson.SanitizeErrorCode(code)
29829	}
29830	if len(message) != 0 {
29831		errorMessage = message
29832	}
29833
29834	switch {
29835	case strings.EqualFold("CertificateValidationException", errorCode):
29836		return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody)
29837
29838	case strings.EqualFold("InternalFailureException", errorCode):
29839		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
29840
29841	case strings.EqualFold("InvalidRequestException", errorCode):
29842		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
29843
29844	case strings.EqualFold("ResourceNotFoundException", errorCode):
29845		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
29846
29847	case strings.EqualFold("ServiceUnavailableException", errorCode):
29848		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
29849
29850	case strings.EqualFold("ThrottlingException", errorCode):
29851		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
29852
29853	case strings.EqualFold("UnauthorizedException", errorCode):
29854		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
29855
29856	default:
29857		genericError := &smithy.GenericAPIError{
29858			Code:    errorCode,
29859			Message: errorMessage,
29860		}
29861		return genericError
29862
29863	}
29864}
29865
29866func awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(v **UpdateDomainConfigurationOutput, value interface{}) error {
29867	if v == nil {
29868		return fmt.Errorf("unexpected nil of type %T", v)
29869	}
29870	if value == nil {
29871		return nil
29872	}
29873
29874	shape, ok := value.(map[string]interface{})
29875	if !ok {
29876		return fmt.Errorf("unexpected JSON type %v", value)
29877	}
29878
29879	var sv *UpdateDomainConfigurationOutput
29880	if *v == nil {
29881		sv = &UpdateDomainConfigurationOutput{}
29882	} else {
29883		sv = *v
29884	}
29885
29886	for key, value := range shape {
29887		switch key {
29888		case "domainConfigurationArn":
29889			if value != nil {
29890				jtv, ok := value.(string)
29891				if !ok {
29892					return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value)
29893				}
29894				sv.DomainConfigurationArn = ptr.String(jtv)
29895			}
29896
29897		case "domainConfigurationName":
29898			if value != nil {
29899				jtv, ok := value.(string)
29900				if !ok {
29901					return fmt.Errorf("expected ReservedDomainConfigurationName to be of type string, got %T instead", value)
29902				}
29903				sv.DomainConfigurationName = ptr.String(jtv)
29904			}
29905
29906		default:
29907			_, _ = key, value
29908
29909		}
29910	}
29911	*v = sv
29912	return nil
29913}
29914
29915type awsRestjson1_deserializeOpUpdateDynamicThingGroup struct {
29916}
29917
29918func (*awsRestjson1_deserializeOpUpdateDynamicThingGroup) ID() string {
29919	return "OperationDeserializer"
29920}
29921
29922func (m *awsRestjson1_deserializeOpUpdateDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
29923	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
29924) {
29925	out, metadata, err = next.HandleDeserialize(ctx, in)
29926	if err != nil {
29927		return out, metadata, err
29928	}
29929
29930	response, ok := out.RawResponse.(*smithyhttp.Response)
29931	if !ok {
29932		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
29933	}
29934
29935	if response.StatusCode < 200 || response.StatusCode >= 300 {
29936		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response, &metadata)
29937	}
29938	output := &UpdateDynamicThingGroupOutput{}
29939	out.Result = output
29940
29941	var buff [1024]byte
29942	ringBuffer := smithyio.NewRingBuffer(buff[:])
29943
29944	body := io.TeeReader(response.Body, ringBuffer)
29945
29946	decoder := json.NewDecoder(body)
29947	decoder.UseNumber()
29948	var shape interface{}
29949	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
29950		var snapshot bytes.Buffer
29951		io.Copy(&snapshot, ringBuffer)
29952		err = &smithy.DeserializationError{
29953			Err:      fmt.Errorf("failed to decode response body, %w", err),
29954			Snapshot: snapshot.Bytes(),
29955		}
29956		return out, metadata, err
29957	}
29958
29959	err = awsRestjson1_deserializeOpDocumentUpdateDynamicThingGroupOutput(&output, shape)
29960	if err != nil {
29961		var snapshot bytes.Buffer
29962		io.Copy(&snapshot, ringBuffer)
29963		return out, metadata, &smithy.DeserializationError{
29964			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
29965			Snapshot: snapshot.Bytes(),
29966		}
29967	}
29968
29969	return out, metadata, err
29970}
29971
29972func awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
29973	var errorBuffer bytes.Buffer
29974	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
29975		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
29976	}
29977	errorBody := bytes.NewReader(errorBuffer.Bytes())
29978
29979	errorCode := "UnknownError"
29980	errorMessage := errorCode
29981
29982	code := response.Header.Get("X-Amzn-ErrorType")
29983	if len(code) != 0 {
29984		errorCode = restjson.SanitizeErrorCode(code)
29985	}
29986
29987	var buff [1024]byte
29988	ringBuffer := smithyio.NewRingBuffer(buff[:])
29989
29990	body := io.TeeReader(errorBody, ringBuffer)
29991	decoder := json.NewDecoder(body)
29992	decoder.UseNumber()
29993	code, message, err := restjson.GetErrorInfo(decoder)
29994	if err != nil {
29995		var snapshot bytes.Buffer
29996		io.Copy(&snapshot, ringBuffer)
29997		err = &smithy.DeserializationError{
29998			Err:      fmt.Errorf("failed to decode response body, %w", err),
29999			Snapshot: snapshot.Bytes(),
30000		}
30001		return err
30002	}
30003
30004	errorBody.Seek(0, io.SeekStart)
30005	if len(code) != 0 {
30006		errorCode = restjson.SanitizeErrorCode(code)
30007	}
30008	if len(message) != 0 {
30009		errorMessage = message
30010	}
30011
30012	switch {
30013	case strings.EqualFold("InternalFailureException", errorCode):
30014		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30015
30016	case strings.EqualFold("InvalidQueryException", errorCode):
30017		return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody)
30018
30019	case strings.EqualFold("InvalidRequestException", errorCode):
30020		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30021
30022	case strings.EqualFold("ResourceNotFoundException", errorCode):
30023		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30024
30025	case strings.EqualFold("ThrottlingException", errorCode):
30026		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30027
30028	case strings.EqualFold("VersionConflictException", errorCode):
30029		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
30030
30031	default:
30032		genericError := &smithy.GenericAPIError{
30033			Code:    errorCode,
30034			Message: errorMessage,
30035		}
30036		return genericError
30037
30038	}
30039}
30040
30041func awsRestjson1_deserializeOpDocumentUpdateDynamicThingGroupOutput(v **UpdateDynamicThingGroupOutput, value interface{}) error {
30042	if v == nil {
30043		return fmt.Errorf("unexpected nil of type %T", v)
30044	}
30045	if value == nil {
30046		return nil
30047	}
30048
30049	shape, ok := value.(map[string]interface{})
30050	if !ok {
30051		return fmt.Errorf("unexpected JSON type %v", value)
30052	}
30053
30054	var sv *UpdateDynamicThingGroupOutput
30055	if *v == nil {
30056		sv = &UpdateDynamicThingGroupOutput{}
30057	} else {
30058		sv = *v
30059	}
30060
30061	for key, value := range shape {
30062		switch key {
30063		case "version":
30064			if value != nil {
30065				jtv, ok := value.(json.Number)
30066				if !ok {
30067					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
30068				}
30069				i64, err := jtv.Int64()
30070				if err != nil {
30071					return err
30072				}
30073				sv.Version = i64
30074			}
30075
30076		default:
30077			_, _ = key, value
30078
30079		}
30080	}
30081	*v = sv
30082	return nil
30083}
30084
30085type awsRestjson1_deserializeOpUpdateEventConfigurations struct {
30086}
30087
30088func (*awsRestjson1_deserializeOpUpdateEventConfigurations) ID() string {
30089	return "OperationDeserializer"
30090}
30091
30092func (m *awsRestjson1_deserializeOpUpdateEventConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30093	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30094) {
30095	out, metadata, err = next.HandleDeserialize(ctx, in)
30096	if err != nil {
30097		return out, metadata, err
30098	}
30099
30100	response, ok := out.RawResponse.(*smithyhttp.Response)
30101	if !ok {
30102		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30103	}
30104
30105	if response.StatusCode < 200 || response.StatusCode >= 300 {
30106		return out, metadata, awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response, &metadata)
30107	}
30108	output := &UpdateEventConfigurationsOutput{}
30109	out.Result = output
30110
30111	return out, metadata, err
30112}
30113
30114func awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30115	var errorBuffer bytes.Buffer
30116	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30117		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30118	}
30119	errorBody := bytes.NewReader(errorBuffer.Bytes())
30120
30121	errorCode := "UnknownError"
30122	errorMessage := errorCode
30123
30124	code := response.Header.Get("X-Amzn-ErrorType")
30125	if len(code) != 0 {
30126		errorCode = restjson.SanitizeErrorCode(code)
30127	}
30128
30129	var buff [1024]byte
30130	ringBuffer := smithyio.NewRingBuffer(buff[:])
30131
30132	body := io.TeeReader(errorBody, ringBuffer)
30133	decoder := json.NewDecoder(body)
30134	decoder.UseNumber()
30135	code, message, err := restjson.GetErrorInfo(decoder)
30136	if err != nil {
30137		var snapshot bytes.Buffer
30138		io.Copy(&snapshot, ringBuffer)
30139		err = &smithy.DeserializationError{
30140			Err:      fmt.Errorf("failed to decode response body, %w", err),
30141			Snapshot: snapshot.Bytes(),
30142		}
30143		return err
30144	}
30145
30146	errorBody.Seek(0, io.SeekStart)
30147	if len(code) != 0 {
30148		errorCode = restjson.SanitizeErrorCode(code)
30149	}
30150	if len(message) != 0 {
30151		errorMessage = message
30152	}
30153
30154	switch {
30155	case strings.EqualFold("InternalFailureException", errorCode):
30156		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30157
30158	case strings.EqualFold("InvalidRequestException", errorCode):
30159		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30160
30161	case strings.EqualFold("ThrottlingException", errorCode):
30162		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30163
30164	default:
30165		genericError := &smithy.GenericAPIError{
30166			Code:    errorCode,
30167			Message: errorMessage,
30168		}
30169		return genericError
30170
30171	}
30172}
30173
30174type awsRestjson1_deserializeOpUpdateIndexingConfiguration struct {
30175}
30176
30177func (*awsRestjson1_deserializeOpUpdateIndexingConfiguration) ID() string {
30178	return "OperationDeserializer"
30179}
30180
30181func (m *awsRestjson1_deserializeOpUpdateIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30182	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30183) {
30184	out, metadata, err = next.HandleDeserialize(ctx, in)
30185	if err != nil {
30186		return out, metadata, err
30187	}
30188
30189	response, ok := out.RawResponse.(*smithyhttp.Response)
30190	if !ok {
30191		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30192	}
30193
30194	if response.StatusCode < 200 || response.StatusCode >= 300 {
30195		return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response, &metadata)
30196	}
30197	output := &UpdateIndexingConfigurationOutput{}
30198	out.Result = output
30199
30200	return out, metadata, err
30201}
30202
30203func awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30204	var errorBuffer bytes.Buffer
30205	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30206		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30207	}
30208	errorBody := bytes.NewReader(errorBuffer.Bytes())
30209
30210	errorCode := "UnknownError"
30211	errorMessage := errorCode
30212
30213	code := response.Header.Get("X-Amzn-ErrorType")
30214	if len(code) != 0 {
30215		errorCode = restjson.SanitizeErrorCode(code)
30216	}
30217
30218	var buff [1024]byte
30219	ringBuffer := smithyio.NewRingBuffer(buff[:])
30220
30221	body := io.TeeReader(errorBody, ringBuffer)
30222	decoder := json.NewDecoder(body)
30223	decoder.UseNumber()
30224	code, message, err := restjson.GetErrorInfo(decoder)
30225	if err != nil {
30226		var snapshot bytes.Buffer
30227		io.Copy(&snapshot, ringBuffer)
30228		err = &smithy.DeserializationError{
30229			Err:      fmt.Errorf("failed to decode response body, %w", err),
30230			Snapshot: snapshot.Bytes(),
30231		}
30232		return err
30233	}
30234
30235	errorBody.Seek(0, io.SeekStart)
30236	if len(code) != 0 {
30237		errorCode = restjson.SanitizeErrorCode(code)
30238	}
30239	if len(message) != 0 {
30240		errorMessage = message
30241	}
30242
30243	switch {
30244	case strings.EqualFold("InternalFailureException", errorCode):
30245		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30246
30247	case strings.EqualFold("InvalidRequestException", errorCode):
30248		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30249
30250	case strings.EqualFold("ServiceUnavailableException", errorCode):
30251		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
30252
30253	case strings.EqualFold("ThrottlingException", errorCode):
30254		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30255
30256	case strings.EqualFold("UnauthorizedException", errorCode):
30257		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
30258
30259	default:
30260		genericError := &smithy.GenericAPIError{
30261			Code:    errorCode,
30262			Message: errorMessage,
30263		}
30264		return genericError
30265
30266	}
30267}
30268
30269type awsRestjson1_deserializeOpUpdateJob struct {
30270}
30271
30272func (*awsRestjson1_deserializeOpUpdateJob) ID() string {
30273	return "OperationDeserializer"
30274}
30275
30276func (m *awsRestjson1_deserializeOpUpdateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30277	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30278) {
30279	out, metadata, err = next.HandleDeserialize(ctx, in)
30280	if err != nil {
30281		return out, metadata, err
30282	}
30283
30284	response, ok := out.RawResponse.(*smithyhttp.Response)
30285	if !ok {
30286		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30287	}
30288
30289	if response.StatusCode < 200 || response.StatusCode >= 300 {
30290		return out, metadata, awsRestjson1_deserializeOpErrorUpdateJob(response, &metadata)
30291	}
30292	output := &UpdateJobOutput{}
30293	out.Result = output
30294
30295	if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
30296		return out, metadata, &smithy.DeserializationError{
30297			Err: fmt.Errorf("failed to discard response body, %w", err),
30298		}
30299	}
30300
30301	return out, metadata, err
30302}
30303
30304func awsRestjson1_deserializeOpErrorUpdateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30305	var errorBuffer bytes.Buffer
30306	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30307		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30308	}
30309	errorBody := bytes.NewReader(errorBuffer.Bytes())
30310
30311	errorCode := "UnknownError"
30312	errorMessage := errorCode
30313
30314	code := response.Header.Get("X-Amzn-ErrorType")
30315	if len(code) != 0 {
30316		errorCode = restjson.SanitizeErrorCode(code)
30317	}
30318
30319	var buff [1024]byte
30320	ringBuffer := smithyio.NewRingBuffer(buff[:])
30321
30322	body := io.TeeReader(errorBody, ringBuffer)
30323	decoder := json.NewDecoder(body)
30324	decoder.UseNumber()
30325	code, message, err := restjson.GetErrorInfo(decoder)
30326	if err != nil {
30327		var snapshot bytes.Buffer
30328		io.Copy(&snapshot, ringBuffer)
30329		err = &smithy.DeserializationError{
30330			Err:      fmt.Errorf("failed to decode response body, %w", err),
30331			Snapshot: snapshot.Bytes(),
30332		}
30333		return err
30334	}
30335
30336	errorBody.Seek(0, io.SeekStart)
30337	if len(code) != 0 {
30338		errorCode = restjson.SanitizeErrorCode(code)
30339	}
30340	if len(message) != 0 {
30341		errorMessage = message
30342	}
30343
30344	switch {
30345	case strings.EqualFold("InvalidRequestException", errorCode):
30346		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30347
30348	case strings.EqualFold("ResourceNotFoundException", errorCode):
30349		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30350
30351	case strings.EqualFold("ServiceUnavailableException", errorCode):
30352		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
30353
30354	case strings.EqualFold("ThrottlingException", errorCode):
30355		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30356
30357	default:
30358		genericError := &smithy.GenericAPIError{
30359			Code:    errorCode,
30360			Message: errorMessage,
30361		}
30362		return genericError
30363
30364	}
30365}
30366
30367type awsRestjson1_deserializeOpUpdateMitigationAction struct {
30368}
30369
30370func (*awsRestjson1_deserializeOpUpdateMitigationAction) ID() string {
30371	return "OperationDeserializer"
30372}
30373
30374func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30375	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30376) {
30377	out, metadata, err = next.HandleDeserialize(ctx, in)
30378	if err != nil {
30379		return out, metadata, err
30380	}
30381
30382	response, ok := out.RawResponse.(*smithyhttp.Response)
30383	if !ok {
30384		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30385	}
30386
30387	if response.StatusCode < 200 || response.StatusCode >= 300 {
30388		return out, metadata, awsRestjson1_deserializeOpErrorUpdateMitigationAction(response, &metadata)
30389	}
30390	output := &UpdateMitigationActionOutput{}
30391	out.Result = output
30392
30393	var buff [1024]byte
30394	ringBuffer := smithyio.NewRingBuffer(buff[:])
30395
30396	body := io.TeeReader(response.Body, ringBuffer)
30397
30398	decoder := json.NewDecoder(body)
30399	decoder.UseNumber()
30400	var shape interface{}
30401	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
30402		var snapshot bytes.Buffer
30403		io.Copy(&snapshot, ringBuffer)
30404		err = &smithy.DeserializationError{
30405			Err:      fmt.Errorf("failed to decode response body, %w", err),
30406			Snapshot: snapshot.Bytes(),
30407		}
30408		return out, metadata, err
30409	}
30410
30411	err = awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(&output, shape)
30412	if err != nil {
30413		var snapshot bytes.Buffer
30414		io.Copy(&snapshot, ringBuffer)
30415		return out, metadata, &smithy.DeserializationError{
30416			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
30417			Snapshot: snapshot.Bytes(),
30418		}
30419	}
30420
30421	return out, metadata, err
30422}
30423
30424func awsRestjson1_deserializeOpErrorUpdateMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30425	var errorBuffer bytes.Buffer
30426	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30427		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30428	}
30429	errorBody := bytes.NewReader(errorBuffer.Bytes())
30430
30431	errorCode := "UnknownError"
30432	errorMessage := errorCode
30433
30434	code := response.Header.Get("X-Amzn-ErrorType")
30435	if len(code) != 0 {
30436		errorCode = restjson.SanitizeErrorCode(code)
30437	}
30438
30439	var buff [1024]byte
30440	ringBuffer := smithyio.NewRingBuffer(buff[:])
30441
30442	body := io.TeeReader(errorBody, ringBuffer)
30443	decoder := json.NewDecoder(body)
30444	decoder.UseNumber()
30445	code, message, err := restjson.GetErrorInfo(decoder)
30446	if err != nil {
30447		var snapshot bytes.Buffer
30448		io.Copy(&snapshot, ringBuffer)
30449		err = &smithy.DeserializationError{
30450			Err:      fmt.Errorf("failed to decode response body, %w", err),
30451			Snapshot: snapshot.Bytes(),
30452		}
30453		return err
30454	}
30455
30456	errorBody.Seek(0, io.SeekStart)
30457	if len(code) != 0 {
30458		errorCode = restjson.SanitizeErrorCode(code)
30459	}
30460	if len(message) != 0 {
30461		errorMessage = message
30462	}
30463
30464	switch {
30465	case strings.EqualFold("InternalFailureException", errorCode):
30466		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30467
30468	case strings.EqualFold("InvalidRequestException", errorCode):
30469		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30470
30471	case strings.EqualFold("ResourceNotFoundException", errorCode):
30472		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30473
30474	case strings.EqualFold("ThrottlingException", errorCode):
30475		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30476
30477	default:
30478		genericError := &smithy.GenericAPIError{
30479			Code:    errorCode,
30480			Message: errorMessage,
30481		}
30482		return genericError
30483
30484	}
30485}
30486
30487func awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(v **UpdateMitigationActionOutput, value interface{}) error {
30488	if v == nil {
30489		return fmt.Errorf("unexpected nil of type %T", v)
30490	}
30491	if value == nil {
30492		return nil
30493	}
30494
30495	shape, ok := value.(map[string]interface{})
30496	if !ok {
30497		return fmt.Errorf("unexpected JSON type %v", value)
30498	}
30499
30500	var sv *UpdateMitigationActionOutput
30501	if *v == nil {
30502		sv = &UpdateMitigationActionOutput{}
30503	} else {
30504		sv = *v
30505	}
30506
30507	for key, value := range shape {
30508		switch key {
30509		case "actionArn":
30510			if value != nil {
30511				jtv, ok := value.(string)
30512				if !ok {
30513					return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value)
30514				}
30515				sv.ActionArn = ptr.String(jtv)
30516			}
30517
30518		case "actionId":
30519			if value != nil {
30520				jtv, ok := value.(string)
30521				if !ok {
30522					return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value)
30523				}
30524				sv.ActionId = ptr.String(jtv)
30525			}
30526
30527		default:
30528			_, _ = key, value
30529
30530		}
30531	}
30532	*v = sv
30533	return nil
30534}
30535
30536type awsRestjson1_deserializeOpUpdateProvisioningTemplate struct {
30537}
30538
30539func (*awsRestjson1_deserializeOpUpdateProvisioningTemplate) ID() string {
30540	return "OperationDeserializer"
30541}
30542
30543func (m *awsRestjson1_deserializeOpUpdateProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30544	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30545) {
30546	out, metadata, err = next.HandleDeserialize(ctx, in)
30547	if err != nil {
30548		return out, metadata, err
30549	}
30550
30551	response, ok := out.RawResponse.(*smithyhttp.Response)
30552	if !ok {
30553		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30554	}
30555
30556	if response.StatusCode < 200 || response.StatusCode >= 300 {
30557		return out, metadata, awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response, &metadata)
30558	}
30559	output := &UpdateProvisioningTemplateOutput{}
30560	out.Result = output
30561
30562	return out, metadata, err
30563}
30564
30565func awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30566	var errorBuffer bytes.Buffer
30567	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30568		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30569	}
30570	errorBody := bytes.NewReader(errorBuffer.Bytes())
30571
30572	errorCode := "UnknownError"
30573	errorMessage := errorCode
30574
30575	code := response.Header.Get("X-Amzn-ErrorType")
30576	if len(code) != 0 {
30577		errorCode = restjson.SanitizeErrorCode(code)
30578	}
30579
30580	var buff [1024]byte
30581	ringBuffer := smithyio.NewRingBuffer(buff[:])
30582
30583	body := io.TeeReader(errorBody, ringBuffer)
30584	decoder := json.NewDecoder(body)
30585	decoder.UseNumber()
30586	code, message, err := restjson.GetErrorInfo(decoder)
30587	if err != nil {
30588		var snapshot bytes.Buffer
30589		io.Copy(&snapshot, ringBuffer)
30590		err = &smithy.DeserializationError{
30591			Err:      fmt.Errorf("failed to decode response body, %w", err),
30592			Snapshot: snapshot.Bytes(),
30593		}
30594		return err
30595	}
30596
30597	errorBody.Seek(0, io.SeekStart)
30598	if len(code) != 0 {
30599		errorCode = restjson.SanitizeErrorCode(code)
30600	}
30601	if len(message) != 0 {
30602		errorMessage = message
30603	}
30604
30605	switch {
30606	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
30607		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
30608
30609	case strings.EqualFold("InternalFailureException", errorCode):
30610		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30611
30612	case strings.EqualFold("InvalidRequestException", errorCode):
30613		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30614
30615	case strings.EqualFold("ResourceNotFoundException", errorCode):
30616		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30617
30618	case strings.EqualFold("UnauthorizedException", errorCode):
30619		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
30620
30621	default:
30622		genericError := &smithy.GenericAPIError{
30623			Code:    errorCode,
30624			Message: errorMessage,
30625		}
30626		return genericError
30627
30628	}
30629}
30630
30631type awsRestjson1_deserializeOpUpdateRoleAlias struct {
30632}
30633
30634func (*awsRestjson1_deserializeOpUpdateRoleAlias) ID() string {
30635	return "OperationDeserializer"
30636}
30637
30638func (m *awsRestjson1_deserializeOpUpdateRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30639	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30640) {
30641	out, metadata, err = next.HandleDeserialize(ctx, in)
30642	if err != nil {
30643		return out, metadata, err
30644	}
30645
30646	response, ok := out.RawResponse.(*smithyhttp.Response)
30647	if !ok {
30648		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30649	}
30650
30651	if response.StatusCode < 200 || response.StatusCode >= 300 {
30652		return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoleAlias(response, &metadata)
30653	}
30654	output := &UpdateRoleAliasOutput{}
30655	out.Result = output
30656
30657	var buff [1024]byte
30658	ringBuffer := smithyio.NewRingBuffer(buff[:])
30659
30660	body := io.TeeReader(response.Body, ringBuffer)
30661
30662	decoder := json.NewDecoder(body)
30663	decoder.UseNumber()
30664	var shape interface{}
30665	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
30666		var snapshot bytes.Buffer
30667		io.Copy(&snapshot, ringBuffer)
30668		err = &smithy.DeserializationError{
30669			Err:      fmt.Errorf("failed to decode response body, %w", err),
30670			Snapshot: snapshot.Bytes(),
30671		}
30672		return out, metadata, err
30673	}
30674
30675	err = awsRestjson1_deserializeOpDocumentUpdateRoleAliasOutput(&output, shape)
30676	if err != nil {
30677		var snapshot bytes.Buffer
30678		io.Copy(&snapshot, ringBuffer)
30679		return out, metadata, &smithy.DeserializationError{
30680			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
30681			Snapshot: snapshot.Bytes(),
30682		}
30683	}
30684
30685	return out, metadata, err
30686}
30687
30688func awsRestjson1_deserializeOpErrorUpdateRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30689	var errorBuffer bytes.Buffer
30690	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30691		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30692	}
30693	errorBody := bytes.NewReader(errorBuffer.Bytes())
30694
30695	errorCode := "UnknownError"
30696	errorMessage := errorCode
30697
30698	code := response.Header.Get("X-Amzn-ErrorType")
30699	if len(code) != 0 {
30700		errorCode = restjson.SanitizeErrorCode(code)
30701	}
30702
30703	var buff [1024]byte
30704	ringBuffer := smithyio.NewRingBuffer(buff[:])
30705
30706	body := io.TeeReader(errorBody, ringBuffer)
30707	decoder := json.NewDecoder(body)
30708	decoder.UseNumber()
30709	code, message, err := restjson.GetErrorInfo(decoder)
30710	if err != nil {
30711		var snapshot bytes.Buffer
30712		io.Copy(&snapshot, ringBuffer)
30713		err = &smithy.DeserializationError{
30714			Err:      fmt.Errorf("failed to decode response body, %w", err),
30715			Snapshot: snapshot.Bytes(),
30716		}
30717		return err
30718	}
30719
30720	errorBody.Seek(0, io.SeekStart)
30721	if len(code) != 0 {
30722		errorCode = restjson.SanitizeErrorCode(code)
30723	}
30724	if len(message) != 0 {
30725		errorMessage = message
30726	}
30727
30728	switch {
30729	case strings.EqualFold("InternalFailureException", errorCode):
30730		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30731
30732	case strings.EqualFold("InvalidRequestException", errorCode):
30733		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30734
30735	case strings.EqualFold("ResourceNotFoundException", errorCode):
30736		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30737
30738	case strings.EqualFold("ServiceUnavailableException", errorCode):
30739		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
30740
30741	case strings.EqualFold("ThrottlingException", errorCode):
30742		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30743
30744	case strings.EqualFold("UnauthorizedException", errorCode):
30745		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
30746
30747	default:
30748		genericError := &smithy.GenericAPIError{
30749			Code:    errorCode,
30750			Message: errorMessage,
30751		}
30752		return genericError
30753
30754	}
30755}
30756
30757func awsRestjson1_deserializeOpDocumentUpdateRoleAliasOutput(v **UpdateRoleAliasOutput, value interface{}) error {
30758	if v == nil {
30759		return fmt.Errorf("unexpected nil of type %T", v)
30760	}
30761	if value == nil {
30762		return nil
30763	}
30764
30765	shape, ok := value.(map[string]interface{})
30766	if !ok {
30767		return fmt.Errorf("unexpected JSON type %v", value)
30768	}
30769
30770	var sv *UpdateRoleAliasOutput
30771	if *v == nil {
30772		sv = &UpdateRoleAliasOutput{}
30773	} else {
30774		sv = *v
30775	}
30776
30777	for key, value := range shape {
30778		switch key {
30779		case "roleAlias":
30780			if value != nil {
30781				jtv, ok := value.(string)
30782				if !ok {
30783					return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value)
30784				}
30785				sv.RoleAlias = ptr.String(jtv)
30786			}
30787
30788		case "roleAliasArn":
30789			if value != nil {
30790				jtv, ok := value.(string)
30791				if !ok {
30792					return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value)
30793				}
30794				sv.RoleAliasArn = ptr.String(jtv)
30795			}
30796
30797		default:
30798			_, _ = key, value
30799
30800		}
30801	}
30802	*v = sv
30803	return nil
30804}
30805
30806type awsRestjson1_deserializeOpUpdateScheduledAudit struct {
30807}
30808
30809func (*awsRestjson1_deserializeOpUpdateScheduledAudit) ID() string {
30810	return "OperationDeserializer"
30811}
30812
30813func (m *awsRestjson1_deserializeOpUpdateScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30814	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30815) {
30816	out, metadata, err = next.HandleDeserialize(ctx, in)
30817	if err != nil {
30818		return out, metadata, err
30819	}
30820
30821	response, ok := out.RawResponse.(*smithyhttp.Response)
30822	if !ok {
30823		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30824	}
30825
30826	if response.StatusCode < 200 || response.StatusCode >= 300 {
30827		return out, metadata, awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response, &metadata)
30828	}
30829	output := &UpdateScheduledAuditOutput{}
30830	out.Result = output
30831
30832	var buff [1024]byte
30833	ringBuffer := smithyio.NewRingBuffer(buff[:])
30834
30835	body := io.TeeReader(response.Body, ringBuffer)
30836
30837	decoder := json.NewDecoder(body)
30838	decoder.UseNumber()
30839	var shape interface{}
30840	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
30841		var snapshot bytes.Buffer
30842		io.Copy(&snapshot, ringBuffer)
30843		err = &smithy.DeserializationError{
30844			Err:      fmt.Errorf("failed to decode response body, %w", err),
30845			Snapshot: snapshot.Bytes(),
30846		}
30847		return out, metadata, err
30848	}
30849
30850	err = awsRestjson1_deserializeOpDocumentUpdateScheduledAuditOutput(&output, shape)
30851	if err != nil {
30852		var snapshot bytes.Buffer
30853		io.Copy(&snapshot, ringBuffer)
30854		return out, metadata, &smithy.DeserializationError{
30855			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
30856			Snapshot: snapshot.Bytes(),
30857		}
30858	}
30859
30860	return out, metadata, err
30861}
30862
30863func awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error {
30864	var errorBuffer bytes.Buffer
30865	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
30866		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
30867	}
30868	errorBody := bytes.NewReader(errorBuffer.Bytes())
30869
30870	errorCode := "UnknownError"
30871	errorMessage := errorCode
30872
30873	code := response.Header.Get("X-Amzn-ErrorType")
30874	if len(code) != 0 {
30875		errorCode = restjson.SanitizeErrorCode(code)
30876	}
30877
30878	var buff [1024]byte
30879	ringBuffer := smithyio.NewRingBuffer(buff[:])
30880
30881	body := io.TeeReader(errorBody, ringBuffer)
30882	decoder := json.NewDecoder(body)
30883	decoder.UseNumber()
30884	code, message, err := restjson.GetErrorInfo(decoder)
30885	if err != nil {
30886		var snapshot bytes.Buffer
30887		io.Copy(&snapshot, ringBuffer)
30888		err = &smithy.DeserializationError{
30889			Err:      fmt.Errorf("failed to decode response body, %w", err),
30890			Snapshot: snapshot.Bytes(),
30891		}
30892		return err
30893	}
30894
30895	errorBody.Seek(0, io.SeekStart)
30896	if len(code) != 0 {
30897		errorCode = restjson.SanitizeErrorCode(code)
30898	}
30899	if len(message) != 0 {
30900		errorMessage = message
30901	}
30902
30903	switch {
30904	case strings.EqualFold("InternalFailureException", errorCode):
30905		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
30906
30907	case strings.EqualFold("InvalidRequestException", errorCode):
30908		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
30909
30910	case strings.EqualFold("ResourceNotFoundException", errorCode):
30911		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
30912
30913	case strings.EqualFold("ThrottlingException", errorCode):
30914		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
30915
30916	default:
30917		genericError := &smithy.GenericAPIError{
30918			Code:    errorCode,
30919			Message: errorMessage,
30920		}
30921		return genericError
30922
30923	}
30924}
30925
30926func awsRestjson1_deserializeOpDocumentUpdateScheduledAuditOutput(v **UpdateScheduledAuditOutput, value interface{}) error {
30927	if v == nil {
30928		return fmt.Errorf("unexpected nil of type %T", v)
30929	}
30930	if value == nil {
30931		return nil
30932	}
30933
30934	shape, ok := value.(map[string]interface{})
30935	if !ok {
30936		return fmt.Errorf("unexpected JSON type %v", value)
30937	}
30938
30939	var sv *UpdateScheduledAuditOutput
30940	if *v == nil {
30941		sv = &UpdateScheduledAuditOutput{}
30942	} else {
30943		sv = *v
30944	}
30945
30946	for key, value := range shape {
30947		switch key {
30948		case "scheduledAuditArn":
30949			if value != nil {
30950				jtv, ok := value.(string)
30951				if !ok {
30952					return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value)
30953				}
30954				sv.ScheduledAuditArn = ptr.String(jtv)
30955			}
30956
30957		default:
30958			_, _ = key, value
30959
30960		}
30961	}
30962	*v = sv
30963	return nil
30964}
30965
30966type awsRestjson1_deserializeOpUpdateSecurityProfile struct {
30967}
30968
30969func (*awsRestjson1_deserializeOpUpdateSecurityProfile) ID() string {
30970	return "OperationDeserializer"
30971}
30972
30973func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30974	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
30975) {
30976	out, metadata, err = next.HandleDeserialize(ctx, in)
30977	if err != nil {
30978		return out, metadata, err
30979	}
30980
30981	response, ok := out.RawResponse.(*smithyhttp.Response)
30982	if !ok {
30983		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
30984	}
30985
30986	if response.StatusCode < 200 || response.StatusCode >= 300 {
30987		return out, metadata, awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response, &metadata)
30988	}
30989	output := &UpdateSecurityProfileOutput{}
30990	out.Result = output
30991
30992	var buff [1024]byte
30993	ringBuffer := smithyio.NewRingBuffer(buff[:])
30994
30995	body := io.TeeReader(response.Body, ringBuffer)
30996
30997	decoder := json.NewDecoder(body)
30998	decoder.UseNumber()
30999	var shape interface{}
31000	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
31001		var snapshot bytes.Buffer
31002		io.Copy(&snapshot, ringBuffer)
31003		err = &smithy.DeserializationError{
31004			Err:      fmt.Errorf("failed to decode response body, %w", err),
31005			Snapshot: snapshot.Bytes(),
31006		}
31007		return out, metadata, err
31008	}
31009
31010	err = awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(&output, shape)
31011	if err != nil {
31012		var snapshot bytes.Buffer
31013		io.Copy(&snapshot, ringBuffer)
31014		return out, metadata, &smithy.DeserializationError{
31015			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
31016			Snapshot: snapshot.Bytes(),
31017		}
31018	}
31019
31020	return out, metadata, err
31021}
31022
31023func awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31024	var errorBuffer bytes.Buffer
31025	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31026		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31027	}
31028	errorBody := bytes.NewReader(errorBuffer.Bytes())
31029
31030	errorCode := "UnknownError"
31031	errorMessage := errorCode
31032
31033	code := response.Header.Get("X-Amzn-ErrorType")
31034	if len(code) != 0 {
31035		errorCode = restjson.SanitizeErrorCode(code)
31036	}
31037
31038	var buff [1024]byte
31039	ringBuffer := smithyio.NewRingBuffer(buff[:])
31040
31041	body := io.TeeReader(errorBody, ringBuffer)
31042	decoder := json.NewDecoder(body)
31043	decoder.UseNumber()
31044	code, message, err := restjson.GetErrorInfo(decoder)
31045	if err != nil {
31046		var snapshot bytes.Buffer
31047		io.Copy(&snapshot, ringBuffer)
31048		err = &smithy.DeserializationError{
31049			Err:      fmt.Errorf("failed to decode response body, %w", err),
31050			Snapshot: snapshot.Bytes(),
31051		}
31052		return err
31053	}
31054
31055	errorBody.Seek(0, io.SeekStart)
31056	if len(code) != 0 {
31057		errorCode = restjson.SanitizeErrorCode(code)
31058	}
31059	if len(message) != 0 {
31060		errorMessage = message
31061	}
31062
31063	switch {
31064	case strings.EqualFold("InternalFailureException", errorCode):
31065		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31066
31067	case strings.EqualFold("InvalidRequestException", errorCode):
31068		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31069
31070	case strings.EqualFold("ResourceNotFoundException", errorCode):
31071		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
31072
31073	case strings.EqualFold("ThrottlingException", errorCode):
31074		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31075
31076	case strings.EqualFold("VersionConflictException", errorCode):
31077		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
31078
31079	default:
31080		genericError := &smithy.GenericAPIError{
31081			Code:    errorCode,
31082			Message: errorMessage,
31083		}
31084		return genericError
31085
31086	}
31087}
31088
31089func awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(v **UpdateSecurityProfileOutput, value interface{}) error {
31090	if v == nil {
31091		return fmt.Errorf("unexpected nil of type %T", v)
31092	}
31093	if value == nil {
31094		return nil
31095	}
31096
31097	shape, ok := value.(map[string]interface{})
31098	if !ok {
31099		return fmt.Errorf("unexpected JSON type %v", value)
31100	}
31101
31102	var sv *UpdateSecurityProfileOutput
31103	if *v == nil {
31104		sv = &UpdateSecurityProfileOutput{}
31105	} else {
31106		sv = *v
31107	}
31108
31109	for key, value := range shape {
31110		switch key {
31111		case "additionalMetricsToRetain":
31112			if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainList(&sv.AdditionalMetricsToRetain, value); err != nil {
31113				return err
31114			}
31115
31116		case "additionalMetricsToRetainV2":
31117			if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainV2List(&sv.AdditionalMetricsToRetainV2, value); err != nil {
31118				return err
31119			}
31120
31121		case "alertTargets":
31122			if err := awsRestjson1_deserializeDocumentAlertTargets(&sv.AlertTargets, value); err != nil {
31123				return err
31124			}
31125
31126		case "behaviors":
31127			if err := awsRestjson1_deserializeDocumentBehaviors(&sv.Behaviors, value); err != nil {
31128				return err
31129			}
31130
31131		case "creationDate":
31132			if value != nil {
31133				jtv, ok := value.(json.Number)
31134				if !ok {
31135					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
31136				}
31137				f64, err := jtv.Float64()
31138				if err != nil {
31139					return err
31140				}
31141				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
31142			}
31143
31144		case "lastModifiedDate":
31145			if value != nil {
31146				jtv, ok := value.(json.Number)
31147				if !ok {
31148					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
31149				}
31150				f64, err := jtv.Float64()
31151				if err != nil {
31152					return err
31153				}
31154				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
31155			}
31156
31157		case "securityProfileArn":
31158			if value != nil {
31159				jtv, ok := value.(string)
31160				if !ok {
31161					return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value)
31162				}
31163				sv.SecurityProfileArn = ptr.String(jtv)
31164			}
31165
31166		case "securityProfileDescription":
31167			if value != nil {
31168				jtv, ok := value.(string)
31169				if !ok {
31170					return fmt.Errorf("expected SecurityProfileDescription to be of type string, got %T instead", value)
31171				}
31172				sv.SecurityProfileDescription = ptr.String(jtv)
31173			}
31174
31175		case "securityProfileName":
31176			if value != nil {
31177				jtv, ok := value.(string)
31178				if !ok {
31179					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
31180				}
31181				sv.SecurityProfileName = ptr.String(jtv)
31182			}
31183
31184		case "version":
31185			if value != nil {
31186				jtv, ok := value.(json.Number)
31187				if !ok {
31188					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
31189				}
31190				i64, err := jtv.Int64()
31191				if err != nil {
31192					return err
31193				}
31194				sv.Version = i64
31195			}
31196
31197		default:
31198			_, _ = key, value
31199
31200		}
31201	}
31202	*v = sv
31203	return nil
31204}
31205
31206type awsRestjson1_deserializeOpUpdateStream struct {
31207}
31208
31209func (*awsRestjson1_deserializeOpUpdateStream) ID() string {
31210	return "OperationDeserializer"
31211}
31212
31213func (m *awsRestjson1_deserializeOpUpdateStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31214	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31215) {
31216	out, metadata, err = next.HandleDeserialize(ctx, in)
31217	if err != nil {
31218		return out, metadata, err
31219	}
31220
31221	response, ok := out.RawResponse.(*smithyhttp.Response)
31222	if !ok {
31223		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31224	}
31225
31226	if response.StatusCode < 200 || response.StatusCode >= 300 {
31227		return out, metadata, awsRestjson1_deserializeOpErrorUpdateStream(response, &metadata)
31228	}
31229	output := &UpdateStreamOutput{}
31230	out.Result = output
31231
31232	var buff [1024]byte
31233	ringBuffer := smithyio.NewRingBuffer(buff[:])
31234
31235	body := io.TeeReader(response.Body, ringBuffer)
31236
31237	decoder := json.NewDecoder(body)
31238	decoder.UseNumber()
31239	var shape interface{}
31240	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
31241		var snapshot bytes.Buffer
31242		io.Copy(&snapshot, ringBuffer)
31243		err = &smithy.DeserializationError{
31244			Err:      fmt.Errorf("failed to decode response body, %w", err),
31245			Snapshot: snapshot.Bytes(),
31246		}
31247		return out, metadata, err
31248	}
31249
31250	err = awsRestjson1_deserializeOpDocumentUpdateStreamOutput(&output, shape)
31251	if err != nil {
31252		var snapshot bytes.Buffer
31253		io.Copy(&snapshot, ringBuffer)
31254		return out, metadata, &smithy.DeserializationError{
31255			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
31256			Snapshot: snapshot.Bytes(),
31257		}
31258	}
31259
31260	return out, metadata, err
31261}
31262
31263func awsRestjson1_deserializeOpErrorUpdateStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31264	var errorBuffer bytes.Buffer
31265	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31266		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31267	}
31268	errorBody := bytes.NewReader(errorBuffer.Bytes())
31269
31270	errorCode := "UnknownError"
31271	errorMessage := errorCode
31272
31273	code := response.Header.Get("X-Amzn-ErrorType")
31274	if len(code) != 0 {
31275		errorCode = restjson.SanitizeErrorCode(code)
31276	}
31277
31278	var buff [1024]byte
31279	ringBuffer := smithyio.NewRingBuffer(buff[:])
31280
31281	body := io.TeeReader(errorBody, ringBuffer)
31282	decoder := json.NewDecoder(body)
31283	decoder.UseNumber()
31284	code, message, err := restjson.GetErrorInfo(decoder)
31285	if err != nil {
31286		var snapshot bytes.Buffer
31287		io.Copy(&snapshot, ringBuffer)
31288		err = &smithy.DeserializationError{
31289			Err:      fmt.Errorf("failed to decode response body, %w", err),
31290			Snapshot: snapshot.Bytes(),
31291		}
31292		return err
31293	}
31294
31295	errorBody.Seek(0, io.SeekStart)
31296	if len(code) != 0 {
31297		errorCode = restjson.SanitizeErrorCode(code)
31298	}
31299	if len(message) != 0 {
31300		errorMessage = message
31301	}
31302
31303	switch {
31304	case strings.EqualFold("InternalFailureException", errorCode):
31305		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31306
31307	case strings.EqualFold("InvalidRequestException", errorCode):
31308		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31309
31310	case strings.EqualFold("ResourceNotFoundException", errorCode):
31311		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
31312
31313	case strings.EqualFold("ServiceUnavailableException", errorCode):
31314		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
31315
31316	case strings.EqualFold("ThrottlingException", errorCode):
31317		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31318
31319	case strings.EqualFold("UnauthorizedException", errorCode):
31320		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
31321
31322	default:
31323		genericError := &smithy.GenericAPIError{
31324			Code:    errorCode,
31325			Message: errorMessage,
31326		}
31327		return genericError
31328
31329	}
31330}
31331
31332func awsRestjson1_deserializeOpDocumentUpdateStreamOutput(v **UpdateStreamOutput, value interface{}) error {
31333	if v == nil {
31334		return fmt.Errorf("unexpected nil of type %T", v)
31335	}
31336	if value == nil {
31337		return nil
31338	}
31339
31340	shape, ok := value.(map[string]interface{})
31341	if !ok {
31342		return fmt.Errorf("unexpected JSON type %v", value)
31343	}
31344
31345	var sv *UpdateStreamOutput
31346	if *v == nil {
31347		sv = &UpdateStreamOutput{}
31348	} else {
31349		sv = *v
31350	}
31351
31352	for key, value := range shape {
31353		switch key {
31354		case "description":
31355			if value != nil {
31356				jtv, ok := value.(string)
31357				if !ok {
31358					return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value)
31359				}
31360				sv.Description = ptr.String(jtv)
31361			}
31362
31363		case "streamArn":
31364			if value != nil {
31365				jtv, ok := value.(string)
31366				if !ok {
31367					return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
31368				}
31369				sv.StreamArn = ptr.String(jtv)
31370			}
31371
31372		case "streamId":
31373			if value != nil {
31374				jtv, ok := value.(string)
31375				if !ok {
31376					return fmt.Errorf("expected StreamId to be of type string, got %T instead", value)
31377				}
31378				sv.StreamId = ptr.String(jtv)
31379			}
31380
31381		case "streamVersion":
31382			if value != nil {
31383				jtv, ok := value.(json.Number)
31384				if !ok {
31385					return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value)
31386				}
31387				i64, err := jtv.Int64()
31388				if err != nil {
31389					return err
31390				}
31391				sv.StreamVersion = ptr.Int32(int32(i64))
31392			}
31393
31394		default:
31395			_, _ = key, value
31396
31397		}
31398	}
31399	*v = sv
31400	return nil
31401}
31402
31403type awsRestjson1_deserializeOpUpdateThing struct {
31404}
31405
31406func (*awsRestjson1_deserializeOpUpdateThing) ID() string {
31407	return "OperationDeserializer"
31408}
31409
31410func (m *awsRestjson1_deserializeOpUpdateThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31411	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31412) {
31413	out, metadata, err = next.HandleDeserialize(ctx, in)
31414	if err != nil {
31415		return out, metadata, err
31416	}
31417
31418	response, ok := out.RawResponse.(*smithyhttp.Response)
31419	if !ok {
31420		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31421	}
31422
31423	if response.StatusCode < 200 || response.StatusCode >= 300 {
31424		return out, metadata, awsRestjson1_deserializeOpErrorUpdateThing(response, &metadata)
31425	}
31426	output := &UpdateThingOutput{}
31427	out.Result = output
31428
31429	return out, metadata, err
31430}
31431
31432func awsRestjson1_deserializeOpErrorUpdateThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31433	var errorBuffer bytes.Buffer
31434	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31435		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31436	}
31437	errorBody := bytes.NewReader(errorBuffer.Bytes())
31438
31439	errorCode := "UnknownError"
31440	errorMessage := errorCode
31441
31442	code := response.Header.Get("X-Amzn-ErrorType")
31443	if len(code) != 0 {
31444		errorCode = restjson.SanitizeErrorCode(code)
31445	}
31446
31447	var buff [1024]byte
31448	ringBuffer := smithyio.NewRingBuffer(buff[:])
31449
31450	body := io.TeeReader(errorBody, ringBuffer)
31451	decoder := json.NewDecoder(body)
31452	decoder.UseNumber()
31453	code, message, err := restjson.GetErrorInfo(decoder)
31454	if err != nil {
31455		var snapshot bytes.Buffer
31456		io.Copy(&snapshot, ringBuffer)
31457		err = &smithy.DeserializationError{
31458			Err:      fmt.Errorf("failed to decode response body, %w", err),
31459			Snapshot: snapshot.Bytes(),
31460		}
31461		return err
31462	}
31463
31464	errorBody.Seek(0, io.SeekStart)
31465	if len(code) != 0 {
31466		errorCode = restjson.SanitizeErrorCode(code)
31467	}
31468	if len(message) != 0 {
31469		errorMessage = message
31470	}
31471
31472	switch {
31473	case strings.EqualFold("InternalFailureException", errorCode):
31474		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31475
31476	case strings.EqualFold("InvalidRequestException", errorCode):
31477		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31478
31479	case strings.EqualFold("ResourceNotFoundException", errorCode):
31480		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
31481
31482	case strings.EqualFold("ServiceUnavailableException", errorCode):
31483		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
31484
31485	case strings.EqualFold("ThrottlingException", errorCode):
31486		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31487
31488	case strings.EqualFold("UnauthorizedException", errorCode):
31489		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
31490
31491	case strings.EqualFold("VersionConflictException", errorCode):
31492		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
31493
31494	default:
31495		genericError := &smithy.GenericAPIError{
31496			Code:    errorCode,
31497			Message: errorMessage,
31498		}
31499		return genericError
31500
31501	}
31502}
31503
31504type awsRestjson1_deserializeOpUpdateThingGroup struct {
31505}
31506
31507func (*awsRestjson1_deserializeOpUpdateThingGroup) ID() string {
31508	return "OperationDeserializer"
31509}
31510
31511func (m *awsRestjson1_deserializeOpUpdateThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31512	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31513) {
31514	out, metadata, err = next.HandleDeserialize(ctx, in)
31515	if err != nil {
31516		return out, metadata, err
31517	}
31518
31519	response, ok := out.RawResponse.(*smithyhttp.Response)
31520	if !ok {
31521		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31522	}
31523
31524	if response.StatusCode < 200 || response.StatusCode >= 300 {
31525		return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingGroup(response, &metadata)
31526	}
31527	output := &UpdateThingGroupOutput{}
31528	out.Result = output
31529
31530	var buff [1024]byte
31531	ringBuffer := smithyio.NewRingBuffer(buff[:])
31532
31533	body := io.TeeReader(response.Body, ringBuffer)
31534
31535	decoder := json.NewDecoder(body)
31536	decoder.UseNumber()
31537	var shape interface{}
31538	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
31539		var snapshot bytes.Buffer
31540		io.Copy(&snapshot, ringBuffer)
31541		err = &smithy.DeserializationError{
31542			Err:      fmt.Errorf("failed to decode response body, %w", err),
31543			Snapshot: snapshot.Bytes(),
31544		}
31545		return out, metadata, err
31546	}
31547
31548	err = awsRestjson1_deserializeOpDocumentUpdateThingGroupOutput(&output, shape)
31549	if err != nil {
31550		var snapshot bytes.Buffer
31551		io.Copy(&snapshot, ringBuffer)
31552		return out, metadata, &smithy.DeserializationError{
31553			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
31554			Snapshot: snapshot.Bytes(),
31555		}
31556	}
31557
31558	return out, metadata, err
31559}
31560
31561func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31562	var errorBuffer bytes.Buffer
31563	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31564		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31565	}
31566	errorBody := bytes.NewReader(errorBuffer.Bytes())
31567
31568	errorCode := "UnknownError"
31569	errorMessage := errorCode
31570
31571	code := response.Header.Get("X-Amzn-ErrorType")
31572	if len(code) != 0 {
31573		errorCode = restjson.SanitizeErrorCode(code)
31574	}
31575
31576	var buff [1024]byte
31577	ringBuffer := smithyio.NewRingBuffer(buff[:])
31578
31579	body := io.TeeReader(errorBody, ringBuffer)
31580	decoder := json.NewDecoder(body)
31581	decoder.UseNumber()
31582	code, message, err := restjson.GetErrorInfo(decoder)
31583	if err != nil {
31584		var snapshot bytes.Buffer
31585		io.Copy(&snapshot, ringBuffer)
31586		err = &smithy.DeserializationError{
31587			Err:      fmt.Errorf("failed to decode response body, %w", err),
31588			Snapshot: snapshot.Bytes(),
31589		}
31590		return err
31591	}
31592
31593	errorBody.Seek(0, io.SeekStart)
31594	if len(code) != 0 {
31595		errorCode = restjson.SanitizeErrorCode(code)
31596	}
31597	if len(message) != 0 {
31598		errorMessage = message
31599	}
31600
31601	switch {
31602	case strings.EqualFold("InternalFailureException", errorCode):
31603		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31604
31605	case strings.EqualFold("InvalidRequestException", errorCode):
31606		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31607
31608	case strings.EqualFold("ResourceNotFoundException", errorCode):
31609		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
31610
31611	case strings.EqualFold("ThrottlingException", errorCode):
31612		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31613
31614	case strings.EqualFold("VersionConflictException", errorCode):
31615		return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody)
31616
31617	default:
31618		genericError := &smithy.GenericAPIError{
31619			Code:    errorCode,
31620			Message: errorMessage,
31621		}
31622		return genericError
31623
31624	}
31625}
31626
31627func awsRestjson1_deserializeOpDocumentUpdateThingGroupOutput(v **UpdateThingGroupOutput, value interface{}) error {
31628	if v == nil {
31629		return fmt.Errorf("unexpected nil of type %T", v)
31630	}
31631	if value == nil {
31632		return nil
31633	}
31634
31635	shape, ok := value.(map[string]interface{})
31636	if !ok {
31637		return fmt.Errorf("unexpected JSON type %v", value)
31638	}
31639
31640	var sv *UpdateThingGroupOutput
31641	if *v == nil {
31642		sv = &UpdateThingGroupOutput{}
31643	} else {
31644		sv = *v
31645	}
31646
31647	for key, value := range shape {
31648		switch key {
31649		case "version":
31650			if value != nil {
31651				jtv, ok := value.(json.Number)
31652				if !ok {
31653					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
31654				}
31655				i64, err := jtv.Int64()
31656				if err != nil {
31657					return err
31658				}
31659				sv.Version = i64
31660			}
31661
31662		default:
31663			_, _ = key, value
31664
31665		}
31666	}
31667	*v = sv
31668	return nil
31669}
31670
31671type awsRestjson1_deserializeOpUpdateThingGroupsForThing struct {
31672}
31673
31674func (*awsRestjson1_deserializeOpUpdateThingGroupsForThing) ID() string {
31675	return "OperationDeserializer"
31676}
31677
31678func (m *awsRestjson1_deserializeOpUpdateThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31679	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31680) {
31681	out, metadata, err = next.HandleDeserialize(ctx, in)
31682	if err != nil {
31683		return out, metadata, err
31684	}
31685
31686	response, ok := out.RawResponse.(*smithyhttp.Response)
31687	if !ok {
31688		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31689	}
31690
31691	if response.StatusCode < 200 || response.StatusCode >= 300 {
31692		return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response, &metadata)
31693	}
31694	output := &UpdateThingGroupsForThingOutput{}
31695	out.Result = output
31696
31697	return out, metadata, err
31698}
31699
31700func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31701	var errorBuffer bytes.Buffer
31702	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31703		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31704	}
31705	errorBody := bytes.NewReader(errorBuffer.Bytes())
31706
31707	errorCode := "UnknownError"
31708	errorMessage := errorCode
31709
31710	code := response.Header.Get("X-Amzn-ErrorType")
31711	if len(code) != 0 {
31712		errorCode = restjson.SanitizeErrorCode(code)
31713	}
31714
31715	var buff [1024]byte
31716	ringBuffer := smithyio.NewRingBuffer(buff[:])
31717
31718	body := io.TeeReader(errorBody, ringBuffer)
31719	decoder := json.NewDecoder(body)
31720	decoder.UseNumber()
31721	code, message, err := restjson.GetErrorInfo(decoder)
31722	if err != nil {
31723		var snapshot bytes.Buffer
31724		io.Copy(&snapshot, ringBuffer)
31725		err = &smithy.DeserializationError{
31726			Err:      fmt.Errorf("failed to decode response body, %w", err),
31727			Snapshot: snapshot.Bytes(),
31728		}
31729		return err
31730	}
31731
31732	errorBody.Seek(0, io.SeekStart)
31733	if len(code) != 0 {
31734		errorCode = restjson.SanitizeErrorCode(code)
31735	}
31736	if len(message) != 0 {
31737		errorMessage = message
31738	}
31739
31740	switch {
31741	case strings.EqualFold("InternalFailureException", errorCode):
31742		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31743
31744	case strings.EqualFold("InvalidRequestException", errorCode):
31745		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31746
31747	case strings.EqualFold("ResourceNotFoundException", errorCode):
31748		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
31749
31750	case strings.EqualFold("ThrottlingException", errorCode):
31751		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31752
31753	default:
31754		genericError := &smithy.GenericAPIError{
31755			Code:    errorCode,
31756			Message: errorMessage,
31757		}
31758		return genericError
31759
31760	}
31761}
31762
31763type awsRestjson1_deserializeOpUpdateTopicRuleDestination struct {
31764}
31765
31766func (*awsRestjson1_deserializeOpUpdateTopicRuleDestination) ID() string {
31767	return "OperationDeserializer"
31768}
31769
31770func (m *awsRestjson1_deserializeOpUpdateTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31771	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31772) {
31773	out, metadata, err = next.HandleDeserialize(ctx, in)
31774	if err != nil {
31775		return out, metadata, err
31776	}
31777
31778	response, ok := out.RawResponse.(*smithyhttp.Response)
31779	if !ok {
31780		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31781	}
31782
31783	if response.StatusCode < 200 || response.StatusCode >= 300 {
31784		return out, metadata, awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response, &metadata)
31785	}
31786	output := &UpdateTopicRuleDestinationOutput{}
31787	out.Result = output
31788
31789	return out, metadata, err
31790}
31791
31792func awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31793	var errorBuffer bytes.Buffer
31794	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31795		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31796	}
31797	errorBody := bytes.NewReader(errorBuffer.Bytes())
31798
31799	errorCode := "UnknownError"
31800	errorMessage := errorCode
31801
31802	code := response.Header.Get("X-Amzn-ErrorType")
31803	if len(code) != 0 {
31804		errorCode = restjson.SanitizeErrorCode(code)
31805	}
31806
31807	var buff [1024]byte
31808	ringBuffer := smithyio.NewRingBuffer(buff[:])
31809
31810	body := io.TeeReader(errorBody, ringBuffer)
31811	decoder := json.NewDecoder(body)
31812	decoder.UseNumber()
31813	code, message, err := restjson.GetErrorInfo(decoder)
31814	if err != nil {
31815		var snapshot bytes.Buffer
31816		io.Copy(&snapshot, ringBuffer)
31817		err = &smithy.DeserializationError{
31818			Err:      fmt.Errorf("failed to decode response body, %w", err),
31819			Snapshot: snapshot.Bytes(),
31820		}
31821		return err
31822	}
31823
31824	errorBody.Seek(0, io.SeekStart)
31825	if len(code) != 0 {
31826		errorCode = restjson.SanitizeErrorCode(code)
31827	}
31828	if len(message) != 0 {
31829		errorMessage = message
31830	}
31831
31832	switch {
31833	case strings.EqualFold("ConflictingResourceUpdateException", errorCode):
31834		return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody)
31835
31836	case strings.EqualFold("InternalException", errorCode):
31837		return awsRestjson1_deserializeErrorInternalException(response, errorBody)
31838
31839	case strings.EqualFold("InvalidRequestException", errorCode):
31840		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31841
31842	case strings.EqualFold("ServiceUnavailableException", errorCode):
31843		return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
31844
31845	case strings.EqualFold("UnauthorizedException", errorCode):
31846		return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody)
31847
31848	default:
31849		genericError := &smithy.GenericAPIError{
31850			Code:    errorCode,
31851			Message: errorMessage,
31852		}
31853		return genericError
31854
31855	}
31856}
31857
31858type awsRestjson1_deserializeOpValidateSecurityProfileBehaviors struct {
31859}
31860
31861func (*awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) ID() string {
31862	return "OperationDeserializer"
31863}
31864
31865func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
31866	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31867) {
31868	out, metadata, err = next.HandleDeserialize(ctx, in)
31869	if err != nil {
31870		return out, metadata, err
31871	}
31872
31873	response, ok := out.RawResponse.(*smithyhttp.Response)
31874	if !ok {
31875		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
31876	}
31877
31878	if response.StatusCode < 200 || response.StatusCode >= 300 {
31879		return out, metadata, awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response, &metadata)
31880	}
31881	output := &ValidateSecurityProfileBehaviorsOutput{}
31882	out.Result = output
31883
31884	var buff [1024]byte
31885	ringBuffer := smithyio.NewRingBuffer(buff[:])
31886
31887	body := io.TeeReader(response.Body, ringBuffer)
31888
31889	decoder := json.NewDecoder(body)
31890	decoder.UseNumber()
31891	var shape interface{}
31892	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
31893		var snapshot bytes.Buffer
31894		io.Copy(&snapshot, ringBuffer)
31895		err = &smithy.DeserializationError{
31896			Err:      fmt.Errorf("failed to decode response body, %w", err),
31897			Snapshot: snapshot.Bytes(),
31898		}
31899		return out, metadata, err
31900	}
31901
31902	err = awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(&output, shape)
31903	if err != nil {
31904		var snapshot bytes.Buffer
31905		io.Copy(&snapshot, ringBuffer)
31906		return out, metadata, &smithy.DeserializationError{
31907			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
31908			Snapshot: snapshot.Bytes(),
31909		}
31910	}
31911
31912	return out, metadata, err
31913}
31914
31915func awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response *smithyhttp.Response, metadata *middleware.Metadata) error {
31916	var errorBuffer bytes.Buffer
31917	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
31918		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
31919	}
31920	errorBody := bytes.NewReader(errorBuffer.Bytes())
31921
31922	errorCode := "UnknownError"
31923	errorMessage := errorCode
31924
31925	code := response.Header.Get("X-Amzn-ErrorType")
31926	if len(code) != 0 {
31927		errorCode = restjson.SanitizeErrorCode(code)
31928	}
31929
31930	var buff [1024]byte
31931	ringBuffer := smithyio.NewRingBuffer(buff[:])
31932
31933	body := io.TeeReader(errorBody, ringBuffer)
31934	decoder := json.NewDecoder(body)
31935	decoder.UseNumber()
31936	code, message, err := restjson.GetErrorInfo(decoder)
31937	if err != nil {
31938		var snapshot bytes.Buffer
31939		io.Copy(&snapshot, ringBuffer)
31940		err = &smithy.DeserializationError{
31941			Err:      fmt.Errorf("failed to decode response body, %w", err),
31942			Snapshot: snapshot.Bytes(),
31943		}
31944		return err
31945	}
31946
31947	errorBody.Seek(0, io.SeekStart)
31948	if len(code) != 0 {
31949		errorCode = restjson.SanitizeErrorCode(code)
31950	}
31951	if len(message) != 0 {
31952		errorMessage = message
31953	}
31954
31955	switch {
31956	case strings.EqualFold("InternalFailureException", errorCode):
31957		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
31958
31959	case strings.EqualFold("InvalidRequestException", errorCode):
31960		return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
31961
31962	case strings.EqualFold("ThrottlingException", errorCode):
31963		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
31964
31965	default:
31966		genericError := &smithy.GenericAPIError{
31967			Code:    errorCode,
31968			Message: errorMessage,
31969		}
31970		return genericError
31971
31972	}
31973}
31974
31975func awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(v **ValidateSecurityProfileBehaviorsOutput, value interface{}) error {
31976	if v == nil {
31977		return fmt.Errorf("unexpected nil of type %T", v)
31978	}
31979	if value == nil {
31980		return nil
31981	}
31982
31983	shape, ok := value.(map[string]interface{})
31984	if !ok {
31985		return fmt.Errorf("unexpected JSON type %v", value)
31986	}
31987
31988	var sv *ValidateSecurityProfileBehaviorsOutput
31989	if *v == nil {
31990		sv = &ValidateSecurityProfileBehaviorsOutput{}
31991	} else {
31992		sv = *v
31993	}
31994
31995	for key, value := range shape {
31996		switch key {
31997		case "valid":
31998			if value != nil {
31999				jtv, ok := value.(bool)
32000				if !ok {
32001					return fmt.Errorf("expected Valid to be of type *bool, got %T instead", value)
32002				}
32003				sv.Valid = jtv
32004			}
32005
32006		case "validationErrors":
32007			if err := awsRestjson1_deserializeDocumentValidationErrors(&sv.ValidationErrors, value); err != nil {
32008				return err
32009			}
32010
32011		default:
32012			_, _ = key, value
32013
32014		}
32015	}
32016	*v = sv
32017	return nil
32018}
32019
32020func awsRestjson1_deserializeErrorCertificateConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32021	output := &types.CertificateConflictException{}
32022	var buff [1024]byte
32023	ringBuffer := smithyio.NewRingBuffer(buff[:])
32024
32025	body := io.TeeReader(errorBody, ringBuffer)
32026	decoder := json.NewDecoder(body)
32027	decoder.UseNumber()
32028	var shape interface{}
32029	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32030		var snapshot bytes.Buffer
32031		io.Copy(&snapshot, ringBuffer)
32032		err = &smithy.DeserializationError{
32033			Err:      fmt.Errorf("failed to decode response body, %w", err),
32034			Snapshot: snapshot.Bytes(),
32035		}
32036		return err
32037	}
32038
32039	err := awsRestjson1_deserializeDocumentCertificateConflictException(&output, shape)
32040
32041	if err != nil {
32042		var snapshot bytes.Buffer
32043		io.Copy(&snapshot, ringBuffer)
32044		err = &smithy.DeserializationError{
32045			Err:      fmt.Errorf("failed to decode response body, %w", err),
32046			Snapshot: snapshot.Bytes(),
32047		}
32048		return err
32049	}
32050
32051	errorBody.Seek(0, io.SeekStart)
32052
32053	return output
32054}
32055
32056func awsRestjson1_deserializeErrorCertificateStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32057	output := &types.CertificateStateException{}
32058	var buff [1024]byte
32059	ringBuffer := smithyio.NewRingBuffer(buff[:])
32060
32061	body := io.TeeReader(errorBody, ringBuffer)
32062	decoder := json.NewDecoder(body)
32063	decoder.UseNumber()
32064	var shape interface{}
32065	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32066		var snapshot bytes.Buffer
32067		io.Copy(&snapshot, ringBuffer)
32068		err = &smithy.DeserializationError{
32069			Err:      fmt.Errorf("failed to decode response body, %w", err),
32070			Snapshot: snapshot.Bytes(),
32071		}
32072		return err
32073	}
32074
32075	err := awsRestjson1_deserializeDocumentCertificateStateException(&output, shape)
32076
32077	if err != nil {
32078		var snapshot bytes.Buffer
32079		io.Copy(&snapshot, ringBuffer)
32080		err = &smithy.DeserializationError{
32081			Err:      fmt.Errorf("failed to decode response body, %w", err),
32082			Snapshot: snapshot.Bytes(),
32083		}
32084		return err
32085	}
32086
32087	errorBody.Seek(0, io.SeekStart)
32088
32089	return output
32090}
32091
32092func awsRestjson1_deserializeErrorCertificateValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32093	output := &types.CertificateValidationException{}
32094	var buff [1024]byte
32095	ringBuffer := smithyio.NewRingBuffer(buff[:])
32096
32097	body := io.TeeReader(errorBody, ringBuffer)
32098	decoder := json.NewDecoder(body)
32099	decoder.UseNumber()
32100	var shape interface{}
32101	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32102		var snapshot bytes.Buffer
32103		io.Copy(&snapshot, ringBuffer)
32104		err = &smithy.DeserializationError{
32105			Err:      fmt.Errorf("failed to decode response body, %w", err),
32106			Snapshot: snapshot.Bytes(),
32107		}
32108		return err
32109	}
32110
32111	err := awsRestjson1_deserializeDocumentCertificateValidationException(&output, shape)
32112
32113	if err != nil {
32114		var snapshot bytes.Buffer
32115		io.Copy(&snapshot, ringBuffer)
32116		err = &smithy.DeserializationError{
32117			Err:      fmt.Errorf("failed to decode response body, %w", err),
32118			Snapshot: snapshot.Bytes(),
32119		}
32120		return err
32121	}
32122
32123	errorBody.Seek(0, io.SeekStart)
32124
32125	return output
32126}
32127
32128func awsRestjson1_deserializeErrorConflictingResourceUpdateException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32129	output := &types.ConflictingResourceUpdateException{}
32130	var buff [1024]byte
32131	ringBuffer := smithyio.NewRingBuffer(buff[:])
32132
32133	body := io.TeeReader(errorBody, ringBuffer)
32134	decoder := json.NewDecoder(body)
32135	decoder.UseNumber()
32136	var shape interface{}
32137	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32138		var snapshot bytes.Buffer
32139		io.Copy(&snapshot, ringBuffer)
32140		err = &smithy.DeserializationError{
32141			Err:      fmt.Errorf("failed to decode response body, %w", err),
32142			Snapshot: snapshot.Bytes(),
32143		}
32144		return err
32145	}
32146
32147	err := awsRestjson1_deserializeDocumentConflictingResourceUpdateException(&output, shape)
32148
32149	if err != nil {
32150		var snapshot bytes.Buffer
32151		io.Copy(&snapshot, ringBuffer)
32152		err = &smithy.DeserializationError{
32153			Err:      fmt.Errorf("failed to decode response body, %w", err),
32154			Snapshot: snapshot.Bytes(),
32155		}
32156		return err
32157	}
32158
32159	errorBody.Seek(0, io.SeekStart)
32160
32161	return output
32162}
32163
32164func awsRestjson1_deserializeErrorDeleteConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32165	output := &types.DeleteConflictException{}
32166	var buff [1024]byte
32167	ringBuffer := smithyio.NewRingBuffer(buff[:])
32168
32169	body := io.TeeReader(errorBody, ringBuffer)
32170	decoder := json.NewDecoder(body)
32171	decoder.UseNumber()
32172	var shape interface{}
32173	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32174		var snapshot bytes.Buffer
32175		io.Copy(&snapshot, ringBuffer)
32176		err = &smithy.DeserializationError{
32177			Err:      fmt.Errorf("failed to decode response body, %w", err),
32178			Snapshot: snapshot.Bytes(),
32179		}
32180		return err
32181	}
32182
32183	err := awsRestjson1_deserializeDocumentDeleteConflictException(&output, shape)
32184
32185	if err != nil {
32186		var snapshot bytes.Buffer
32187		io.Copy(&snapshot, ringBuffer)
32188		err = &smithy.DeserializationError{
32189			Err:      fmt.Errorf("failed to decode response body, %w", err),
32190			Snapshot: snapshot.Bytes(),
32191		}
32192		return err
32193	}
32194
32195	errorBody.Seek(0, io.SeekStart)
32196
32197	return output
32198}
32199
32200func awsRestjson1_deserializeErrorIndexNotReadyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32201	output := &types.IndexNotReadyException{}
32202	var buff [1024]byte
32203	ringBuffer := smithyio.NewRingBuffer(buff[:])
32204
32205	body := io.TeeReader(errorBody, ringBuffer)
32206	decoder := json.NewDecoder(body)
32207	decoder.UseNumber()
32208	var shape interface{}
32209	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32210		var snapshot bytes.Buffer
32211		io.Copy(&snapshot, ringBuffer)
32212		err = &smithy.DeserializationError{
32213			Err:      fmt.Errorf("failed to decode response body, %w", err),
32214			Snapshot: snapshot.Bytes(),
32215		}
32216		return err
32217	}
32218
32219	err := awsRestjson1_deserializeDocumentIndexNotReadyException(&output, shape)
32220
32221	if err != nil {
32222		var snapshot bytes.Buffer
32223		io.Copy(&snapshot, ringBuffer)
32224		err = &smithy.DeserializationError{
32225			Err:      fmt.Errorf("failed to decode response body, %w", err),
32226			Snapshot: snapshot.Bytes(),
32227		}
32228		return err
32229	}
32230
32231	errorBody.Seek(0, io.SeekStart)
32232
32233	return output
32234}
32235
32236func awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32237	output := &types.InternalException{}
32238	var buff [1024]byte
32239	ringBuffer := smithyio.NewRingBuffer(buff[:])
32240
32241	body := io.TeeReader(errorBody, ringBuffer)
32242	decoder := json.NewDecoder(body)
32243	decoder.UseNumber()
32244	var shape interface{}
32245	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32246		var snapshot bytes.Buffer
32247		io.Copy(&snapshot, ringBuffer)
32248		err = &smithy.DeserializationError{
32249			Err:      fmt.Errorf("failed to decode response body, %w", err),
32250			Snapshot: snapshot.Bytes(),
32251		}
32252		return err
32253	}
32254
32255	err := awsRestjson1_deserializeDocumentInternalException(&output, shape)
32256
32257	if err != nil {
32258		var snapshot bytes.Buffer
32259		io.Copy(&snapshot, ringBuffer)
32260		err = &smithy.DeserializationError{
32261			Err:      fmt.Errorf("failed to decode response body, %w", err),
32262			Snapshot: snapshot.Bytes(),
32263		}
32264		return err
32265	}
32266
32267	errorBody.Seek(0, io.SeekStart)
32268
32269	return output
32270}
32271
32272func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32273	output := &types.InternalFailureException{}
32274	var buff [1024]byte
32275	ringBuffer := smithyio.NewRingBuffer(buff[:])
32276
32277	body := io.TeeReader(errorBody, ringBuffer)
32278	decoder := json.NewDecoder(body)
32279	decoder.UseNumber()
32280	var shape interface{}
32281	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32282		var snapshot bytes.Buffer
32283		io.Copy(&snapshot, ringBuffer)
32284		err = &smithy.DeserializationError{
32285			Err:      fmt.Errorf("failed to decode response body, %w", err),
32286			Snapshot: snapshot.Bytes(),
32287		}
32288		return err
32289	}
32290
32291	err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape)
32292
32293	if err != nil {
32294		var snapshot bytes.Buffer
32295		io.Copy(&snapshot, ringBuffer)
32296		err = &smithy.DeserializationError{
32297			Err:      fmt.Errorf("failed to decode response body, %w", err),
32298			Snapshot: snapshot.Bytes(),
32299		}
32300		return err
32301	}
32302
32303	errorBody.Seek(0, io.SeekStart)
32304
32305	return output
32306}
32307
32308func awsRestjson1_deserializeErrorInvalidAggregationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32309	output := &types.InvalidAggregationException{}
32310	var buff [1024]byte
32311	ringBuffer := smithyio.NewRingBuffer(buff[:])
32312
32313	body := io.TeeReader(errorBody, ringBuffer)
32314	decoder := json.NewDecoder(body)
32315	decoder.UseNumber()
32316	var shape interface{}
32317	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32318		var snapshot bytes.Buffer
32319		io.Copy(&snapshot, ringBuffer)
32320		err = &smithy.DeserializationError{
32321			Err:      fmt.Errorf("failed to decode response body, %w", err),
32322			Snapshot: snapshot.Bytes(),
32323		}
32324		return err
32325	}
32326
32327	err := awsRestjson1_deserializeDocumentInvalidAggregationException(&output, shape)
32328
32329	if err != nil {
32330		var snapshot bytes.Buffer
32331		io.Copy(&snapshot, ringBuffer)
32332		err = &smithy.DeserializationError{
32333			Err:      fmt.Errorf("failed to decode response body, %w", err),
32334			Snapshot: snapshot.Bytes(),
32335		}
32336		return err
32337	}
32338
32339	errorBody.Seek(0, io.SeekStart)
32340
32341	return output
32342}
32343
32344func awsRestjson1_deserializeErrorInvalidQueryException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32345	output := &types.InvalidQueryException{}
32346	var buff [1024]byte
32347	ringBuffer := smithyio.NewRingBuffer(buff[:])
32348
32349	body := io.TeeReader(errorBody, ringBuffer)
32350	decoder := json.NewDecoder(body)
32351	decoder.UseNumber()
32352	var shape interface{}
32353	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32354		var snapshot bytes.Buffer
32355		io.Copy(&snapshot, ringBuffer)
32356		err = &smithy.DeserializationError{
32357			Err:      fmt.Errorf("failed to decode response body, %w", err),
32358			Snapshot: snapshot.Bytes(),
32359		}
32360		return err
32361	}
32362
32363	err := awsRestjson1_deserializeDocumentInvalidQueryException(&output, shape)
32364
32365	if err != nil {
32366		var snapshot bytes.Buffer
32367		io.Copy(&snapshot, ringBuffer)
32368		err = &smithy.DeserializationError{
32369			Err:      fmt.Errorf("failed to decode response body, %w", err),
32370			Snapshot: snapshot.Bytes(),
32371		}
32372		return err
32373	}
32374
32375	errorBody.Seek(0, io.SeekStart)
32376
32377	return output
32378}
32379
32380func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32381	output := &types.InvalidRequestException{}
32382	var buff [1024]byte
32383	ringBuffer := smithyio.NewRingBuffer(buff[:])
32384
32385	body := io.TeeReader(errorBody, ringBuffer)
32386	decoder := json.NewDecoder(body)
32387	decoder.UseNumber()
32388	var shape interface{}
32389	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32390		var snapshot bytes.Buffer
32391		io.Copy(&snapshot, ringBuffer)
32392		err = &smithy.DeserializationError{
32393			Err:      fmt.Errorf("failed to decode response body, %w", err),
32394			Snapshot: snapshot.Bytes(),
32395		}
32396		return err
32397	}
32398
32399	err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape)
32400
32401	if err != nil {
32402		var snapshot bytes.Buffer
32403		io.Copy(&snapshot, ringBuffer)
32404		err = &smithy.DeserializationError{
32405			Err:      fmt.Errorf("failed to decode response body, %w", err),
32406			Snapshot: snapshot.Bytes(),
32407		}
32408		return err
32409	}
32410
32411	errorBody.Seek(0, io.SeekStart)
32412
32413	return output
32414}
32415
32416func awsRestjson1_deserializeErrorInvalidResponseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32417	output := &types.InvalidResponseException{}
32418	var buff [1024]byte
32419	ringBuffer := smithyio.NewRingBuffer(buff[:])
32420
32421	body := io.TeeReader(errorBody, ringBuffer)
32422	decoder := json.NewDecoder(body)
32423	decoder.UseNumber()
32424	var shape interface{}
32425	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32426		var snapshot bytes.Buffer
32427		io.Copy(&snapshot, ringBuffer)
32428		err = &smithy.DeserializationError{
32429			Err:      fmt.Errorf("failed to decode response body, %w", err),
32430			Snapshot: snapshot.Bytes(),
32431		}
32432		return err
32433	}
32434
32435	err := awsRestjson1_deserializeDocumentInvalidResponseException(&output, shape)
32436
32437	if err != nil {
32438		var snapshot bytes.Buffer
32439		io.Copy(&snapshot, ringBuffer)
32440		err = &smithy.DeserializationError{
32441			Err:      fmt.Errorf("failed to decode response body, %w", err),
32442			Snapshot: snapshot.Bytes(),
32443		}
32444		return err
32445	}
32446
32447	errorBody.Seek(0, io.SeekStart)
32448
32449	return output
32450}
32451
32452func awsRestjson1_deserializeErrorInvalidStateTransitionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32453	output := &types.InvalidStateTransitionException{}
32454	var buff [1024]byte
32455	ringBuffer := smithyio.NewRingBuffer(buff[:])
32456
32457	body := io.TeeReader(errorBody, ringBuffer)
32458	decoder := json.NewDecoder(body)
32459	decoder.UseNumber()
32460	var shape interface{}
32461	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32462		var snapshot bytes.Buffer
32463		io.Copy(&snapshot, ringBuffer)
32464		err = &smithy.DeserializationError{
32465			Err:      fmt.Errorf("failed to decode response body, %w", err),
32466			Snapshot: snapshot.Bytes(),
32467		}
32468		return err
32469	}
32470
32471	err := awsRestjson1_deserializeDocumentInvalidStateTransitionException(&output, shape)
32472
32473	if err != nil {
32474		var snapshot bytes.Buffer
32475		io.Copy(&snapshot, ringBuffer)
32476		err = &smithy.DeserializationError{
32477			Err:      fmt.Errorf("failed to decode response body, %w", err),
32478			Snapshot: snapshot.Bytes(),
32479		}
32480		return err
32481	}
32482
32483	errorBody.Seek(0, io.SeekStart)
32484
32485	return output
32486}
32487
32488func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32489	output := &types.LimitExceededException{}
32490	var buff [1024]byte
32491	ringBuffer := smithyio.NewRingBuffer(buff[:])
32492
32493	body := io.TeeReader(errorBody, ringBuffer)
32494	decoder := json.NewDecoder(body)
32495	decoder.UseNumber()
32496	var shape interface{}
32497	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32498		var snapshot bytes.Buffer
32499		io.Copy(&snapshot, ringBuffer)
32500		err = &smithy.DeserializationError{
32501			Err:      fmt.Errorf("failed to decode response body, %w", err),
32502			Snapshot: snapshot.Bytes(),
32503		}
32504		return err
32505	}
32506
32507	err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape)
32508
32509	if err != nil {
32510		var snapshot bytes.Buffer
32511		io.Copy(&snapshot, ringBuffer)
32512		err = &smithy.DeserializationError{
32513			Err:      fmt.Errorf("failed to decode response body, %w", err),
32514			Snapshot: snapshot.Bytes(),
32515		}
32516		return err
32517	}
32518
32519	errorBody.Seek(0, io.SeekStart)
32520
32521	return output
32522}
32523
32524func awsRestjson1_deserializeErrorMalformedPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32525	output := &types.MalformedPolicyException{}
32526	var buff [1024]byte
32527	ringBuffer := smithyio.NewRingBuffer(buff[:])
32528
32529	body := io.TeeReader(errorBody, ringBuffer)
32530	decoder := json.NewDecoder(body)
32531	decoder.UseNumber()
32532	var shape interface{}
32533	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32534		var snapshot bytes.Buffer
32535		io.Copy(&snapshot, ringBuffer)
32536		err = &smithy.DeserializationError{
32537			Err:      fmt.Errorf("failed to decode response body, %w", err),
32538			Snapshot: snapshot.Bytes(),
32539		}
32540		return err
32541	}
32542
32543	err := awsRestjson1_deserializeDocumentMalformedPolicyException(&output, shape)
32544
32545	if err != nil {
32546		var snapshot bytes.Buffer
32547		io.Copy(&snapshot, ringBuffer)
32548		err = &smithy.DeserializationError{
32549			Err:      fmt.Errorf("failed to decode response body, %w", err),
32550			Snapshot: snapshot.Bytes(),
32551		}
32552		return err
32553	}
32554
32555	errorBody.Seek(0, io.SeekStart)
32556
32557	return output
32558}
32559
32560func awsRestjson1_deserializeErrorNotConfiguredException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32561	output := &types.NotConfiguredException{}
32562	var buff [1024]byte
32563	ringBuffer := smithyio.NewRingBuffer(buff[:])
32564
32565	body := io.TeeReader(errorBody, ringBuffer)
32566	decoder := json.NewDecoder(body)
32567	decoder.UseNumber()
32568	var shape interface{}
32569	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32570		var snapshot bytes.Buffer
32571		io.Copy(&snapshot, ringBuffer)
32572		err = &smithy.DeserializationError{
32573			Err:      fmt.Errorf("failed to decode response body, %w", err),
32574			Snapshot: snapshot.Bytes(),
32575		}
32576		return err
32577	}
32578
32579	err := awsRestjson1_deserializeDocumentNotConfiguredException(&output, shape)
32580
32581	if err != nil {
32582		var snapshot bytes.Buffer
32583		io.Copy(&snapshot, ringBuffer)
32584		err = &smithy.DeserializationError{
32585			Err:      fmt.Errorf("failed to decode response body, %w", err),
32586			Snapshot: snapshot.Bytes(),
32587		}
32588		return err
32589	}
32590
32591	errorBody.Seek(0, io.SeekStart)
32592
32593	return output
32594}
32595
32596func awsRestjson1_deserializeErrorRegistrationCodeValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32597	output := &types.RegistrationCodeValidationException{}
32598	var buff [1024]byte
32599	ringBuffer := smithyio.NewRingBuffer(buff[:])
32600
32601	body := io.TeeReader(errorBody, ringBuffer)
32602	decoder := json.NewDecoder(body)
32603	decoder.UseNumber()
32604	var shape interface{}
32605	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32606		var snapshot bytes.Buffer
32607		io.Copy(&snapshot, ringBuffer)
32608		err = &smithy.DeserializationError{
32609			Err:      fmt.Errorf("failed to decode response body, %w", err),
32610			Snapshot: snapshot.Bytes(),
32611		}
32612		return err
32613	}
32614
32615	err := awsRestjson1_deserializeDocumentRegistrationCodeValidationException(&output, shape)
32616
32617	if err != nil {
32618		var snapshot bytes.Buffer
32619		io.Copy(&snapshot, ringBuffer)
32620		err = &smithy.DeserializationError{
32621			Err:      fmt.Errorf("failed to decode response body, %w", err),
32622			Snapshot: snapshot.Bytes(),
32623		}
32624		return err
32625	}
32626
32627	errorBody.Seek(0, io.SeekStart)
32628
32629	return output
32630}
32631
32632func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32633	output := &types.ResourceAlreadyExistsException{}
32634	var buff [1024]byte
32635	ringBuffer := smithyio.NewRingBuffer(buff[:])
32636
32637	body := io.TeeReader(errorBody, ringBuffer)
32638	decoder := json.NewDecoder(body)
32639	decoder.UseNumber()
32640	var shape interface{}
32641	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32642		var snapshot bytes.Buffer
32643		io.Copy(&snapshot, ringBuffer)
32644		err = &smithy.DeserializationError{
32645			Err:      fmt.Errorf("failed to decode response body, %w", err),
32646			Snapshot: snapshot.Bytes(),
32647		}
32648		return err
32649	}
32650
32651	err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape)
32652
32653	if err != nil {
32654		var snapshot bytes.Buffer
32655		io.Copy(&snapshot, ringBuffer)
32656		err = &smithy.DeserializationError{
32657			Err:      fmt.Errorf("failed to decode response body, %w", err),
32658			Snapshot: snapshot.Bytes(),
32659		}
32660		return err
32661	}
32662
32663	errorBody.Seek(0, io.SeekStart)
32664
32665	return output
32666}
32667
32668func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32669	output := &types.ResourceNotFoundException{}
32670	var buff [1024]byte
32671	ringBuffer := smithyio.NewRingBuffer(buff[:])
32672
32673	body := io.TeeReader(errorBody, ringBuffer)
32674	decoder := json.NewDecoder(body)
32675	decoder.UseNumber()
32676	var shape interface{}
32677	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32678		var snapshot bytes.Buffer
32679		io.Copy(&snapshot, ringBuffer)
32680		err = &smithy.DeserializationError{
32681			Err:      fmt.Errorf("failed to decode response body, %w", err),
32682			Snapshot: snapshot.Bytes(),
32683		}
32684		return err
32685	}
32686
32687	err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
32688
32689	if err != nil {
32690		var snapshot bytes.Buffer
32691		io.Copy(&snapshot, ringBuffer)
32692		err = &smithy.DeserializationError{
32693			Err:      fmt.Errorf("failed to decode response body, %w", err),
32694			Snapshot: snapshot.Bytes(),
32695		}
32696		return err
32697	}
32698
32699	errorBody.Seek(0, io.SeekStart)
32700
32701	return output
32702}
32703
32704func awsRestjson1_deserializeErrorResourceRegistrationFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32705	output := &types.ResourceRegistrationFailureException{}
32706	var buff [1024]byte
32707	ringBuffer := smithyio.NewRingBuffer(buff[:])
32708
32709	body := io.TeeReader(errorBody, ringBuffer)
32710	decoder := json.NewDecoder(body)
32711	decoder.UseNumber()
32712	var shape interface{}
32713	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32714		var snapshot bytes.Buffer
32715		io.Copy(&snapshot, ringBuffer)
32716		err = &smithy.DeserializationError{
32717			Err:      fmt.Errorf("failed to decode response body, %w", err),
32718			Snapshot: snapshot.Bytes(),
32719		}
32720		return err
32721	}
32722
32723	err := awsRestjson1_deserializeDocumentResourceRegistrationFailureException(&output, shape)
32724
32725	if err != nil {
32726		var snapshot bytes.Buffer
32727		io.Copy(&snapshot, ringBuffer)
32728		err = &smithy.DeserializationError{
32729			Err:      fmt.Errorf("failed to decode response body, %w", err),
32730			Snapshot: snapshot.Bytes(),
32731		}
32732		return err
32733	}
32734
32735	errorBody.Seek(0, io.SeekStart)
32736
32737	return output
32738}
32739
32740func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32741	output := &types.ServiceUnavailableException{}
32742	var buff [1024]byte
32743	ringBuffer := smithyio.NewRingBuffer(buff[:])
32744
32745	body := io.TeeReader(errorBody, ringBuffer)
32746	decoder := json.NewDecoder(body)
32747	decoder.UseNumber()
32748	var shape interface{}
32749	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32750		var snapshot bytes.Buffer
32751		io.Copy(&snapshot, ringBuffer)
32752		err = &smithy.DeserializationError{
32753			Err:      fmt.Errorf("failed to decode response body, %w", err),
32754			Snapshot: snapshot.Bytes(),
32755		}
32756		return err
32757	}
32758
32759	err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape)
32760
32761	if err != nil {
32762		var snapshot bytes.Buffer
32763		io.Copy(&snapshot, ringBuffer)
32764		err = &smithy.DeserializationError{
32765			Err:      fmt.Errorf("failed to decode response body, %w", err),
32766			Snapshot: snapshot.Bytes(),
32767		}
32768		return err
32769	}
32770
32771	errorBody.Seek(0, io.SeekStart)
32772
32773	return output
32774}
32775
32776func awsRestjson1_deserializeErrorSqlParseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32777	output := &types.SqlParseException{}
32778	var buff [1024]byte
32779	ringBuffer := smithyio.NewRingBuffer(buff[:])
32780
32781	body := io.TeeReader(errorBody, ringBuffer)
32782	decoder := json.NewDecoder(body)
32783	decoder.UseNumber()
32784	var shape interface{}
32785	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32786		var snapshot bytes.Buffer
32787		io.Copy(&snapshot, ringBuffer)
32788		err = &smithy.DeserializationError{
32789			Err:      fmt.Errorf("failed to decode response body, %w", err),
32790			Snapshot: snapshot.Bytes(),
32791		}
32792		return err
32793	}
32794
32795	err := awsRestjson1_deserializeDocumentSqlParseException(&output, shape)
32796
32797	if err != nil {
32798		var snapshot bytes.Buffer
32799		io.Copy(&snapshot, ringBuffer)
32800		err = &smithy.DeserializationError{
32801			Err:      fmt.Errorf("failed to decode response body, %w", err),
32802			Snapshot: snapshot.Bytes(),
32803		}
32804		return err
32805	}
32806
32807	errorBody.Seek(0, io.SeekStart)
32808
32809	return output
32810}
32811
32812func awsRestjson1_deserializeErrorTaskAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32813	output := &types.TaskAlreadyExistsException{}
32814	var buff [1024]byte
32815	ringBuffer := smithyio.NewRingBuffer(buff[:])
32816
32817	body := io.TeeReader(errorBody, ringBuffer)
32818	decoder := json.NewDecoder(body)
32819	decoder.UseNumber()
32820	var shape interface{}
32821	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32822		var snapshot bytes.Buffer
32823		io.Copy(&snapshot, ringBuffer)
32824		err = &smithy.DeserializationError{
32825			Err:      fmt.Errorf("failed to decode response body, %w", err),
32826			Snapshot: snapshot.Bytes(),
32827		}
32828		return err
32829	}
32830
32831	err := awsRestjson1_deserializeDocumentTaskAlreadyExistsException(&output, shape)
32832
32833	if err != nil {
32834		var snapshot bytes.Buffer
32835		io.Copy(&snapshot, ringBuffer)
32836		err = &smithy.DeserializationError{
32837			Err:      fmt.Errorf("failed to decode response body, %w", err),
32838			Snapshot: snapshot.Bytes(),
32839		}
32840		return err
32841	}
32842
32843	errorBody.Seek(0, io.SeekStart)
32844
32845	return output
32846}
32847
32848func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32849	output := &types.ThrottlingException{}
32850	var buff [1024]byte
32851	ringBuffer := smithyio.NewRingBuffer(buff[:])
32852
32853	body := io.TeeReader(errorBody, ringBuffer)
32854	decoder := json.NewDecoder(body)
32855	decoder.UseNumber()
32856	var shape interface{}
32857	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32858		var snapshot bytes.Buffer
32859		io.Copy(&snapshot, ringBuffer)
32860		err = &smithy.DeserializationError{
32861			Err:      fmt.Errorf("failed to decode response body, %w", err),
32862			Snapshot: snapshot.Bytes(),
32863		}
32864		return err
32865	}
32866
32867	err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
32868
32869	if err != nil {
32870		var snapshot bytes.Buffer
32871		io.Copy(&snapshot, ringBuffer)
32872		err = &smithy.DeserializationError{
32873			Err:      fmt.Errorf("failed to decode response body, %w", err),
32874			Snapshot: snapshot.Bytes(),
32875		}
32876		return err
32877	}
32878
32879	errorBody.Seek(0, io.SeekStart)
32880
32881	return output
32882}
32883
32884func awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32885	output := &types.TransferAlreadyCompletedException{}
32886	var buff [1024]byte
32887	ringBuffer := smithyio.NewRingBuffer(buff[:])
32888
32889	body := io.TeeReader(errorBody, ringBuffer)
32890	decoder := json.NewDecoder(body)
32891	decoder.UseNumber()
32892	var shape interface{}
32893	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32894		var snapshot bytes.Buffer
32895		io.Copy(&snapshot, ringBuffer)
32896		err = &smithy.DeserializationError{
32897			Err:      fmt.Errorf("failed to decode response body, %w", err),
32898			Snapshot: snapshot.Bytes(),
32899		}
32900		return err
32901	}
32902
32903	err := awsRestjson1_deserializeDocumentTransferAlreadyCompletedException(&output, shape)
32904
32905	if err != nil {
32906		var snapshot bytes.Buffer
32907		io.Copy(&snapshot, ringBuffer)
32908		err = &smithy.DeserializationError{
32909			Err:      fmt.Errorf("failed to decode response body, %w", err),
32910			Snapshot: snapshot.Bytes(),
32911		}
32912		return err
32913	}
32914
32915	errorBody.Seek(0, io.SeekStart)
32916
32917	return output
32918}
32919
32920func awsRestjson1_deserializeErrorTransferConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32921	output := &types.TransferConflictException{}
32922	var buff [1024]byte
32923	ringBuffer := smithyio.NewRingBuffer(buff[:])
32924
32925	body := io.TeeReader(errorBody, ringBuffer)
32926	decoder := json.NewDecoder(body)
32927	decoder.UseNumber()
32928	var shape interface{}
32929	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32930		var snapshot bytes.Buffer
32931		io.Copy(&snapshot, ringBuffer)
32932		err = &smithy.DeserializationError{
32933			Err:      fmt.Errorf("failed to decode response body, %w", err),
32934			Snapshot: snapshot.Bytes(),
32935		}
32936		return err
32937	}
32938
32939	err := awsRestjson1_deserializeDocumentTransferConflictException(&output, shape)
32940
32941	if err != nil {
32942		var snapshot bytes.Buffer
32943		io.Copy(&snapshot, ringBuffer)
32944		err = &smithy.DeserializationError{
32945			Err:      fmt.Errorf("failed to decode response body, %w", err),
32946			Snapshot: snapshot.Bytes(),
32947		}
32948		return err
32949	}
32950
32951	errorBody.Seek(0, io.SeekStart)
32952
32953	return output
32954}
32955
32956func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32957	output := &types.UnauthorizedException{}
32958	var buff [1024]byte
32959	ringBuffer := smithyio.NewRingBuffer(buff[:])
32960
32961	body := io.TeeReader(errorBody, ringBuffer)
32962	decoder := json.NewDecoder(body)
32963	decoder.UseNumber()
32964	var shape interface{}
32965	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
32966		var snapshot bytes.Buffer
32967		io.Copy(&snapshot, ringBuffer)
32968		err = &smithy.DeserializationError{
32969			Err:      fmt.Errorf("failed to decode response body, %w", err),
32970			Snapshot: snapshot.Bytes(),
32971		}
32972		return err
32973	}
32974
32975	err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape)
32976
32977	if err != nil {
32978		var snapshot bytes.Buffer
32979		io.Copy(&snapshot, ringBuffer)
32980		err = &smithy.DeserializationError{
32981			Err:      fmt.Errorf("failed to decode response body, %w", err),
32982			Snapshot: snapshot.Bytes(),
32983		}
32984		return err
32985	}
32986
32987	errorBody.Seek(0, io.SeekStart)
32988
32989	return output
32990}
32991
32992func awsRestjson1_deserializeErrorVersionConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
32993	output := &types.VersionConflictException{}
32994	var buff [1024]byte
32995	ringBuffer := smithyio.NewRingBuffer(buff[:])
32996
32997	body := io.TeeReader(errorBody, ringBuffer)
32998	decoder := json.NewDecoder(body)
32999	decoder.UseNumber()
33000	var shape interface{}
33001	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
33002		var snapshot bytes.Buffer
33003		io.Copy(&snapshot, ringBuffer)
33004		err = &smithy.DeserializationError{
33005			Err:      fmt.Errorf("failed to decode response body, %w", err),
33006			Snapshot: snapshot.Bytes(),
33007		}
33008		return err
33009	}
33010
33011	err := awsRestjson1_deserializeDocumentVersionConflictException(&output, shape)
33012
33013	if err != nil {
33014		var snapshot bytes.Buffer
33015		io.Copy(&snapshot, ringBuffer)
33016		err = &smithy.DeserializationError{
33017			Err:      fmt.Errorf("failed to decode response body, %w", err),
33018			Snapshot: snapshot.Bytes(),
33019		}
33020		return err
33021	}
33022
33023	errorBody.Seek(0, io.SeekStart)
33024
33025	return output
33026}
33027
33028func awsRestjson1_deserializeErrorVersionsLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
33029	output := &types.VersionsLimitExceededException{}
33030	var buff [1024]byte
33031	ringBuffer := smithyio.NewRingBuffer(buff[:])
33032
33033	body := io.TeeReader(errorBody, ringBuffer)
33034	decoder := json.NewDecoder(body)
33035	decoder.UseNumber()
33036	var shape interface{}
33037	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
33038		var snapshot bytes.Buffer
33039		io.Copy(&snapshot, ringBuffer)
33040		err = &smithy.DeserializationError{
33041			Err:      fmt.Errorf("failed to decode response body, %w", err),
33042			Snapshot: snapshot.Bytes(),
33043		}
33044		return err
33045	}
33046
33047	err := awsRestjson1_deserializeDocumentVersionsLimitExceededException(&output, shape)
33048
33049	if err != nil {
33050		var snapshot bytes.Buffer
33051		io.Copy(&snapshot, ringBuffer)
33052		err = &smithy.DeserializationError{
33053			Err:      fmt.Errorf("failed to decode response body, %w", err),
33054			Snapshot: snapshot.Bytes(),
33055		}
33056		return err
33057	}
33058
33059	errorBody.Seek(0, io.SeekStart)
33060
33061	return output
33062}
33063
33064func awsRestjson1_deserializeDocumentAbortConfig(v **types.AbortConfig, value interface{}) error {
33065	if v == nil {
33066		return fmt.Errorf("unexpected nil of type %T", v)
33067	}
33068	if value == nil {
33069		return nil
33070	}
33071
33072	shape, ok := value.(map[string]interface{})
33073	if !ok {
33074		return fmt.Errorf("unexpected JSON type %v", value)
33075	}
33076
33077	var sv *types.AbortConfig
33078	if *v == nil {
33079		sv = &types.AbortConfig{}
33080	} else {
33081		sv = *v
33082	}
33083
33084	for key, value := range shape {
33085		switch key {
33086		case "criteriaList":
33087			if err := awsRestjson1_deserializeDocumentAbortCriteriaList(&sv.CriteriaList, value); err != nil {
33088				return err
33089			}
33090
33091		default:
33092			_, _ = key, value
33093
33094		}
33095	}
33096	*v = sv
33097	return nil
33098}
33099
33100func awsRestjson1_deserializeDocumentAbortCriteria(v **types.AbortCriteria, value interface{}) error {
33101	if v == nil {
33102		return fmt.Errorf("unexpected nil of type %T", v)
33103	}
33104	if value == nil {
33105		return nil
33106	}
33107
33108	shape, ok := value.(map[string]interface{})
33109	if !ok {
33110		return fmt.Errorf("unexpected JSON type %v", value)
33111	}
33112
33113	var sv *types.AbortCriteria
33114	if *v == nil {
33115		sv = &types.AbortCriteria{}
33116	} else {
33117		sv = *v
33118	}
33119
33120	for key, value := range shape {
33121		switch key {
33122		case "action":
33123			if value != nil {
33124				jtv, ok := value.(string)
33125				if !ok {
33126					return fmt.Errorf("expected AbortAction to be of type string, got %T instead", value)
33127				}
33128				sv.Action = types.AbortAction(jtv)
33129			}
33130
33131		case "failureType":
33132			if value != nil {
33133				jtv, ok := value.(string)
33134				if !ok {
33135					return fmt.Errorf("expected JobExecutionFailureType to be of type string, got %T instead", value)
33136				}
33137				sv.FailureType = types.JobExecutionFailureType(jtv)
33138			}
33139
33140		case "minNumberOfExecutedThings":
33141			if value != nil {
33142				jtv, ok := value.(json.Number)
33143				if !ok {
33144					return fmt.Errorf("expected MinimumNumberOfExecutedThings to be json.Number, got %T instead", value)
33145				}
33146				i64, err := jtv.Int64()
33147				if err != nil {
33148					return err
33149				}
33150				sv.MinNumberOfExecutedThings = ptr.Int32(int32(i64))
33151			}
33152
33153		case "thresholdPercentage":
33154			if value != nil {
33155				jtv, ok := value.(json.Number)
33156				if !ok {
33157					return fmt.Errorf("expected AbortThresholdPercentage to be json.Number, got %T instead", value)
33158				}
33159				f64, err := jtv.Float64()
33160				if err != nil {
33161					return err
33162				}
33163				sv.ThresholdPercentage = ptr.Float64(f64)
33164			}
33165
33166		default:
33167			_, _ = key, value
33168
33169		}
33170	}
33171	*v = sv
33172	return nil
33173}
33174
33175func awsRestjson1_deserializeDocumentAbortCriteriaList(v *[]types.AbortCriteria, value interface{}) error {
33176	if v == nil {
33177		return fmt.Errorf("unexpected nil of type %T", v)
33178	}
33179	if value == nil {
33180		return nil
33181	}
33182
33183	shape, ok := value.([]interface{})
33184	if !ok {
33185		return fmt.Errorf("unexpected JSON type %v", value)
33186	}
33187
33188	var cv []types.AbortCriteria
33189	if *v == nil {
33190		cv = []types.AbortCriteria{}
33191	} else {
33192		cv = *v
33193	}
33194
33195	for _, value := range shape {
33196		var col types.AbortCriteria
33197		destAddr := &col
33198		if err := awsRestjson1_deserializeDocumentAbortCriteria(&destAddr, value); err != nil {
33199			return err
33200		}
33201		col = *destAddr
33202		cv = append(cv, col)
33203
33204	}
33205	*v = cv
33206	return nil
33207}
33208
33209func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) error {
33210	if v == nil {
33211		return fmt.Errorf("unexpected nil of type %T", v)
33212	}
33213	if value == nil {
33214		return nil
33215	}
33216
33217	shape, ok := value.(map[string]interface{})
33218	if !ok {
33219		return fmt.Errorf("unexpected JSON type %v", value)
33220	}
33221
33222	var sv *types.Action
33223	if *v == nil {
33224		sv = &types.Action{}
33225	} else {
33226		sv = *v
33227	}
33228
33229	for key, value := range shape {
33230		switch key {
33231		case "cloudwatchAlarm":
33232			if err := awsRestjson1_deserializeDocumentCloudwatchAlarmAction(&sv.CloudwatchAlarm, value); err != nil {
33233				return err
33234			}
33235
33236		case "cloudwatchLogs":
33237			if err := awsRestjson1_deserializeDocumentCloudwatchLogsAction(&sv.CloudwatchLogs, value); err != nil {
33238				return err
33239			}
33240
33241		case "cloudwatchMetric":
33242			if err := awsRestjson1_deserializeDocumentCloudwatchMetricAction(&sv.CloudwatchMetric, value); err != nil {
33243				return err
33244			}
33245
33246		case "dynamoDB":
33247			if err := awsRestjson1_deserializeDocumentDynamoDBAction(&sv.DynamoDB, value); err != nil {
33248				return err
33249			}
33250
33251		case "dynamoDBv2":
33252			if err := awsRestjson1_deserializeDocumentDynamoDBv2Action(&sv.DynamoDBv2, value); err != nil {
33253				return err
33254			}
33255
33256		case "elasticsearch":
33257			if err := awsRestjson1_deserializeDocumentElasticsearchAction(&sv.Elasticsearch, value); err != nil {
33258				return err
33259			}
33260
33261		case "firehose":
33262			if err := awsRestjson1_deserializeDocumentFirehoseAction(&sv.Firehose, value); err != nil {
33263				return err
33264			}
33265
33266		case "http":
33267			if err := awsRestjson1_deserializeDocumentHttpAction(&sv.Http, value); err != nil {
33268				return err
33269			}
33270
33271		case "iotAnalytics":
33272			if err := awsRestjson1_deserializeDocumentIotAnalyticsAction(&sv.IotAnalytics, value); err != nil {
33273				return err
33274			}
33275
33276		case "iotEvents":
33277			if err := awsRestjson1_deserializeDocumentIotEventsAction(&sv.IotEvents, value); err != nil {
33278				return err
33279			}
33280
33281		case "iotSiteWise":
33282			if err := awsRestjson1_deserializeDocumentIotSiteWiseAction(&sv.IotSiteWise, value); err != nil {
33283				return err
33284			}
33285
33286		case "kinesis":
33287			if err := awsRestjson1_deserializeDocumentKinesisAction(&sv.Kinesis, value); err != nil {
33288				return err
33289			}
33290
33291		case "lambda":
33292			if err := awsRestjson1_deserializeDocumentLambdaAction(&sv.Lambda, value); err != nil {
33293				return err
33294			}
33295
33296		case "republish":
33297			if err := awsRestjson1_deserializeDocumentRepublishAction(&sv.Republish, value); err != nil {
33298				return err
33299			}
33300
33301		case "s3":
33302			if err := awsRestjson1_deserializeDocumentS3Action(&sv.S3, value); err != nil {
33303				return err
33304			}
33305
33306		case "salesforce":
33307			if err := awsRestjson1_deserializeDocumentSalesforceAction(&sv.Salesforce, value); err != nil {
33308				return err
33309			}
33310
33311		case "sns":
33312			if err := awsRestjson1_deserializeDocumentSnsAction(&sv.Sns, value); err != nil {
33313				return err
33314			}
33315
33316		case "sqs":
33317			if err := awsRestjson1_deserializeDocumentSqsAction(&sv.Sqs, value); err != nil {
33318				return err
33319			}
33320
33321		case "stepFunctions":
33322			if err := awsRestjson1_deserializeDocumentStepFunctionsAction(&sv.StepFunctions, value); err != nil {
33323				return err
33324			}
33325
33326		case "timestream":
33327			if err := awsRestjson1_deserializeDocumentTimestreamAction(&sv.Timestream, value); err != nil {
33328				return err
33329			}
33330
33331		default:
33332			_, _ = key, value
33333
33334		}
33335	}
33336	*v = sv
33337	return nil
33338}
33339
33340func awsRestjson1_deserializeDocumentActionList(v *[]types.Action, value interface{}) error {
33341	if v == nil {
33342		return fmt.Errorf("unexpected nil of type %T", v)
33343	}
33344	if value == nil {
33345		return nil
33346	}
33347
33348	shape, ok := value.([]interface{})
33349	if !ok {
33350		return fmt.Errorf("unexpected JSON type %v", value)
33351	}
33352
33353	var cv []types.Action
33354	if *v == nil {
33355		cv = []types.Action{}
33356	} else {
33357		cv = *v
33358	}
33359
33360	for _, value := range shape {
33361		var col types.Action
33362		destAddr := &col
33363		if err := awsRestjson1_deserializeDocumentAction(&destAddr, value); err != nil {
33364			return err
33365		}
33366		col = *destAddr
33367		cv = append(cv, col)
33368
33369	}
33370	*v = cv
33371	return nil
33372}
33373
33374func awsRestjson1_deserializeDocumentActiveViolation(v **types.ActiveViolation, value interface{}) error {
33375	if v == nil {
33376		return fmt.Errorf("unexpected nil of type %T", v)
33377	}
33378	if value == nil {
33379		return nil
33380	}
33381
33382	shape, ok := value.(map[string]interface{})
33383	if !ok {
33384		return fmt.Errorf("unexpected JSON type %v", value)
33385	}
33386
33387	var sv *types.ActiveViolation
33388	if *v == nil {
33389		sv = &types.ActiveViolation{}
33390	} else {
33391		sv = *v
33392	}
33393
33394	for key, value := range shape {
33395		switch key {
33396		case "behavior":
33397			if err := awsRestjson1_deserializeDocumentBehavior(&sv.Behavior, value); err != nil {
33398				return err
33399			}
33400
33401		case "lastViolationTime":
33402			if value != nil {
33403				jtv, ok := value.(json.Number)
33404				if !ok {
33405					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
33406				}
33407				f64, err := jtv.Float64()
33408				if err != nil {
33409					return err
33410				}
33411				sv.LastViolationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
33412			}
33413
33414		case "lastViolationValue":
33415			if err := awsRestjson1_deserializeDocumentMetricValue(&sv.LastViolationValue, value); err != nil {
33416				return err
33417			}
33418
33419		case "securityProfileName":
33420			if value != nil {
33421				jtv, ok := value.(string)
33422				if !ok {
33423					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
33424				}
33425				sv.SecurityProfileName = ptr.String(jtv)
33426			}
33427
33428		case "thingName":
33429			if value != nil {
33430				jtv, ok := value.(string)
33431				if !ok {
33432					return fmt.Errorf("expected DeviceDefenderThingName to be of type string, got %T instead", value)
33433				}
33434				sv.ThingName = ptr.String(jtv)
33435			}
33436
33437		case "violationId":
33438			if value != nil {
33439				jtv, ok := value.(string)
33440				if !ok {
33441					return fmt.Errorf("expected ViolationId to be of type string, got %T instead", value)
33442				}
33443				sv.ViolationId = ptr.String(jtv)
33444			}
33445
33446		case "violationStartTime":
33447			if value != nil {
33448				jtv, ok := value.(json.Number)
33449				if !ok {
33450					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
33451				}
33452				f64, err := jtv.Float64()
33453				if err != nil {
33454					return err
33455				}
33456				sv.ViolationStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
33457			}
33458
33459		default:
33460			_, _ = key, value
33461
33462		}
33463	}
33464	*v = sv
33465	return nil
33466}
33467
33468func awsRestjson1_deserializeDocumentActiveViolations(v *[]types.ActiveViolation, value interface{}) error {
33469	if v == nil {
33470		return fmt.Errorf("unexpected nil of type %T", v)
33471	}
33472	if value == nil {
33473		return nil
33474	}
33475
33476	shape, ok := value.([]interface{})
33477	if !ok {
33478		return fmt.Errorf("unexpected JSON type %v", value)
33479	}
33480
33481	var cv []types.ActiveViolation
33482	if *v == nil {
33483		cv = []types.ActiveViolation{}
33484	} else {
33485		cv = *v
33486	}
33487
33488	for _, value := range shape {
33489		var col types.ActiveViolation
33490		destAddr := &col
33491		if err := awsRestjson1_deserializeDocumentActiveViolation(&destAddr, value); err != nil {
33492			return err
33493		}
33494		col = *destAddr
33495		cv = append(cv, col)
33496
33497	}
33498	*v = cv
33499	return nil
33500}
33501
33502func awsRestjson1_deserializeDocumentAdditionalMetricsToRetainList(v *[]string, value interface{}) error {
33503	if v == nil {
33504		return fmt.Errorf("unexpected nil of type %T", v)
33505	}
33506	if value == nil {
33507		return nil
33508	}
33509
33510	shape, ok := value.([]interface{})
33511	if !ok {
33512		return fmt.Errorf("unexpected JSON type %v", value)
33513	}
33514
33515	var cv []string
33516	if *v == nil {
33517		cv = []string{}
33518	} else {
33519		cv = *v
33520	}
33521
33522	for _, value := range shape {
33523		var col string
33524		if value != nil {
33525			jtv, ok := value.(string)
33526			if !ok {
33527				return fmt.Errorf("expected BehaviorMetric to be of type string, got %T instead", value)
33528			}
33529			col = jtv
33530		}
33531		cv = append(cv, col)
33532
33533	}
33534	*v = cv
33535	return nil
33536}
33537
33538func awsRestjson1_deserializeDocumentAdditionalMetricsToRetainV2List(v *[]types.MetricToRetain, value interface{}) error {
33539	if v == nil {
33540		return fmt.Errorf("unexpected nil of type %T", v)
33541	}
33542	if value == nil {
33543		return nil
33544	}
33545
33546	shape, ok := value.([]interface{})
33547	if !ok {
33548		return fmt.Errorf("unexpected JSON type %v", value)
33549	}
33550
33551	var cv []types.MetricToRetain
33552	if *v == nil {
33553		cv = []types.MetricToRetain{}
33554	} else {
33555		cv = *v
33556	}
33557
33558	for _, value := range shape {
33559		var col types.MetricToRetain
33560		destAddr := &col
33561		if err := awsRestjson1_deserializeDocumentMetricToRetain(&destAddr, value); err != nil {
33562			return err
33563		}
33564		col = *destAddr
33565		cv = append(cv, col)
33566
33567	}
33568	*v = cv
33569	return nil
33570}
33571
33572func awsRestjson1_deserializeDocumentAdditionalParameterMap(v *map[string]string, value interface{}) error {
33573	if v == nil {
33574		return fmt.Errorf("unexpected nil of type %T", v)
33575	}
33576	if value == nil {
33577		return nil
33578	}
33579
33580	shape, ok := value.(map[string]interface{})
33581	if !ok {
33582		return fmt.Errorf("unexpected JSON type %v", value)
33583	}
33584
33585	var mv map[string]string
33586	if *v == nil {
33587		mv = map[string]string{}
33588	} else {
33589		mv = *v
33590	}
33591
33592	for key, value := range shape {
33593		var parsedVal string
33594		if value != nil {
33595			jtv, ok := value.(string)
33596			if !ok {
33597				return fmt.Errorf("expected Value to be of type string, got %T instead", value)
33598			}
33599			parsedVal = jtv
33600		}
33601		mv[key] = parsedVal
33602
33603	}
33604	*v = mv
33605	return nil
33606}
33607
33608func awsRestjson1_deserializeDocumentAddThingsToThingGroupParams(v **types.AddThingsToThingGroupParams, value interface{}) error {
33609	if v == nil {
33610		return fmt.Errorf("unexpected nil of type %T", v)
33611	}
33612	if value == nil {
33613		return nil
33614	}
33615
33616	shape, ok := value.(map[string]interface{})
33617	if !ok {
33618		return fmt.Errorf("unexpected JSON type %v", value)
33619	}
33620
33621	var sv *types.AddThingsToThingGroupParams
33622	if *v == nil {
33623		sv = &types.AddThingsToThingGroupParams{}
33624	} else {
33625		sv = *v
33626	}
33627
33628	for key, value := range shape {
33629		switch key {
33630		case "overrideDynamicGroups":
33631			if value != nil {
33632				jtv, ok := value.(bool)
33633				if !ok {
33634					return fmt.Errorf("expected OverrideDynamicGroups to be of type *bool, got %T instead", value)
33635				}
33636				sv.OverrideDynamicGroups = jtv
33637			}
33638
33639		case "thingGroupNames":
33640			if err := awsRestjson1_deserializeDocumentThingGroupNames(&sv.ThingGroupNames, value); err != nil {
33641				return err
33642			}
33643
33644		default:
33645			_, _ = key, value
33646
33647		}
33648	}
33649	*v = sv
33650	return nil
33651}
33652
33653func awsRestjson1_deserializeDocumentAlertTarget(v **types.AlertTarget, value interface{}) error {
33654	if v == nil {
33655		return fmt.Errorf("unexpected nil of type %T", v)
33656	}
33657	if value == nil {
33658		return nil
33659	}
33660
33661	shape, ok := value.(map[string]interface{})
33662	if !ok {
33663		return fmt.Errorf("unexpected JSON type %v", value)
33664	}
33665
33666	var sv *types.AlertTarget
33667	if *v == nil {
33668		sv = &types.AlertTarget{}
33669	} else {
33670		sv = *v
33671	}
33672
33673	for key, value := range shape {
33674		switch key {
33675		case "alertTargetArn":
33676			if value != nil {
33677				jtv, ok := value.(string)
33678				if !ok {
33679					return fmt.Errorf("expected AlertTargetArn to be of type string, got %T instead", value)
33680				}
33681				sv.AlertTargetArn = ptr.String(jtv)
33682			}
33683
33684		case "roleArn":
33685			if value != nil {
33686				jtv, ok := value.(string)
33687				if !ok {
33688					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
33689				}
33690				sv.RoleArn = ptr.String(jtv)
33691			}
33692
33693		default:
33694			_, _ = key, value
33695
33696		}
33697	}
33698	*v = sv
33699	return nil
33700}
33701
33702func awsRestjson1_deserializeDocumentAlertTargets(v *map[string]types.AlertTarget, value interface{}) error {
33703	if v == nil {
33704		return fmt.Errorf("unexpected nil of type %T", v)
33705	}
33706	if value == nil {
33707		return nil
33708	}
33709
33710	shape, ok := value.(map[string]interface{})
33711	if !ok {
33712		return fmt.Errorf("unexpected JSON type %v", value)
33713	}
33714
33715	var mv map[string]types.AlertTarget
33716	if *v == nil {
33717		mv = map[string]types.AlertTarget{}
33718	} else {
33719		mv = *v
33720	}
33721
33722	for key, value := range shape {
33723		var parsedVal types.AlertTarget
33724		mapVar := parsedVal
33725		destAddr := &mapVar
33726		if err := awsRestjson1_deserializeDocumentAlertTarget(&destAddr, value); err != nil {
33727			return err
33728		}
33729		parsedVal = *destAddr
33730		mv[key] = parsedVal
33731
33732	}
33733	*v = mv
33734	return nil
33735}
33736
33737func awsRestjson1_deserializeDocumentAllowed(v **types.Allowed, value interface{}) error {
33738	if v == nil {
33739		return fmt.Errorf("unexpected nil of type %T", v)
33740	}
33741	if value == nil {
33742		return nil
33743	}
33744
33745	shape, ok := value.(map[string]interface{})
33746	if !ok {
33747		return fmt.Errorf("unexpected JSON type %v", value)
33748	}
33749
33750	var sv *types.Allowed
33751	if *v == nil {
33752		sv = &types.Allowed{}
33753	} else {
33754		sv = *v
33755	}
33756
33757	for key, value := range shape {
33758		switch key {
33759		case "policies":
33760			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
33761				return err
33762			}
33763
33764		default:
33765			_, _ = key, value
33766
33767		}
33768	}
33769	*v = sv
33770	return nil
33771}
33772
33773func awsRestjson1_deserializeDocumentAssetPropertyTimestamp(v **types.AssetPropertyTimestamp, value interface{}) error {
33774	if v == nil {
33775		return fmt.Errorf("unexpected nil of type %T", v)
33776	}
33777	if value == nil {
33778		return nil
33779	}
33780
33781	shape, ok := value.(map[string]interface{})
33782	if !ok {
33783		return fmt.Errorf("unexpected JSON type %v", value)
33784	}
33785
33786	var sv *types.AssetPropertyTimestamp
33787	if *v == nil {
33788		sv = &types.AssetPropertyTimestamp{}
33789	} else {
33790		sv = *v
33791	}
33792
33793	for key, value := range shape {
33794		switch key {
33795		case "offsetInNanos":
33796			if value != nil {
33797				jtv, ok := value.(string)
33798				if !ok {
33799					return fmt.Errorf("expected AssetPropertyOffsetInNanos to be of type string, got %T instead", value)
33800				}
33801				sv.OffsetInNanos = ptr.String(jtv)
33802			}
33803
33804		case "timeInSeconds":
33805			if value != nil {
33806				jtv, ok := value.(string)
33807				if !ok {
33808					return fmt.Errorf("expected AssetPropertyTimeInSeconds to be of type string, got %T instead", value)
33809				}
33810				sv.TimeInSeconds = ptr.String(jtv)
33811			}
33812
33813		default:
33814			_, _ = key, value
33815
33816		}
33817	}
33818	*v = sv
33819	return nil
33820}
33821
33822func awsRestjson1_deserializeDocumentAssetPropertyValue(v **types.AssetPropertyValue, value interface{}) error {
33823	if v == nil {
33824		return fmt.Errorf("unexpected nil of type %T", v)
33825	}
33826	if value == nil {
33827		return nil
33828	}
33829
33830	shape, ok := value.(map[string]interface{})
33831	if !ok {
33832		return fmt.Errorf("unexpected JSON type %v", value)
33833	}
33834
33835	var sv *types.AssetPropertyValue
33836	if *v == nil {
33837		sv = &types.AssetPropertyValue{}
33838	} else {
33839		sv = *v
33840	}
33841
33842	for key, value := range shape {
33843		switch key {
33844		case "quality":
33845			if value != nil {
33846				jtv, ok := value.(string)
33847				if !ok {
33848					return fmt.Errorf("expected AssetPropertyQuality to be of type string, got %T instead", value)
33849				}
33850				sv.Quality = ptr.String(jtv)
33851			}
33852
33853		case "timestamp":
33854			if err := awsRestjson1_deserializeDocumentAssetPropertyTimestamp(&sv.Timestamp, value); err != nil {
33855				return err
33856			}
33857
33858		case "value":
33859			if err := awsRestjson1_deserializeDocumentAssetPropertyVariant(&sv.Value, value); err != nil {
33860				return err
33861			}
33862
33863		default:
33864			_, _ = key, value
33865
33866		}
33867	}
33868	*v = sv
33869	return nil
33870}
33871
33872func awsRestjson1_deserializeDocumentAssetPropertyValueList(v *[]types.AssetPropertyValue, value interface{}) error {
33873	if v == nil {
33874		return fmt.Errorf("unexpected nil of type %T", v)
33875	}
33876	if value == nil {
33877		return nil
33878	}
33879
33880	shape, ok := value.([]interface{})
33881	if !ok {
33882		return fmt.Errorf("unexpected JSON type %v", value)
33883	}
33884
33885	var cv []types.AssetPropertyValue
33886	if *v == nil {
33887		cv = []types.AssetPropertyValue{}
33888	} else {
33889		cv = *v
33890	}
33891
33892	for _, value := range shape {
33893		var col types.AssetPropertyValue
33894		destAddr := &col
33895		if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&destAddr, value); err != nil {
33896			return err
33897		}
33898		col = *destAddr
33899		cv = append(cv, col)
33900
33901	}
33902	*v = cv
33903	return nil
33904}
33905
33906func awsRestjson1_deserializeDocumentAssetPropertyVariant(v *types.AssetPropertyVariant, value interface{}) error {
33907	if v == nil {
33908		return fmt.Errorf("unexpected nil of type %T", v)
33909	}
33910	if value == nil {
33911		return nil
33912	}
33913
33914	shape, ok := value.(map[string]interface{})
33915	if !ok {
33916		return fmt.Errorf("unexpected JSON type %v", value)
33917	}
33918
33919	var uv types.AssetPropertyVariant
33920loop:
33921	for key, value := range shape {
33922		switch key {
33923		case "booleanValue":
33924			var mv string
33925			if value != nil {
33926				jtv, ok := value.(string)
33927				if !ok {
33928					return fmt.Errorf("expected AssetPropertyBooleanValue to be of type string, got %T instead", value)
33929				}
33930				mv = jtv
33931			}
33932			uv = &types.AssetPropertyVariantMemberBooleanValue{Value: mv}
33933			break loop
33934
33935		case "doubleValue":
33936			var mv string
33937			if value != nil {
33938				jtv, ok := value.(string)
33939				if !ok {
33940					return fmt.Errorf("expected AssetPropertyDoubleValue to be of type string, got %T instead", value)
33941				}
33942				mv = jtv
33943			}
33944			uv = &types.AssetPropertyVariantMemberDoubleValue{Value: mv}
33945			break loop
33946
33947		case "integerValue":
33948			var mv string
33949			if value != nil {
33950				jtv, ok := value.(string)
33951				if !ok {
33952					return fmt.Errorf("expected AssetPropertyIntegerValue to be of type string, got %T instead", value)
33953				}
33954				mv = jtv
33955			}
33956			uv = &types.AssetPropertyVariantMemberIntegerValue{Value: mv}
33957			break loop
33958
33959		case "stringValue":
33960			var mv string
33961			if value != nil {
33962				jtv, ok := value.(string)
33963				if !ok {
33964					return fmt.Errorf("expected AssetPropertyStringValue to be of type string, got %T instead", value)
33965				}
33966				mv = jtv
33967			}
33968			uv = &types.AssetPropertyVariantMemberStringValue{Value: mv}
33969			break loop
33970
33971		default:
33972			uv = &types.UnknownUnionMember{Tag: key}
33973			break loop
33974
33975		}
33976	}
33977	*v = uv
33978	return nil
33979}
33980
33981func awsRestjson1_deserializeDocumentAttributePayload(v **types.AttributePayload, value interface{}) error {
33982	if v == nil {
33983		return fmt.Errorf("unexpected nil of type %T", v)
33984	}
33985	if value == nil {
33986		return nil
33987	}
33988
33989	shape, ok := value.(map[string]interface{})
33990	if !ok {
33991		return fmt.Errorf("unexpected JSON type %v", value)
33992	}
33993
33994	var sv *types.AttributePayload
33995	if *v == nil {
33996		sv = &types.AttributePayload{}
33997	} else {
33998		sv = *v
33999	}
34000
34001	for key, value := range shape {
34002		switch key {
34003		case "attributes":
34004			if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil {
34005				return err
34006			}
34007
34008		case "merge":
34009			if value != nil {
34010				jtv, ok := value.(bool)
34011				if !ok {
34012					return fmt.Errorf("expected Flag to be of type *bool, got %T instead", value)
34013				}
34014				sv.Merge = jtv
34015			}
34016
34017		default:
34018			_, _ = key, value
34019
34020		}
34021	}
34022	*v = sv
34023	return nil
34024}
34025
34026func awsRestjson1_deserializeDocumentAttributes(v *map[string]string, value interface{}) error {
34027	if v == nil {
34028		return fmt.Errorf("unexpected nil of type %T", v)
34029	}
34030	if value == nil {
34031		return nil
34032	}
34033
34034	shape, ok := value.(map[string]interface{})
34035	if !ok {
34036		return fmt.Errorf("unexpected JSON type %v", value)
34037	}
34038
34039	var mv map[string]string
34040	if *v == nil {
34041		mv = map[string]string{}
34042	} else {
34043		mv = *v
34044	}
34045
34046	for key, value := range shape {
34047		var parsedVal string
34048		if value != nil {
34049			jtv, ok := value.(string)
34050			if !ok {
34051				return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value)
34052			}
34053			parsedVal = jtv
34054		}
34055		mv[key] = parsedVal
34056
34057	}
34058	*v = mv
34059	return nil
34060}
34061
34062func awsRestjson1_deserializeDocumentAttributesMap(v *map[string]string, value interface{}) error {
34063	if v == nil {
34064		return fmt.Errorf("unexpected nil of type %T", v)
34065	}
34066	if value == nil {
34067		return nil
34068	}
34069
34070	shape, ok := value.(map[string]interface{})
34071	if !ok {
34072		return fmt.Errorf("unexpected JSON type %v", value)
34073	}
34074
34075	var mv map[string]string
34076	if *v == nil {
34077		mv = map[string]string{}
34078	} else {
34079		mv = *v
34080	}
34081
34082	for key, value := range shape {
34083		var parsedVal string
34084		if value != nil {
34085			jtv, ok := value.(string)
34086			if !ok {
34087				return fmt.Errorf("expected Value to be of type string, got %T instead", value)
34088			}
34089			parsedVal = jtv
34090		}
34091		mv[key] = parsedVal
34092
34093	}
34094	*v = mv
34095	return nil
34096}
34097
34098func awsRestjson1_deserializeDocumentAuditCheckConfiguration(v **types.AuditCheckConfiguration, value interface{}) error {
34099	if v == nil {
34100		return fmt.Errorf("unexpected nil of type %T", v)
34101	}
34102	if value == nil {
34103		return nil
34104	}
34105
34106	shape, ok := value.(map[string]interface{})
34107	if !ok {
34108		return fmt.Errorf("unexpected JSON type %v", value)
34109	}
34110
34111	var sv *types.AuditCheckConfiguration
34112	if *v == nil {
34113		sv = &types.AuditCheckConfiguration{}
34114	} else {
34115		sv = *v
34116	}
34117
34118	for key, value := range shape {
34119		switch key {
34120		case "enabled":
34121			if value != nil {
34122				jtv, ok := value.(bool)
34123				if !ok {
34124					return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
34125				}
34126				sv.Enabled = jtv
34127			}
34128
34129		default:
34130			_, _ = key, value
34131
34132		}
34133	}
34134	*v = sv
34135	return nil
34136}
34137
34138func awsRestjson1_deserializeDocumentAuditCheckConfigurations(v *map[string]types.AuditCheckConfiguration, value interface{}) error {
34139	if v == nil {
34140		return fmt.Errorf("unexpected nil of type %T", v)
34141	}
34142	if value == nil {
34143		return nil
34144	}
34145
34146	shape, ok := value.(map[string]interface{})
34147	if !ok {
34148		return fmt.Errorf("unexpected JSON type %v", value)
34149	}
34150
34151	var mv map[string]types.AuditCheckConfiguration
34152	if *v == nil {
34153		mv = map[string]types.AuditCheckConfiguration{}
34154	} else {
34155		mv = *v
34156	}
34157
34158	for key, value := range shape {
34159		var parsedVal types.AuditCheckConfiguration
34160		mapVar := parsedVal
34161		destAddr := &mapVar
34162		if err := awsRestjson1_deserializeDocumentAuditCheckConfiguration(&destAddr, value); err != nil {
34163			return err
34164		}
34165		parsedVal = *destAddr
34166		mv[key] = parsedVal
34167
34168	}
34169	*v = mv
34170	return nil
34171}
34172
34173func awsRestjson1_deserializeDocumentAuditCheckDetails(v **types.AuditCheckDetails, value interface{}) error {
34174	if v == nil {
34175		return fmt.Errorf("unexpected nil of type %T", v)
34176	}
34177	if value == nil {
34178		return nil
34179	}
34180
34181	shape, ok := value.(map[string]interface{})
34182	if !ok {
34183		return fmt.Errorf("unexpected JSON type %v", value)
34184	}
34185
34186	var sv *types.AuditCheckDetails
34187	if *v == nil {
34188		sv = &types.AuditCheckDetails{}
34189	} else {
34190		sv = *v
34191	}
34192
34193	for key, value := range shape {
34194		switch key {
34195		case "checkCompliant":
34196			if value != nil {
34197				jtv, ok := value.(bool)
34198				if !ok {
34199					return fmt.Errorf("expected CheckCompliant to be of type *bool, got %T instead", value)
34200				}
34201				sv.CheckCompliant = ptr.Bool(jtv)
34202			}
34203
34204		case "checkRunStatus":
34205			if value != nil {
34206				jtv, ok := value.(string)
34207				if !ok {
34208					return fmt.Errorf("expected AuditCheckRunStatus to be of type string, got %T instead", value)
34209				}
34210				sv.CheckRunStatus = types.AuditCheckRunStatus(jtv)
34211			}
34212
34213		case "errorCode":
34214			if value != nil {
34215				jtv, ok := value.(string)
34216				if !ok {
34217					return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value)
34218				}
34219				sv.ErrorCode = ptr.String(jtv)
34220			}
34221
34222		case "message":
34223			if value != nil {
34224				jtv, ok := value.(string)
34225				if !ok {
34226					return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
34227				}
34228				sv.Message = ptr.String(jtv)
34229			}
34230
34231		case "nonCompliantResourcesCount":
34232			if value != nil {
34233				jtv, ok := value.(json.Number)
34234				if !ok {
34235					return fmt.Errorf("expected NonCompliantResourcesCount to be json.Number, got %T instead", value)
34236				}
34237				i64, err := jtv.Int64()
34238				if err != nil {
34239					return err
34240				}
34241				sv.NonCompliantResourcesCount = ptr.Int64(i64)
34242			}
34243
34244		case "suppressedNonCompliantResourcesCount":
34245			if value != nil {
34246				jtv, ok := value.(json.Number)
34247				if !ok {
34248					return fmt.Errorf("expected SuppressedNonCompliantResourcesCount to be json.Number, got %T instead", value)
34249				}
34250				i64, err := jtv.Int64()
34251				if err != nil {
34252					return err
34253				}
34254				sv.SuppressedNonCompliantResourcesCount = ptr.Int64(i64)
34255			}
34256
34257		case "totalResourcesCount":
34258			if value != nil {
34259				jtv, ok := value.(json.Number)
34260				if !ok {
34261					return fmt.Errorf("expected TotalResourcesCount to be json.Number, got %T instead", value)
34262				}
34263				i64, err := jtv.Int64()
34264				if err != nil {
34265					return err
34266				}
34267				sv.TotalResourcesCount = ptr.Int64(i64)
34268			}
34269
34270		default:
34271			_, _ = key, value
34272
34273		}
34274	}
34275	*v = sv
34276	return nil
34277}
34278
34279func awsRestjson1_deserializeDocumentAuditCheckToActionsMapping(v *map[string][]string, value interface{}) error {
34280	if v == nil {
34281		return fmt.Errorf("unexpected nil of type %T", v)
34282	}
34283	if value == nil {
34284		return nil
34285	}
34286
34287	shape, ok := value.(map[string]interface{})
34288	if !ok {
34289		return fmt.Errorf("unexpected JSON type %v", value)
34290	}
34291
34292	var mv map[string][]string
34293	if *v == nil {
34294		mv = map[string][]string{}
34295	} else {
34296		mv = *v
34297	}
34298
34299	for key, value := range shape {
34300		var parsedVal []string
34301		mapVar := parsedVal
34302		if err := awsRestjson1_deserializeDocumentMitigationActionNameList(&mapVar, value); err != nil {
34303			return err
34304		}
34305		parsedVal = mapVar
34306		mv[key] = parsedVal
34307
34308	}
34309	*v = mv
34310	return nil
34311}
34312
34313func awsRestjson1_deserializeDocumentAuditCheckToReasonCodeFilter(v *map[string][]string, value interface{}) error {
34314	if v == nil {
34315		return fmt.Errorf("unexpected nil of type %T", v)
34316	}
34317	if value == nil {
34318		return nil
34319	}
34320
34321	shape, ok := value.(map[string]interface{})
34322	if !ok {
34323		return fmt.Errorf("unexpected JSON type %v", value)
34324	}
34325
34326	var mv map[string][]string
34327	if *v == nil {
34328		mv = map[string][]string{}
34329	} else {
34330		mv = *v
34331	}
34332
34333	for key, value := range shape {
34334		var parsedVal []string
34335		mapVar := parsedVal
34336		if err := awsRestjson1_deserializeDocumentReasonForNonComplianceCodes(&mapVar, value); err != nil {
34337			return err
34338		}
34339		parsedVal = mapVar
34340		mv[key] = parsedVal
34341
34342	}
34343	*v = mv
34344	return nil
34345}
34346
34347func awsRestjson1_deserializeDocumentAuditDetails(v *map[string]types.AuditCheckDetails, value interface{}) error {
34348	if v == nil {
34349		return fmt.Errorf("unexpected nil of type %T", v)
34350	}
34351	if value == nil {
34352		return nil
34353	}
34354
34355	shape, ok := value.(map[string]interface{})
34356	if !ok {
34357		return fmt.Errorf("unexpected JSON type %v", value)
34358	}
34359
34360	var mv map[string]types.AuditCheckDetails
34361	if *v == nil {
34362		mv = map[string]types.AuditCheckDetails{}
34363	} else {
34364		mv = *v
34365	}
34366
34367	for key, value := range shape {
34368		var parsedVal types.AuditCheckDetails
34369		mapVar := parsedVal
34370		destAddr := &mapVar
34371		if err := awsRestjson1_deserializeDocumentAuditCheckDetails(&destAddr, value); err != nil {
34372			return err
34373		}
34374		parsedVal = *destAddr
34375		mv[key] = parsedVal
34376
34377	}
34378	*v = mv
34379	return nil
34380}
34381
34382func awsRestjson1_deserializeDocumentAuditFinding(v **types.AuditFinding, value interface{}) error {
34383	if v == nil {
34384		return fmt.Errorf("unexpected nil of type %T", v)
34385	}
34386	if value == nil {
34387		return nil
34388	}
34389
34390	shape, ok := value.(map[string]interface{})
34391	if !ok {
34392		return fmt.Errorf("unexpected JSON type %v", value)
34393	}
34394
34395	var sv *types.AuditFinding
34396	if *v == nil {
34397		sv = &types.AuditFinding{}
34398	} else {
34399		sv = *v
34400	}
34401
34402	for key, value := range shape {
34403		switch key {
34404		case "checkName":
34405			if value != nil {
34406				jtv, ok := value.(string)
34407				if !ok {
34408					return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value)
34409				}
34410				sv.CheckName = ptr.String(jtv)
34411			}
34412
34413		case "findingId":
34414			if value != nil {
34415				jtv, ok := value.(string)
34416				if !ok {
34417					return fmt.Errorf("expected FindingId to be of type string, got %T instead", value)
34418				}
34419				sv.FindingId = ptr.String(jtv)
34420			}
34421
34422		case "findingTime":
34423			if value != nil {
34424				jtv, ok := value.(json.Number)
34425				if !ok {
34426					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
34427				}
34428				f64, err := jtv.Float64()
34429				if err != nil {
34430					return err
34431				}
34432				sv.FindingTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
34433			}
34434
34435		case "isSuppressed":
34436			if value != nil {
34437				jtv, ok := value.(bool)
34438				if !ok {
34439					return fmt.Errorf("expected IsSuppressed to be of type *bool, got %T instead", value)
34440				}
34441				sv.IsSuppressed = ptr.Bool(jtv)
34442			}
34443
34444		case "nonCompliantResource":
34445			if err := awsRestjson1_deserializeDocumentNonCompliantResource(&sv.NonCompliantResource, value); err != nil {
34446				return err
34447			}
34448
34449		case "reasonForNonCompliance":
34450			if value != nil {
34451				jtv, ok := value.(string)
34452				if !ok {
34453					return fmt.Errorf("expected ReasonForNonCompliance to be of type string, got %T instead", value)
34454				}
34455				sv.ReasonForNonCompliance = ptr.String(jtv)
34456			}
34457
34458		case "reasonForNonComplianceCode":
34459			if value != nil {
34460				jtv, ok := value.(string)
34461				if !ok {
34462					return fmt.Errorf("expected ReasonForNonComplianceCode to be of type string, got %T instead", value)
34463				}
34464				sv.ReasonForNonComplianceCode = ptr.String(jtv)
34465			}
34466
34467		case "relatedResources":
34468			if err := awsRestjson1_deserializeDocumentRelatedResources(&sv.RelatedResources, value); err != nil {
34469				return err
34470			}
34471
34472		case "severity":
34473			if value != nil {
34474				jtv, ok := value.(string)
34475				if !ok {
34476					return fmt.Errorf("expected AuditFindingSeverity to be of type string, got %T instead", value)
34477				}
34478				sv.Severity = types.AuditFindingSeverity(jtv)
34479			}
34480
34481		case "taskId":
34482			if value != nil {
34483				jtv, ok := value.(string)
34484				if !ok {
34485					return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value)
34486				}
34487				sv.TaskId = ptr.String(jtv)
34488			}
34489
34490		case "taskStartTime":
34491			if value != nil {
34492				jtv, ok := value.(json.Number)
34493				if !ok {
34494					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
34495				}
34496				f64, err := jtv.Float64()
34497				if err != nil {
34498					return err
34499				}
34500				sv.TaskStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
34501			}
34502
34503		default:
34504			_, _ = key, value
34505
34506		}
34507	}
34508	*v = sv
34509	return nil
34510}
34511
34512func awsRestjson1_deserializeDocumentAuditFindings(v *[]types.AuditFinding, value interface{}) error {
34513	if v == nil {
34514		return fmt.Errorf("unexpected nil of type %T", v)
34515	}
34516	if value == nil {
34517		return nil
34518	}
34519
34520	shape, ok := value.([]interface{})
34521	if !ok {
34522		return fmt.Errorf("unexpected JSON type %v", value)
34523	}
34524
34525	var cv []types.AuditFinding
34526	if *v == nil {
34527		cv = []types.AuditFinding{}
34528	} else {
34529		cv = *v
34530	}
34531
34532	for _, value := range shape {
34533		var col types.AuditFinding
34534		destAddr := &col
34535		if err := awsRestjson1_deserializeDocumentAuditFinding(&destAddr, value); err != nil {
34536			return err
34537		}
34538		col = *destAddr
34539		cv = append(cv, col)
34540
34541	}
34542	*v = cv
34543	return nil
34544}
34545
34546func awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadata(v **types.AuditMitigationActionExecutionMetadata, value interface{}) error {
34547	if v == nil {
34548		return fmt.Errorf("unexpected nil of type %T", v)
34549	}
34550	if value == nil {
34551		return nil
34552	}
34553
34554	shape, ok := value.(map[string]interface{})
34555	if !ok {
34556		return fmt.Errorf("unexpected JSON type %v", value)
34557	}
34558
34559	var sv *types.AuditMitigationActionExecutionMetadata
34560	if *v == nil {
34561		sv = &types.AuditMitigationActionExecutionMetadata{}
34562	} else {
34563		sv = *v
34564	}
34565
34566	for key, value := range shape {
34567		switch key {
34568		case "actionId":
34569			if value != nil {
34570				jtv, ok := value.(string)
34571				if !ok {
34572					return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value)
34573				}
34574				sv.ActionId = ptr.String(jtv)
34575			}
34576
34577		case "actionName":
34578			if value != nil {
34579				jtv, ok := value.(string)
34580				if !ok {
34581					return fmt.Errorf("expected MitigationActionName to be of type string, got %T instead", value)
34582				}
34583				sv.ActionName = ptr.String(jtv)
34584			}
34585
34586		case "endTime":
34587			if value != nil {
34588				jtv, ok := value.(json.Number)
34589				if !ok {
34590					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
34591				}
34592				f64, err := jtv.Float64()
34593				if err != nil {
34594					return err
34595				}
34596				sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
34597			}
34598
34599		case "errorCode":
34600			if value != nil {
34601				jtv, ok := value.(string)
34602				if !ok {
34603					return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value)
34604				}
34605				sv.ErrorCode = ptr.String(jtv)
34606			}
34607
34608		case "findingId":
34609			if value != nil {
34610				jtv, ok := value.(string)
34611				if !ok {
34612					return fmt.Errorf("expected FindingId to be of type string, got %T instead", value)
34613				}
34614				sv.FindingId = ptr.String(jtv)
34615			}
34616
34617		case "message":
34618			if value != nil {
34619				jtv, ok := value.(string)
34620				if !ok {
34621					return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
34622				}
34623				sv.Message = ptr.String(jtv)
34624			}
34625
34626		case "startTime":
34627			if value != nil {
34628				jtv, ok := value.(json.Number)
34629				if !ok {
34630					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
34631				}
34632				f64, err := jtv.Float64()
34633				if err != nil {
34634					return err
34635				}
34636				sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
34637			}
34638
34639		case "status":
34640			if value != nil {
34641				jtv, ok := value.(string)
34642				if !ok {
34643					return fmt.Errorf("expected AuditMitigationActionsExecutionStatus to be of type string, got %T instead", value)
34644				}
34645				sv.Status = types.AuditMitigationActionsExecutionStatus(jtv)
34646			}
34647
34648		case "taskId":
34649			if value != nil {
34650				jtv, ok := value.(string)
34651				if !ok {
34652					return fmt.Errorf("expected AuditMitigationActionsTaskId to be of type string, got %T instead", value)
34653				}
34654				sv.TaskId = ptr.String(jtv)
34655			}
34656
34657		default:
34658			_, _ = key, value
34659
34660		}
34661	}
34662	*v = sv
34663	return nil
34664}
34665
34666func awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadataList(v *[]types.AuditMitigationActionExecutionMetadata, value interface{}) error {
34667	if v == nil {
34668		return fmt.Errorf("unexpected nil of type %T", v)
34669	}
34670	if value == nil {
34671		return nil
34672	}
34673
34674	shape, ok := value.([]interface{})
34675	if !ok {
34676		return fmt.Errorf("unexpected JSON type %v", value)
34677	}
34678
34679	var cv []types.AuditMitigationActionExecutionMetadata
34680	if *v == nil {
34681		cv = []types.AuditMitigationActionExecutionMetadata{}
34682	} else {
34683		cv = *v
34684	}
34685
34686	for _, value := range shape {
34687		var col types.AuditMitigationActionExecutionMetadata
34688		destAddr := &col
34689		if err := awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadata(&destAddr, value); err != nil {
34690			return err
34691		}
34692		col = *destAddr
34693		cv = append(cv, col)
34694
34695	}
34696	*v = cv
34697	return nil
34698}
34699
34700func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(v **types.AuditMitigationActionsTaskMetadata, value interface{}) error {
34701	if v == nil {
34702		return fmt.Errorf("unexpected nil of type %T", v)
34703	}
34704	if value == nil {
34705		return nil
34706	}
34707
34708	shape, ok := value.(map[string]interface{})
34709	if !ok {
34710		return fmt.Errorf("unexpected JSON type %v", value)
34711	}
34712
34713	var sv *types.AuditMitigationActionsTaskMetadata
34714	if *v == nil {
34715		sv = &types.AuditMitigationActionsTaskMetadata{}
34716	} else {
34717		sv = *v
34718	}
34719
34720	for key, value := range shape {
34721		switch key {
34722		case "startTime":
34723			if value != nil {
34724				jtv, ok := value.(json.Number)
34725				if !ok {
34726					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
34727				}
34728				f64, err := jtv.Float64()
34729				if err != nil {
34730					return err
34731				}
34732				sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
34733			}
34734
34735		case "taskId":
34736			if value != nil {
34737				jtv, ok := value.(string)
34738				if !ok {
34739					return fmt.Errorf("expected AuditMitigationActionsTaskId to be of type string, got %T instead", value)
34740				}
34741				sv.TaskId = ptr.String(jtv)
34742			}
34743
34744		case "taskStatus":
34745			if value != nil {
34746				jtv, ok := value.(string)
34747				if !ok {
34748					return fmt.Errorf("expected AuditMitigationActionsTaskStatus to be of type string, got %T instead", value)
34749				}
34750				sv.TaskStatus = types.AuditMitigationActionsTaskStatus(jtv)
34751			}
34752
34753		default:
34754			_, _ = key, value
34755
34756		}
34757	}
34758	*v = sv
34759	return nil
34760}
34761
34762func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(v *[]types.AuditMitigationActionsTaskMetadata, value interface{}) error {
34763	if v == nil {
34764		return fmt.Errorf("unexpected nil of type %T", v)
34765	}
34766	if value == nil {
34767		return nil
34768	}
34769
34770	shape, ok := value.([]interface{})
34771	if !ok {
34772		return fmt.Errorf("unexpected JSON type %v", value)
34773	}
34774
34775	var cv []types.AuditMitigationActionsTaskMetadata
34776	if *v == nil {
34777		cv = []types.AuditMitigationActionsTaskMetadata{}
34778	} else {
34779		cv = *v
34780	}
34781
34782	for _, value := range shape {
34783		var col types.AuditMitigationActionsTaskMetadata
34784		destAddr := &col
34785		if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(&destAddr, value); err != nil {
34786			return err
34787		}
34788		col = *destAddr
34789		cv = append(cv, col)
34790
34791	}
34792	*v = cv
34793	return nil
34794}
34795
34796func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskStatistics(v *map[string]types.TaskStatisticsForAuditCheck, value interface{}) error {
34797	if v == nil {
34798		return fmt.Errorf("unexpected nil of type %T", v)
34799	}
34800	if value == nil {
34801		return nil
34802	}
34803
34804	shape, ok := value.(map[string]interface{})
34805	if !ok {
34806		return fmt.Errorf("unexpected JSON type %v", value)
34807	}
34808
34809	var mv map[string]types.TaskStatisticsForAuditCheck
34810	if *v == nil {
34811		mv = map[string]types.TaskStatisticsForAuditCheck{}
34812	} else {
34813		mv = *v
34814	}
34815
34816	for key, value := range shape {
34817		var parsedVal types.TaskStatisticsForAuditCheck
34818		mapVar := parsedVal
34819		destAddr := &mapVar
34820		if err := awsRestjson1_deserializeDocumentTaskStatisticsForAuditCheck(&destAddr, value); err != nil {
34821			return err
34822		}
34823		parsedVal = *destAddr
34824		mv[key] = parsedVal
34825
34826	}
34827	*v = mv
34828	return nil
34829}
34830
34831func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(v **types.AuditMitigationActionsTaskTarget, value interface{}) error {
34832	if v == nil {
34833		return fmt.Errorf("unexpected nil of type %T", v)
34834	}
34835	if value == nil {
34836		return nil
34837	}
34838
34839	shape, ok := value.(map[string]interface{})
34840	if !ok {
34841		return fmt.Errorf("unexpected JSON type %v", value)
34842	}
34843
34844	var sv *types.AuditMitigationActionsTaskTarget
34845	if *v == nil {
34846		sv = &types.AuditMitigationActionsTaskTarget{}
34847	} else {
34848		sv = *v
34849	}
34850
34851	for key, value := range shape {
34852		switch key {
34853		case "auditCheckToReasonCodeFilter":
34854			if err := awsRestjson1_deserializeDocumentAuditCheckToReasonCodeFilter(&sv.AuditCheckToReasonCodeFilter, value); err != nil {
34855				return err
34856			}
34857
34858		case "auditTaskId":
34859			if value != nil {
34860				jtv, ok := value.(string)
34861				if !ok {
34862					return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value)
34863				}
34864				sv.AuditTaskId = ptr.String(jtv)
34865			}
34866
34867		case "findingIds":
34868			if err := awsRestjson1_deserializeDocumentFindingIds(&sv.FindingIds, value); err != nil {
34869				return err
34870			}
34871
34872		default:
34873			_, _ = key, value
34874
34875		}
34876	}
34877	*v = sv
34878	return nil
34879}
34880
34881func awsRestjson1_deserializeDocumentAuditNotificationTarget(v **types.AuditNotificationTarget, value interface{}) error {
34882	if v == nil {
34883		return fmt.Errorf("unexpected nil of type %T", v)
34884	}
34885	if value == nil {
34886		return nil
34887	}
34888
34889	shape, ok := value.(map[string]interface{})
34890	if !ok {
34891		return fmt.Errorf("unexpected JSON type %v", value)
34892	}
34893
34894	var sv *types.AuditNotificationTarget
34895	if *v == nil {
34896		sv = &types.AuditNotificationTarget{}
34897	} else {
34898		sv = *v
34899	}
34900
34901	for key, value := range shape {
34902		switch key {
34903		case "enabled":
34904			if value != nil {
34905				jtv, ok := value.(bool)
34906				if !ok {
34907					return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
34908				}
34909				sv.Enabled = jtv
34910			}
34911
34912		case "roleArn":
34913			if value != nil {
34914				jtv, ok := value.(string)
34915				if !ok {
34916					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
34917				}
34918				sv.RoleArn = ptr.String(jtv)
34919			}
34920
34921		case "targetArn":
34922			if value != nil {
34923				jtv, ok := value.(string)
34924				if !ok {
34925					return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value)
34926				}
34927				sv.TargetArn = ptr.String(jtv)
34928			}
34929
34930		default:
34931			_, _ = key, value
34932
34933		}
34934	}
34935	*v = sv
34936	return nil
34937}
34938
34939func awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(v *map[string]types.AuditNotificationTarget, value interface{}) error {
34940	if v == nil {
34941		return fmt.Errorf("unexpected nil of type %T", v)
34942	}
34943	if value == nil {
34944		return nil
34945	}
34946
34947	shape, ok := value.(map[string]interface{})
34948	if !ok {
34949		return fmt.Errorf("unexpected JSON type %v", value)
34950	}
34951
34952	var mv map[string]types.AuditNotificationTarget
34953	if *v == nil {
34954		mv = map[string]types.AuditNotificationTarget{}
34955	} else {
34956		mv = *v
34957	}
34958
34959	for key, value := range shape {
34960		var parsedVal types.AuditNotificationTarget
34961		mapVar := parsedVal
34962		destAddr := &mapVar
34963		if err := awsRestjson1_deserializeDocumentAuditNotificationTarget(&destAddr, value); err != nil {
34964			return err
34965		}
34966		parsedVal = *destAddr
34967		mv[key] = parsedVal
34968
34969	}
34970	*v = mv
34971	return nil
34972}
34973
34974func awsRestjson1_deserializeDocumentAuditSuppression(v **types.AuditSuppression, value interface{}) error {
34975	if v == nil {
34976		return fmt.Errorf("unexpected nil of type %T", v)
34977	}
34978	if value == nil {
34979		return nil
34980	}
34981
34982	shape, ok := value.(map[string]interface{})
34983	if !ok {
34984		return fmt.Errorf("unexpected JSON type %v", value)
34985	}
34986
34987	var sv *types.AuditSuppression
34988	if *v == nil {
34989		sv = &types.AuditSuppression{}
34990	} else {
34991		sv = *v
34992	}
34993
34994	for key, value := range shape {
34995		switch key {
34996		case "checkName":
34997			if value != nil {
34998				jtv, ok := value.(string)
34999				if !ok {
35000					return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value)
35001				}
35002				sv.CheckName = ptr.String(jtv)
35003			}
35004
35005		case "description":
35006			if value != nil {
35007				jtv, ok := value.(string)
35008				if !ok {
35009					return fmt.Errorf("expected AuditDescription to be of type string, got %T instead", value)
35010				}
35011				sv.Description = ptr.String(jtv)
35012			}
35013
35014		case "expirationDate":
35015			if value != nil {
35016				jtv, ok := value.(json.Number)
35017				if !ok {
35018					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
35019				}
35020				f64, err := jtv.Float64()
35021				if err != nil {
35022					return err
35023				}
35024				sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
35025			}
35026
35027		case "resourceIdentifier":
35028			if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil {
35029				return err
35030			}
35031
35032		case "suppressIndefinitely":
35033			if value != nil {
35034				jtv, ok := value.(bool)
35035				if !ok {
35036					return fmt.Errorf("expected SuppressIndefinitely to be of type *bool, got %T instead", value)
35037				}
35038				sv.SuppressIndefinitely = ptr.Bool(jtv)
35039			}
35040
35041		default:
35042			_, _ = key, value
35043
35044		}
35045	}
35046	*v = sv
35047	return nil
35048}
35049
35050func awsRestjson1_deserializeDocumentAuditSuppressionList(v *[]types.AuditSuppression, value interface{}) error {
35051	if v == nil {
35052		return fmt.Errorf("unexpected nil of type %T", v)
35053	}
35054	if value == nil {
35055		return nil
35056	}
35057
35058	shape, ok := value.([]interface{})
35059	if !ok {
35060		return fmt.Errorf("unexpected JSON type %v", value)
35061	}
35062
35063	var cv []types.AuditSuppression
35064	if *v == nil {
35065		cv = []types.AuditSuppression{}
35066	} else {
35067		cv = *v
35068	}
35069
35070	for _, value := range shape {
35071		var col types.AuditSuppression
35072		destAddr := &col
35073		if err := awsRestjson1_deserializeDocumentAuditSuppression(&destAddr, value); err != nil {
35074			return err
35075		}
35076		col = *destAddr
35077		cv = append(cv, col)
35078
35079	}
35080	*v = cv
35081	return nil
35082}
35083
35084func awsRestjson1_deserializeDocumentAuditTaskMetadata(v **types.AuditTaskMetadata, value interface{}) error {
35085	if v == nil {
35086		return fmt.Errorf("unexpected nil of type %T", v)
35087	}
35088	if value == nil {
35089		return nil
35090	}
35091
35092	shape, ok := value.(map[string]interface{})
35093	if !ok {
35094		return fmt.Errorf("unexpected JSON type %v", value)
35095	}
35096
35097	var sv *types.AuditTaskMetadata
35098	if *v == nil {
35099		sv = &types.AuditTaskMetadata{}
35100	} else {
35101		sv = *v
35102	}
35103
35104	for key, value := range shape {
35105		switch key {
35106		case "taskId":
35107			if value != nil {
35108				jtv, ok := value.(string)
35109				if !ok {
35110					return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value)
35111				}
35112				sv.TaskId = ptr.String(jtv)
35113			}
35114
35115		case "taskStatus":
35116			if value != nil {
35117				jtv, ok := value.(string)
35118				if !ok {
35119					return fmt.Errorf("expected AuditTaskStatus to be of type string, got %T instead", value)
35120				}
35121				sv.TaskStatus = types.AuditTaskStatus(jtv)
35122			}
35123
35124		case "taskType":
35125			if value != nil {
35126				jtv, ok := value.(string)
35127				if !ok {
35128					return fmt.Errorf("expected AuditTaskType to be of type string, got %T instead", value)
35129				}
35130				sv.TaskType = types.AuditTaskType(jtv)
35131			}
35132
35133		default:
35134			_, _ = key, value
35135
35136		}
35137	}
35138	*v = sv
35139	return nil
35140}
35141
35142func awsRestjson1_deserializeDocumentAuditTaskMetadataList(v *[]types.AuditTaskMetadata, value interface{}) error {
35143	if v == nil {
35144		return fmt.Errorf("unexpected nil of type %T", v)
35145	}
35146	if value == nil {
35147		return nil
35148	}
35149
35150	shape, ok := value.([]interface{})
35151	if !ok {
35152		return fmt.Errorf("unexpected JSON type %v", value)
35153	}
35154
35155	var cv []types.AuditTaskMetadata
35156	if *v == nil {
35157		cv = []types.AuditTaskMetadata{}
35158	} else {
35159		cv = *v
35160	}
35161
35162	for _, value := range shape {
35163		var col types.AuditTaskMetadata
35164		destAddr := &col
35165		if err := awsRestjson1_deserializeDocumentAuditTaskMetadata(&destAddr, value); err != nil {
35166			return err
35167		}
35168		col = *destAddr
35169		cv = append(cv, col)
35170
35171	}
35172	*v = cv
35173	return nil
35174}
35175
35176func awsRestjson1_deserializeDocumentAuthInfo(v **types.AuthInfo, value interface{}) error {
35177	if v == nil {
35178		return fmt.Errorf("unexpected nil of type %T", v)
35179	}
35180	if value == nil {
35181		return nil
35182	}
35183
35184	shape, ok := value.(map[string]interface{})
35185	if !ok {
35186		return fmt.Errorf("unexpected JSON type %v", value)
35187	}
35188
35189	var sv *types.AuthInfo
35190	if *v == nil {
35191		sv = &types.AuthInfo{}
35192	} else {
35193		sv = *v
35194	}
35195
35196	for key, value := range shape {
35197		switch key {
35198		case "actionType":
35199			if value != nil {
35200				jtv, ok := value.(string)
35201				if !ok {
35202					return fmt.Errorf("expected ActionType to be of type string, got %T instead", value)
35203				}
35204				sv.ActionType = types.ActionType(jtv)
35205			}
35206
35207		case "resources":
35208			if err := awsRestjson1_deserializeDocumentResources(&sv.Resources, value); err != nil {
35209				return err
35210			}
35211
35212		default:
35213			_, _ = key, value
35214
35215		}
35216	}
35217	*v = sv
35218	return nil
35219}
35220
35221func awsRestjson1_deserializeDocumentAuthorizerConfig(v **types.AuthorizerConfig, value interface{}) error {
35222	if v == nil {
35223		return fmt.Errorf("unexpected nil of type %T", v)
35224	}
35225	if value == nil {
35226		return nil
35227	}
35228
35229	shape, ok := value.(map[string]interface{})
35230	if !ok {
35231		return fmt.Errorf("unexpected JSON type %v", value)
35232	}
35233
35234	var sv *types.AuthorizerConfig
35235	if *v == nil {
35236		sv = &types.AuthorizerConfig{}
35237	} else {
35238		sv = *v
35239	}
35240
35241	for key, value := range shape {
35242		switch key {
35243		case "allowAuthorizerOverride":
35244			if value != nil {
35245				jtv, ok := value.(bool)
35246				if !ok {
35247					return fmt.Errorf("expected AllowAuthorizerOverride to be of type *bool, got %T instead", value)
35248				}
35249				sv.AllowAuthorizerOverride = jtv
35250			}
35251
35252		case "defaultAuthorizerName":
35253			if value != nil {
35254				jtv, ok := value.(string)
35255				if !ok {
35256					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
35257				}
35258				sv.DefaultAuthorizerName = ptr.String(jtv)
35259			}
35260
35261		default:
35262			_, _ = key, value
35263
35264		}
35265	}
35266	*v = sv
35267	return nil
35268}
35269
35270func awsRestjson1_deserializeDocumentAuthorizerDescription(v **types.AuthorizerDescription, value interface{}) error {
35271	if v == nil {
35272		return fmt.Errorf("unexpected nil of type %T", v)
35273	}
35274	if value == nil {
35275		return nil
35276	}
35277
35278	shape, ok := value.(map[string]interface{})
35279	if !ok {
35280		return fmt.Errorf("unexpected JSON type %v", value)
35281	}
35282
35283	var sv *types.AuthorizerDescription
35284	if *v == nil {
35285		sv = &types.AuthorizerDescription{}
35286	} else {
35287		sv = *v
35288	}
35289
35290	for key, value := range shape {
35291		switch key {
35292		case "authorizerArn":
35293			if value != nil {
35294				jtv, ok := value.(string)
35295				if !ok {
35296					return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value)
35297				}
35298				sv.AuthorizerArn = ptr.String(jtv)
35299			}
35300
35301		case "authorizerFunctionArn":
35302			if value != nil {
35303				jtv, ok := value.(string)
35304				if !ok {
35305					return fmt.Errorf("expected AuthorizerFunctionArn to be of type string, got %T instead", value)
35306				}
35307				sv.AuthorizerFunctionArn = ptr.String(jtv)
35308			}
35309
35310		case "authorizerName":
35311			if value != nil {
35312				jtv, ok := value.(string)
35313				if !ok {
35314					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
35315				}
35316				sv.AuthorizerName = ptr.String(jtv)
35317			}
35318
35319		case "creationDate":
35320			if value != nil {
35321				jtv, ok := value.(json.Number)
35322				if !ok {
35323					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
35324				}
35325				f64, err := jtv.Float64()
35326				if err != nil {
35327					return err
35328				}
35329				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
35330			}
35331
35332		case "lastModifiedDate":
35333			if value != nil {
35334				jtv, ok := value.(json.Number)
35335				if !ok {
35336					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
35337				}
35338				f64, err := jtv.Float64()
35339				if err != nil {
35340					return err
35341				}
35342				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
35343			}
35344
35345		case "signingDisabled":
35346			if value != nil {
35347				jtv, ok := value.(bool)
35348				if !ok {
35349					return fmt.Errorf("expected BooleanKey to be of type *bool, got %T instead", value)
35350				}
35351				sv.SigningDisabled = ptr.Bool(jtv)
35352			}
35353
35354		case "status":
35355			if value != nil {
35356				jtv, ok := value.(string)
35357				if !ok {
35358					return fmt.Errorf("expected AuthorizerStatus to be of type string, got %T instead", value)
35359				}
35360				sv.Status = types.AuthorizerStatus(jtv)
35361			}
35362
35363		case "tokenKeyName":
35364			if value != nil {
35365				jtv, ok := value.(string)
35366				if !ok {
35367					return fmt.Errorf("expected TokenKeyName to be of type string, got %T instead", value)
35368				}
35369				sv.TokenKeyName = ptr.String(jtv)
35370			}
35371
35372		case "tokenSigningPublicKeys":
35373			if err := awsRestjson1_deserializeDocumentPublicKeyMap(&sv.TokenSigningPublicKeys, value); err != nil {
35374				return err
35375			}
35376
35377		default:
35378			_, _ = key, value
35379
35380		}
35381	}
35382	*v = sv
35383	return nil
35384}
35385
35386func awsRestjson1_deserializeDocumentAuthorizers(v *[]types.AuthorizerSummary, value interface{}) error {
35387	if v == nil {
35388		return fmt.Errorf("unexpected nil of type %T", v)
35389	}
35390	if value == nil {
35391		return nil
35392	}
35393
35394	shape, ok := value.([]interface{})
35395	if !ok {
35396		return fmt.Errorf("unexpected JSON type %v", value)
35397	}
35398
35399	var cv []types.AuthorizerSummary
35400	if *v == nil {
35401		cv = []types.AuthorizerSummary{}
35402	} else {
35403		cv = *v
35404	}
35405
35406	for _, value := range shape {
35407		var col types.AuthorizerSummary
35408		destAddr := &col
35409		if err := awsRestjson1_deserializeDocumentAuthorizerSummary(&destAddr, value); err != nil {
35410			return err
35411		}
35412		col = *destAddr
35413		cv = append(cv, col)
35414
35415	}
35416	*v = cv
35417	return nil
35418}
35419
35420func awsRestjson1_deserializeDocumentAuthorizerSummary(v **types.AuthorizerSummary, value interface{}) error {
35421	if v == nil {
35422		return fmt.Errorf("unexpected nil of type %T", v)
35423	}
35424	if value == nil {
35425		return nil
35426	}
35427
35428	shape, ok := value.(map[string]interface{})
35429	if !ok {
35430		return fmt.Errorf("unexpected JSON type %v", value)
35431	}
35432
35433	var sv *types.AuthorizerSummary
35434	if *v == nil {
35435		sv = &types.AuthorizerSummary{}
35436	} else {
35437		sv = *v
35438	}
35439
35440	for key, value := range shape {
35441		switch key {
35442		case "authorizerArn":
35443			if value != nil {
35444				jtv, ok := value.(string)
35445				if !ok {
35446					return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value)
35447				}
35448				sv.AuthorizerArn = ptr.String(jtv)
35449			}
35450
35451		case "authorizerName":
35452			if value != nil {
35453				jtv, ok := value.(string)
35454				if !ok {
35455					return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value)
35456				}
35457				sv.AuthorizerName = ptr.String(jtv)
35458			}
35459
35460		default:
35461			_, _ = key, value
35462
35463		}
35464	}
35465	*v = sv
35466	return nil
35467}
35468
35469func awsRestjson1_deserializeDocumentAuthResult(v **types.AuthResult, value interface{}) error {
35470	if v == nil {
35471		return fmt.Errorf("unexpected nil of type %T", v)
35472	}
35473	if value == nil {
35474		return nil
35475	}
35476
35477	shape, ok := value.(map[string]interface{})
35478	if !ok {
35479		return fmt.Errorf("unexpected JSON type %v", value)
35480	}
35481
35482	var sv *types.AuthResult
35483	if *v == nil {
35484		sv = &types.AuthResult{}
35485	} else {
35486		sv = *v
35487	}
35488
35489	for key, value := range shape {
35490		switch key {
35491		case "allowed":
35492			if err := awsRestjson1_deserializeDocumentAllowed(&sv.Allowed, value); err != nil {
35493				return err
35494			}
35495
35496		case "authDecision":
35497			if value != nil {
35498				jtv, ok := value.(string)
35499				if !ok {
35500					return fmt.Errorf("expected AuthDecision to be of type string, got %T instead", value)
35501				}
35502				sv.AuthDecision = types.AuthDecision(jtv)
35503			}
35504
35505		case "authInfo":
35506			if err := awsRestjson1_deserializeDocumentAuthInfo(&sv.AuthInfo, value); err != nil {
35507				return err
35508			}
35509
35510		case "denied":
35511			if err := awsRestjson1_deserializeDocumentDenied(&sv.Denied, value); err != nil {
35512				return err
35513			}
35514
35515		case "missingContextValues":
35516			if err := awsRestjson1_deserializeDocumentMissingContextValues(&sv.MissingContextValues, value); err != nil {
35517				return err
35518			}
35519
35520		default:
35521			_, _ = key, value
35522
35523		}
35524	}
35525	*v = sv
35526	return nil
35527}
35528
35529func awsRestjson1_deserializeDocumentAuthResults(v *[]types.AuthResult, value interface{}) error {
35530	if v == nil {
35531		return fmt.Errorf("unexpected nil of type %T", v)
35532	}
35533	if value == nil {
35534		return nil
35535	}
35536
35537	shape, ok := value.([]interface{})
35538	if !ok {
35539		return fmt.Errorf("unexpected JSON type %v", value)
35540	}
35541
35542	var cv []types.AuthResult
35543	if *v == nil {
35544		cv = []types.AuthResult{}
35545	} else {
35546		cv = *v
35547	}
35548
35549	for _, value := range shape {
35550		var col types.AuthResult
35551		destAddr := &col
35552		if err := awsRestjson1_deserializeDocumentAuthResult(&destAddr, value); err != nil {
35553			return err
35554		}
35555		col = *destAddr
35556		cv = append(cv, col)
35557
35558	}
35559	*v = cv
35560	return nil
35561}
35562
35563func awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(v **types.AwsJobExecutionsRolloutConfig, value interface{}) error {
35564	if v == nil {
35565		return fmt.Errorf("unexpected nil of type %T", v)
35566	}
35567	if value == nil {
35568		return nil
35569	}
35570
35571	shape, ok := value.(map[string]interface{})
35572	if !ok {
35573		return fmt.Errorf("unexpected JSON type %v", value)
35574	}
35575
35576	var sv *types.AwsJobExecutionsRolloutConfig
35577	if *v == nil {
35578		sv = &types.AwsJobExecutionsRolloutConfig{}
35579	} else {
35580		sv = *v
35581	}
35582
35583	for key, value := range shape {
35584		switch key {
35585		case "exponentialRate":
35586			if err := awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(&sv.ExponentialRate, value); err != nil {
35587				return err
35588			}
35589
35590		case "maximumPerMinute":
35591			if value != nil {
35592				jtv, ok := value.(json.Number)
35593				if !ok {
35594					return fmt.Errorf("expected MaximumPerMinute to be json.Number, got %T instead", value)
35595				}
35596				i64, err := jtv.Int64()
35597				if err != nil {
35598					return err
35599				}
35600				sv.MaximumPerMinute = ptr.Int32(int32(i64))
35601			}
35602
35603		default:
35604			_, _ = key, value
35605
35606		}
35607	}
35608	*v = sv
35609	return nil
35610}
35611
35612func awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(v **types.AwsJobExponentialRolloutRate, value interface{}) error {
35613	if v == nil {
35614		return fmt.Errorf("unexpected nil of type %T", v)
35615	}
35616	if value == nil {
35617		return nil
35618	}
35619
35620	shape, ok := value.(map[string]interface{})
35621	if !ok {
35622		return fmt.Errorf("unexpected JSON type %v", value)
35623	}
35624
35625	var sv *types.AwsJobExponentialRolloutRate
35626	if *v == nil {
35627		sv = &types.AwsJobExponentialRolloutRate{}
35628	} else {
35629		sv = *v
35630	}
35631
35632	for key, value := range shape {
35633		switch key {
35634		case "baseRatePerMinute":
35635			if value != nil {
35636				jtv, ok := value.(json.Number)
35637				if !ok {
35638					return fmt.Errorf("expected AwsJobRolloutRatePerMinute to be json.Number, got %T instead", value)
35639				}
35640				i64, err := jtv.Int64()
35641				if err != nil {
35642					return err
35643				}
35644				sv.BaseRatePerMinute = ptr.Int32(int32(i64))
35645			}
35646
35647		case "incrementFactor":
35648			if value != nil {
35649				jtv, ok := value.(json.Number)
35650				if !ok {
35651					return fmt.Errorf("expected AwsJobRolloutIncrementFactor to be json.Number, got %T instead", value)
35652				}
35653				f64, err := jtv.Float64()
35654				if err != nil {
35655					return err
35656				}
35657				sv.IncrementFactor = f64
35658			}
35659
35660		case "rateIncreaseCriteria":
35661			if err := awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(&sv.RateIncreaseCriteria, value); err != nil {
35662				return err
35663			}
35664
35665		default:
35666			_, _ = key, value
35667
35668		}
35669	}
35670	*v = sv
35671	return nil
35672}
35673
35674func awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(v **types.AwsJobPresignedUrlConfig, value interface{}) error {
35675	if v == nil {
35676		return fmt.Errorf("unexpected nil of type %T", v)
35677	}
35678	if value == nil {
35679		return nil
35680	}
35681
35682	shape, ok := value.(map[string]interface{})
35683	if !ok {
35684		return fmt.Errorf("unexpected JSON type %v", value)
35685	}
35686
35687	var sv *types.AwsJobPresignedUrlConfig
35688	if *v == nil {
35689		sv = &types.AwsJobPresignedUrlConfig{}
35690	} else {
35691		sv = *v
35692	}
35693
35694	for key, value := range shape {
35695		switch key {
35696		case "expiresInSec":
35697			if value != nil {
35698				jtv, ok := value.(json.Number)
35699				if !ok {
35700					return fmt.Errorf("expected ExpiresInSeconds to be json.Number, got %T instead", value)
35701				}
35702				i64, err := jtv.Int64()
35703				if err != nil {
35704					return err
35705				}
35706				sv.ExpiresInSec = ptr.Int64(i64)
35707			}
35708
35709		default:
35710			_, _ = key, value
35711
35712		}
35713	}
35714	*v = sv
35715	return nil
35716}
35717
35718func awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(v **types.AwsJobRateIncreaseCriteria, value interface{}) error {
35719	if v == nil {
35720		return fmt.Errorf("unexpected nil of type %T", v)
35721	}
35722	if value == nil {
35723		return nil
35724	}
35725
35726	shape, ok := value.(map[string]interface{})
35727	if !ok {
35728		return fmt.Errorf("unexpected JSON type %v", value)
35729	}
35730
35731	var sv *types.AwsJobRateIncreaseCriteria
35732	if *v == nil {
35733		sv = &types.AwsJobRateIncreaseCriteria{}
35734	} else {
35735		sv = *v
35736	}
35737
35738	for key, value := range shape {
35739		switch key {
35740		case "numberOfNotifiedThings":
35741			if value != nil {
35742				jtv, ok := value.(json.Number)
35743				if !ok {
35744					return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value)
35745				}
35746				i64, err := jtv.Int64()
35747				if err != nil {
35748					return err
35749				}
35750				sv.NumberOfNotifiedThings = ptr.Int32(int32(i64))
35751			}
35752
35753		case "numberOfSucceededThings":
35754			if value != nil {
35755				jtv, ok := value.(json.Number)
35756				if !ok {
35757					return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value)
35758				}
35759				i64, err := jtv.Int64()
35760				if err != nil {
35761					return err
35762				}
35763				sv.NumberOfSucceededThings = ptr.Int32(int32(i64))
35764			}
35765
35766		default:
35767			_, _ = key, value
35768
35769		}
35770	}
35771	*v = sv
35772	return nil
35773}
35774
35775func awsRestjson1_deserializeDocumentBehavior(v **types.Behavior, value interface{}) error {
35776	if v == nil {
35777		return fmt.Errorf("unexpected nil of type %T", v)
35778	}
35779	if value == nil {
35780		return nil
35781	}
35782
35783	shape, ok := value.(map[string]interface{})
35784	if !ok {
35785		return fmt.Errorf("unexpected JSON type %v", value)
35786	}
35787
35788	var sv *types.Behavior
35789	if *v == nil {
35790		sv = &types.Behavior{}
35791	} else {
35792		sv = *v
35793	}
35794
35795	for key, value := range shape {
35796		switch key {
35797		case "criteria":
35798			if err := awsRestjson1_deserializeDocumentBehaviorCriteria(&sv.Criteria, value); err != nil {
35799				return err
35800			}
35801
35802		case "metric":
35803			if value != nil {
35804				jtv, ok := value.(string)
35805				if !ok {
35806					return fmt.Errorf("expected BehaviorMetric to be of type string, got %T instead", value)
35807				}
35808				sv.Metric = ptr.String(jtv)
35809			}
35810
35811		case "metricDimension":
35812			if err := awsRestjson1_deserializeDocumentMetricDimension(&sv.MetricDimension, value); err != nil {
35813				return err
35814			}
35815
35816		case "name":
35817			if value != nil {
35818				jtv, ok := value.(string)
35819				if !ok {
35820					return fmt.Errorf("expected BehaviorName to be of type string, got %T instead", value)
35821				}
35822				sv.Name = ptr.String(jtv)
35823			}
35824
35825		default:
35826			_, _ = key, value
35827
35828		}
35829	}
35830	*v = sv
35831	return nil
35832}
35833
35834func awsRestjson1_deserializeDocumentBehaviorCriteria(v **types.BehaviorCriteria, value interface{}) error {
35835	if v == nil {
35836		return fmt.Errorf("unexpected nil of type %T", v)
35837	}
35838	if value == nil {
35839		return nil
35840	}
35841
35842	shape, ok := value.(map[string]interface{})
35843	if !ok {
35844		return fmt.Errorf("unexpected JSON type %v", value)
35845	}
35846
35847	var sv *types.BehaviorCriteria
35848	if *v == nil {
35849		sv = &types.BehaviorCriteria{}
35850	} else {
35851		sv = *v
35852	}
35853
35854	for key, value := range shape {
35855		switch key {
35856		case "comparisonOperator":
35857			if value != nil {
35858				jtv, ok := value.(string)
35859				if !ok {
35860					return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value)
35861				}
35862				sv.ComparisonOperator = types.ComparisonOperator(jtv)
35863			}
35864
35865		case "consecutiveDatapointsToAlarm":
35866			if value != nil {
35867				jtv, ok := value.(json.Number)
35868				if !ok {
35869					return fmt.Errorf("expected ConsecutiveDatapointsToAlarm to be json.Number, got %T instead", value)
35870				}
35871				i64, err := jtv.Int64()
35872				if err != nil {
35873					return err
35874				}
35875				sv.ConsecutiveDatapointsToAlarm = ptr.Int32(int32(i64))
35876			}
35877
35878		case "consecutiveDatapointsToClear":
35879			if value != nil {
35880				jtv, ok := value.(json.Number)
35881				if !ok {
35882					return fmt.Errorf("expected ConsecutiveDatapointsToClear to be json.Number, got %T instead", value)
35883				}
35884				i64, err := jtv.Int64()
35885				if err != nil {
35886					return err
35887				}
35888				sv.ConsecutiveDatapointsToClear = ptr.Int32(int32(i64))
35889			}
35890
35891		case "durationSeconds":
35892			if value != nil {
35893				jtv, ok := value.(json.Number)
35894				if !ok {
35895					return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value)
35896				}
35897				i64, err := jtv.Int64()
35898				if err != nil {
35899					return err
35900				}
35901				sv.DurationSeconds = ptr.Int32(int32(i64))
35902			}
35903
35904		case "statisticalThreshold":
35905			if err := awsRestjson1_deserializeDocumentStatisticalThreshold(&sv.StatisticalThreshold, value); err != nil {
35906				return err
35907			}
35908
35909		case "value":
35910			if err := awsRestjson1_deserializeDocumentMetricValue(&sv.Value, value); err != nil {
35911				return err
35912			}
35913
35914		default:
35915			_, _ = key, value
35916
35917		}
35918	}
35919	*v = sv
35920	return nil
35921}
35922
35923func awsRestjson1_deserializeDocumentBehaviors(v *[]types.Behavior, value interface{}) error {
35924	if v == nil {
35925		return fmt.Errorf("unexpected nil of type %T", v)
35926	}
35927	if value == nil {
35928		return nil
35929	}
35930
35931	shape, ok := value.([]interface{})
35932	if !ok {
35933		return fmt.Errorf("unexpected JSON type %v", value)
35934	}
35935
35936	var cv []types.Behavior
35937	if *v == nil {
35938		cv = []types.Behavior{}
35939	} else {
35940		cv = *v
35941	}
35942
35943	for _, value := range shape {
35944		var col types.Behavior
35945		destAddr := &col
35946		if err := awsRestjson1_deserializeDocumentBehavior(&destAddr, value); err != nil {
35947			return err
35948		}
35949		col = *destAddr
35950		cv = append(cv, col)
35951
35952	}
35953	*v = cv
35954	return nil
35955}
35956
35957func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroupMetadata, value interface{}) error {
35958	if v == nil {
35959		return fmt.Errorf("unexpected nil of type %T", v)
35960	}
35961	if value == nil {
35962		return nil
35963	}
35964
35965	shape, ok := value.(map[string]interface{})
35966	if !ok {
35967		return fmt.Errorf("unexpected JSON type %v", value)
35968	}
35969
35970	var sv *types.BillingGroupMetadata
35971	if *v == nil {
35972		sv = &types.BillingGroupMetadata{}
35973	} else {
35974		sv = *v
35975	}
35976
35977	for key, value := range shape {
35978		switch key {
35979		case "creationDate":
35980			if value != nil {
35981				jtv, ok := value.(json.Number)
35982				if !ok {
35983					return fmt.Errorf("expected CreationDate to be json.Number, got %T instead", value)
35984				}
35985				f64, err := jtv.Float64()
35986				if err != nil {
35987					return err
35988				}
35989				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
35990			}
35991
35992		default:
35993			_, _ = key, value
35994
35995		}
35996	}
35997	*v = sv
35998	return nil
35999}
36000
36001func awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(v *[]types.GroupNameAndArn, value interface{}) error {
36002	if v == nil {
36003		return fmt.Errorf("unexpected nil of type %T", v)
36004	}
36005	if value == nil {
36006		return nil
36007	}
36008
36009	shape, ok := value.([]interface{})
36010	if !ok {
36011		return fmt.Errorf("unexpected JSON type %v", value)
36012	}
36013
36014	var cv []types.GroupNameAndArn
36015	if *v == nil {
36016		cv = []types.GroupNameAndArn{}
36017	} else {
36018		cv = *v
36019	}
36020
36021	for _, value := range shape {
36022		var col types.GroupNameAndArn
36023		destAddr := &col
36024		if err := awsRestjson1_deserializeDocumentGroupNameAndArn(&destAddr, value); err != nil {
36025			return err
36026		}
36027		col = *destAddr
36028		cv = append(cv, col)
36029
36030	}
36031	*v = cv
36032	return nil
36033}
36034
36035func awsRestjson1_deserializeDocumentBillingGroupProperties(v **types.BillingGroupProperties, value interface{}) error {
36036	if v == nil {
36037		return fmt.Errorf("unexpected nil of type %T", v)
36038	}
36039	if value == nil {
36040		return nil
36041	}
36042
36043	shape, ok := value.(map[string]interface{})
36044	if !ok {
36045		return fmt.Errorf("unexpected JSON type %v", value)
36046	}
36047
36048	var sv *types.BillingGroupProperties
36049	if *v == nil {
36050		sv = &types.BillingGroupProperties{}
36051	} else {
36052		sv = *v
36053	}
36054
36055	for key, value := range shape {
36056		switch key {
36057		case "billingGroupDescription":
36058			if value != nil {
36059				jtv, ok := value.(string)
36060				if !ok {
36061					return fmt.Errorf("expected BillingGroupDescription to be of type string, got %T instead", value)
36062				}
36063				sv.BillingGroupDescription = ptr.String(jtv)
36064			}
36065
36066		default:
36067			_, _ = key, value
36068
36069		}
36070	}
36071	*v = sv
36072	return nil
36073}
36074
36075func awsRestjson1_deserializeDocumentCACertificate(v **types.CACertificate, value interface{}) error {
36076	if v == nil {
36077		return fmt.Errorf("unexpected nil of type %T", v)
36078	}
36079	if value == nil {
36080		return nil
36081	}
36082
36083	shape, ok := value.(map[string]interface{})
36084	if !ok {
36085		return fmt.Errorf("unexpected JSON type %v", value)
36086	}
36087
36088	var sv *types.CACertificate
36089	if *v == nil {
36090		sv = &types.CACertificate{}
36091	} else {
36092		sv = *v
36093	}
36094
36095	for key, value := range shape {
36096		switch key {
36097		case "certificateArn":
36098			if value != nil {
36099				jtv, ok := value.(string)
36100				if !ok {
36101					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
36102				}
36103				sv.CertificateArn = ptr.String(jtv)
36104			}
36105
36106		case "certificateId":
36107			if value != nil {
36108				jtv, ok := value.(string)
36109				if !ok {
36110					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
36111				}
36112				sv.CertificateId = ptr.String(jtv)
36113			}
36114
36115		case "creationDate":
36116			if value != nil {
36117				jtv, ok := value.(json.Number)
36118				if !ok {
36119					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36120				}
36121				f64, err := jtv.Float64()
36122				if err != nil {
36123					return err
36124				}
36125				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36126			}
36127
36128		case "status":
36129			if value != nil {
36130				jtv, ok := value.(string)
36131				if !ok {
36132					return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value)
36133				}
36134				sv.Status = types.CACertificateStatus(jtv)
36135			}
36136
36137		default:
36138			_, _ = key, value
36139
36140		}
36141	}
36142	*v = sv
36143	return nil
36144}
36145
36146func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertificateDescription, value interface{}) error {
36147	if v == nil {
36148		return fmt.Errorf("unexpected nil of type %T", v)
36149	}
36150	if value == nil {
36151		return nil
36152	}
36153
36154	shape, ok := value.(map[string]interface{})
36155	if !ok {
36156		return fmt.Errorf("unexpected JSON type %v", value)
36157	}
36158
36159	var sv *types.CACertificateDescription
36160	if *v == nil {
36161		sv = &types.CACertificateDescription{}
36162	} else {
36163		sv = *v
36164	}
36165
36166	for key, value := range shape {
36167		switch key {
36168		case "autoRegistrationStatus":
36169			if value != nil {
36170				jtv, ok := value.(string)
36171				if !ok {
36172					return fmt.Errorf("expected AutoRegistrationStatus to be of type string, got %T instead", value)
36173				}
36174				sv.AutoRegistrationStatus = types.AutoRegistrationStatus(jtv)
36175			}
36176
36177		case "certificateArn":
36178			if value != nil {
36179				jtv, ok := value.(string)
36180				if !ok {
36181					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
36182				}
36183				sv.CertificateArn = ptr.String(jtv)
36184			}
36185
36186		case "certificateId":
36187			if value != nil {
36188				jtv, ok := value.(string)
36189				if !ok {
36190					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
36191				}
36192				sv.CertificateId = ptr.String(jtv)
36193			}
36194
36195		case "certificatePem":
36196			if value != nil {
36197				jtv, ok := value.(string)
36198				if !ok {
36199					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
36200				}
36201				sv.CertificatePem = ptr.String(jtv)
36202			}
36203
36204		case "creationDate":
36205			if value != nil {
36206				jtv, ok := value.(json.Number)
36207				if !ok {
36208					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36209				}
36210				f64, err := jtv.Float64()
36211				if err != nil {
36212					return err
36213				}
36214				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36215			}
36216
36217		case "customerVersion":
36218			if value != nil {
36219				jtv, ok := value.(json.Number)
36220				if !ok {
36221					return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value)
36222				}
36223				i64, err := jtv.Int64()
36224				if err != nil {
36225					return err
36226				}
36227				sv.CustomerVersion = ptr.Int32(int32(i64))
36228			}
36229
36230		case "generationId":
36231			if value != nil {
36232				jtv, ok := value.(string)
36233				if !ok {
36234					return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value)
36235				}
36236				sv.GenerationId = ptr.String(jtv)
36237			}
36238
36239		case "lastModifiedDate":
36240			if value != nil {
36241				jtv, ok := value.(json.Number)
36242				if !ok {
36243					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36244				}
36245				f64, err := jtv.Float64()
36246				if err != nil {
36247					return err
36248				}
36249				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36250			}
36251
36252		case "ownedBy":
36253			if value != nil {
36254				jtv, ok := value.(string)
36255				if !ok {
36256					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
36257				}
36258				sv.OwnedBy = ptr.String(jtv)
36259			}
36260
36261		case "status":
36262			if value != nil {
36263				jtv, ok := value.(string)
36264				if !ok {
36265					return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value)
36266				}
36267				sv.Status = types.CACertificateStatus(jtv)
36268			}
36269
36270		case "validity":
36271			if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil {
36272				return err
36273			}
36274
36275		default:
36276			_, _ = key, value
36277
36278		}
36279	}
36280	*v = sv
36281	return nil
36282}
36283
36284func awsRestjson1_deserializeDocumentCACertificates(v *[]types.CACertificate, value interface{}) error {
36285	if v == nil {
36286		return fmt.Errorf("unexpected nil of type %T", v)
36287	}
36288	if value == nil {
36289		return nil
36290	}
36291
36292	shape, ok := value.([]interface{})
36293	if !ok {
36294		return fmt.Errorf("unexpected JSON type %v", value)
36295	}
36296
36297	var cv []types.CACertificate
36298	if *v == nil {
36299		cv = []types.CACertificate{}
36300	} else {
36301		cv = *v
36302	}
36303
36304	for _, value := range shape {
36305		var col types.CACertificate
36306		destAddr := &col
36307		if err := awsRestjson1_deserializeDocumentCACertificate(&destAddr, value); err != nil {
36308			return err
36309		}
36310		col = *destAddr
36311		cv = append(cv, col)
36312
36313	}
36314	*v = cv
36315	return nil
36316}
36317
36318func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value interface{}) error {
36319	if v == nil {
36320		return fmt.Errorf("unexpected nil of type %T", v)
36321	}
36322	if value == nil {
36323		return nil
36324	}
36325
36326	shape, ok := value.(map[string]interface{})
36327	if !ok {
36328		return fmt.Errorf("unexpected JSON type %v", value)
36329	}
36330
36331	var sv *types.Certificate
36332	if *v == nil {
36333		sv = &types.Certificate{}
36334	} else {
36335		sv = *v
36336	}
36337
36338	for key, value := range shape {
36339		switch key {
36340		case "certificateArn":
36341			if value != nil {
36342				jtv, ok := value.(string)
36343				if !ok {
36344					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
36345				}
36346				sv.CertificateArn = ptr.String(jtv)
36347			}
36348
36349		case "certificateId":
36350			if value != nil {
36351				jtv, ok := value.(string)
36352				if !ok {
36353					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
36354				}
36355				sv.CertificateId = ptr.String(jtv)
36356			}
36357
36358		case "certificateMode":
36359			if value != nil {
36360				jtv, ok := value.(string)
36361				if !ok {
36362					return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value)
36363				}
36364				sv.CertificateMode = types.CertificateMode(jtv)
36365			}
36366
36367		case "creationDate":
36368			if value != nil {
36369				jtv, ok := value.(json.Number)
36370				if !ok {
36371					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36372				}
36373				f64, err := jtv.Float64()
36374				if err != nil {
36375					return err
36376				}
36377				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36378			}
36379
36380		case "status":
36381			if value != nil {
36382				jtv, ok := value.(string)
36383				if !ok {
36384					return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value)
36385				}
36386				sv.Status = types.CertificateStatus(jtv)
36387			}
36388
36389		default:
36390			_, _ = key, value
36391
36392		}
36393	}
36394	*v = sv
36395	return nil
36396}
36397
36398func awsRestjson1_deserializeDocumentCertificateConflictException(v **types.CertificateConflictException, value interface{}) error {
36399	if v == nil {
36400		return fmt.Errorf("unexpected nil of type %T", v)
36401	}
36402	if value == nil {
36403		return nil
36404	}
36405
36406	shape, ok := value.(map[string]interface{})
36407	if !ok {
36408		return fmt.Errorf("unexpected JSON type %v", value)
36409	}
36410
36411	var sv *types.CertificateConflictException
36412	if *v == nil {
36413		sv = &types.CertificateConflictException{}
36414	} else {
36415		sv = *v
36416	}
36417
36418	for key, value := range shape {
36419		switch key {
36420		case "message":
36421			if value != nil {
36422				jtv, ok := value.(string)
36423				if !ok {
36424					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
36425				}
36426				sv.Message = ptr.String(jtv)
36427			}
36428
36429		default:
36430			_, _ = key, value
36431
36432		}
36433	}
36434	*v = sv
36435	return nil
36436}
36437
36438func awsRestjson1_deserializeDocumentCertificateDescription(v **types.CertificateDescription, value interface{}) error {
36439	if v == nil {
36440		return fmt.Errorf("unexpected nil of type %T", v)
36441	}
36442	if value == nil {
36443		return nil
36444	}
36445
36446	shape, ok := value.(map[string]interface{})
36447	if !ok {
36448		return fmt.Errorf("unexpected JSON type %v", value)
36449	}
36450
36451	var sv *types.CertificateDescription
36452	if *v == nil {
36453		sv = &types.CertificateDescription{}
36454	} else {
36455		sv = *v
36456	}
36457
36458	for key, value := range shape {
36459		switch key {
36460		case "caCertificateId":
36461			if value != nil {
36462				jtv, ok := value.(string)
36463				if !ok {
36464					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
36465				}
36466				sv.CaCertificateId = ptr.String(jtv)
36467			}
36468
36469		case "certificateArn":
36470			if value != nil {
36471				jtv, ok := value.(string)
36472				if !ok {
36473					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
36474				}
36475				sv.CertificateArn = ptr.String(jtv)
36476			}
36477
36478		case "certificateId":
36479			if value != nil {
36480				jtv, ok := value.(string)
36481				if !ok {
36482					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
36483				}
36484				sv.CertificateId = ptr.String(jtv)
36485			}
36486
36487		case "certificateMode":
36488			if value != nil {
36489				jtv, ok := value.(string)
36490				if !ok {
36491					return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value)
36492				}
36493				sv.CertificateMode = types.CertificateMode(jtv)
36494			}
36495
36496		case "certificatePem":
36497			if value != nil {
36498				jtv, ok := value.(string)
36499				if !ok {
36500					return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value)
36501				}
36502				sv.CertificatePem = ptr.String(jtv)
36503			}
36504
36505		case "creationDate":
36506			if value != nil {
36507				jtv, ok := value.(json.Number)
36508				if !ok {
36509					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36510				}
36511				f64, err := jtv.Float64()
36512				if err != nil {
36513					return err
36514				}
36515				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36516			}
36517
36518		case "customerVersion":
36519			if value != nil {
36520				jtv, ok := value.(json.Number)
36521				if !ok {
36522					return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value)
36523				}
36524				i64, err := jtv.Int64()
36525				if err != nil {
36526					return err
36527				}
36528				sv.CustomerVersion = ptr.Int32(int32(i64))
36529			}
36530
36531		case "generationId":
36532			if value != nil {
36533				jtv, ok := value.(string)
36534				if !ok {
36535					return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value)
36536				}
36537				sv.GenerationId = ptr.String(jtv)
36538			}
36539
36540		case "lastModifiedDate":
36541			if value != nil {
36542				jtv, ok := value.(json.Number)
36543				if !ok {
36544					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36545				}
36546				f64, err := jtv.Float64()
36547				if err != nil {
36548					return err
36549				}
36550				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
36551			}
36552
36553		case "ownedBy":
36554			if value != nil {
36555				jtv, ok := value.(string)
36556				if !ok {
36557					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
36558				}
36559				sv.OwnedBy = ptr.String(jtv)
36560			}
36561
36562		case "previousOwnedBy":
36563			if value != nil {
36564				jtv, ok := value.(string)
36565				if !ok {
36566					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
36567				}
36568				sv.PreviousOwnedBy = ptr.String(jtv)
36569			}
36570
36571		case "status":
36572			if value != nil {
36573				jtv, ok := value.(string)
36574				if !ok {
36575					return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value)
36576				}
36577				sv.Status = types.CertificateStatus(jtv)
36578			}
36579
36580		case "transferData":
36581			if err := awsRestjson1_deserializeDocumentTransferData(&sv.TransferData, value); err != nil {
36582				return err
36583			}
36584
36585		case "validity":
36586			if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil {
36587				return err
36588			}
36589
36590		default:
36591			_, _ = key, value
36592
36593		}
36594	}
36595	*v = sv
36596	return nil
36597}
36598
36599func awsRestjson1_deserializeDocumentCertificates(v *[]types.Certificate, value interface{}) error {
36600	if v == nil {
36601		return fmt.Errorf("unexpected nil of type %T", v)
36602	}
36603	if value == nil {
36604		return nil
36605	}
36606
36607	shape, ok := value.([]interface{})
36608	if !ok {
36609		return fmt.Errorf("unexpected JSON type %v", value)
36610	}
36611
36612	var cv []types.Certificate
36613	if *v == nil {
36614		cv = []types.Certificate{}
36615	} else {
36616		cv = *v
36617	}
36618
36619	for _, value := range shape {
36620		var col types.Certificate
36621		destAddr := &col
36622		if err := awsRestjson1_deserializeDocumentCertificate(&destAddr, value); err != nil {
36623			return err
36624		}
36625		col = *destAddr
36626		cv = append(cv, col)
36627
36628	}
36629	*v = cv
36630	return nil
36631}
36632
36633func awsRestjson1_deserializeDocumentCertificateStateException(v **types.CertificateStateException, value interface{}) error {
36634	if v == nil {
36635		return fmt.Errorf("unexpected nil of type %T", v)
36636	}
36637	if value == nil {
36638		return nil
36639	}
36640
36641	shape, ok := value.(map[string]interface{})
36642	if !ok {
36643		return fmt.Errorf("unexpected JSON type %v", value)
36644	}
36645
36646	var sv *types.CertificateStateException
36647	if *v == nil {
36648		sv = &types.CertificateStateException{}
36649	} else {
36650		sv = *v
36651	}
36652
36653	for key, value := range shape {
36654		switch key {
36655		case "message":
36656			if value != nil {
36657				jtv, ok := value.(string)
36658				if !ok {
36659					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
36660				}
36661				sv.Message = ptr.String(jtv)
36662			}
36663
36664		default:
36665			_, _ = key, value
36666
36667		}
36668	}
36669	*v = sv
36670	return nil
36671}
36672
36673func awsRestjson1_deserializeDocumentCertificateValidationException(v **types.CertificateValidationException, value interface{}) error {
36674	if v == nil {
36675		return fmt.Errorf("unexpected nil of type %T", v)
36676	}
36677	if value == nil {
36678		return nil
36679	}
36680
36681	shape, ok := value.(map[string]interface{})
36682	if !ok {
36683		return fmt.Errorf("unexpected JSON type %v", value)
36684	}
36685
36686	var sv *types.CertificateValidationException
36687	if *v == nil {
36688		sv = &types.CertificateValidationException{}
36689	} else {
36690		sv = *v
36691	}
36692
36693	for key, value := range shape {
36694		switch key {
36695		case "message":
36696			if value != nil {
36697				jtv, ok := value.(string)
36698				if !ok {
36699					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
36700				}
36701				sv.Message = ptr.String(jtv)
36702			}
36703
36704		default:
36705			_, _ = key, value
36706
36707		}
36708	}
36709	*v = sv
36710	return nil
36711}
36712
36713func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateValidity, value interface{}) error {
36714	if v == nil {
36715		return fmt.Errorf("unexpected nil of type %T", v)
36716	}
36717	if value == nil {
36718		return nil
36719	}
36720
36721	shape, ok := value.(map[string]interface{})
36722	if !ok {
36723		return fmt.Errorf("unexpected JSON type %v", value)
36724	}
36725
36726	var sv *types.CertificateValidity
36727	if *v == nil {
36728		sv = &types.CertificateValidity{}
36729	} else {
36730		sv = *v
36731	}
36732
36733	for key, value := range shape {
36734		switch key {
36735		case "notAfter":
36736			if value != nil {
36737				jtv, ok := value.(json.Number)
36738				if !ok {
36739					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36740				}
36741				f64, err := jtv.Float64()
36742				if err != nil {
36743					return err
36744				}
36745				sv.NotAfter = ptr.Time(smithytime.ParseEpochSeconds(f64))
36746			}
36747
36748		case "notBefore":
36749			if value != nil {
36750				jtv, ok := value.(json.Number)
36751				if !ok {
36752					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
36753				}
36754				f64, err := jtv.Float64()
36755				if err != nil {
36756					return err
36757				}
36758				sv.NotBefore = ptr.Time(smithytime.ParseEpochSeconds(f64))
36759			}
36760
36761		default:
36762			_, _ = key, value
36763
36764		}
36765	}
36766	*v = sv
36767	return nil
36768}
36769
36770func awsRestjson1_deserializeDocumentCidrs(v *[]string, value interface{}) error {
36771	if v == nil {
36772		return fmt.Errorf("unexpected nil of type %T", v)
36773	}
36774	if value == nil {
36775		return nil
36776	}
36777
36778	shape, ok := value.([]interface{})
36779	if !ok {
36780		return fmt.Errorf("unexpected JSON type %v", value)
36781	}
36782
36783	var cv []string
36784	if *v == nil {
36785		cv = []string{}
36786	} else {
36787		cv = *v
36788	}
36789
36790	for _, value := range shape {
36791		var col string
36792		if value != nil {
36793			jtv, ok := value.(string)
36794			if !ok {
36795				return fmt.Errorf("expected Cidr to be of type string, got %T instead", value)
36796			}
36797			col = jtv
36798		}
36799		cv = append(cv, col)
36800
36801	}
36802	*v = cv
36803	return nil
36804}
36805
36806func awsRestjson1_deserializeDocumentCloudwatchAlarmAction(v **types.CloudwatchAlarmAction, value interface{}) error {
36807	if v == nil {
36808		return fmt.Errorf("unexpected nil of type %T", v)
36809	}
36810	if value == nil {
36811		return nil
36812	}
36813
36814	shape, ok := value.(map[string]interface{})
36815	if !ok {
36816		return fmt.Errorf("unexpected JSON type %v", value)
36817	}
36818
36819	var sv *types.CloudwatchAlarmAction
36820	if *v == nil {
36821		sv = &types.CloudwatchAlarmAction{}
36822	} else {
36823		sv = *v
36824	}
36825
36826	for key, value := range shape {
36827		switch key {
36828		case "alarmName":
36829			if value != nil {
36830				jtv, ok := value.(string)
36831				if !ok {
36832					return fmt.Errorf("expected AlarmName to be of type string, got %T instead", value)
36833				}
36834				sv.AlarmName = ptr.String(jtv)
36835			}
36836
36837		case "roleArn":
36838			if value != nil {
36839				jtv, ok := value.(string)
36840				if !ok {
36841					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
36842				}
36843				sv.RoleArn = ptr.String(jtv)
36844			}
36845
36846		case "stateReason":
36847			if value != nil {
36848				jtv, ok := value.(string)
36849				if !ok {
36850					return fmt.Errorf("expected StateReason to be of type string, got %T instead", value)
36851				}
36852				sv.StateReason = ptr.String(jtv)
36853			}
36854
36855		case "stateValue":
36856			if value != nil {
36857				jtv, ok := value.(string)
36858				if !ok {
36859					return fmt.Errorf("expected StateValue to be of type string, got %T instead", value)
36860				}
36861				sv.StateValue = ptr.String(jtv)
36862			}
36863
36864		default:
36865			_, _ = key, value
36866
36867		}
36868	}
36869	*v = sv
36870	return nil
36871}
36872
36873func awsRestjson1_deserializeDocumentCloudwatchLogsAction(v **types.CloudwatchLogsAction, value interface{}) error {
36874	if v == nil {
36875		return fmt.Errorf("unexpected nil of type %T", v)
36876	}
36877	if value == nil {
36878		return nil
36879	}
36880
36881	shape, ok := value.(map[string]interface{})
36882	if !ok {
36883		return fmt.Errorf("unexpected JSON type %v", value)
36884	}
36885
36886	var sv *types.CloudwatchLogsAction
36887	if *v == nil {
36888		sv = &types.CloudwatchLogsAction{}
36889	} else {
36890		sv = *v
36891	}
36892
36893	for key, value := range shape {
36894		switch key {
36895		case "logGroupName":
36896			if value != nil {
36897				jtv, ok := value.(string)
36898				if !ok {
36899					return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value)
36900				}
36901				sv.LogGroupName = ptr.String(jtv)
36902			}
36903
36904		case "roleArn":
36905			if value != nil {
36906				jtv, ok := value.(string)
36907				if !ok {
36908					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
36909				}
36910				sv.RoleArn = ptr.String(jtv)
36911			}
36912
36913		default:
36914			_, _ = key, value
36915
36916		}
36917	}
36918	*v = sv
36919	return nil
36920}
36921
36922func awsRestjson1_deserializeDocumentCloudwatchMetricAction(v **types.CloudwatchMetricAction, value interface{}) error {
36923	if v == nil {
36924		return fmt.Errorf("unexpected nil of type %T", v)
36925	}
36926	if value == nil {
36927		return nil
36928	}
36929
36930	shape, ok := value.(map[string]interface{})
36931	if !ok {
36932		return fmt.Errorf("unexpected JSON type %v", value)
36933	}
36934
36935	var sv *types.CloudwatchMetricAction
36936	if *v == nil {
36937		sv = &types.CloudwatchMetricAction{}
36938	} else {
36939		sv = *v
36940	}
36941
36942	for key, value := range shape {
36943		switch key {
36944		case "metricName":
36945			if value != nil {
36946				jtv, ok := value.(string)
36947				if !ok {
36948					return fmt.Errorf("expected String to be of type string, got %T instead", value)
36949				}
36950				sv.MetricName = ptr.String(jtv)
36951			}
36952
36953		case "metricNamespace":
36954			if value != nil {
36955				jtv, ok := value.(string)
36956				if !ok {
36957					return fmt.Errorf("expected String to be of type string, got %T instead", value)
36958				}
36959				sv.MetricNamespace = ptr.String(jtv)
36960			}
36961
36962		case "metricTimestamp":
36963			if value != nil {
36964				jtv, ok := value.(string)
36965				if !ok {
36966					return fmt.Errorf("expected String to be of type string, got %T instead", value)
36967				}
36968				sv.MetricTimestamp = ptr.String(jtv)
36969			}
36970
36971		case "metricUnit":
36972			if value != nil {
36973				jtv, ok := value.(string)
36974				if !ok {
36975					return fmt.Errorf("expected String to be of type string, got %T instead", value)
36976				}
36977				sv.MetricUnit = ptr.String(jtv)
36978			}
36979
36980		case "metricValue":
36981			if value != nil {
36982				jtv, ok := value.(string)
36983				if !ok {
36984					return fmt.Errorf("expected String to be of type string, got %T instead", value)
36985				}
36986				sv.MetricValue = ptr.String(jtv)
36987			}
36988
36989		case "roleArn":
36990			if value != nil {
36991				jtv, ok := value.(string)
36992				if !ok {
36993					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
36994				}
36995				sv.RoleArn = ptr.String(jtv)
36996			}
36997
36998		default:
36999			_, _ = key, value
37000
37001		}
37002	}
37003	*v = sv
37004	return nil
37005}
37006
37007func awsRestjson1_deserializeDocumentCodeSigning(v **types.CodeSigning, value interface{}) error {
37008	if v == nil {
37009		return fmt.Errorf("unexpected nil of type %T", v)
37010	}
37011	if value == nil {
37012		return nil
37013	}
37014
37015	shape, ok := value.(map[string]interface{})
37016	if !ok {
37017		return fmt.Errorf("unexpected JSON type %v", value)
37018	}
37019
37020	var sv *types.CodeSigning
37021	if *v == nil {
37022		sv = &types.CodeSigning{}
37023	} else {
37024		sv = *v
37025	}
37026
37027	for key, value := range shape {
37028		switch key {
37029		case "awsSignerJobId":
37030			if value != nil {
37031				jtv, ok := value.(string)
37032				if !ok {
37033					return fmt.Errorf("expected SigningJobId to be of type string, got %T instead", value)
37034				}
37035				sv.AwsSignerJobId = ptr.String(jtv)
37036			}
37037
37038		case "customCodeSigning":
37039			if err := awsRestjson1_deserializeDocumentCustomCodeSigning(&sv.CustomCodeSigning, value); err != nil {
37040				return err
37041			}
37042
37043		case "startSigningJobParameter":
37044			if err := awsRestjson1_deserializeDocumentStartSigningJobParameter(&sv.StartSigningJobParameter, value); err != nil {
37045				return err
37046			}
37047
37048		default:
37049			_, _ = key, value
37050
37051		}
37052	}
37053	*v = sv
37054	return nil
37055}
37056
37057func awsRestjson1_deserializeDocumentCodeSigningCertificateChain(v **types.CodeSigningCertificateChain, value interface{}) error {
37058	if v == nil {
37059		return fmt.Errorf("unexpected nil of type %T", v)
37060	}
37061	if value == nil {
37062		return nil
37063	}
37064
37065	shape, ok := value.(map[string]interface{})
37066	if !ok {
37067		return fmt.Errorf("unexpected JSON type %v", value)
37068	}
37069
37070	var sv *types.CodeSigningCertificateChain
37071	if *v == nil {
37072		sv = &types.CodeSigningCertificateChain{}
37073	} else {
37074		sv = *v
37075	}
37076
37077	for key, value := range shape {
37078		switch key {
37079		case "certificateName":
37080			if value != nil {
37081				jtv, ok := value.(string)
37082				if !ok {
37083					return fmt.Errorf("expected CertificateName to be of type string, got %T instead", value)
37084				}
37085				sv.CertificateName = ptr.String(jtv)
37086			}
37087
37088		case "inlineDocument":
37089			if value != nil {
37090				jtv, ok := value.(string)
37091				if !ok {
37092					return fmt.Errorf("expected InlineDocument to be of type string, got %T instead", value)
37093				}
37094				sv.InlineDocument = ptr.String(jtv)
37095			}
37096
37097		default:
37098			_, _ = key, value
37099
37100		}
37101	}
37102	*v = sv
37103	return nil
37104}
37105
37106func awsRestjson1_deserializeDocumentCodeSigningSignature(v **types.CodeSigningSignature, value interface{}) error {
37107	if v == nil {
37108		return fmt.Errorf("unexpected nil of type %T", v)
37109	}
37110	if value == nil {
37111		return nil
37112	}
37113
37114	shape, ok := value.(map[string]interface{})
37115	if !ok {
37116		return fmt.Errorf("unexpected JSON type %v", value)
37117	}
37118
37119	var sv *types.CodeSigningSignature
37120	if *v == nil {
37121		sv = &types.CodeSigningSignature{}
37122	} else {
37123		sv = *v
37124	}
37125
37126	for key, value := range shape {
37127		switch key {
37128		case "inlineDocument":
37129			if value != nil {
37130				jtv, ok := value.(string)
37131				if !ok {
37132					return fmt.Errorf("expected Signature to be []byte, got %T instead", value)
37133				}
37134				dv, err := base64.StdEncoding.DecodeString(jtv)
37135				if err != nil {
37136					return fmt.Errorf("failed to base64 decode Signature, %w", err)
37137				}
37138				sv.InlineDocument = dv
37139			}
37140
37141		default:
37142			_, _ = key, value
37143
37144		}
37145	}
37146	*v = sv
37147	return nil
37148}
37149
37150func awsRestjson1_deserializeDocumentConfiguration(v **types.Configuration, value interface{}) error {
37151	if v == nil {
37152		return fmt.Errorf("unexpected nil of type %T", v)
37153	}
37154	if value == nil {
37155		return nil
37156	}
37157
37158	shape, ok := value.(map[string]interface{})
37159	if !ok {
37160		return fmt.Errorf("unexpected JSON type %v", value)
37161	}
37162
37163	var sv *types.Configuration
37164	if *v == nil {
37165		sv = &types.Configuration{}
37166	} else {
37167		sv = *v
37168	}
37169
37170	for key, value := range shape {
37171		switch key {
37172		case "Enabled":
37173			if value != nil {
37174				jtv, ok := value.(bool)
37175				if !ok {
37176					return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
37177				}
37178				sv.Enabled = jtv
37179			}
37180
37181		default:
37182			_, _ = key, value
37183
37184		}
37185	}
37186	*v = sv
37187	return nil
37188}
37189
37190func awsRestjson1_deserializeDocumentConflictingResourceUpdateException(v **types.ConflictingResourceUpdateException, value interface{}) error {
37191	if v == nil {
37192		return fmt.Errorf("unexpected nil of type %T", v)
37193	}
37194	if value == nil {
37195		return nil
37196	}
37197
37198	shape, ok := value.(map[string]interface{})
37199	if !ok {
37200		return fmt.Errorf("unexpected JSON type %v", value)
37201	}
37202
37203	var sv *types.ConflictingResourceUpdateException
37204	if *v == nil {
37205		sv = &types.ConflictingResourceUpdateException{}
37206	} else {
37207		sv = *v
37208	}
37209
37210	for key, value := range shape {
37211		switch key {
37212		case "message":
37213			if value != nil {
37214				jtv, ok := value.(string)
37215				if !ok {
37216					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
37217				}
37218				sv.Message = ptr.String(jtv)
37219			}
37220
37221		default:
37222			_, _ = key, value
37223
37224		}
37225	}
37226	*v = sv
37227	return nil
37228}
37229
37230func awsRestjson1_deserializeDocumentCustomCodeSigning(v **types.CustomCodeSigning, value interface{}) error {
37231	if v == nil {
37232		return fmt.Errorf("unexpected nil of type %T", v)
37233	}
37234	if value == nil {
37235		return nil
37236	}
37237
37238	shape, ok := value.(map[string]interface{})
37239	if !ok {
37240		return fmt.Errorf("unexpected JSON type %v", value)
37241	}
37242
37243	var sv *types.CustomCodeSigning
37244	if *v == nil {
37245		sv = &types.CustomCodeSigning{}
37246	} else {
37247		sv = *v
37248	}
37249
37250	for key, value := range shape {
37251		switch key {
37252		case "certificateChain":
37253			if err := awsRestjson1_deserializeDocumentCodeSigningCertificateChain(&sv.CertificateChain, value); err != nil {
37254				return err
37255			}
37256
37257		case "hashAlgorithm":
37258			if value != nil {
37259				jtv, ok := value.(string)
37260				if !ok {
37261					return fmt.Errorf("expected HashAlgorithm to be of type string, got %T instead", value)
37262				}
37263				sv.HashAlgorithm = ptr.String(jtv)
37264			}
37265
37266		case "signature":
37267			if err := awsRestjson1_deserializeDocumentCodeSigningSignature(&sv.Signature, value); err != nil {
37268				return err
37269			}
37270
37271		case "signatureAlgorithm":
37272			if value != nil {
37273				jtv, ok := value.(string)
37274				if !ok {
37275					return fmt.Errorf("expected SignatureAlgorithm to be of type string, got %T instead", value)
37276				}
37277				sv.SignatureAlgorithm = ptr.String(jtv)
37278			}
37279
37280		default:
37281			_, _ = key, value
37282
37283		}
37284	}
37285	*v = sv
37286	return nil
37287}
37288
37289func awsRestjson1_deserializeDocumentDeleteConflictException(v **types.DeleteConflictException, value interface{}) error {
37290	if v == nil {
37291		return fmt.Errorf("unexpected nil of type %T", v)
37292	}
37293	if value == nil {
37294		return nil
37295	}
37296
37297	shape, ok := value.(map[string]interface{})
37298	if !ok {
37299		return fmt.Errorf("unexpected JSON type %v", value)
37300	}
37301
37302	var sv *types.DeleteConflictException
37303	if *v == nil {
37304		sv = &types.DeleteConflictException{}
37305	} else {
37306		sv = *v
37307	}
37308
37309	for key, value := range shape {
37310		switch key {
37311		case "message":
37312			if value != nil {
37313				jtv, ok := value.(string)
37314				if !ok {
37315					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
37316				}
37317				sv.Message = ptr.String(jtv)
37318			}
37319
37320		default:
37321			_, _ = key, value
37322
37323		}
37324	}
37325	*v = sv
37326	return nil
37327}
37328
37329func awsRestjson1_deserializeDocumentDenied(v **types.Denied, value interface{}) error {
37330	if v == nil {
37331		return fmt.Errorf("unexpected nil of type %T", v)
37332	}
37333	if value == nil {
37334		return nil
37335	}
37336
37337	shape, ok := value.(map[string]interface{})
37338	if !ok {
37339		return fmt.Errorf("unexpected JSON type %v", value)
37340	}
37341
37342	var sv *types.Denied
37343	if *v == nil {
37344		sv = &types.Denied{}
37345	} else {
37346		sv = *v
37347	}
37348
37349	for key, value := range shape {
37350		switch key {
37351		case "explicitDeny":
37352			if err := awsRestjson1_deserializeDocumentExplicitDeny(&sv.ExplicitDeny, value); err != nil {
37353				return err
37354			}
37355
37356		case "implicitDeny":
37357			if err := awsRestjson1_deserializeDocumentImplicitDeny(&sv.ImplicitDeny, value); err != nil {
37358				return err
37359			}
37360
37361		default:
37362			_, _ = key, value
37363
37364		}
37365	}
37366	*v = sv
37367	return nil
37368}
37369
37370func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error {
37371	if v == nil {
37372		return fmt.Errorf("unexpected nil of type %T", v)
37373	}
37374	if value == nil {
37375		return nil
37376	}
37377
37378	shape, ok := value.(map[string]interface{})
37379	if !ok {
37380		return fmt.Errorf("unexpected JSON type %v", value)
37381	}
37382
37383	var sv *types.Destination
37384	if *v == nil {
37385		sv = &types.Destination{}
37386	} else {
37387		sv = *v
37388	}
37389
37390	for key, value := range shape {
37391		switch key {
37392		case "s3Destination":
37393			if err := awsRestjson1_deserializeDocumentS3Destination(&sv.S3Destination, value); err != nil {
37394				return err
37395			}
37396
37397		default:
37398			_, _ = key, value
37399
37400		}
37401	}
37402	*v = sv
37403	return nil
37404}
37405
37406func awsRestjson1_deserializeDocumentDetailsMap(v *map[string]string, value interface{}) error {
37407	if v == nil {
37408		return fmt.Errorf("unexpected nil of type %T", v)
37409	}
37410	if value == nil {
37411		return nil
37412	}
37413
37414	shape, ok := value.(map[string]interface{})
37415	if !ok {
37416		return fmt.Errorf("unexpected JSON type %v", value)
37417	}
37418
37419	var mv map[string]string
37420	if *v == nil {
37421		mv = map[string]string{}
37422	} else {
37423		mv = *v
37424	}
37425
37426	for key, value := range shape {
37427		var parsedVal string
37428		if value != nil {
37429			jtv, ok := value.(string)
37430			if !ok {
37431				return fmt.Errorf("expected DetailsValue to be of type string, got %T instead", value)
37432			}
37433			parsedVal = jtv
37434		}
37435		mv[key] = parsedVal
37436
37437	}
37438	*v = mv
37439	return nil
37440}
37441
37442func awsRestjson1_deserializeDocumentDimensionNames(v *[]string, value interface{}) error {
37443	if v == nil {
37444		return fmt.Errorf("unexpected nil of type %T", v)
37445	}
37446	if value == nil {
37447		return nil
37448	}
37449
37450	shape, ok := value.([]interface{})
37451	if !ok {
37452		return fmt.Errorf("unexpected JSON type %v", value)
37453	}
37454
37455	var cv []string
37456	if *v == nil {
37457		cv = []string{}
37458	} else {
37459		cv = *v
37460	}
37461
37462	for _, value := range shape {
37463		var col string
37464		if value != nil {
37465			jtv, ok := value.(string)
37466			if !ok {
37467				return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
37468			}
37469			col = jtv
37470		}
37471		cv = append(cv, col)
37472
37473	}
37474	*v = cv
37475	return nil
37476}
37477
37478func awsRestjson1_deserializeDocumentDimensionStringValues(v *[]string, value interface{}) error {
37479	if v == nil {
37480		return fmt.Errorf("unexpected nil of type %T", v)
37481	}
37482	if value == nil {
37483		return nil
37484	}
37485
37486	shape, ok := value.([]interface{})
37487	if !ok {
37488		return fmt.Errorf("unexpected JSON type %v", value)
37489	}
37490
37491	var cv []string
37492	if *v == nil {
37493		cv = []string{}
37494	} else {
37495		cv = *v
37496	}
37497
37498	for _, value := range shape {
37499		var col string
37500		if value != nil {
37501			jtv, ok := value.(string)
37502			if !ok {
37503				return fmt.Errorf("expected DimensionStringValue to be of type string, got %T instead", value)
37504			}
37505			col = jtv
37506		}
37507		cv = append(cv, col)
37508
37509	}
37510	*v = cv
37511	return nil
37512}
37513
37514func awsRestjson1_deserializeDocumentDomainConfigurations(v *[]types.DomainConfigurationSummary, value interface{}) error {
37515	if v == nil {
37516		return fmt.Errorf("unexpected nil of type %T", v)
37517	}
37518	if value == nil {
37519		return nil
37520	}
37521
37522	shape, ok := value.([]interface{})
37523	if !ok {
37524		return fmt.Errorf("unexpected JSON type %v", value)
37525	}
37526
37527	var cv []types.DomainConfigurationSummary
37528	if *v == nil {
37529		cv = []types.DomainConfigurationSummary{}
37530	} else {
37531		cv = *v
37532	}
37533
37534	for _, value := range shape {
37535		var col types.DomainConfigurationSummary
37536		destAddr := &col
37537		if err := awsRestjson1_deserializeDocumentDomainConfigurationSummary(&destAddr, value); err != nil {
37538			return err
37539		}
37540		col = *destAddr
37541		cv = append(cv, col)
37542
37543	}
37544	*v = cv
37545	return nil
37546}
37547
37548func awsRestjson1_deserializeDocumentDomainConfigurationSummary(v **types.DomainConfigurationSummary, value interface{}) error {
37549	if v == nil {
37550		return fmt.Errorf("unexpected nil of type %T", v)
37551	}
37552	if value == nil {
37553		return nil
37554	}
37555
37556	shape, ok := value.(map[string]interface{})
37557	if !ok {
37558		return fmt.Errorf("unexpected JSON type %v", value)
37559	}
37560
37561	var sv *types.DomainConfigurationSummary
37562	if *v == nil {
37563		sv = &types.DomainConfigurationSummary{}
37564	} else {
37565		sv = *v
37566	}
37567
37568	for key, value := range shape {
37569		switch key {
37570		case "domainConfigurationArn":
37571			if value != nil {
37572				jtv, ok := value.(string)
37573				if !ok {
37574					return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value)
37575				}
37576				sv.DomainConfigurationArn = ptr.String(jtv)
37577			}
37578
37579		case "domainConfigurationName":
37580			if value != nil {
37581				jtv, ok := value.(string)
37582				if !ok {
37583					return fmt.Errorf("expected ReservedDomainConfigurationName to be of type string, got %T instead", value)
37584				}
37585				sv.DomainConfigurationName = ptr.String(jtv)
37586			}
37587
37588		case "serviceType":
37589			if value != nil {
37590				jtv, ok := value.(string)
37591				if !ok {
37592					return fmt.Errorf("expected ServiceType to be of type string, got %T instead", value)
37593				}
37594				sv.ServiceType = types.ServiceType(jtv)
37595			}
37596
37597		default:
37598			_, _ = key, value
37599
37600		}
37601	}
37602	*v = sv
37603	return nil
37604}
37605
37606func awsRestjson1_deserializeDocumentDynamoDBAction(v **types.DynamoDBAction, value interface{}) error {
37607	if v == nil {
37608		return fmt.Errorf("unexpected nil of type %T", v)
37609	}
37610	if value == nil {
37611		return nil
37612	}
37613
37614	shape, ok := value.(map[string]interface{})
37615	if !ok {
37616		return fmt.Errorf("unexpected JSON type %v", value)
37617	}
37618
37619	var sv *types.DynamoDBAction
37620	if *v == nil {
37621		sv = &types.DynamoDBAction{}
37622	} else {
37623		sv = *v
37624	}
37625
37626	for key, value := range shape {
37627		switch key {
37628		case "hashKeyField":
37629			if value != nil {
37630				jtv, ok := value.(string)
37631				if !ok {
37632					return fmt.Errorf("expected HashKeyField to be of type string, got %T instead", value)
37633				}
37634				sv.HashKeyField = ptr.String(jtv)
37635			}
37636
37637		case "hashKeyType":
37638			if value != nil {
37639				jtv, ok := value.(string)
37640				if !ok {
37641					return fmt.Errorf("expected DynamoKeyType to be of type string, got %T instead", value)
37642				}
37643				sv.HashKeyType = types.DynamoKeyType(jtv)
37644			}
37645
37646		case "hashKeyValue":
37647			if value != nil {
37648				jtv, ok := value.(string)
37649				if !ok {
37650					return fmt.Errorf("expected HashKeyValue to be of type string, got %T instead", value)
37651				}
37652				sv.HashKeyValue = ptr.String(jtv)
37653			}
37654
37655		case "operation":
37656			if value != nil {
37657				jtv, ok := value.(string)
37658				if !ok {
37659					return fmt.Errorf("expected DynamoOperation to be of type string, got %T instead", value)
37660				}
37661				sv.Operation = ptr.String(jtv)
37662			}
37663
37664		case "payloadField":
37665			if value != nil {
37666				jtv, ok := value.(string)
37667				if !ok {
37668					return fmt.Errorf("expected PayloadField to be of type string, got %T instead", value)
37669				}
37670				sv.PayloadField = ptr.String(jtv)
37671			}
37672
37673		case "rangeKeyField":
37674			if value != nil {
37675				jtv, ok := value.(string)
37676				if !ok {
37677					return fmt.Errorf("expected RangeKeyField to be of type string, got %T instead", value)
37678				}
37679				sv.RangeKeyField = ptr.String(jtv)
37680			}
37681
37682		case "rangeKeyType":
37683			if value != nil {
37684				jtv, ok := value.(string)
37685				if !ok {
37686					return fmt.Errorf("expected DynamoKeyType to be of type string, got %T instead", value)
37687				}
37688				sv.RangeKeyType = types.DynamoKeyType(jtv)
37689			}
37690
37691		case "rangeKeyValue":
37692			if value != nil {
37693				jtv, ok := value.(string)
37694				if !ok {
37695					return fmt.Errorf("expected RangeKeyValue to be of type string, got %T instead", value)
37696				}
37697				sv.RangeKeyValue = ptr.String(jtv)
37698			}
37699
37700		case "roleArn":
37701			if value != nil {
37702				jtv, ok := value.(string)
37703				if !ok {
37704					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
37705				}
37706				sv.RoleArn = ptr.String(jtv)
37707			}
37708
37709		case "tableName":
37710			if value != nil {
37711				jtv, ok := value.(string)
37712				if !ok {
37713					return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
37714				}
37715				sv.TableName = ptr.String(jtv)
37716			}
37717
37718		default:
37719			_, _ = key, value
37720
37721		}
37722	}
37723	*v = sv
37724	return nil
37725}
37726
37727func awsRestjson1_deserializeDocumentDynamoDBv2Action(v **types.DynamoDBv2Action, value interface{}) error {
37728	if v == nil {
37729		return fmt.Errorf("unexpected nil of type %T", v)
37730	}
37731	if value == nil {
37732		return nil
37733	}
37734
37735	shape, ok := value.(map[string]interface{})
37736	if !ok {
37737		return fmt.Errorf("unexpected JSON type %v", value)
37738	}
37739
37740	var sv *types.DynamoDBv2Action
37741	if *v == nil {
37742		sv = &types.DynamoDBv2Action{}
37743	} else {
37744		sv = *v
37745	}
37746
37747	for key, value := range shape {
37748		switch key {
37749		case "putItem":
37750			if err := awsRestjson1_deserializeDocumentPutItemInput(&sv.PutItem, value); err != nil {
37751				return err
37752			}
37753
37754		case "roleArn":
37755			if value != nil {
37756				jtv, ok := value.(string)
37757				if !ok {
37758					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
37759				}
37760				sv.RoleArn = ptr.String(jtv)
37761			}
37762
37763		default:
37764			_, _ = key, value
37765
37766		}
37767	}
37768	*v = sv
37769	return nil
37770}
37771
37772func awsRestjson1_deserializeDocumentEffectivePolicies(v *[]types.EffectivePolicy, value interface{}) error {
37773	if v == nil {
37774		return fmt.Errorf("unexpected nil of type %T", v)
37775	}
37776	if value == nil {
37777		return nil
37778	}
37779
37780	shape, ok := value.([]interface{})
37781	if !ok {
37782		return fmt.Errorf("unexpected JSON type %v", value)
37783	}
37784
37785	var cv []types.EffectivePolicy
37786	if *v == nil {
37787		cv = []types.EffectivePolicy{}
37788	} else {
37789		cv = *v
37790	}
37791
37792	for _, value := range shape {
37793		var col types.EffectivePolicy
37794		destAddr := &col
37795		if err := awsRestjson1_deserializeDocumentEffectivePolicy(&destAddr, value); err != nil {
37796			return err
37797		}
37798		col = *destAddr
37799		cv = append(cv, col)
37800
37801	}
37802	*v = cv
37803	return nil
37804}
37805
37806func awsRestjson1_deserializeDocumentEffectivePolicy(v **types.EffectivePolicy, value interface{}) error {
37807	if v == nil {
37808		return fmt.Errorf("unexpected nil of type %T", v)
37809	}
37810	if value == nil {
37811		return nil
37812	}
37813
37814	shape, ok := value.(map[string]interface{})
37815	if !ok {
37816		return fmt.Errorf("unexpected JSON type %v", value)
37817	}
37818
37819	var sv *types.EffectivePolicy
37820	if *v == nil {
37821		sv = &types.EffectivePolicy{}
37822	} else {
37823		sv = *v
37824	}
37825
37826	for key, value := range shape {
37827		switch key {
37828		case "policyArn":
37829			if value != nil {
37830				jtv, ok := value.(string)
37831				if !ok {
37832					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
37833				}
37834				sv.PolicyArn = ptr.String(jtv)
37835			}
37836
37837		case "policyDocument":
37838			if value != nil {
37839				jtv, ok := value.(string)
37840				if !ok {
37841					return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
37842				}
37843				sv.PolicyDocument = ptr.String(jtv)
37844			}
37845
37846		case "policyName":
37847			if value != nil {
37848				jtv, ok := value.(string)
37849				if !ok {
37850					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
37851				}
37852				sv.PolicyName = ptr.String(jtv)
37853			}
37854
37855		default:
37856			_, _ = key, value
37857
37858		}
37859	}
37860	*v = sv
37861	return nil
37862}
37863
37864func awsRestjson1_deserializeDocumentElasticsearchAction(v **types.ElasticsearchAction, value interface{}) error {
37865	if v == nil {
37866		return fmt.Errorf("unexpected nil of type %T", v)
37867	}
37868	if value == nil {
37869		return nil
37870	}
37871
37872	shape, ok := value.(map[string]interface{})
37873	if !ok {
37874		return fmt.Errorf("unexpected JSON type %v", value)
37875	}
37876
37877	var sv *types.ElasticsearchAction
37878	if *v == nil {
37879		sv = &types.ElasticsearchAction{}
37880	} else {
37881		sv = *v
37882	}
37883
37884	for key, value := range shape {
37885		switch key {
37886		case "endpoint":
37887			if value != nil {
37888				jtv, ok := value.(string)
37889				if !ok {
37890					return fmt.Errorf("expected ElasticsearchEndpoint to be of type string, got %T instead", value)
37891				}
37892				sv.Endpoint = ptr.String(jtv)
37893			}
37894
37895		case "id":
37896			if value != nil {
37897				jtv, ok := value.(string)
37898				if !ok {
37899					return fmt.Errorf("expected ElasticsearchId to be of type string, got %T instead", value)
37900				}
37901				sv.Id = ptr.String(jtv)
37902			}
37903
37904		case "index":
37905			if value != nil {
37906				jtv, ok := value.(string)
37907				if !ok {
37908					return fmt.Errorf("expected ElasticsearchIndex to be of type string, got %T instead", value)
37909				}
37910				sv.Index = ptr.String(jtv)
37911			}
37912
37913		case "roleArn":
37914			if value != nil {
37915				jtv, ok := value.(string)
37916				if !ok {
37917					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
37918				}
37919				sv.RoleArn = ptr.String(jtv)
37920			}
37921
37922		case "type":
37923			if value != nil {
37924				jtv, ok := value.(string)
37925				if !ok {
37926					return fmt.Errorf("expected ElasticsearchType to be of type string, got %T instead", value)
37927				}
37928				sv.Type = ptr.String(jtv)
37929			}
37930
37931		default:
37932			_, _ = key, value
37933
37934		}
37935	}
37936	*v = sv
37937	return nil
37938}
37939
37940func awsRestjson1_deserializeDocumentEnableIoTLoggingParams(v **types.EnableIoTLoggingParams, value interface{}) error {
37941	if v == nil {
37942		return fmt.Errorf("unexpected nil of type %T", v)
37943	}
37944	if value == nil {
37945		return nil
37946	}
37947
37948	shape, ok := value.(map[string]interface{})
37949	if !ok {
37950		return fmt.Errorf("unexpected JSON type %v", value)
37951	}
37952
37953	var sv *types.EnableIoTLoggingParams
37954	if *v == nil {
37955		sv = &types.EnableIoTLoggingParams{}
37956	} else {
37957		sv = *v
37958	}
37959
37960	for key, value := range shape {
37961		switch key {
37962		case "logLevel":
37963			if value != nil {
37964				jtv, ok := value.(string)
37965				if !ok {
37966					return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value)
37967				}
37968				sv.LogLevel = types.LogLevel(jtv)
37969			}
37970
37971		case "roleArnForLogging":
37972			if value != nil {
37973				jtv, ok := value.(string)
37974				if !ok {
37975					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
37976				}
37977				sv.RoleArnForLogging = ptr.String(jtv)
37978			}
37979
37980		default:
37981			_, _ = key, value
37982
37983		}
37984	}
37985	*v = sv
37986	return nil
37987}
37988
37989func awsRestjson1_deserializeDocumentErrorInfo(v **types.ErrorInfo, value interface{}) error {
37990	if v == nil {
37991		return fmt.Errorf("unexpected nil of type %T", v)
37992	}
37993	if value == nil {
37994		return nil
37995	}
37996
37997	shape, ok := value.(map[string]interface{})
37998	if !ok {
37999		return fmt.Errorf("unexpected JSON type %v", value)
38000	}
38001
38002	var sv *types.ErrorInfo
38003	if *v == nil {
38004		sv = &types.ErrorInfo{}
38005	} else {
38006		sv = *v
38007	}
38008
38009	for key, value := range shape {
38010		switch key {
38011		case "code":
38012			if value != nil {
38013				jtv, ok := value.(string)
38014				if !ok {
38015					return fmt.Errorf("expected Code to be of type string, got %T instead", value)
38016				}
38017				sv.Code = ptr.String(jtv)
38018			}
38019
38020		case "message":
38021			if value != nil {
38022				jtv, ok := value.(string)
38023				if !ok {
38024					return fmt.Errorf("expected OTAUpdateErrorMessage to be of type string, got %T instead", value)
38025				}
38026				sv.Message = ptr.String(jtv)
38027			}
38028
38029		default:
38030			_, _ = key, value
38031
38032		}
38033	}
38034	*v = sv
38035	return nil
38036}
38037
38038func awsRestjson1_deserializeDocumentEventConfigurations(v *map[string]types.Configuration, value interface{}) error {
38039	if v == nil {
38040		return fmt.Errorf("unexpected nil of type %T", v)
38041	}
38042	if value == nil {
38043		return nil
38044	}
38045
38046	shape, ok := value.(map[string]interface{})
38047	if !ok {
38048		return fmt.Errorf("unexpected JSON type %v", value)
38049	}
38050
38051	var mv map[string]types.Configuration
38052	if *v == nil {
38053		mv = map[string]types.Configuration{}
38054	} else {
38055		mv = *v
38056	}
38057
38058	for key, value := range shape {
38059		var parsedVal types.Configuration
38060		mapVar := parsedVal
38061		destAddr := &mapVar
38062		if err := awsRestjson1_deserializeDocumentConfiguration(&destAddr, value); err != nil {
38063			return err
38064		}
38065		parsedVal = *destAddr
38066		mv[key] = parsedVal
38067
38068	}
38069	*v = mv
38070	return nil
38071}
38072
38073func awsRestjson1_deserializeDocumentExplicitDeny(v **types.ExplicitDeny, value interface{}) error {
38074	if v == nil {
38075		return fmt.Errorf("unexpected nil of type %T", v)
38076	}
38077	if value == nil {
38078		return nil
38079	}
38080
38081	shape, ok := value.(map[string]interface{})
38082	if !ok {
38083		return fmt.Errorf("unexpected JSON type %v", value)
38084	}
38085
38086	var sv *types.ExplicitDeny
38087	if *v == nil {
38088		sv = &types.ExplicitDeny{}
38089	} else {
38090		sv = *v
38091	}
38092
38093	for key, value := range shape {
38094		switch key {
38095		case "policies":
38096			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
38097				return err
38098			}
38099
38100		default:
38101			_, _ = key, value
38102
38103		}
38104	}
38105	*v = sv
38106	return nil
38107}
38108
38109func awsRestjson1_deserializeDocumentExponentialRolloutRate(v **types.ExponentialRolloutRate, value interface{}) error {
38110	if v == nil {
38111		return fmt.Errorf("unexpected nil of type %T", v)
38112	}
38113	if value == nil {
38114		return nil
38115	}
38116
38117	shape, ok := value.(map[string]interface{})
38118	if !ok {
38119		return fmt.Errorf("unexpected JSON type %v", value)
38120	}
38121
38122	var sv *types.ExponentialRolloutRate
38123	if *v == nil {
38124		sv = &types.ExponentialRolloutRate{}
38125	} else {
38126		sv = *v
38127	}
38128
38129	for key, value := range shape {
38130		switch key {
38131		case "baseRatePerMinute":
38132			if value != nil {
38133				jtv, ok := value.(json.Number)
38134				if !ok {
38135					return fmt.Errorf("expected RolloutRatePerMinute to be json.Number, got %T instead", value)
38136				}
38137				i64, err := jtv.Int64()
38138				if err != nil {
38139					return err
38140				}
38141				sv.BaseRatePerMinute = ptr.Int32(int32(i64))
38142			}
38143
38144		case "incrementFactor":
38145			if value != nil {
38146				jtv, ok := value.(json.Number)
38147				if !ok {
38148					return fmt.Errorf("expected IncrementFactor to be json.Number, got %T instead", value)
38149				}
38150				f64, err := jtv.Float64()
38151				if err != nil {
38152					return err
38153				}
38154				sv.IncrementFactor = f64
38155			}
38156
38157		case "rateIncreaseCriteria":
38158			if err := awsRestjson1_deserializeDocumentRateIncreaseCriteria(&sv.RateIncreaseCriteria, value); err != nil {
38159				return err
38160			}
38161
38162		default:
38163			_, _ = key, value
38164
38165		}
38166	}
38167	*v = sv
38168	return nil
38169}
38170
38171func awsRestjson1_deserializeDocumentField(v **types.Field, value interface{}) error {
38172	if v == nil {
38173		return fmt.Errorf("unexpected nil of type %T", v)
38174	}
38175	if value == nil {
38176		return nil
38177	}
38178
38179	shape, ok := value.(map[string]interface{})
38180	if !ok {
38181		return fmt.Errorf("unexpected JSON type %v", value)
38182	}
38183
38184	var sv *types.Field
38185	if *v == nil {
38186		sv = &types.Field{}
38187	} else {
38188		sv = *v
38189	}
38190
38191	for key, value := range shape {
38192		switch key {
38193		case "name":
38194			if value != nil {
38195				jtv, ok := value.(string)
38196				if !ok {
38197					return fmt.Errorf("expected FieldName to be of type string, got %T instead", value)
38198				}
38199				sv.Name = ptr.String(jtv)
38200			}
38201
38202		case "type":
38203			if value != nil {
38204				jtv, ok := value.(string)
38205				if !ok {
38206					return fmt.Errorf("expected FieldType to be of type string, got %T instead", value)
38207				}
38208				sv.Type = types.FieldType(jtv)
38209			}
38210
38211		default:
38212			_, _ = key, value
38213
38214		}
38215	}
38216	*v = sv
38217	return nil
38218}
38219
38220func awsRestjson1_deserializeDocumentFields(v *[]types.Field, value interface{}) error {
38221	if v == nil {
38222		return fmt.Errorf("unexpected nil of type %T", v)
38223	}
38224	if value == nil {
38225		return nil
38226	}
38227
38228	shape, ok := value.([]interface{})
38229	if !ok {
38230		return fmt.Errorf("unexpected JSON type %v", value)
38231	}
38232
38233	var cv []types.Field
38234	if *v == nil {
38235		cv = []types.Field{}
38236	} else {
38237		cv = *v
38238	}
38239
38240	for _, value := range shape {
38241		var col types.Field
38242		destAddr := &col
38243		if err := awsRestjson1_deserializeDocumentField(&destAddr, value); err != nil {
38244			return err
38245		}
38246		col = *destAddr
38247		cv = append(cv, col)
38248
38249	}
38250	*v = cv
38251	return nil
38252}
38253
38254func awsRestjson1_deserializeDocumentFileLocation(v **types.FileLocation, value interface{}) error {
38255	if v == nil {
38256		return fmt.Errorf("unexpected nil of type %T", v)
38257	}
38258	if value == nil {
38259		return nil
38260	}
38261
38262	shape, ok := value.(map[string]interface{})
38263	if !ok {
38264		return fmt.Errorf("unexpected JSON type %v", value)
38265	}
38266
38267	var sv *types.FileLocation
38268	if *v == nil {
38269		sv = &types.FileLocation{}
38270	} else {
38271		sv = *v
38272	}
38273
38274	for key, value := range shape {
38275		switch key {
38276		case "s3Location":
38277			if err := awsRestjson1_deserializeDocumentS3Location(&sv.S3Location, value); err != nil {
38278				return err
38279			}
38280
38281		case "stream":
38282			if err := awsRestjson1_deserializeDocumentStream(&sv.Stream, value); err != nil {
38283				return err
38284			}
38285
38286		default:
38287			_, _ = key, value
38288
38289		}
38290	}
38291	*v = sv
38292	return nil
38293}
38294
38295func awsRestjson1_deserializeDocumentFindingIds(v *[]string, value interface{}) error {
38296	if v == nil {
38297		return fmt.Errorf("unexpected nil of type %T", v)
38298	}
38299	if value == nil {
38300		return nil
38301	}
38302
38303	shape, ok := value.([]interface{})
38304	if !ok {
38305		return fmt.Errorf("unexpected JSON type %v", value)
38306	}
38307
38308	var cv []string
38309	if *v == nil {
38310		cv = []string{}
38311	} else {
38312		cv = *v
38313	}
38314
38315	for _, value := range shape {
38316		var col string
38317		if value != nil {
38318			jtv, ok := value.(string)
38319			if !ok {
38320				return fmt.Errorf("expected FindingId to be of type string, got %T instead", value)
38321			}
38322			col = jtv
38323		}
38324		cv = append(cv, col)
38325
38326	}
38327	*v = cv
38328	return nil
38329}
38330
38331func awsRestjson1_deserializeDocumentFirehoseAction(v **types.FirehoseAction, value interface{}) error {
38332	if v == nil {
38333		return fmt.Errorf("unexpected nil of type %T", v)
38334	}
38335	if value == nil {
38336		return nil
38337	}
38338
38339	shape, ok := value.(map[string]interface{})
38340	if !ok {
38341		return fmt.Errorf("unexpected JSON type %v", value)
38342	}
38343
38344	var sv *types.FirehoseAction
38345	if *v == nil {
38346		sv = &types.FirehoseAction{}
38347	} else {
38348		sv = *v
38349	}
38350
38351	for key, value := range shape {
38352		switch key {
38353		case "batchMode":
38354			if value != nil {
38355				jtv, ok := value.(bool)
38356				if !ok {
38357					return fmt.Errorf("expected BatchMode to be of type *bool, got %T instead", value)
38358				}
38359				sv.BatchMode = ptr.Bool(jtv)
38360			}
38361
38362		case "deliveryStreamName":
38363			if value != nil {
38364				jtv, ok := value.(string)
38365				if !ok {
38366					return fmt.Errorf("expected DeliveryStreamName to be of type string, got %T instead", value)
38367				}
38368				sv.DeliveryStreamName = ptr.String(jtv)
38369			}
38370
38371		case "roleArn":
38372			if value != nil {
38373				jtv, ok := value.(string)
38374				if !ok {
38375					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
38376				}
38377				sv.RoleArn = ptr.String(jtv)
38378			}
38379
38380		case "separator":
38381			if value != nil {
38382				jtv, ok := value.(string)
38383				if !ok {
38384					return fmt.Errorf("expected FirehoseSeparator to be of type string, got %T instead", value)
38385				}
38386				sv.Separator = ptr.String(jtv)
38387			}
38388
38389		default:
38390			_, _ = key, value
38391
38392		}
38393	}
38394	*v = sv
38395	return nil
38396}
38397
38398func awsRestjson1_deserializeDocumentGroupNameAndArn(v **types.GroupNameAndArn, value interface{}) error {
38399	if v == nil {
38400		return fmt.Errorf("unexpected nil of type %T", v)
38401	}
38402	if value == nil {
38403		return nil
38404	}
38405
38406	shape, ok := value.(map[string]interface{})
38407	if !ok {
38408		return fmt.Errorf("unexpected JSON type %v", value)
38409	}
38410
38411	var sv *types.GroupNameAndArn
38412	if *v == nil {
38413		sv = &types.GroupNameAndArn{}
38414	} else {
38415		sv = *v
38416	}
38417
38418	for key, value := range shape {
38419		switch key {
38420		case "groupArn":
38421			if value != nil {
38422				jtv, ok := value.(string)
38423				if !ok {
38424					return fmt.Errorf("expected ThingGroupArn to be of type string, got %T instead", value)
38425				}
38426				sv.GroupArn = ptr.String(jtv)
38427			}
38428
38429		case "groupName":
38430			if value != nil {
38431				jtv, ok := value.(string)
38432				if !ok {
38433					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
38434				}
38435				sv.GroupName = ptr.String(jtv)
38436			}
38437
38438		default:
38439			_, _ = key, value
38440
38441		}
38442	}
38443	*v = sv
38444	return nil
38445}
38446
38447func awsRestjson1_deserializeDocumentHeaderList(v *[]types.HttpActionHeader, value interface{}) error {
38448	if v == nil {
38449		return fmt.Errorf("unexpected nil of type %T", v)
38450	}
38451	if value == nil {
38452		return nil
38453	}
38454
38455	shape, ok := value.([]interface{})
38456	if !ok {
38457		return fmt.Errorf("unexpected JSON type %v", value)
38458	}
38459
38460	var cv []types.HttpActionHeader
38461	if *v == nil {
38462		cv = []types.HttpActionHeader{}
38463	} else {
38464		cv = *v
38465	}
38466
38467	for _, value := range shape {
38468		var col types.HttpActionHeader
38469		destAddr := &col
38470		if err := awsRestjson1_deserializeDocumentHttpActionHeader(&destAddr, value); err != nil {
38471			return err
38472		}
38473		col = *destAddr
38474		cv = append(cv, col)
38475
38476	}
38477	*v = cv
38478	return nil
38479}
38480
38481func awsRestjson1_deserializeDocumentHttpAction(v **types.HttpAction, value interface{}) error {
38482	if v == nil {
38483		return fmt.Errorf("unexpected nil of type %T", v)
38484	}
38485	if value == nil {
38486		return nil
38487	}
38488
38489	shape, ok := value.(map[string]interface{})
38490	if !ok {
38491		return fmt.Errorf("unexpected JSON type %v", value)
38492	}
38493
38494	var sv *types.HttpAction
38495	if *v == nil {
38496		sv = &types.HttpAction{}
38497	} else {
38498		sv = *v
38499	}
38500
38501	for key, value := range shape {
38502		switch key {
38503		case "auth":
38504			if err := awsRestjson1_deserializeDocumentHttpAuthorization(&sv.Auth, value); err != nil {
38505				return err
38506			}
38507
38508		case "confirmationUrl":
38509			if value != nil {
38510				jtv, ok := value.(string)
38511				if !ok {
38512					return fmt.Errorf("expected Url to be of type string, got %T instead", value)
38513				}
38514				sv.ConfirmationUrl = ptr.String(jtv)
38515			}
38516
38517		case "headers":
38518			if err := awsRestjson1_deserializeDocumentHeaderList(&sv.Headers, value); err != nil {
38519				return err
38520			}
38521
38522		case "url":
38523			if value != nil {
38524				jtv, ok := value.(string)
38525				if !ok {
38526					return fmt.Errorf("expected Url to be of type string, got %T instead", value)
38527				}
38528				sv.Url = ptr.String(jtv)
38529			}
38530
38531		default:
38532			_, _ = key, value
38533
38534		}
38535	}
38536	*v = sv
38537	return nil
38538}
38539
38540func awsRestjson1_deserializeDocumentHttpActionHeader(v **types.HttpActionHeader, value interface{}) error {
38541	if v == nil {
38542		return fmt.Errorf("unexpected nil of type %T", v)
38543	}
38544	if value == nil {
38545		return nil
38546	}
38547
38548	shape, ok := value.(map[string]interface{})
38549	if !ok {
38550		return fmt.Errorf("unexpected JSON type %v", value)
38551	}
38552
38553	var sv *types.HttpActionHeader
38554	if *v == nil {
38555		sv = &types.HttpActionHeader{}
38556	} else {
38557		sv = *v
38558	}
38559
38560	for key, value := range shape {
38561		switch key {
38562		case "key":
38563			if value != nil {
38564				jtv, ok := value.(string)
38565				if !ok {
38566					return fmt.Errorf("expected HeaderKey to be of type string, got %T instead", value)
38567				}
38568				sv.Key = ptr.String(jtv)
38569			}
38570
38571		case "value":
38572			if value != nil {
38573				jtv, ok := value.(string)
38574				if !ok {
38575					return fmt.Errorf("expected HeaderValue to be of type string, got %T instead", value)
38576				}
38577				sv.Value = ptr.String(jtv)
38578			}
38579
38580		default:
38581			_, _ = key, value
38582
38583		}
38584	}
38585	*v = sv
38586	return nil
38587}
38588
38589func awsRestjson1_deserializeDocumentHttpAuthorization(v **types.HttpAuthorization, value interface{}) error {
38590	if v == nil {
38591		return fmt.Errorf("unexpected nil of type %T", v)
38592	}
38593	if value == nil {
38594		return nil
38595	}
38596
38597	shape, ok := value.(map[string]interface{})
38598	if !ok {
38599		return fmt.Errorf("unexpected JSON type %v", value)
38600	}
38601
38602	var sv *types.HttpAuthorization
38603	if *v == nil {
38604		sv = &types.HttpAuthorization{}
38605	} else {
38606		sv = *v
38607	}
38608
38609	for key, value := range shape {
38610		switch key {
38611		case "sigv4":
38612			if err := awsRestjson1_deserializeDocumentSigV4Authorization(&sv.Sigv4, value); err != nil {
38613				return err
38614			}
38615
38616		default:
38617			_, _ = key, value
38618
38619		}
38620	}
38621	*v = sv
38622	return nil
38623}
38624
38625func awsRestjson1_deserializeDocumentHttpUrlDestinationProperties(v **types.HttpUrlDestinationProperties, value interface{}) error {
38626	if v == nil {
38627		return fmt.Errorf("unexpected nil of type %T", v)
38628	}
38629	if value == nil {
38630		return nil
38631	}
38632
38633	shape, ok := value.(map[string]interface{})
38634	if !ok {
38635		return fmt.Errorf("unexpected JSON type %v", value)
38636	}
38637
38638	var sv *types.HttpUrlDestinationProperties
38639	if *v == nil {
38640		sv = &types.HttpUrlDestinationProperties{}
38641	} else {
38642		sv = *v
38643	}
38644
38645	for key, value := range shape {
38646		switch key {
38647		case "confirmationUrl":
38648			if value != nil {
38649				jtv, ok := value.(string)
38650				if !ok {
38651					return fmt.Errorf("expected Url to be of type string, got %T instead", value)
38652				}
38653				sv.ConfirmationUrl = ptr.String(jtv)
38654			}
38655
38656		default:
38657			_, _ = key, value
38658
38659		}
38660	}
38661	*v = sv
38662	return nil
38663}
38664
38665func awsRestjson1_deserializeDocumentHttpUrlDestinationSummary(v **types.HttpUrlDestinationSummary, value interface{}) error {
38666	if v == nil {
38667		return fmt.Errorf("unexpected nil of type %T", v)
38668	}
38669	if value == nil {
38670		return nil
38671	}
38672
38673	shape, ok := value.(map[string]interface{})
38674	if !ok {
38675		return fmt.Errorf("unexpected JSON type %v", value)
38676	}
38677
38678	var sv *types.HttpUrlDestinationSummary
38679	if *v == nil {
38680		sv = &types.HttpUrlDestinationSummary{}
38681	} else {
38682		sv = *v
38683	}
38684
38685	for key, value := range shape {
38686		switch key {
38687		case "confirmationUrl":
38688			if value != nil {
38689				jtv, ok := value.(string)
38690				if !ok {
38691					return fmt.Errorf("expected Url to be of type string, got %T instead", value)
38692				}
38693				sv.ConfirmationUrl = ptr.String(jtv)
38694			}
38695
38696		default:
38697			_, _ = key, value
38698
38699		}
38700	}
38701	*v = sv
38702	return nil
38703}
38704
38705func awsRestjson1_deserializeDocumentImplicitDeny(v **types.ImplicitDeny, value interface{}) error {
38706	if v == nil {
38707		return fmt.Errorf("unexpected nil of type %T", v)
38708	}
38709	if value == nil {
38710		return nil
38711	}
38712
38713	shape, ok := value.(map[string]interface{})
38714	if !ok {
38715		return fmt.Errorf("unexpected JSON type %v", value)
38716	}
38717
38718	var sv *types.ImplicitDeny
38719	if *v == nil {
38720		sv = &types.ImplicitDeny{}
38721	} else {
38722		sv = *v
38723	}
38724
38725	for key, value := range shape {
38726		switch key {
38727		case "policies":
38728			if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil {
38729				return err
38730			}
38731
38732		default:
38733			_, _ = key, value
38734
38735		}
38736	}
38737	*v = sv
38738	return nil
38739}
38740
38741func awsRestjson1_deserializeDocumentIndexNamesList(v *[]string, value interface{}) error {
38742	if v == nil {
38743		return fmt.Errorf("unexpected nil of type %T", v)
38744	}
38745	if value == nil {
38746		return nil
38747	}
38748
38749	shape, ok := value.([]interface{})
38750	if !ok {
38751		return fmt.Errorf("unexpected JSON type %v", value)
38752	}
38753
38754	var cv []string
38755	if *v == nil {
38756		cv = []string{}
38757	} else {
38758		cv = *v
38759	}
38760
38761	for _, value := range shape {
38762		var col string
38763		if value != nil {
38764			jtv, ok := value.(string)
38765			if !ok {
38766				return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
38767			}
38768			col = jtv
38769		}
38770		cv = append(cv, col)
38771
38772	}
38773	*v = cv
38774	return nil
38775}
38776
38777func awsRestjson1_deserializeDocumentIndexNotReadyException(v **types.IndexNotReadyException, value interface{}) error {
38778	if v == nil {
38779		return fmt.Errorf("unexpected nil of type %T", v)
38780	}
38781	if value == nil {
38782		return nil
38783	}
38784
38785	shape, ok := value.(map[string]interface{})
38786	if !ok {
38787		return fmt.Errorf("unexpected JSON type %v", value)
38788	}
38789
38790	var sv *types.IndexNotReadyException
38791	if *v == nil {
38792		sv = &types.IndexNotReadyException{}
38793	} else {
38794		sv = *v
38795	}
38796
38797	for key, value := range shape {
38798		switch key {
38799		case "message":
38800			if value != nil {
38801				jtv, ok := value.(string)
38802				if !ok {
38803					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
38804				}
38805				sv.Message = ptr.String(jtv)
38806			}
38807
38808		default:
38809			_, _ = key, value
38810
38811		}
38812	}
38813	*v = sv
38814	return nil
38815}
38816
38817func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error {
38818	if v == nil {
38819		return fmt.Errorf("unexpected nil of type %T", v)
38820	}
38821	if value == nil {
38822		return nil
38823	}
38824
38825	shape, ok := value.(map[string]interface{})
38826	if !ok {
38827		return fmt.Errorf("unexpected JSON type %v", value)
38828	}
38829
38830	var sv *types.InternalException
38831	if *v == nil {
38832		sv = &types.InternalException{}
38833	} else {
38834		sv = *v
38835	}
38836
38837	for key, value := range shape {
38838		switch key {
38839		case "message":
38840			if value != nil {
38841				jtv, ok := value.(string)
38842				if !ok {
38843					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
38844				}
38845				sv.Message = ptr.String(jtv)
38846			}
38847
38848		default:
38849			_, _ = key, value
38850
38851		}
38852	}
38853	*v = sv
38854	return nil
38855}
38856
38857func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error {
38858	if v == nil {
38859		return fmt.Errorf("unexpected nil of type %T", v)
38860	}
38861	if value == nil {
38862		return nil
38863	}
38864
38865	shape, ok := value.(map[string]interface{})
38866	if !ok {
38867		return fmt.Errorf("unexpected JSON type %v", value)
38868	}
38869
38870	var sv *types.InternalFailureException
38871	if *v == nil {
38872		sv = &types.InternalFailureException{}
38873	} else {
38874		sv = *v
38875	}
38876
38877	for key, value := range shape {
38878		switch key {
38879		case "message":
38880			if value != nil {
38881				jtv, ok := value.(string)
38882				if !ok {
38883					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
38884				}
38885				sv.Message = ptr.String(jtv)
38886			}
38887
38888		default:
38889			_, _ = key, value
38890
38891		}
38892	}
38893	*v = sv
38894	return nil
38895}
38896
38897func awsRestjson1_deserializeDocumentInvalidAggregationException(v **types.InvalidAggregationException, value interface{}) error {
38898	if v == nil {
38899		return fmt.Errorf("unexpected nil of type %T", v)
38900	}
38901	if value == nil {
38902		return nil
38903	}
38904
38905	shape, ok := value.(map[string]interface{})
38906	if !ok {
38907		return fmt.Errorf("unexpected JSON type %v", value)
38908	}
38909
38910	var sv *types.InvalidAggregationException
38911	if *v == nil {
38912		sv = &types.InvalidAggregationException{}
38913	} else {
38914		sv = *v
38915	}
38916
38917	for key, value := range shape {
38918		switch key {
38919		case "message":
38920			if value != nil {
38921				jtv, ok := value.(string)
38922				if !ok {
38923					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
38924				}
38925				sv.Message = ptr.String(jtv)
38926			}
38927
38928		default:
38929			_, _ = key, value
38930
38931		}
38932	}
38933	*v = sv
38934	return nil
38935}
38936
38937func awsRestjson1_deserializeDocumentInvalidQueryException(v **types.InvalidQueryException, value interface{}) error {
38938	if v == nil {
38939		return fmt.Errorf("unexpected nil of type %T", v)
38940	}
38941	if value == nil {
38942		return nil
38943	}
38944
38945	shape, ok := value.(map[string]interface{})
38946	if !ok {
38947		return fmt.Errorf("unexpected JSON type %v", value)
38948	}
38949
38950	var sv *types.InvalidQueryException
38951	if *v == nil {
38952		sv = &types.InvalidQueryException{}
38953	} else {
38954		sv = *v
38955	}
38956
38957	for key, value := range shape {
38958		switch key {
38959		case "message":
38960			if value != nil {
38961				jtv, ok := value.(string)
38962				if !ok {
38963					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
38964				}
38965				sv.Message = ptr.String(jtv)
38966			}
38967
38968		default:
38969			_, _ = key, value
38970
38971		}
38972	}
38973	*v = sv
38974	return nil
38975}
38976
38977func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error {
38978	if v == nil {
38979		return fmt.Errorf("unexpected nil of type %T", v)
38980	}
38981	if value == nil {
38982		return nil
38983	}
38984
38985	shape, ok := value.(map[string]interface{})
38986	if !ok {
38987		return fmt.Errorf("unexpected JSON type %v", value)
38988	}
38989
38990	var sv *types.InvalidRequestException
38991	if *v == nil {
38992		sv = &types.InvalidRequestException{}
38993	} else {
38994		sv = *v
38995	}
38996
38997	for key, value := range shape {
38998		switch key {
38999		case "message":
39000			if value != nil {
39001				jtv, ok := value.(string)
39002				if !ok {
39003					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
39004				}
39005				sv.Message = ptr.String(jtv)
39006			}
39007
39008		default:
39009			_, _ = key, value
39010
39011		}
39012	}
39013	*v = sv
39014	return nil
39015}
39016
39017func awsRestjson1_deserializeDocumentInvalidResponseException(v **types.InvalidResponseException, value interface{}) error {
39018	if v == nil {
39019		return fmt.Errorf("unexpected nil of type %T", v)
39020	}
39021	if value == nil {
39022		return nil
39023	}
39024
39025	shape, ok := value.(map[string]interface{})
39026	if !ok {
39027		return fmt.Errorf("unexpected JSON type %v", value)
39028	}
39029
39030	var sv *types.InvalidResponseException
39031	if *v == nil {
39032		sv = &types.InvalidResponseException{}
39033	} else {
39034		sv = *v
39035	}
39036
39037	for key, value := range shape {
39038		switch key {
39039		case "message":
39040			if value != nil {
39041				jtv, ok := value.(string)
39042				if !ok {
39043					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
39044				}
39045				sv.Message = ptr.String(jtv)
39046			}
39047
39048		default:
39049			_, _ = key, value
39050
39051		}
39052	}
39053	*v = sv
39054	return nil
39055}
39056
39057func awsRestjson1_deserializeDocumentInvalidStateTransitionException(v **types.InvalidStateTransitionException, value interface{}) error {
39058	if v == nil {
39059		return fmt.Errorf("unexpected nil of type %T", v)
39060	}
39061	if value == nil {
39062		return nil
39063	}
39064
39065	shape, ok := value.(map[string]interface{})
39066	if !ok {
39067		return fmt.Errorf("unexpected JSON type %v", value)
39068	}
39069
39070	var sv *types.InvalidStateTransitionException
39071	if *v == nil {
39072		sv = &types.InvalidStateTransitionException{}
39073	} else {
39074		sv = *v
39075	}
39076
39077	for key, value := range shape {
39078		switch key {
39079		case "message":
39080			if value != nil {
39081				jtv, ok := value.(string)
39082				if !ok {
39083					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
39084				}
39085				sv.Message = ptr.String(jtv)
39086			}
39087
39088		default:
39089			_, _ = key, value
39090
39091		}
39092	}
39093	*v = sv
39094	return nil
39095}
39096
39097func awsRestjson1_deserializeDocumentIotAnalyticsAction(v **types.IotAnalyticsAction, value interface{}) error {
39098	if v == nil {
39099		return fmt.Errorf("unexpected nil of type %T", v)
39100	}
39101	if value == nil {
39102		return nil
39103	}
39104
39105	shape, ok := value.(map[string]interface{})
39106	if !ok {
39107		return fmt.Errorf("unexpected JSON type %v", value)
39108	}
39109
39110	var sv *types.IotAnalyticsAction
39111	if *v == nil {
39112		sv = &types.IotAnalyticsAction{}
39113	} else {
39114		sv = *v
39115	}
39116
39117	for key, value := range shape {
39118		switch key {
39119		case "batchMode":
39120			if value != nil {
39121				jtv, ok := value.(bool)
39122				if !ok {
39123					return fmt.Errorf("expected BatchMode to be of type *bool, got %T instead", value)
39124				}
39125				sv.BatchMode = ptr.Bool(jtv)
39126			}
39127
39128		case "channelArn":
39129			if value != nil {
39130				jtv, ok := value.(string)
39131				if !ok {
39132					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
39133				}
39134				sv.ChannelArn = ptr.String(jtv)
39135			}
39136
39137		case "channelName":
39138			if value != nil {
39139				jtv, ok := value.(string)
39140				if !ok {
39141					return fmt.Errorf("expected ChannelName to be of type string, got %T instead", value)
39142				}
39143				sv.ChannelName = ptr.String(jtv)
39144			}
39145
39146		case "roleArn":
39147			if value != nil {
39148				jtv, ok := value.(string)
39149				if !ok {
39150					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
39151				}
39152				sv.RoleArn = ptr.String(jtv)
39153			}
39154
39155		default:
39156			_, _ = key, value
39157
39158		}
39159	}
39160	*v = sv
39161	return nil
39162}
39163
39164func awsRestjson1_deserializeDocumentIotEventsAction(v **types.IotEventsAction, value interface{}) error {
39165	if v == nil {
39166		return fmt.Errorf("unexpected nil of type %T", v)
39167	}
39168	if value == nil {
39169		return nil
39170	}
39171
39172	shape, ok := value.(map[string]interface{})
39173	if !ok {
39174		return fmt.Errorf("unexpected JSON type %v", value)
39175	}
39176
39177	var sv *types.IotEventsAction
39178	if *v == nil {
39179		sv = &types.IotEventsAction{}
39180	} else {
39181		sv = *v
39182	}
39183
39184	for key, value := range shape {
39185		switch key {
39186		case "batchMode":
39187			if value != nil {
39188				jtv, ok := value.(bool)
39189				if !ok {
39190					return fmt.Errorf("expected BatchMode to be of type *bool, got %T instead", value)
39191				}
39192				sv.BatchMode = ptr.Bool(jtv)
39193			}
39194
39195		case "inputName":
39196			if value != nil {
39197				jtv, ok := value.(string)
39198				if !ok {
39199					return fmt.Errorf("expected InputName to be of type string, got %T instead", value)
39200				}
39201				sv.InputName = ptr.String(jtv)
39202			}
39203
39204		case "messageId":
39205			if value != nil {
39206				jtv, ok := value.(string)
39207				if !ok {
39208					return fmt.Errorf("expected MessageId to be of type string, got %T instead", value)
39209				}
39210				sv.MessageId = ptr.String(jtv)
39211			}
39212
39213		case "roleArn":
39214			if value != nil {
39215				jtv, ok := value.(string)
39216				if !ok {
39217					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
39218				}
39219				sv.RoleArn = ptr.String(jtv)
39220			}
39221
39222		default:
39223			_, _ = key, value
39224
39225		}
39226	}
39227	*v = sv
39228	return nil
39229}
39230
39231func awsRestjson1_deserializeDocumentIotSiteWiseAction(v **types.IotSiteWiseAction, value interface{}) error {
39232	if v == nil {
39233		return fmt.Errorf("unexpected nil of type %T", v)
39234	}
39235	if value == nil {
39236		return nil
39237	}
39238
39239	shape, ok := value.(map[string]interface{})
39240	if !ok {
39241		return fmt.Errorf("unexpected JSON type %v", value)
39242	}
39243
39244	var sv *types.IotSiteWiseAction
39245	if *v == nil {
39246		sv = &types.IotSiteWiseAction{}
39247	} else {
39248		sv = *v
39249	}
39250
39251	for key, value := range shape {
39252		switch key {
39253		case "putAssetPropertyValueEntries":
39254			if err := awsRestjson1_deserializeDocumentPutAssetPropertyValueEntryList(&sv.PutAssetPropertyValueEntries, value); err != nil {
39255				return err
39256			}
39257
39258		case "roleArn":
39259			if value != nil {
39260				jtv, ok := value.(string)
39261				if !ok {
39262					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
39263				}
39264				sv.RoleArn = ptr.String(jtv)
39265			}
39266
39267		default:
39268			_, _ = key, value
39269
39270		}
39271	}
39272	*v = sv
39273	return nil
39274}
39275
39276func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error {
39277	if v == nil {
39278		return fmt.Errorf("unexpected nil of type %T", v)
39279	}
39280	if value == nil {
39281		return nil
39282	}
39283
39284	shape, ok := value.(map[string]interface{})
39285	if !ok {
39286		return fmt.Errorf("unexpected JSON type %v", value)
39287	}
39288
39289	var sv *types.Job
39290	if *v == nil {
39291		sv = &types.Job{}
39292	} else {
39293		sv = *v
39294	}
39295
39296	for key, value := range shape {
39297		switch key {
39298		case "abortConfig":
39299			if err := awsRestjson1_deserializeDocumentAbortConfig(&sv.AbortConfig, value); err != nil {
39300				return err
39301			}
39302
39303		case "comment":
39304			if value != nil {
39305				jtv, ok := value.(string)
39306				if !ok {
39307					return fmt.Errorf("expected Comment to be of type string, got %T instead", value)
39308				}
39309				sv.Comment = ptr.String(jtv)
39310			}
39311
39312		case "completedAt":
39313			if value != nil {
39314				jtv, ok := value.(json.Number)
39315				if !ok {
39316					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39317				}
39318				f64, err := jtv.Float64()
39319				if err != nil {
39320					return err
39321				}
39322				sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39323			}
39324
39325		case "createdAt":
39326			if value != nil {
39327				jtv, ok := value.(json.Number)
39328				if !ok {
39329					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39330				}
39331				f64, err := jtv.Float64()
39332				if err != nil {
39333					return err
39334				}
39335				sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39336			}
39337
39338		case "description":
39339			if value != nil {
39340				jtv, ok := value.(string)
39341				if !ok {
39342					return fmt.Errorf("expected JobDescription to be of type string, got %T instead", value)
39343				}
39344				sv.Description = ptr.String(jtv)
39345			}
39346
39347		case "forceCanceled":
39348			if value != nil {
39349				jtv, ok := value.(bool)
39350				if !ok {
39351					return fmt.Errorf("expected Forced to be of type *bool, got %T instead", value)
39352				}
39353				sv.ForceCanceled = ptr.Bool(jtv)
39354			}
39355
39356		case "jobArn":
39357			if value != nil {
39358				jtv, ok := value.(string)
39359				if !ok {
39360					return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
39361				}
39362				sv.JobArn = ptr.String(jtv)
39363			}
39364
39365		case "jobExecutionsRolloutConfig":
39366			if err := awsRestjson1_deserializeDocumentJobExecutionsRolloutConfig(&sv.JobExecutionsRolloutConfig, value); err != nil {
39367				return err
39368			}
39369
39370		case "jobId":
39371			if value != nil {
39372				jtv, ok := value.(string)
39373				if !ok {
39374					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
39375				}
39376				sv.JobId = ptr.String(jtv)
39377			}
39378
39379		case "jobProcessDetails":
39380			if err := awsRestjson1_deserializeDocumentJobProcessDetails(&sv.JobProcessDetails, value); err != nil {
39381				return err
39382			}
39383
39384		case "lastUpdatedAt":
39385			if value != nil {
39386				jtv, ok := value.(json.Number)
39387				if !ok {
39388					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39389				}
39390				f64, err := jtv.Float64()
39391				if err != nil {
39392					return err
39393				}
39394				sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39395			}
39396
39397		case "namespaceId":
39398			if value != nil {
39399				jtv, ok := value.(string)
39400				if !ok {
39401					return fmt.Errorf("expected NamespaceId to be of type string, got %T instead", value)
39402				}
39403				sv.NamespaceId = ptr.String(jtv)
39404			}
39405
39406		case "presignedUrlConfig":
39407			if err := awsRestjson1_deserializeDocumentPresignedUrlConfig(&sv.PresignedUrlConfig, value); err != nil {
39408				return err
39409			}
39410
39411		case "reasonCode":
39412			if value != nil {
39413				jtv, ok := value.(string)
39414				if !ok {
39415					return fmt.Errorf("expected ReasonCode to be of type string, got %T instead", value)
39416				}
39417				sv.ReasonCode = ptr.String(jtv)
39418			}
39419
39420		case "status":
39421			if value != nil {
39422				jtv, ok := value.(string)
39423				if !ok {
39424					return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value)
39425				}
39426				sv.Status = types.JobStatus(jtv)
39427			}
39428
39429		case "targets":
39430			if err := awsRestjson1_deserializeDocumentJobTargets(&sv.Targets, value); err != nil {
39431				return err
39432			}
39433
39434		case "targetSelection":
39435			if value != nil {
39436				jtv, ok := value.(string)
39437				if !ok {
39438					return fmt.Errorf("expected TargetSelection to be of type string, got %T instead", value)
39439				}
39440				sv.TargetSelection = types.TargetSelection(jtv)
39441			}
39442
39443		case "timeoutConfig":
39444			if err := awsRestjson1_deserializeDocumentTimeoutConfig(&sv.TimeoutConfig, value); err != nil {
39445				return err
39446			}
39447
39448		default:
39449			_, _ = key, value
39450
39451		}
39452	}
39453	*v = sv
39454	return nil
39455}
39456
39457func awsRestjson1_deserializeDocumentJobExecution(v **types.JobExecution, value interface{}) error {
39458	if v == nil {
39459		return fmt.Errorf("unexpected nil of type %T", v)
39460	}
39461	if value == nil {
39462		return nil
39463	}
39464
39465	shape, ok := value.(map[string]interface{})
39466	if !ok {
39467		return fmt.Errorf("unexpected JSON type %v", value)
39468	}
39469
39470	var sv *types.JobExecution
39471	if *v == nil {
39472		sv = &types.JobExecution{}
39473	} else {
39474		sv = *v
39475	}
39476
39477	for key, value := range shape {
39478		switch key {
39479		case "approximateSecondsBeforeTimedOut":
39480			if value != nil {
39481				jtv, ok := value.(json.Number)
39482				if !ok {
39483					return fmt.Errorf("expected ApproximateSecondsBeforeTimedOut to be json.Number, got %T instead", value)
39484				}
39485				i64, err := jtv.Int64()
39486				if err != nil {
39487					return err
39488				}
39489				sv.ApproximateSecondsBeforeTimedOut = ptr.Int64(i64)
39490			}
39491
39492		case "executionNumber":
39493			if value != nil {
39494				jtv, ok := value.(json.Number)
39495				if !ok {
39496					return fmt.Errorf("expected ExecutionNumber to be json.Number, got %T instead", value)
39497				}
39498				i64, err := jtv.Int64()
39499				if err != nil {
39500					return err
39501				}
39502				sv.ExecutionNumber = ptr.Int64(i64)
39503			}
39504
39505		case "forceCanceled":
39506			if value != nil {
39507				jtv, ok := value.(bool)
39508				if !ok {
39509					return fmt.Errorf("expected Forced to be of type *bool, got %T instead", value)
39510				}
39511				sv.ForceCanceled = ptr.Bool(jtv)
39512			}
39513
39514		case "jobId":
39515			if value != nil {
39516				jtv, ok := value.(string)
39517				if !ok {
39518					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
39519				}
39520				sv.JobId = ptr.String(jtv)
39521			}
39522
39523		case "lastUpdatedAt":
39524			if value != nil {
39525				jtv, ok := value.(json.Number)
39526				if !ok {
39527					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39528				}
39529				f64, err := jtv.Float64()
39530				if err != nil {
39531					return err
39532				}
39533				sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39534			}
39535
39536		case "queuedAt":
39537			if value != nil {
39538				jtv, ok := value.(json.Number)
39539				if !ok {
39540					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39541				}
39542				f64, err := jtv.Float64()
39543				if err != nil {
39544					return err
39545				}
39546				sv.QueuedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39547			}
39548
39549		case "startedAt":
39550			if value != nil {
39551				jtv, ok := value.(json.Number)
39552				if !ok {
39553					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39554				}
39555				f64, err := jtv.Float64()
39556				if err != nil {
39557					return err
39558				}
39559				sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39560			}
39561
39562		case "status":
39563			if value != nil {
39564				jtv, ok := value.(string)
39565				if !ok {
39566					return fmt.Errorf("expected JobExecutionStatus to be of type string, got %T instead", value)
39567				}
39568				sv.Status = types.JobExecutionStatus(jtv)
39569			}
39570
39571		case "statusDetails":
39572			if err := awsRestjson1_deserializeDocumentJobExecutionStatusDetails(&sv.StatusDetails, value); err != nil {
39573				return err
39574			}
39575
39576		case "thingArn":
39577			if value != nil {
39578				jtv, ok := value.(string)
39579				if !ok {
39580					return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
39581				}
39582				sv.ThingArn = ptr.String(jtv)
39583			}
39584
39585		case "versionNumber":
39586			if value != nil {
39587				jtv, ok := value.(json.Number)
39588				if !ok {
39589					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
39590				}
39591				i64, err := jtv.Int64()
39592				if err != nil {
39593					return err
39594				}
39595				sv.VersionNumber = i64
39596			}
39597
39598		default:
39599			_, _ = key, value
39600
39601		}
39602	}
39603	*v = sv
39604	return nil
39605}
39606
39607func awsRestjson1_deserializeDocumentJobExecutionsRolloutConfig(v **types.JobExecutionsRolloutConfig, value interface{}) error {
39608	if v == nil {
39609		return fmt.Errorf("unexpected nil of type %T", v)
39610	}
39611	if value == nil {
39612		return nil
39613	}
39614
39615	shape, ok := value.(map[string]interface{})
39616	if !ok {
39617		return fmt.Errorf("unexpected JSON type %v", value)
39618	}
39619
39620	var sv *types.JobExecutionsRolloutConfig
39621	if *v == nil {
39622		sv = &types.JobExecutionsRolloutConfig{}
39623	} else {
39624		sv = *v
39625	}
39626
39627	for key, value := range shape {
39628		switch key {
39629		case "exponentialRate":
39630			if err := awsRestjson1_deserializeDocumentExponentialRolloutRate(&sv.ExponentialRate, value); err != nil {
39631				return err
39632			}
39633
39634		case "maximumPerMinute":
39635			if value != nil {
39636				jtv, ok := value.(json.Number)
39637				if !ok {
39638					return fmt.Errorf("expected MaxJobExecutionsPerMin to be json.Number, got %T instead", value)
39639				}
39640				i64, err := jtv.Int64()
39641				if err != nil {
39642					return err
39643				}
39644				sv.MaximumPerMinute = ptr.Int32(int32(i64))
39645			}
39646
39647		default:
39648			_, _ = key, value
39649
39650		}
39651	}
39652	*v = sv
39653	return nil
39654}
39655
39656func awsRestjson1_deserializeDocumentJobExecutionStatusDetails(v **types.JobExecutionStatusDetails, value interface{}) error {
39657	if v == nil {
39658		return fmt.Errorf("unexpected nil of type %T", v)
39659	}
39660	if value == nil {
39661		return nil
39662	}
39663
39664	shape, ok := value.(map[string]interface{})
39665	if !ok {
39666		return fmt.Errorf("unexpected JSON type %v", value)
39667	}
39668
39669	var sv *types.JobExecutionStatusDetails
39670	if *v == nil {
39671		sv = &types.JobExecutionStatusDetails{}
39672	} else {
39673		sv = *v
39674	}
39675
39676	for key, value := range shape {
39677		switch key {
39678		case "detailsMap":
39679			if err := awsRestjson1_deserializeDocumentDetailsMap(&sv.DetailsMap, value); err != nil {
39680				return err
39681			}
39682
39683		default:
39684			_, _ = key, value
39685
39686		}
39687	}
39688	*v = sv
39689	return nil
39690}
39691
39692func awsRestjson1_deserializeDocumentJobExecutionSummary(v **types.JobExecutionSummary, value interface{}) error {
39693	if v == nil {
39694		return fmt.Errorf("unexpected nil of type %T", v)
39695	}
39696	if value == nil {
39697		return nil
39698	}
39699
39700	shape, ok := value.(map[string]interface{})
39701	if !ok {
39702		return fmt.Errorf("unexpected JSON type %v", value)
39703	}
39704
39705	var sv *types.JobExecutionSummary
39706	if *v == nil {
39707		sv = &types.JobExecutionSummary{}
39708	} else {
39709		sv = *v
39710	}
39711
39712	for key, value := range shape {
39713		switch key {
39714		case "executionNumber":
39715			if value != nil {
39716				jtv, ok := value.(json.Number)
39717				if !ok {
39718					return fmt.Errorf("expected ExecutionNumber to be json.Number, got %T instead", value)
39719				}
39720				i64, err := jtv.Int64()
39721				if err != nil {
39722					return err
39723				}
39724				sv.ExecutionNumber = ptr.Int64(i64)
39725			}
39726
39727		case "lastUpdatedAt":
39728			if value != nil {
39729				jtv, ok := value.(json.Number)
39730				if !ok {
39731					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39732				}
39733				f64, err := jtv.Float64()
39734				if err != nil {
39735					return err
39736				}
39737				sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39738			}
39739
39740		case "queuedAt":
39741			if value != nil {
39742				jtv, ok := value.(json.Number)
39743				if !ok {
39744					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39745				}
39746				f64, err := jtv.Float64()
39747				if err != nil {
39748					return err
39749				}
39750				sv.QueuedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39751			}
39752
39753		case "startedAt":
39754			if value != nil {
39755				jtv, ok := value.(json.Number)
39756				if !ok {
39757					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
39758				}
39759				f64, err := jtv.Float64()
39760				if err != nil {
39761					return err
39762				}
39763				sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
39764			}
39765
39766		case "status":
39767			if value != nil {
39768				jtv, ok := value.(string)
39769				if !ok {
39770					return fmt.Errorf("expected JobExecutionStatus to be of type string, got %T instead", value)
39771				}
39772				sv.Status = types.JobExecutionStatus(jtv)
39773			}
39774
39775		default:
39776			_, _ = key, value
39777
39778		}
39779	}
39780	*v = sv
39781	return nil
39782}
39783
39784func awsRestjson1_deserializeDocumentJobExecutionSummaryForJob(v **types.JobExecutionSummaryForJob, value interface{}) error {
39785	if v == nil {
39786		return fmt.Errorf("unexpected nil of type %T", v)
39787	}
39788	if value == nil {
39789		return nil
39790	}
39791
39792	shape, ok := value.(map[string]interface{})
39793	if !ok {
39794		return fmt.Errorf("unexpected JSON type %v", value)
39795	}
39796
39797	var sv *types.JobExecutionSummaryForJob
39798	if *v == nil {
39799		sv = &types.JobExecutionSummaryForJob{}
39800	} else {
39801		sv = *v
39802	}
39803
39804	for key, value := range shape {
39805		switch key {
39806		case "jobExecutionSummary":
39807			if err := awsRestjson1_deserializeDocumentJobExecutionSummary(&sv.JobExecutionSummary, value); err != nil {
39808				return err
39809			}
39810
39811		case "thingArn":
39812			if value != nil {
39813				jtv, ok := value.(string)
39814				if !ok {
39815					return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
39816				}
39817				sv.ThingArn = ptr.String(jtv)
39818			}
39819
39820		default:
39821			_, _ = key, value
39822
39823		}
39824	}
39825	*v = sv
39826	return nil
39827}
39828
39829func awsRestjson1_deserializeDocumentJobExecutionSummaryForJobList(v *[]types.JobExecutionSummaryForJob, value interface{}) error {
39830	if v == nil {
39831		return fmt.Errorf("unexpected nil of type %T", v)
39832	}
39833	if value == nil {
39834		return nil
39835	}
39836
39837	shape, ok := value.([]interface{})
39838	if !ok {
39839		return fmt.Errorf("unexpected JSON type %v", value)
39840	}
39841
39842	var cv []types.JobExecutionSummaryForJob
39843	if *v == nil {
39844		cv = []types.JobExecutionSummaryForJob{}
39845	} else {
39846		cv = *v
39847	}
39848
39849	for _, value := range shape {
39850		var col types.JobExecutionSummaryForJob
39851		destAddr := &col
39852		if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForJob(&destAddr, value); err != nil {
39853			return err
39854		}
39855		col = *destAddr
39856		cv = append(cv, col)
39857
39858	}
39859	*v = cv
39860	return nil
39861}
39862
39863func awsRestjson1_deserializeDocumentJobExecutionSummaryForThing(v **types.JobExecutionSummaryForThing, value interface{}) error {
39864	if v == nil {
39865		return fmt.Errorf("unexpected nil of type %T", v)
39866	}
39867	if value == nil {
39868		return nil
39869	}
39870
39871	shape, ok := value.(map[string]interface{})
39872	if !ok {
39873		return fmt.Errorf("unexpected JSON type %v", value)
39874	}
39875
39876	var sv *types.JobExecutionSummaryForThing
39877	if *v == nil {
39878		sv = &types.JobExecutionSummaryForThing{}
39879	} else {
39880		sv = *v
39881	}
39882
39883	for key, value := range shape {
39884		switch key {
39885		case "jobExecutionSummary":
39886			if err := awsRestjson1_deserializeDocumentJobExecutionSummary(&sv.JobExecutionSummary, value); err != nil {
39887				return err
39888			}
39889
39890		case "jobId":
39891			if value != nil {
39892				jtv, ok := value.(string)
39893				if !ok {
39894					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
39895				}
39896				sv.JobId = ptr.String(jtv)
39897			}
39898
39899		default:
39900			_, _ = key, value
39901
39902		}
39903	}
39904	*v = sv
39905	return nil
39906}
39907
39908func awsRestjson1_deserializeDocumentJobExecutionSummaryForThingList(v *[]types.JobExecutionSummaryForThing, value interface{}) error {
39909	if v == nil {
39910		return fmt.Errorf("unexpected nil of type %T", v)
39911	}
39912	if value == nil {
39913		return nil
39914	}
39915
39916	shape, ok := value.([]interface{})
39917	if !ok {
39918		return fmt.Errorf("unexpected JSON type %v", value)
39919	}
39920
39921	var cv []types.JobExecutionSummaryForThing
39922	if *v == nil {
39923		cv = []types.JobExecutionSummaryForThing{}
39924	} else {
39925		cv = *v
39926	}
39927
39928	for _, value := range shape {
39929		var col types.JobExecutionSummaryForThing
39930		destAddr := &col
39931		if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForThing(&destAddr, value); err != nil {
39932			return err
39933		}
39934		col = *destAddr
39935		cv = append(cv, col)
39936
39937	}
39938	*v = cv
39939	return nil
39940}
39941
39942func awsRestjson1_deserializeDocumentJobProcessDetails(v **types.JobProcessDetails, value interface{}) error {
39943	if v == nil {
39944		return fmt.Errorf("unexpected nil of type %T", v)
39945	}
39946	if value == nil {
39947		return nil
39948	}
39949
39950	shape, ok := value.(map[string]interface{})
39951	if !ok {
39952		return fmt.Errorf("unexpected JSON type %v", value)
39953	}
39954
39955	var sv *types.JobProcessDetails
39956	if *v == nil {
39957		sv = &types.JobProcessDetails{}
39958	} else {
39959		sv = *v
39960	}
39961
39962	for key, value := range shape {
39963		switch key {
39964		case "numberOfCanceledThings":
39965			if value != nil {
39966				jtv, ok := value.(json.Number)
39967				if !ok {
39968					return fmt.Errorf("expected CanceledThings to be json.Number, got %T instead", value)
39969				}
39970				i64, err := jtv.Int64()
39971				if err != nil {
39972					return err
39973				}
39974				sv.NumberOfCanceledThings = ptr.Int32(int32(i64))
39975			}
39976
39977		case "numberOfFailedThings":
39978			if value != nil {
39979				jtv, ok := value.(json.Number)
39980				if !ok {
39981					return fmt.Errorf("expected FailedThings to be json.Number, got %T instead", value)
39982				}
39983				i64, err := jtv.Int64()
39984				if err != nil {
39985					return err
39986				}
39987				sv.NumberOfFailedThings = ptr.Int32(int32(i64))
39988			}
39989
39990		case "numberOfInProgressThings":
39991			if value != nil {
39992				jtv, ok := value.(json.Number)
39993				if !ok {
39994					return fmt.Errorf("expected InProgressThings to be json.Number, got %T instead", value)
39995				}
39996				i64, err := jtv.Int64()
39997				if err != nil {
39998					return err
39999				}
40000				sv.NumberOfInProgressThings = ptr.Int32(int32(i64))
40001			}
40002
40003		case "numberOfQueuedThings":
40004			if value != nil {
40005				jtv, ok := value.(json.Number)
40006				if !ok {
40007					return fmt.Errorf("expected QueuedThings to be json.Number, got %T instead", value)
40008				}
40009				i64, err := jtv.Int64()
40010				if err != nil {
40011					return err
40012				}
40013				sv.NumberOfQueuedThings = ptr.Int32(int32(i64))
40014			}
40015
40016		case "numberOfRejectedThings":
40017			if value != nil {
40018				jtv, ok := value.(json.Number)
40019				if !ok {
40020					return fmt.Errorf("expected RejectedThings to be json.Number, got %T instead", value)
40021				}
40022				i64, err := jtv.Int64()
40023				if err != nil {
40024					return err
40025				}
40026				sv.NumberOfRejectedThings = ptr.Int32(int32(i64))
40027			}
40028
40029		case "numberOfRemovedThings":
40030			if value != nil {
40031				jtv, ok := value.(json.Number)
40032				if !ok {
40033					return fmt.Errorf("expected RemovedThings to be json.Number, got %T instead", value)
40034				}
40035				i64, err := jtv.Int64()
40036				if err != nil {
40037					return err
40038				}
40039				sv.NumberOfRemovedThings = ptr.Int32(int32(i64))
40040			}
40041
40042		case "numberOfSucceededThings":
40043			if value != nil {
40044				jtv, ok := value.(json.Number)
40045				if !ok {
40046					return fmt.Errorf("expected SucceededThings to be json.Number, got %T instead", value)
40047				}
40048				i64, err := jtv.Int64()
40049				if err != nil {
40050					return err
40051				}
40052				sv.NumberOfSucceededThings = ptr.Int32(int32(i64))
40053			}
40054
40055		case "numberOfTimedOutThings":
40056			if value != nil {
40057				jtv, ok := value.(json.Number)
40058				if !ok {
40059					return fmt.Errorf("expected TimedOutThings to be json.Number, got %T instead", value)
40060				}
40061				i64, err := jtv.Int64()
40062				if err != nil {
40063					return err
40064				}
40065				sv.NumberOfTimedOutThings = ptr.Int32(int32(i64))
40066			}
40067
40068		case "processingTargets":
40069			if err := awsRestjson1_deserializeDocumentProcessingTargetNameList(&sv.ProcessingTargets, value); err != nil {
40070				return err
40071			}
40072
40073		default:
40074			_, _ = key, value
40075
40076		}
40077	}
40078	*v = sv
40079	return nil
40080}
40081
40082func awsRestjson1_deserializeDocumentJobSummary(v **types.JobSummary, value interface{}) error {
40083	if v == nil {
40084		return fmt.Errorf("unexpected nil of type %T", v)
40085	}
40086	if value == nil {
40087		return nil
40088	}
40089
40090	shape, ok := value.(map[string]interface{})
40091	if !ok {
40092		return fmt.Errorf("unexpected JSON type %v", value)
40093	}
40094
40095	var sv *types.JobSummary
40096	if *v == nil {
40097		sv = &types.JobSummary{}
40098	} else {
40099		sv = *v
40100	}
40101
40102	for key, value := range shape {
40103		switch key {
40104		case "completedAt":
40105			if value != nil {
40106				jtv, ok := value.(json.Number)
40107				if !ok {
40108					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
40109				}
40110				f64, err := jtv.Float64()
40111				if err != nil {
40112					return err
40113				}
40114				sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
40115			}
40116
40117		case "createdAt":
40118			if value != nil {
40119				jtv, ok := value.(json.Number)
40120				if !ok {
40121					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
40122				}
40123				f64, err := jtv.Float64()
40124				if err != nil {
40125					return err
40126				}
40127				sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
40128			}
40129
40130		case "jobArn":
40131			if value != nil {
40132				jtv, ok := value.(string)
40133				if !ok {
40134					return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
40135				}
40136				sv.JobArn = ptr.String(jtv)
40137			}
40138
40139		case "jobId":
40140			if value != nil {
40141				jtv, ok := value.(string)
40142				if !ok {
40143					return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
40144				}
40145				sv.JobId = ptr.String(jtv)
40146			}
40147
40148		case "lastUpdatedAt":
40149			if value != nil {
40150				jtv, ok := value.(json.Number)
40151				if !ok {
40152					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
40153				}
40154				f64, err := jtv.Float64()
40155				if err != nil {
40156					return err
40157				}
40158				sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
40159			}
40160
40161		case "status":
40162			if value != nil {
40163				jtv, ok := value.(string)
40164				if !ok {
40165					return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value)
40166				}
40167				sv.Status = types.JobStatus(jtv)
40168			}
40169
40170		case "targetSelection":
40171			if value != nil {
40172				jtv, ok := value.(string)
40173				if !ok {
40174					return fmt.Errorf("expected TargetSelection to be of type string, got %T instead", value)
40175				}
40176				sv.TargetSelection = types.TargetSelection(jtv)
40177			}
40178
40179		case "thingGroupId":
40180			if value != nil {
40181				jtv, ok := value.(string)
40182				if !ok {
40183					return fmt.Errorf("expected ThingGroupId to be of type string, got %T instead", value)
40184				}
40185				sv.ThingGroupId = ptr.String(jtv)
40186			}
40187
40188		default:
40189			_, _ = key, value
40190
40191		}
40192	}
40193	*v = sv
40194	return nil
40195}
40196
40197func awsRestjson1_deserializeDocumentJobSummaryList(v *[]types.JobSummary, value interface{}) error {
40198	if v == nil {
40199		return fmt.Errorf("unexpected nil of type %T", v)
40200	}
40201	if value == nil {
40202		return nil
40203	}
40204
40205	shape, ok := value.([]interface{})
40206	if !ok {
40207		return fmt.Errorf("unexpected JSON type %v", value)
40208	}
40209
40210	var cv []types.JobSummary
40211	if *v == nil {
40212		cv = []types.JobSummary{}
40213	} else {
40214		cv = *v
40215	}
40216
40217	for _, value := range shape {
40218		var col types.JobSummary
40219		destAddr := &col
40220		if err := awsRestjson1_deserializeDocumentJobSummary(&destAddr, value); err != nil {
40221			return err
40222		}
40223		col = *destAddr
40224		cv = append(cv, col)
40225
40226	}
40227	*v = cv
40228	return nil
40229}
40230
40231func awsRestjson1_deserializeDocumentJobTargets(v *[]string, value interface{}) error {
40232	if v == nil {
40233		return fmt.Errorf("unexpected nil of type %T", v)
40234	}
40235	if value == nil {
40236		return nil
40237	}
40238
40239	shape, ok := value.([]interface{})
40240	if !ok {
40241		return fmt.Errorf("unexpected JSON type %v", value)
40242	}
40243
40244	var cv []string
40245	if *v == nil {
40246		cv = []string{}
40247	} else {
40248		cv = *v
40249	}
40250
40251	for _, value := range shape {
40252		var col string
40253		if value != nil {
40254			jtv, ok := value.(string)
40255			if !ok {
40256				return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value)
40257			}
40258			col = jtv
40259		}
40260		cv = append(cv, col)
40261
40262	}
40263	*v = cv
40264	return nil
40265}
40266
40267func awsRestjson1_deserializeDocumentKeyPair(v **types.KeyPair, value interface{}) error {
40268	if v == nil {
40269		return fmt.Errorf("unexpected nil of type %T", v)
40270	}
40271	if value == nil {
40272		return nil
40273	}
40274
40275	shape, ok := value.(map[string]interface{})
40276	if !ok {
40277		return fmt.Errorf("unexpected JSON type %v", value)
40278	}
40279
40280	var sv *types.KeyPair
40281	if *v == nil {
40282		sv = &types.KeyPair{}
40283	} else {
40284		sv = *v
40285	}
40286
40287	for key, value := range shape {
40288		switch key {
40289		case "PrivateKey":
40290			if value != nil {
40291				jtv, ok := value.(string)
40292				if !ok {
40293					return fmt.Errorf("expected PrivateKey to be of type string, got %T instead", value)
40294				}
40295				sv.PrivateKey = ptr.String(jtv)
40296			}
40297
40298		case "PublicKey":
40299			if value != nil {
40300				jtv, ok := value.(string)
40301				if !ok {
40302					return fmt.Errorf("expected PublicKey to be of type string, got %T instead", value)
40303				}
40304				sv.PublicKey = ptr.String(jtv)
40305			}
40306
40307		default:
40308			_, _ = key, value
40309
40310		}
40311	}
40312	*v = sv
40313	return nil
40314}
40315
40316func awsRestjson1_deserializeDocumentKinesisAction(v **types.KinesisAction, value interface{}) error {
40317	if v == nil {
40318		return fmt.Errorf("unexpected nil of type %T", v)
40319	}
40320	if value == nil {
40321		return nil
40322	}
40323
40324	shape, ok := value.(map[string]interface{})
40325	if !ok {
40326		return fmt.Errorf("unexpected JSON type %v", value)
40327	}
40328
40329	var sv *types.KinesisAction
40330	if *v == nil {
40331		sv = &types.KinesisAction{}
40332	} else {
40333		sv = *v
40334	}
40335
40336	for key, value := range shape {
40337		switch key {
40338		case "partitionKey":
40339			if value != nil {
40340				jtv, ok := value.(string)
40341				if !ok {
40342					return fmt.Errorf("expected PartitionKey to be of type string, got %T instead", value)
40343				}
40344				sv.PartitionKey = ptr.String(jtv)
40345			}
40346
40347		case "roleArn":
40348			if value != nil {
40349				jtv, ok := value.(string)
40350				if !ok {
40351					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
40352				}
40353				sv.RoleArn = ptr.String(jtv)
40354			}
40355
40356		case "streamName":
40357			if value != nil {
40358				jtv, ok := value.(string)
40359				if !ok {
40360					return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
40361				}
40362				sv.StreamName = ptr.String(jtv)
40363			}
40364
40365		default:
40366			_, _ = key, value
40367
40368		}
40369	}
40370	*v = sv
40371	return nil
40372}
40373
40374func awsRestjson1_deserializeDocumentLambdaAction(v **types.LambdaAction, value interface{}) error {
40375	if v == nil {
40376		return fmt.Errorf("unexpected nil of type %T", v)
40377	}
40378	if value == nil {
40379		return nil
40380	}
40381
40382	shape, ok := value.(map[string]interface{})
40383	if !ok {
40384		return fmt.Errorf("unexpected JSON type %v", value)
40385	}
40386
40387	var sv *types.LambdaAction
40388	if *v == nil {
40389		sv = &types.LambdaAction{}
40390	} else {
40391		sv = *v
40392	}
40393
40394	for key, value := range shape {
40395		switch key {
40396		case "functionArn":
40397			if value != nil {
40398				jtv, ok := value.(string)
40399				if !ok {
40400					return fmt.Errorf("expected FunctionArn to be of type string, got %T instead", value)
40401				}
40402				sv.FunctionArn = ptr.String(jtv)
40403			}
40404
40405		default:
40406			_, _ = key, value
40407
40408		}
40409	}
40410	*v = sv
40411	return nil
40412}
40413
40414func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
40415	if v == nil {
40416		return fmt.Errorf("unexpected nil of type %T", v)
40417	}
40418	if value == nil {
40419		return nil
40420	}
40421
40422	shape, ok := value.(map[string]interface{})
40423	if !ok {
40424		return fmt.Errorf("unexpected JSON type %v", value)
40425	}
40426
40427	var sv *types.LimitExceededException
40428	if *v == nil {
40429		sv = &types.LimitExceededException{}
40430	} else {
40431		sv = *v
40432	}
40433
40434	for key, value := range shape {
40435		switch key {
40436		case "message":
40437			if value != nil {
40438				jtv, ok := value.(string)
40439				if !ok {
40440					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
40441				}
40442				sv.Message = ptr.String(jtv)
40443			}
40444
40445		default:
40446			_, _ = key, value
40447
40448		}
40449	}
40450	*v = sv
40451	return nil
40452}
40453
40454func awsRestjson1_deserializeDocumentLogTarget(v **types.LogTarget, value interface{}) error {
40455	if v == nil {
40456		return fmt.Errorf("unexpected nil of type %T", v)
40457	}
40458	if value == nil {
40459		return nil
40460	}
40461
40462	shape, ok := value.(map[string]interface{})
40463	if !ok {
40464		return fmt.Errorf("unexpected JSON type %v", value)
40465	}
40466
40467	var sv *types.LogTarget
40468	if *v == nil {
40469		sv = &types.LogTarget{}
40470	} else {
40471		sv = *v
40472	}
40473
40474	for key, value := range shape {
40475		switch key {
40476		case "targetName":
40477			if value != nil {
40478				jtv, ok := value.(string)
40479				if !ok {
40480					return fmt.Errorf("expected LogTargetName to be of type string, got %T instead", value)
40481				}
40482				sv.TargetName = ptr.String(jtv)
40483			}
40484
40485		case "targetType":
40486			if value != nil {
40487				jtv, ok := value.(string)
40488				if !ok {
40489					return fmt.Errorf("expected LogTargetType to be of type string, got %T instead", value)
40490				}
40491				sv.TargetType = types.LogTargetType(jtv)
40492			}
40493
40494		default:
40495			_, _ = key, value
40496
40497		}
40498	}
40499	*v = sv
40500	return nil
40501}
40502
40503func awsRestjson1_deserializeDocumentLogTargetConfiguration(v **types.LogTargetConfiguration, value interface{}) error {
40504	if v == nil {
40505		return fmt.Errorf("unexpected nil of type %T", v)
40506	}
40507	if value == nil {
40508		return nil
40509	}
40510
40511	shape, ok := value.(map[string]interface{})
40512	if !ok {
40513		return fmt.Errorf("unexpected JSON type %v", value)
40514	}
40515
40516	var sv *types.LogTargetConfiguration
40517	if *v == nil {
40518		sv = &types.LogTargetConfiguration{}
40519	} else {
40520		sv = *v
40521	}
40522
40523	for key, value := range shape {
40524		switch key {
40525		case "logLevel":
40526			if value != nil {
40527				jtv, ok := value.(string)
40528				if !ok {
40529					return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value)
40530				}
40531				sv.LogLevel = types.LogLevel(jtv)
40532			}
40533
40534		case "logTarget":
40535			if err := awsRestjson1_deserializeDocumentLogTarget(&sv.LogTarget, value); err != nil {
40536				return err
40537			}
40538
40539		default:
40540			_, _ = key, value
40541
40542		}
40543	}
40544	*v = sv
40545	return nil
40546}
40547
40548func awsRestjson1_deserializeDocumentLogTargetConfigurations(v *[]types.LogTargetConfiguration, value interface{}) error {
40549	if v == nil {
40550		return fmt.Errorf("unexpected nil of type %T", v)
40551	}
40552	if value == nil {
40553		return nil
40554	}
40555
40556	shape, ok := value.([]interface{})
40557	if !ok {
40558		return fmt.Errorf("unexpected JSON type %v", value)
40559	}
40560
40561	var cv []types.LogTargetConfiguration
40562	if *v == nil {
40563		cv = []types.LogTargetConfiguration{}
40564	} else {
40565		cv = *v
40566	}
40567
40568	for _, value := range shape {
40569		var col types.LogTargetConfiguration
40570		destAddr := &col
40571		if err := awsRestjson1_deserializeDocumentLogTargetConfiguration(&destAddr, value); err != nil {
40572			return err
40573		}
40574		col = *destAddr
40575		cv = append(cv, col)
40576
40577	}
40578	*v = cv
40579	return nil
40580}
40581
40582func awsRestjson1_deserializeDocumentMalformedPolicyException(v **types.MalformedPolicyException, value interface{}) error {
40583	if v == nil {
40584		return fmt.Errorf("unexpected nil of type %T", v)
40585	}
40586	if value == nil {
40587		return nil
40588	}
40589
40590	shape, ok := value.(map[string]interface{})
40591	if !ok {
40592		return fmt.Errorf("unexpected JSON type %v", value)
40593	}
40594
40595	var sv *types.MalformedPolicyException
40596	if *v == nil {
40597		sv = &types.MalformedPolicyException{}
40598	} else {
40599		sv = *v
40600	}
40601
40602	for key, value := range shape {
40603		switch key {
40604		case "message":
40605			if value != nil {
40606				jtv, ok := value.(string)
40607				if !ok {
40608					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
40609				}
40610				sv.Message = ptr.String(jtv)
40611			}
40612
40613		default:
40614			_, _ = key, value
40615
40616		}
40617	}
40618	*v = sv
40619	return nil
40620}
40621
40622func awsRestjson1_deserializeDocumentMetricDimension(v **types.MetricDimension, value interface{}) error {
40623	if v == nil {
40624		return fmt.Errorf("unexpected nil of type %T", v)
40625	}
40626	if value == nil {
40627		return nil
40628	}
40629
40630	shape, ok := value.(map[string]interface{})
40631	if !ok {
40632		return fmt.Errorf("unexpected JSON type %v", value)
40633	}
40634
40635	var sv *types.MetricDimension
40636	if *v == nil {
40637		sv = &types.MetricDimension{}
40638	} else {
40639		sv = *v
40640	}
40641
40642	for key, value := range shape {
40643		switch key {
40644		case "dimensionName":
40645			if value != nil {
40646				jtv, ok := value.(string)
40647				if !ok {
40648					return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
40649				}
40650				sv.DimensionName = ptr.String(jtv)
40651			}
40652
40653		case "operator":
40654			if value != nil {
40655				jtv, ok := value.(string)
40656				if !ok {
40657					return fmt.Errorf("expected DimensionValueOperator to be of type string, got %T instead", value)
40658				}
40659				sv.Operator = types.DimensionValueOperator(jtv)
40660			}
40661
40662		default:
40663			_, _ = key, value
40664
40665		}
40666	}
40667	*v = sv
40668	return nil
40669}
40670
40671func awsRestjson1_deserializeDocumentMetricToRetain(v **types.MetricToRetain, value interface{}) error {
40672	if v == nil {
40673		return fmt.Errorf("unexpected nil of type %T", v)
40674	}
40675	if value == nil {
40676		return nil
40677	}
40678
40679	shape, ok := value.(map[string]interface{})
40680	if !ok {
40681		return fmt.Errorf("unexpected JSON type %v", value)
40682	}
40683
40684	var sv *types.MetricToRetain
40685	if *v == nil {
40686		sv = &types.MetricToRetain{}
40687	} else {
40688		sv = *v
40689	}
40690
40691	for key, value := range shape {
40692		switch key {
40693		case "metric":
40694			if value != nil {
40695				jtv, ok := value.(string)
40696				if !ok {
40697					return fmt.Errorf("expected BehaviorMetric to be of type string, got %T instead", value)
40698				}
40699				sv.Metric = ptr.String(jtv)
40700			}
40701
40702		case "metricDimension":
40703			if err := awsRestjson1_deserializeDocumentMetricDimension(&sv.MetricDimension, value); err != nil {
40704				return err
40705			}
40706
40707		default:
40708			_, _ = key, value
40709
40710		}
40711	}
40712	*v = sv
40713	return nil
40714}
40715
40716func awsRestjson1_deserializeDocumentMetricValue(v **types.MetricValue, value interface{}) error {
40717	if v == nil {
40718		return fmt.Errorf("unexpected nil of type %T", v)
40719	}
40720	if value == nil {
40721		return nil
40722	}
40723
40724	shape, ok := value.(map[string]interface{})
40725	if !ok {
40726		return fmt.Errorf("unexpected JSON type %v", value)
40727	}
40728
40729	var sv *types.MetricValue
40730	if *v == nil {
40731		sv = &types.MetricValue{}
40732	} else {
40733		sv = *v
40734	}
40735
40736	for key, value := range shape {
40737		switch key {
40738		case "cidrs":
40739			if err := awsRestjson1_deserializeDocumentCidrs(&sv.Cidrs, value); err != nil {
40740				return err
40741			}
40742
40743		case "count":
40744			if value != nil {
40745				jtv, ok := value.(json.Number)
40746				if !ok {
40747					return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value)
40748				}
40749				i64, err := jtv.Int64()
40750				if err != nil {
40751					return err
40752				}
40753				sv.Count = ptr.Int64(i64)
40754			}
40755
40756		case "ports":
40757			if err := awsRestjson1_deserializeDocumentPorts(&sv.Ports, value); err != nil {
40758				return err
40759			}
40760
40761		default:
40762			_, _ = key, value
40763
40764		}
40765	}
40766	*v = sv
40767	return nil
40768}
40769
40770func awsRestjson1_deserializeDocumentMissingContextValues(v *[]string, value interface{}) error {
40771	if v == nil {
40772		return fmt.Errorf("unexpected nil of type %T", v)
40773	}
40774	if value == nil {
40775		return nil
40776	}
40777
40778	shape, ok := value.([]interface{})
40779	if !ok {
40780		return fmt.Errorf("unexpected JSON type %v", value)
40781	}
40782
40783	var cv []string
40784	if *v == nil {
40785		cv = []string{}
40786	} else {
40787		cv = *v
40788	}
40789
40790	for _, value := range shape {
40791		var col string
40792		if value != nil {
40793			jtv, ok := value.(string)
40794			if !ok {
40795				return fmt.Errorf("expected MissingContextValue to be of type string, got %T instead", value)
40796			}
40797			col = jtv
40798		}
40799		cv = append(cv, col)
40800
40801	}
40802	*v = cv
40803	return nil
40804}
40805
40806func awsRestjson1_deserializeDocumentMitigationAction(v **types.MitigationAction, value interface{}) error {
40807	if v == nil {
40808		return fmt.Errorf("unexpected nil of type %T", v)
40809	}
40810	if value == nil {
40811		return nil
40812	}
40813
40814	shape, ok := value.(map[string]interface{})
40815	if !ok {
40816		return fmt.Errorf("unexpected JSON type %v", value)
40817	}
40818
40819	var sv *types.MitigationAction
40820	if *v == nil {
40821		sv = &types.MitigationAction{}
40822	} else {
40823		sv = *v
40824	}
40825
40826	for key, value := range shape {
40827		switch key {
40828		case "actionParams":
40829			if err := awsRestjson1_deserializeDocumentMitigationActionParams(&sv.ActionParams, value); err != nil {
40830				return err
40831			}
40832
40833		case "id":
40834			if value != nil {
40835				jtv, ok := value.(string)
40836				if !ok {
40837					return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value)
40838				}
40839				sv.Id = ptr.String(jtv)
40840			}
40841
40842		case "name":
40843			if value != nil {
40844				jtv, ok := value.(string)
40845				if !ok {
40846					return fmt.Errorf("expected MitigationActionName to be of type string, got %T instead", value)
40847				}
40848				sv.Name = ptr.String(jtv)
40849			}
40850
40851		case "roleArn":
40852			if value != nil {
40853				jtv, ok := value.(string)
40854				if !ok {
40855					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
40856				}
40857				sv.RoleArn = ptr.String(jtv)
40858			}
40859
40860		default:
40861			_, _ = key, value
40862
40863		}
40864	}
40865	*v = sv
40866	return nil
40867}
40868
40869func awsRestjson1_deserializeDocumentMitigationActionIdentifier(v **types.MitigationActionIdentifier, value interface{}) error {
40870	if v == nil {
40871		return fmt.Errorf("unexpected nil of type %T", v)
40872	}
40873	if value == nil {
40874		return nil
40875	}
40876
40877	shape, ok := value.(map[string]interface{})
40878	if !ok {
40879		return fmt.Errorf("unexpected JSON type %v", value)
40880	}
40881
40882	var sv *types.MitigationActionIdentifier
40883	if *v == nil {
40884		sv = &types.MitigationActionIdentifier{}
40885	} else {
40886		sv = *v
40887	}
40888
40889	for key, value := range shape {
40890		switch key {
40891		case "actionArn":
40892			if value != nil {
40893				jtv, ok := value.(string)
40894				if !ok {
40895					return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value)
40896				}
40897				sv.ActionArn = ptr.String(jtv)
40898			}
40899
40900		case "actionName":
40901			if value != nil {
40902				jtv, ok := value.(string)
40903				if !ok {
40904					return fmt.Errorf("expected MitigationActionName to be of type string, got %T instead", value)
40905				}
40906				sv.ActionName = ptr.String(jtv)
40907			}
40908
40909		case "creationDate":
40910			if value != nil {
40911				jtv, ok := value.(json.Number)
40912				if !ok {
40913					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
40914				}
40915				f64, err := jtv.Float64()
40916				if err != nil {
40917					return err
40918				}
40919				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
40920			}
40921
40922		default:
40923			_, _ = key, value
40924
40925		}
40926	}
40927	*v = sv
40928	return nil
40929}
40930
40931func awsRestjson1_deserializeDocumentMitigationActionIdentifierList(v *[]types.MitigationActionIdentifier, value interface{}) error {
40932	if v == nil {
40933		return fmt.Errorf("unexpected nil of type %T", v)
40934	}
40935	if value == nil {
40936		return nil
40937	}
40938
40939	shape, ok := value.([]interface{})
40940	if !ok {
40941		return fmt.Errorf("unexpected JSON type %v", value)
40942	}
40943
40944	var cv []types.MitigationActionIdentifier
40945	if *v == nil {
40946		cv = []types.MitigationActionIdentifier{}
40947	} else {
40948		cv = *v
40949	}
40950
40951	for _, value := range shape {
40952		var col types.MitigationActionIdentifier
40953		destAddr := &col
40954		if err := awsRestjson1_deserializeDocumentMitigationActionIdentifier(&destAddr, value); err != nil {
40955			return err
40956		}
40957		col = *destAddr
40958		cv = append(cv, col)
40959
40960	}
40961	*v = cv
40962	return nil
40963}
40964
40965func awsRestjson1_deserializeDocumentMitigationActionList(v *[]types.MitigationAction, value interface{}) error {
40966	if v == nil {
40967		return fmt.Errorf("unexpected nil of type %T", v)
40968	}
40969	if value == nil {
40970		return nil
40971	}
40972
40973	shape, ok := value.([]interface{})
40974	if !ok {
40975		return fmt.Errorf("unexpected JSON type %v", value)
40976	}
40977
40978	var cv []types.MitigationAction
40979	if *v == nil {
40980		cv = []types.MitigationAction{}
40981	} else {
40982		cv = *v
40983	}
40984
40985	for _, value := range shape {
40986		var col types.MitigationAction
40987		destAddr := &col
40988		if err := awsRestjson1_deserializeDocumentMitigationAction(&destAddr, value); err != nil {
40989			return err
40990		}
40991		col = *destAddr
40992		cv = append(cv, col)
40993
40994	}
40995	*v = cv
40996	return nil
40997}
40998
40999func awsRestjson1_deserializeDocumentMitigationActionNameList(v *[]string, value interface{}) error {
41000	if v == nil {
41001		return fmt.Errorf("unexpected nil of type %T", v)
41002	}
41003	if value == nil {
41004		return nil
41005	}
41006
41007	shape, ok := value.([]interface{})
41008	if !ok {
41009		return fmt.Errorf("unexpected JSON type %v", value)
41010	}
41011
41012	var cv []string
41013	if *v == nil {
41014		cv = []string{}
41015	} else {
41016		cv = *v
41017	}
41018
41019	for _, value := range shape {
41020		var col string
41021		if value != nil {
41022			jtv, ok := value.(string)
41023			if !ok {
41024				return fmt.Errorf("expected MitigationActionName to be of type string, got %T instead", value)
41025			}
41026			col = jtv
41027		}
41028		cv = append(cv, col)
41029
41030	}
41031	*v = cv
41032	return nil
41033}
41034
41035func awsRestjson1_deserializeDocumentMitigationActionParams(v **types.MitigationActionParams, value interface{}) error {
41036	if v == nil {
41037		return fmt.Errorf("unexpected nil of type %T", v)
41038	}
41039	if value == nil {
41040		return nil
41041	}
41042
41043	shape, ok := value.(map[string]interface{})
41044	if !ok {
41045		return fmt.Errorf("unexpected JSON type %v", value)
41046	}
41047
41048	var sv *types.MitigationActionParams
41049	if *v == nil {
41050		sv = &types.MitigationActionParams{}
41051	} else {
41052		sv = *v
41053	}
41054
41055	for key, value := range shape {
41056		switch key {
41057		case "addThingsToThingGroupParams":
41058			if err := awsRestjson1_deserializeDocumentAddThingsToThingGroupParams(&sv.AddThingsToThingGroupParams, value); err != nil {
41059				return err
41060			}
41061
41062		case "enableIoTLoggingParams":
41063			if err := awsRestjson1_deserializeDocumentEnableIoTLoggingParams(&sv.EnableIoTLoggingParams, value); err != nil {
41064				return err
41065			}
41066
41067		case "publishFindingToSnsParams":
41068			if err := awsRestjson1_deserializeDocumentPublishFindingToSnsParams(&sv.PublishFindingToSnsParams, value); err != nil {
41069				return err
41070			}
41071
41072		case "replaceDefaultPolicyVersionParams":
41073			if err := awsRestjson1_deserializeDocumentReplaceDefaultPolicyVersionParams(&sv.ReplaceDefaultPolicyVersionParams, value); err != nil {
41074				return err
41075			}
41076
41077		case "updateCACertificateParams":
41078			if err := awsRestjson1_deserializeDocumentUpdateCACertificateParams(&sv.UpdateCACertificateParams, value); err != nil {
41079				return err
41080			}
41081
41082		case "updateDeviceCertificateParams":
41083			if err := awsRestjson1_deserializeDocumentUpdateDeviceCertificateParams(&sv.UpdateDeviceCertificateParams, value); err != nil {
41084				return err
41085			}
41086
41087		default:
41088			_, _ = key, value
41089
41090		}
41091	}
41092	*v = sv
41093	return nil
41094}
41095
41096func awsRestjson1_deserializeDocumentNonCompliantResource(v **types.NonCompliantResource, value interface{}) error {
41097	if v == nil {
41098		return fmt.Errorf("unexpected nil of type %T", v)
41099	}
41100	if value == nil {
41101		return nil
41102	}
41103
41104	shape, ok := value.(map[string]interface{})
41105	if !ok {
41106		return fmt.Errorf("unexpected JSON type %v", value)
41107	}
41108
41109	var sv *types.NonCompliantResource
41110	if *v == nil {
41111		sv = &types.NonCompliantResource{}
41112	} else {
41113		sv = *v
41114	}
41115
41116	for key, value := range shape {
41117		switch key {
41118		case "additionalInfo":
41119			if err := awsRestjson1_deserializeDocumentStringMap(&sv.AdditionalInfo, value); err != nil {
41120				return err
41121			}
41122
41123		case "resourceIdentifier":
41124			if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil {
41125				return err
41126			}
41127
41128		case "resourceType":
41129			if value != nil {
41130				jtv, ok := value.(string)
41131				if !ok {
41132					return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
41133				}
41134				sv.ResourceType = types.ResourceType(jtv)
41135			}
41136
41137		default:
41138			_, _ = key, value
41139
41140		}
41141	}
41142	*v = sv
41143	return nil
41144}
41145
41146func awsRestjson1_deserializeDocumentNotConfiguredException(v **types.NotConfiguredException, value interface{}) error {
41147	if v == nil {
41148		return fmt.Errorf("unexpected nil of type %T", v)
41149	}
41150	if value == nil {
41151		return nil
41152	}
41153
41154	shape, ok := value.(map[string]interface{})
41155	if !ok {
41156		return fmt.Errorf("unexpected JSON type %v", value)
41157	}
41158
41159	var sv *types.NotConfiguredException
41160	if *v == nil {
41161		sv = &types.NotConfiguredException{}
41162	} else {
41163		sv = *v
41164	}
41165
41166	for key, value := range shape {
41167		switch key {
41168		case "message":
41169			if value != nil {
41170				jtv, ok := value.(string)
41171				if !ok {
41172					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
41173				}
41174				sv.Message = ptr.String(jtv)
41175			}
41176
41177		default:
41178			_, _ = key, value
41179
41180		}
41181	}
41182	*v = sv
41183	return nil
41184}
41185
41186func awsRestjson1_deserializeDocumentOTAUpdateFile(v **types.OTAUpdateFile, value interface{}) error {
41187	if v == nil {
41188		return fmt.Errorf("unexpected nil of type %T", v)
41189	}
41190	if value == nil {
41191		return nil
41192	}
41193
41194	shape, ok := value.(map[string]interface{})
41195	if !ok {
41196		return fmt.Errorf("unexpected JSON type %v", value)
41197	}
41198
41199	var sv *types.OTAUpdateFile
41200	if *v == nil {
41201		sv = &types.OTAUpdateFile{}
41202	} else {
41203		sv = *v
41204	}
41205
41206	for key, value := range shape {
41207		switch key {
41208		case "attributes":
41209			if err := awsRestjson1_deserializeDocumentAttributesMap(&sv.Attributes, value); err != nil {
41210				return err
41211			}
41212
41213		case "codeSigning":
41214			if err := awsRestjson1_deserializeDocumentCodeSigning(&sv.CodeSigning, value); err != nil {
41215				return err
41216			}
41217
41218		case "fileLocation":
41219			if err := awsRestjson1_deserializeDocumentFileLocation(&sv.FileLocation, value); err != nil {
41220				return err
41221			}
41222
41223		case "fileName":
41224			if value != nil {
41225				jtv, ok := value.(string)
41226				if !ok {
41227					return fmt.Errorf("expected FileName to be of type string, got %T instead", value)
41228				}
41229				sv.FileName = ptr.String(jtv)
41230			}
41231
41232		case "fileType":
41233			if value != nil {
41234				jtv, ok := value.(json.Number)
41235				if !ok {
41236					return fmt.Errorf("expected FileType to be json.Number, got %T instead", value)
41237				}
41238				i64, err := jtv.Int64()
41239				if err != nil {
41240					return err
41241				}
41242				sv.FileType = ptr.Int32(int32(i64))
41243			}
41244
41245		case "fileVersion":
41246			if value != nil {
41247				jtv, ok := value.(string)
41248				if !ok {
41249					return fmt.Errorf("expected OTAUpdateFileVersion to be of type string, got %T instead", value)
41250				}
41251				sv.FileVersion = ptr.String(jtv)
41252			}
41253
41254		default:
41255			_, _ = key, value
41256
41257		}
41258	}
41259	*v = sv
41260	return nil
41261}
41262
41263func awsRestjson1_deserializeDocumentOTAUpdateFiles(v *[]types.OTAUpdateFile, value interface{}) error {
41264	if v == nil {
41265		return fmt.Errorf("unexpected nil of type %T", v)
41266	}
41267	if value == nil {
41268		return nil
41269	}
41270
41271	shape, ok := value.([]interface{})
41272	if !ok {
41273		return fmt.Errorf("unexpected JSON type %v", value)
41274	}
41275
41276	var cv []types.OTAUpdateFile
41277	if *v == nil {
41278		cv = []types.OTAUpdateFile{}
41279	} else {
41280		cv = *v
41281	}
41282
41283	for _, value := range shape {
41284		var col types.OTAUpdateFile
41285		destAddr := &col
41286		if err := awsRestjson1_deserializeDocumentOTAUpdateFile(&destAddr, value); err != nil {
41287			return err
41288		}
41289		col = *destAddr
41290		cv = append(cv, col)
41291
41292	}
41293	*v = cv
41294	return nil
41295}
41296
41297func awsRestjson1_deserializeDocumentOTAUpdateInfo(v **types.OTAUpdateInfo, value interface{}) error {
41298	if v == nil {
41299		return fmt.Errorf("unexpected nil of type %T", v)
41300	}
41301	if value == nil {
41302		return nil
41303	}
41304
41305	shape, ok := value.(map[string]interface{})
41306	if !ok {
41307		return fmt.Errorf("unexpected JSON type %v", value)
41308	}
41309
41310	var sv *types.OTAUpdateInfo
41311	if *v == nil {
41312		sv = &types.OTAUpdateInfo{}
41313	} else {
41314		sv = *v
41315	}
41316
41317	for key, value := range shape {
41318		switch key {
41319		case "additionalParameters":
41320			if err := awsRestjson1_deserializeDocumentAdditionalParameterMap(&sv.AdditionalParameters, value); err != nil {
41321				return err
41322			}
41323
41324		case "awsIotJobArn":
41325			if value != nil {
41326				jtv, ok := value.(string)
41327				if !ok {
41328					return fmt.Errorf("expected AwsIotJobArn to be of type string, got %T instead", value)
41329				}
41330				sv.AwsIotJobArn = ptr.String(jtv)
41331			}
41332
41333		case "awsIotJobId":
41334			if value != nil {
41335				jtv, ok := value.(string)
41336				if !ok {
41337					return fmt.Errorf("expected AwsIotJobId to be of type string, got %T instead", value)
41338				}
41339				sv.AwsIotJobId = ptr.String(jtv)
41340			}
41341
41342		case "awsJobExecutionsRolloutConfig":
41343			if err := awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(&sv.AwsJobExecutionsRolloutConfig, value); err != nil {
41344				return err
41345			}
41346
41347		case "awsJobPresignedUrlConfig":
41348			if err := awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(&sv.AwsJobPresignedUrlConfig, value); err != nil {
41349				return err
41350			}
41351
41352		case "creationDate":
41353			if value != nil {
41354				jtv, ok := value.(json.Number)
41355				if !ok {
41356					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41357				}
41358				f64, err := jtv.Float64()
41359				if err != nil {
41360					return err
41361				}
41362				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41363			}
41364
41365		case "description":
41366			if value != nil {
41367				jtv, ok := value.(string)
41368				if !ok {
41369					return fmt.Errorf("expected OTAUpdateDescription to be of type string, got %T instead", value)
41370				}
41371				sv.Description = ptr.String(jtv)
41372			}
41373
41374		case "errorInfo":
41375			if err := awsRestjson1_deserializeDocumentErrorInfo(&sv.ErrorInfo, value); err != nil {
41376				return err
41377			}
41378
41379		case "lastModifiedDate":
41380			if value != nil {
41381				jtv, ok := value.(json.Number)
41382				if !ok {
41383					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41384				}
41385				f64, err := jtv.Float64()
41386				if err != nil {
41387					return err
41388				}
41389				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41390			}
41391
41392		case "otaUpdateArn":
41393			if value != nil {
41394				jtv, ok := value.(string)
41395				if !ok {
41396					return fmt.Errorf("expected OTAUpdateArn to be of type string, got %T instead", value)
41397				}
41398				sv.OtaUpdateArn = ptr.String(jtv)
41399			}
41400
41401		case "otaUpdateFiles":
41402			if err := awsRestjson1_deserializeDocumentOTAUpdateFiles(&sv.OtaUpdateFiles, value); err != nil {
41403				return err
41404			}
41405
41406		case "otaUpdateId":
41407			if value != nil {
41408				jtv, ok := value.(string)
41409				if !ok {
41410					return fmt.Errorf("expected OTAUpdateId to be of type string, got %T instead", value)
41411				}
41412				sv.OtaUpdateId = ptr.String(jtv)
41413			}
41414
41415		case "otaUpdateStatus":
41416			if value != nil {
41417				jtv, ok := value.(string)
41418				if !ok {
41419					return fmt.Errorf("expected OTAUpdateStatus to be of type string, got %T instead", value)
41420				}
41421				sv.OtaUpdateStatus = types.OTAUpdateStatus(jtv)
41422			}
41423
41424		case "protocols":
41425			if err := awsRestjson1_deserializeDocumentProtocols(&sv.Protocols, value); err != nil {
41426				return err
41427			}
41428
41429		case "targets":
41430			if err := awsRestjson1_deserializeDocumentTargets(&sv.Targets, value); err != nil {
41431				return err
41432			}
41433
41434		case "targetSelection":
41435			if value != nil {
41436				jtv, ok := value.(string)
41437				if !ok {
41438					return fmt.Errorf("expected TargetSelection to be of type string, got %T instead", value)
41439				}
41440				sv.TargetSelection = types.TargetSelection(jtv)
41441			}
41442
41443		default:
41444			_, _ = key, value
41445
41446		}
41447	}
41448	*v = sv
41449	return nil
41450}
41451
41452func awsRestjson1_deserializeDocumentOTAUpdatesSummary(v *[]types.OTAUpdateSummary, value interface{}) error {
41453	if v == nil {
41454		return fmt.Errorf("unexpected nil of type %T", v)
41455	}
41456	if value == nil {
41457		return nil
41458	}
41459
41460	shape, ok := value.([]interface{})
41461	if !ok {
41462		return fmt.Errorf("unexpected JSON type %v", value)
41463	}
41464
41465	var cv []types.OTAUpdateSummary
41466	if *v == nil {
41467		cv = []types.OTAUpdateSummary{}
41468	} else {
41469		cv = *v
41470	}
41471
41472	for _, value := range shape {
41473		var col types.OTAUpdateSummary
41474		destAddr := &col
41475		if err := awsRestjson1_deserializeDocumentOTAUpdateSummary(&destAddr, value); err != nil {
41476			return err
41477		}
41478		col = *destAddr
41479		cv = append(cv, col)
41480
41481	}
41482	*v = cv
41483	return nil
41484}
41485
41486func awsRestjson1_deserializeDocumentOTAUpdateSummary(v **types.OTAUpdateSummary, value interface{}) error {
41487	if v == nil {
41488		return fmt.Errorf("unexpected nil of type %T", v)
41489	}
41490	if value == nil {
41491		return nil
41492	}
41493
41494	shape, ok := value.(map[string]interface{})
41495	if !ok {
41496		return fmt.Errorf("unexpected JSON type %v", value)
41497	}
41498
41499	var sv *types.OTAUpdateSummary
41500	if *v == nil {
41501		sv = &types.OTAUpdateSummary{}
41502	} else {
41503		sv = *v
41504	}
41505
41506	for key, value := range shape {
41507		switch key {
41508		case "creationDate":
41509			if value != nil {
41510				jtv, ok := value.(json.Number)
41511				if !ok {
41512					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41513				}
41514				f64, err := jtv.Float64()
41515				if err != nil {
41516					return err
41517				}
41518				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41519			}
41520
41521		case "otaUpdateArn":
41522			if value != nil {
41523				jtv, ok := value.(string)
41524				if !ok {
41525					return fmt.Errorf("expected OTAUpdateArn to be of type string, got %T instead", value)
41526				}
41527				sv.OtaUpdateArn = ptr.String(jtv)
41528			}
41529
41530		case "otaUpdateId":
41531			if value != nil {
41532				jtv, ok := value.(string)
41533				if !ok {
41534					return fmt.Errorf("expected OTAUpdateId to be of type string, got %T instead", value)
41535				}
41536				sv.OtaUpdateId = ptr.String(jtv)
41537			}
41538
41539		default:
41540			_, _ = key, value
41541
41542		}
41543	}
41544	*v = sv
41545	return nil
41546}
41547
41548func awsRestjson1_deserializeDocumentOutgoingCertificate(v **types.OutgoingCertificate, value interface{}) error {
41549	if v == nil {
41550		return fmt.Errorf("unexpected nil of type %T", v)
41551	}
41552	if value == nil {
41553		return nil
41554	}
41555
41556	shape, ok := value.(map[string]interface{})
41557	if !ok {
41558		return fmt.Errorf("unexpected JSON type %v", value)
41559	}
41560
41561	var sv *types.OutgoingCertificate
41562	if *v == nil {
41563		sv = &types.OutgoingCertificate{}
41564	} else {
41565		sv = *v
41566	}
41567
41568	for key, value := range shape {
41569		switch key {
41570		case "certificateArn":
41571			if value != nil {
41572				jtv, ok := value.(string)
41573				if !ok {
41574					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
41575				}
41576				sv.CertificateArn = ptr.String(jtv)
41577			}
41578
41579		case "certificateId":
41580			if value != nil {
41581				jtv, ok := value.(string)
41582				if !ok {
41583					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
41584				}
41585				sv.CertificateId = ptr.String(jtv)
41586			}
41587
41588		case "creationDate":
41589			if value != nil {
41590				jtv, ok := value.(json.Number)
41591				if !ok {
41592					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41593				}
41594				f64, err := jtv.Float64()
41595				if err != nil {
41596					return err
41597				}
41598				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41599			}
41600
41601		case "transferDate":
41602			if value != nil {
41603				jtv, ok := value.(json.Number)
41604				if !ok {
41605					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41606				}
41607				f64, err := jtv.Float64()
41608				if err != nil {
41609					return err
41610				}
41611				sv.TransferDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41612			}
41613
41614		case "transferMessage":
41615			if value != nil {
41616				jtv, ok := value.(string)
41617				if !ok {
41618					return fmt.Errorf("expected Message to be of type string, got %T instead", value)
41619				}
41620				sv.TransferMessage = ptr.String(jtv)
41621			}
41622
41623		case "transferredTo":
41624			if value != nil {
41625				jtv, ok := value.(string)
41626				if !ok {
41627					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
41628				}
41629				sv.TransferredTo = ptr.String(jtv)
41630			}
41631
41632		default:
41633			_, _ = key, value
41634
41635		}
41636	}
41637	*v = sv
41638	return nil
41639}
41640
41641func awsRestjson1_deserializeDocumentOutgoingCertificates(v *[]types.OutgoingCertificate, value interface{}) error {
41642	if v == nil {
41643		return fmt.Errorf("unexpected nil of type %T", v)
41644	}
41645	if value == nil {
41646		return nil
41647	}
41648
41649	shape, ok := value.([]interface{})
41650	if !ok {
41651		return fmt.Errorf("unexpected JSON type %v", value)
41652	}
41653
41654	var cv []types.OutgoingCertificate
41655	if *v == nil {
41656		cv = []types.OutgoingCertificate{}
41657	} else {
41658		cv = *v
41659	}
41660
41661	for _, value := range shape {
41662		var col types.OutgoingCertificate
41663		destAddr := &col
41664		if err := awsRestjson1_deserializeDocumentOutgoingCertificate(&destAddr, value); err != nil {
41665			return err
41666		}
41667		col = *destAddr
41668		cv = append(cv, col)
41669
41670	}
41671	*v = cv
41672	return nil
41673}
41674
41675func awsRestjson1_deserializeDocumentPercentiles(v *[]types.PercentPair, value interface{}) error {
41676	if v == nil {
41677		return fmt.Errorf("unexpected nil of type %T", v)
41678	}
41679	if value == nil {
41680		return nil
41681	}
41682
41683	shape, ok := value.([]interface{})
41684	if !ok {
41685		return fmt.Errorf("unexpected JSON type %v", value)
41686	}
41687
41688	var cv []types.PercentPair
41689	if *v == nil {
41690		cv = []types.PercentPair{}
41691	} else {
41692		cv = *v
41693	}
41694
41695	for _, value := range shape {
41696		var col types.PercentPair
41697		destAddr := &col
41698		if err := awsRestjson1_deserializeDocumentPercentPair(&destAddr, value); err != nil {
41699			return err
41700		}
41701		col = *destAddr
41702		cv = append(cv, col)
41703
41704	}
41705	*v = cv
41706	return nil
41707}
41708
41709func awsRestjson1_deserializeDocumentPercentPair(v **types.PercentPair, value interface{}) error {
41710	if v == nil {
41711		return fmt.Errorf("unexpected nil of type %T", v)
41712	}
41713	if value == nil {
41714		return nil
41715	}
41716
41717	shape, ok := value.(map[string]interface{})
41718	if !ok {
41719		return fmt.Errorf("unexpected JSON type %v", value)
41720	}
41721
41722	var sv *types.PercentPair
41723	if *v == nil {
41724		sv = &types.PercentPair{}
41725	} else {
41726		sv = *v
41727	}
41728
41729	for key, value := range shape {
41730		switch key {
41731		case "percent":
41732			if value != nil {
41733				jtv, ok := value.(json.Number)
41734				if !ok {
41735					return fmt.Errorf("expected Percent to be json.Number, got %T instead", value)
41736				}
41737				f64, err := jtv.Float64()
41738				if err != nil {
41739					return err
41740				}
41741				sv.Percent = f64
41742			}
41743
41744		case "value":
41745			if value != nil {
41746				jtv, ok := value.(json.Number)
41747				if !ok {
41748					return fmt.Errorf("expected PercentValue to be json.Number, got %T instead", value)
41749				}
41750				f64, err := jtv.Float64()
41751				if err != nil {
41752					return err
41753				}
41754				sv.Value = f64
41755			}
41756
41757		default:
41758			_, _ = key, value
41759
41760		}
41761	}
41762	*v = sv
41763	return nil
41764}
41765
41766func awsRestjson1_deserializeDocumentPolicies(v *[]types.Policy, value interface{}) error {
41767	if v == nil {
41768		return fmt.Errorf("unexpected nil of type %T", v)
41769	}
41770	if value == nil {
41771		return nil
41772	}
41773
41774	shape, ok := value.([]interface{})
41775	if !ok {
41776		return fmt.Errorf("unexpected JSON type %v", value)
41777	}
41778
41779	var cv []types.Policy
41780	if *v == nil {
41781		cv = []types.Policy{}
41782	} else {
41783		cv = *v
41784	}
41785
41786	for _, value := range shape {
41787		var col types.Policy
41788		destAddr := &col
41789		if err := awsRestjson1_deserializeDocumentPolicy(&destAddr, value); err != nil {
41790			return err
41791		}
41792		col = *destAddr
41793		cv = append(cv, col)
41794
41795	}
41796	*v = cv
41797	return nil
41798}
41799
41800func awsRestjson1_deserializeDocumentPolicy(v **types.Policy, value interface{}) error {
41801	if v == nil {
41802		return fmt.Errorf("unexpected nil of type %T", v)
41803	}
41804	if value == nil {
41805		return nil
41806	}
41807
41808	shape, ok := value.(map[string]interface{})
41809	if !ok {
41810		return fmt.Errorf("unexpected JSON type %v", value)
41811	}
41812
41813	var sv *types.Policy
41814	if *v == nil {
41815		sv = &types.Policy{}
41816	} else {
41817		sv = *v
41818	}
41819
41820	for key, value := range shape {
41821		switch key {
41822		case "policyArn":
41823			if value != nil {
41824				jtv, ok := value.(string)
41825				if !ok {
41826					return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value)
41827				}
41828				sv.PolicyArn = ptr.String(jtv)
41829			}
41830
41831		case "policyName":
41832			if value != nil {
41833				jtv, ok := value.(string)
41834				if !ok {
41835					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
41836				}
41837				sv.PolicyName = ptr.String(jtv)
41838			}
41839
41840		default:
41841			_, _ = key, value
41842
41843		}
41844	}
41845	*v = sv
41846	return nil
41847}
41848
41849func awsRestjson1_deserializeDocumentPolicyDocuments(v *[]string, value interface{}) error {
41850	if v == nil {
41851		return fmt.Errorf("unexpected nil of type %T", v)
41852	}
41853	if value == nil {
41854		return nil
41855	}
41856
41857	shape, ok := value.([]interface{})
41858	if !ok {
41859		return fmt.Errorf("unexpected JSON type %v", value)
41860	}
41861
41862	var cv []string
41863	if *v == nil {
41864		cv = []string{}
41865	} else {
41866		cv = *v
41867	}
41868
41869	for _, value := range shape {
41870		var col string
41871		if value != nil {
41872			jtv, ok := value.(string)
41873			if !ok {
41874				return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value)
41875			}
41876			col = jtv
41877		}
41878		cv = append(cv, col)
41879
41880	}
41881	*v = cv
41882	return nil
41883}
41884
41885func awsRestjson1_deserializeDocumentPolicyTargets(v *[]string, value interface{}) error {
41886	if v == nil {
41887		return fmt.Errorf("unexpected nil of type %T", v)
41888	}
41889	if value == nil {
41890		return nil
41891	}
41892
41893	shape, ok := value.([]interface{})
41894	if !ok {
41895		return fmt.Errorf("unexpected JSON type %v", value)
41896	}
41897
41898	var cv []string
41899	if *v == nil {
41900		cv = []string{}
41901	} else {
41902		cv = *v
41903	}
41904
41905	for _, value := range shape {
41906		var col string
41907		if value != nil {
41908			jtv, ok := value.(string)
41909			if !ok {
41910				return fmt.Errorf("expected PolicyTarget to be of type string, got %T instead", value)
41911			}
41912			col = jtv
41913		}
41914		cv = append(cv, col)
41915
41916	}
41917	*v = cv
41918	return nil
41919}
41920
41921func awsRestjson1_deserializeDocumentPolicyVersion(v **types.PolicyVersion, value interface{}) error {
41922	if v == nil {
41923		return fmt.Errorf("unexpected nil of type %T", v)
41924	}
41925	if value == nil {
41926		return nil
41927	}
41928
41929	shape, ok := value.(map[string]interface{})
41930	if !ok {
41931		return fmt.Errorf("unexpected JSON type %v", value)
41932	}
41933
41934	var sv *types.PolicyVersion
41935	if *v == nil {
41936		sv = &types.PolicyVersion{}
41937	} else {
41938		sv = *v
41939	}
41940
41941	for key, value := range shape {
41942		switch key {
41943		case "createDate":
41944			if value != nil {
41945				jtv, ok := value.(json.Number)
41946				if !ok {
41947					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
41948				}
41949				f64, err := jtv.Float64()
41950				if err != nil {
41951					return err
41952				}
41953				sv.CreateDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
41954			}
41955
41956		case "isDefaultVersion":
41957			if value != nil {
41958				jtv, ok := value.(bool)
41959				if !ok {
41960					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
41961				}
41962				sv.IsDefaultVersion = jtv
41963			}
41964
41965		case "versionId":
41966			if value != nil {
41967				jtv, ok := value.(string)
41968				if !ok {
41969					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
41970				}
41971				sv.VersionId = ptr.String(jtv)
41972			}
41973
41974		default:
41975			_, _ = key, value
41976
41977		}
41978	}
41979	*v = sv
41980	return nil
41981}
41982
41983func awsRestjson1_deserializeDocumentPolicyVersionIdentifier(v **types.PolicyVersionIdentifier, value interface{}) error {
41984	if v == nil {
41985		return fmt.Errorf("unexpected nil of type %T", v)
41986	}
41987	if value == nil {
41988		return nil
41989	}
41990
41991	shape, ok := value.(map[string]interface{})
41992	if !ok {
41993		return fmt.Errorf("unexpected JSON type %v", value)
41994	}
41995
41996	var sv *types.PolicyVersionIdentifier
41997	if *v == nil {
41998		sv = &types.PolicyVersionIdentifier{}
41999	} else {
42000		sv = *v
42001	}
42002
42003	for key, value := range shape {
42004		switch key {
42005		case "policyName":
42006			if value != nil {
42007				jtv, ok := value.(string)
42008				if !ok {
42009					return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value)
42010				}
42011				sv.PolicyName = ptr.String(jtv)
42012			}
42013
42014		case "policyVersionId":
42015			if value != nil {
42016				jtv, ok := value.(string)
42017				if !ok {
42018					return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value)
42019				}
42020				sv.PolicyVersionId = ptr.String(jtv)
42021			}
42022
42023		default:
42024			_, _ = key, value
42025
42026		}
42027	}
42028	*v = sv
42029	return nil
42030}
42031
42032func awsRestjson1_deserializeDocumentPolicyVersions(v *[]types.PolicyVersion, value interface{}) error {
42033	if v == nil {
42034		return fmt.Errorf("unexpected nil of type %T", v)
42035	}
42036	if value == nil {
42037		return nil
42038	}
42039
42040	shape, ok := value.([]interface{})
42041	if !ok {
42042		return fmt.Errorf("unexpected JSON type %v", value)
42043	}
42044
42045	var cv []types.PolicyVersion
42046	if *v == nil {
42047		cv = []types.PolicyVersion{}
42048	} else {
42049		cv = *v
42050	}
42051
42052	for _, value := range shape {
42053		var col types.PolicyVersion
42054		destAddr := &col
42055		if err := awsRestjson1_deserializeDocumentPolicyVersion(&destAddr, value); err != nil {
42056			return err
42057		}
42058		col = *destAddr
42059		cv = append(cv, col)
42060
42061	}
42062	*v = cv
42063	return nil
42064}
42065
42066func awsRestjson1_deserializeDocumentPorts(v *[]int32, value interface{}) error {
42067	if v == nil {
42068		return fmt.Errorf("unexpected nil of type %T", v)
42069	}
42070	if value == nil {
42071		return nil
42072	}
42073
42074	shape, ok := value.([]interface{})
42075	if !ok {
42076		return fmt.Errorf("unexpected JSON type %v", value)
42077	}
42078
42079	var cv []int32
42080	if *v == nil {
42081		cv = []int32{}
42082	} else {
42083		cv = *v
42084	}
42085
42086	for _, value := range shape {
42087		var col int32
42088		if value != nil {
42089			jtv, ok := value.(json.Number)
42090			if !ok {
42091				return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
42092			}
42093			i64, err := jtv.Int64()
42094			if err != nil {
42095				return err
42096			}
42097			col = int32(i64)
42098		}
42099		cv = append(cv, col)
42100
42101	}
42102	*v = cv
42103	return nil
42104}
42105
42106func awsRestjson1_deserializeDocumentPresignedUrlConfig(v **types.PresignedUrlConfig, value interface{}) error {
42107	if v == nil {
42108		return fmt.Errorf("unexpected nil of type %T", v)
42109	}
42110	if value == nil {
42111		return nil
42112	}
42113
42114	shape, ok := value.(map[string]interface{})
42115	if !ok {
42116		return fmt.Errorf("unexpected JSON type %v", value)
42117	}
42118
42119	var sv *types.PresignedUrlConfig
42120	if *v == nil {
42121		sv = &types.PresignedUrlConfig{}
42122	} else {
42123		sv = *v
42124	}
42125
42126	for key, value := range shape {
42127		switch key {
42128		case "expiresInSec":
42129			if value != nil {
42130				jtv, ok := value.(json.Number)
42131				if !ok {
42132					return fmt.Errorf("expected ExpiresInSec to be json.Number, got %T instead", value)
42133				}
42134				i64, err := jtv.Int64()
42135				if err != nil {
42136					return err
42137				}
42138				sv.ExpiresInSec = ptr.Int64(i64)
42139			}
42140
42141		case "roleArn":
42142			if value != nil {
42143				jtv, ok := value.(string)
42144				if !ok {
42145					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
42146				}
42147				sv.RoleArn = ptr.String(jtv)
42148			}
42149
42150		default:
42151			_, _ = key, value
42152
42153		}
42154	}
42155	*v = sv
42156	return nil
42157}
42158
42159func awsRestjson1_deserializeDocumentPrincipals(v *[]string, value interface{}) error {
42160	if v == nil {
42161		return fmt.Errorf("unexpected nil of type %T", v)
42162	}
42163	if value == nil {
42164		return nil
42165	}
42166
42167	shape, ok := value.([]interface{})
42168	if !ok {
42169		return fmt.Errorf("unexpected JSON type %v", value)
42170	}
42171
42172	var cv []string
42173	if *v == nil {
42174		cv = []string{}
42175	} else {
42176		cv = *v
42177	}
42178
42179	for _, value := range shape {
42180		var col string
42181		if value != nil {
42182			jtv, ok := value.(string)
42183			if !ok {
42184				return fmt.Errorf("expected PrincipalArn to be of type string, got %T instead", value)
42185			}
42186			col = jtv
42187		}
42188		cv = append(cv, col)
42189
42190	}
42191	*v = cv
42192	return nil
42193}
42194
42195func awsRestjson1_deserializeDocumentProcessingTargetNameList(v *[]string, value interface{}) error {
42196	if v == nil {
42197		return fmt.Errorf("unexpected nil of type %T", v)
42198	}
42199	if value == nil {
42200		return nil
42201	}
42202
42203	shape, ok := value.([]interface{})
42204	if !ok {
42205		return fmt.Errorf("unexpected JSON type %v", value)
42206	}
42207
42208	var cv []string
42209	if *v == nil {
42210		cv = []string{}
42211	} else {
42212		cv = *v
42213	}
42214
42215	for _, value := range shape {
42216		var col string
42217		if value != nil {
42218			jtv, ok := value.(string)
42219			if !ok {
42220				return fmt.Errorf("expected ProcessingTargetName to be of type string, got %T instead", value)
42221			}
42222			col = jtv
42223		}
42224		cv = append(cv, col)
42225
42226	}
42227	*v = cv
42228	return nil
42229}
42230
42231func awsRestjson1_deserializeDocumentProtocols(v *[]types.Protocol, value interface{}) error {
42232	if v == nil {
42233		return fmt.Errorf("unexpected nil of type %T", v)
42234	}
42235	if value == nil {
42236		return nil
42237	}
42238
42239	shape, ok := value.([]interface{})
42240	if !ok {
42241		return fmt.Errorf("unexpected JSON type %v", value)
42242	}
42243
42244	var cv []types.Protocol
42245	if *v == nil {
42246		cv = []types.Protocol{}
42247	} else {
42248		cv = *v
42249	}
42250
42251	for _, value := range shape {
42252		var col types.Protocol
42253		if value != nil {
42254			jtv, ok := value.(string)
42255			if !ok {
42256				return fmt.Errorf("expected Protocol to be of type string, got %T instead", value)
42257			}
42258			col = types.Protocol(jtv)
42259		}
42260		cv = append(cv, col)
42261
42262	}
42263	*v = cv
42264	return nil
42265}
42266
42267func awsRestjson1_deserializeDocumentProvisioningHook(v **types.ProvisioningHook, value interface{}) error {
42268	if v == nil {
42269		return fmt.Errorf("unexpected nil of type %T", v)
42270	}
42271	if value == nil {
42272		return nil
42273	}
42274
42275	shape, ok := value.(map[string]interface{})
42276	if !ok {
42277		return fmt.Errorf("unexpected JSON type %v", value)
42278	}
42279
42280	var sv *types.ProvisioningHook
42281	if *v == nil {
42282		sv = &types.ProvisioningHook{}
42283	} else {
42284		sv = *v
42285	}
42286
42287	for key, value := range shape {
42288		switch key {
42289		case "payloadVersion":
42290			if value != nil {
42291				jtv, ok := value.(string)
42292				if !ok {
42293					return fmt.Errorf("expected PayloadVersion to be of type string, got %T instead", value)
42294				}
42295				sv.PayloadVersion = ptr.String(jtv)
42296			}
42297
42298		case "targetArn":
42299			if value != nil {
42300				jtv, ok := value.(string)
42301				if !ok {
42302					return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value)
42303				}
42304				sv.TargetArn = ptr.String(jtv)
42305			}
42306
42307		default:
42308			_, _ = key, value
42309
42310		}
42311	}
42312	*v = sv
42313	return nil
42314}
42315
42316func awsRestjson1_deserializeDocumentProvisioningTemplateListing(v *[]types.ProvisioningTemplateSummary, value interface{}) error {
42317	if v == nil {
42318		return fmt.Errorf("unexpected nil of type %T", v)
42319	}
42320	if value == nil {
42321		return nil
42322	}
42323
42324	shape, ok := value.([]interface{})
42325	if !ok {
42326		return fmt.Errorf("unexpected JSON type %v", value)
42327	}
42328
42329	var cv []types.ProvisioningTemplateSummary
42330	if *v == nil {
42331		cv = []types.ProvisioningTemplateSummary{}
42332	} else {
42333		cv = *v
42334	}
42335
42336	for _, value := range shape {
42337		var col types.ProvisioningTemplateSummary
42338		destAddr := &col
42339		if err := awsRestjson1_deserializeDocumentProvisioningTemplateSummary(&destAddr, value); err != nil {
42340			return err
42341		}
42342		col = *destAddr
42343		cv = append(cv, col)
42344
42345	}
42346	*v = cv
42347	return nil
42348}
42349
42350func awsRestjson1_deserializeDocumentProvisioningTemplateSummary(v **types.ProvisioningTemplateSummary, value interface{}) error {
42351	if v == nil {
42352		return fmt.Errorf("unexpected nil of type %T", v)
42353	}
42354	if value == nil {
42355		return nil
42356	}
42357
42358	shape, ok := value.(map[string]interface{})
42359	if !ok {
42360		return fmt.Errorf("unexpected JSON type %v", value)
42361	}
42362
42363	var sv *types.ProvisioningTemplateSummary
42364	if *v == nil {
42365		sv = &types.ProvisioningTemplateSummary{}
42366	} else {
42367		sv = *v
42368	}
42369
42370	for key, value := range shape {
42371		switch key {
42372		case "creationDate":
42373			if value != nil {
42374				jtv, ok := value.(json.Number)
42375				if !ok {
42376					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
42377				}
42378				f64, err := jtv.Float64()
42379				if err != nil {
42380					return err
42381				}
42382				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
42383			}
42384
42385		case "description":
42386			if value != nil {
42387				jtv, ok := value.(string)
42388				if !ok {
42389					return fmt.Errorf("expected TemplateDescription to be of type string, got %T instead", value)
42390				}
42391				sv.Description = ptr.String(jtv)
42392			}
42393
42394		case "enabled":
42395			if value != nil {
42396				jtv, ok := value.(bool)
42397				if !ok {
42398					return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
42399				}
42400				sv.Enabled = jtv
42401			}
42402
42403		case "lastModifiedDate":
42404			if value != nil {
42405				jtv, ok := value.(json.Number)
42406				if !ok {
42407					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
42408				}
42409				f64, err := jtv.Float64()
42410				if err != nil {
42411					return err
42412				}
42413				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
42414			}
42415
42416		case "templateArn":
42417			if value != nil {
42418				jtv, ok := value.(string)
42419				if !ok {
42420					return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value)
42421				}
42422				sv.TemplateArn = ptr.String(jtv)
42423			}
42424
42425		case "templateName":
42426			if value != nil {
42427				jtv, ok := value.(string)
42428				if !ok {
42429					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
42430				}
42431				sv.TemplateName = ptr.String(jtv)
42432			}
42433
42434		default:
42435			_, _ = key, value
42436
42437		}
42438	}
42439	*v = sv
42440	return nil
42441}
42442
42443func awsRestjson1_deserializeDocumentProvisioningTemplateVersionListing(v *[]types.ProvisioningTemplateVersionSummary, value interface{}) error {
42444	if v == nil {
42445		return fmt.Errorf("unexpected nil of type %T", v)
42446	}
42447	if value == nil {
42448		return nil
42449	}
42450
42451	shape, ok := value.([]interface{})
42452	if !ok {
42453		return fmt.Errorf("unexpected JSON type %v", value)
42454	}
42455
42456	var cv []types.ProvisioningTemplateVersionSummary
42457	if *v == nil {
42458		cv = []types.ProvisioningTemplateVersionSummary{}
42459	} else {
42460		cv = *v
42461	}
42462
42463	for _, value := range shape {
42464		var col types.ProvisioningTemplateVersionSummary
42465		destAddr := &col
42466		if err := awsRestjson1_deserializeDocumentProvisioningTemplateVersionSummary(&destAddr, value); err != nil {
42467			return err
42468		}
42469		col = *destAddr
42470		cv = append(cv, col)
42471
42472	}
42473	*v = cv
42474	return nil
42475}
42476
42477func awsRestjson1_deserializeDocumentProvisioningTemplateVersionSummary(v **types.ProvisioningTemplateVersionSummary, value interface{}) error {
42478	if v == nil {
42479		return fmt.Errorf("unexpected nil of type %T", v)
42480	}
42481	if value == nil {
42482		return nil
42483	}
42484
42485	shape, ok := value.(map[string]interface{})
42486	if !ok {
42487		return fmt.Errorf("unexpected JSON type %v", value)
42488	}
42489
42490	var sv *types.ProvisioningTemplateVersionSummary
42491	if *v == nil {
42492		sv = &types.ProvisioningTemplateVersionSummary{}
42493	} else {
42494		sv = *v
42495	}
42496
42497	for key, value := range shape {
42498		switch key {
42499		case "creationDate":
42500			if value != nil {
42501				jtv, ok := value.(json.Number)
42502				if !ok {
42503					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
42504				}
42505				f64, err := jtv.Float64()
42506				if err != nil {
42507					return err
42508				}
42509				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
42510			}
42511
42512		case "isDefaultVersion":
42513			if value != nil {
42514				jtv, ok := value.(bool)
42515				if !ok {
42516					return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value)
42517				}
42518				sv.IsDefaultVersion = jtv
42519			}
42520
42521		case "versionId":
42522			if value != nil {
42523				jtv, ok := value.(json.Number)
42524				if !ok {
42525					return fmt.Errorf("expected TemplateVersionId to be json.Number, got %T instead", value)
42526				}
42527				i64, err := jtv.Int64()
42528				if err != nil {
42529					return err
42530				}
42531				sv.VersionId = ptr.Int32(int32(i64))
42532			}
42533
42534		default:
42535			_, _ = key, value
42536
42537		}
42538	}
42539	*v = sv
42540	return nil
42541}
42542
42543func awsRestjson1_deserializeDocumentPublicKeyMap(v *map[string]string, value interface{}) error {
42544	if v == nil {
42545		return fmt.Errorf("unexpected nil of type %T", v)
42546	}
42547	if value == nil {
42548		return nil
42549	}
42550
42551	shape, ok := value.(map[string]interface{})
42552	if !ok {
42553		return fmt.Errorf("unexpected JSON type %v", value)
42554	}
42555
42556	var mv map[string]string
42557	if *v == nil {
42558		mv = map[string]string{}
42559	} else {
42560		mv = *v
42561	}
42562
42563	for key, value := range shape {
42564		var parsedVal string
42565		if value != nil {
42566			jtv, ok := value.(string)
42567			if !ok {
42568				return fmt.Errorf("expected KeyValue to be of type string, got %T instead", value)
42569			}
42570			parsedVal = jtv
42571		}
42572		mv[key] = parsedVal
42573
42574	}
42575	*v = mv
42576	return nil
42577}
42578
42579func awsRestjson1_deserializeDocumentPublishFindingToSnsParams(v **types.PublishFindingToSnsParams, value interface{}) error {
42580	if v == nil {
42581		return fmt.Errorf("unexpected nil of type %T", v)
42582	}
42583	if value == nil {
42584		return nil
42585	}
42586
42587	shape, ok := value.(map[string]interface{})
42588	if !ok {
42589		return fmt.Errorf("unexpected JSON type %v", value)
42590	}
42591
42592	var sv *types.PublishFindingToSnsParams
42593	if *v == nil {
42594		sv = &types.PublishFindingToSnsParams{}
42595	} else {
42596		sv = *v
42597	}
42598
42599	for key, value := range shape {
42600		switch key {
42601		case "topicArn":
42602			if value != nil {
42603				jtv, ok := value.(string)
42604				if !ok {
42605					return fmt.Errorf("expected SnsTopicArn to be of type string, got %T instead", value)
42606				}
42607				sv.TopicArn = ptr.String(jtv)
42608			}
42609
42610		default:
42611			_, _ = key, value
42612
42613		}
42614	}
42615	*v = sv
42616	return nil
42617}
42618
42619func awsRestjson1_deserializeDocumentPutAssetPropertyValueEntry(v **types.PutAssetPropertyValueEntry, value interface{}) error {
42620	if v == nil {
42621		return fmt.Errorf("unexpected nil of type %T", v)
42622	}
42623	if value == nil {
42624		return nil
42625	}
42626
42627	shape, ok := value.(map[string]interface{})
42628	if !ok {
42629		return fmt.Errorf("unexpected JSON type %v", value)
42630	}
42631
42632	var sv *types.PutAssetPropertyValueEntry
42633	if *v == nil {
42634		sv = &types.PutAssetPropertyValueEntry{}
42635	} else {
42636		sv = *v
42637	}
42638
42639	for key, value := range shape {
42640		switch key {
42641		case "assetId":
42642			if value != nil {
42643				jtv, ok := value.(string)
42644				if !ok {
42645					return fmt.Errorf("expected AssetId to be of type string, got %T instead", value)
42646				}
42647				sv.AssetId = ptr.String(jtv)
42648			}
42649
42650		case "entryId":
42651			if value != nil {
42652				jtv, ok := value.(string)
42653				if !ok {
42654					return fmt.Errorf("expected AssetPropertyEntryId to be of type string, got %T instead", value)
42655				}
42656				sv.EntryId = ptr.String(jtv)
42657			}
42658
42659		case "propertyAlias":
42660			if value != nil {
42661				jtv, ok := value.(string)
42662				if !ok {
42663					return fmt.Errorf("expected AssetPropertyAlias to be of type string, got %T instead", value)
42664				}
42665				sv.PropertyAlias = ptr.String(jtv)
42666			}
42667
42668		case "propertyId":
42669			if value != nil {
42670				jtv, ok := value.(string)
42671				if !ok {
42672					return fmt.Errorf("expected AssetPropertyId to be of type string, got %T instead", value)
42673				}
42674				sv.PropertyId = ptr.String(jtv)
42675			}
42676
42677		case "propertyValues":
42678			if err := awsRestjson1_deserializeDocumentAssetPropertyValueList(&sv.PropertyValues, value); err != nil {
42679				return err
42680			}
42681
42682		default:
42683			_, _ = key, value
42684
42685		}
42686	}
42687	*v = sv
42688	return nil
42689}
42690
42691func awsRestjson1_deserializeDocumentPutAssetPropertyValueEntryList(v *[]types.PutAssetPropertyValueEntry, value interface{}) error {
42692	if v == nil {
42693		return fmt.Errorf("unexpected nil of type %T", v)
42694	}
42695	if value == nil {
42696		return nil
42697	}
42698
42699	shape, ok := value.([]interface{})
42700	if !ok {
42701		return fmt.Errorf("unexpected JSON type %v", value)
42702	}
42703
42704	var cv []types.PutAssetPropertyValueEntry
42705	if *v == nil {
42706		cv = []types.PutAssetPropertyValueEntry{}
42707	} else {
42708		cv = *v
42709	}
42710
42711	for _, value := range shape {
42712		var col types.PutAssetPropertyValueEntry
42713		destAddr := &col
42714		if err := awsRestjson1_deserializeDocumentPutAssetPropertyValueEntry(&destAddr, value); err != nil {
42715			return err
42716		}
42717		col = *destAddr
42718		cv = append(cv, col)
42719
42720	}
42721	*v = cv
42722	return nil
42723}
42724
42725func awsRestjson1_deserializeDocumentPutItemInput(v **types.PutItemInput, value interface{}) error {
42726	if v == nil {
42727		return fmt.Errorf("unexpected nil of type %T", v)
42728	}
42729	if value == nil {
42730		return nil
42731	}
42732
42733	shape, ok := value.(map[string]interface{})
42734	if !ok {
42735		return fmt.Errorf("unexpected JSON type %v", value)
42736	}
42737
42738	var sv *types.PutItemInput
42739	if *v == nil {
42740		sv = &types.PutItemInput{}
42741	} else {
42742		sv = *v
42743	}
42744
42745	for key, value := range shape {
42746		switch key {
42747		case "tableName":
42748			if value != nil {
42749				jtv, ok := value.(string)
42750				if !ok {
42751					return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
42752				}
42753				sv.TableName = ptr.String(jtv)
42754			}
42755
42756		default:
42757			_, _ = key, value
42758
42759		}
42760	}
42761	*v = sv
42762	return nil
42763}
42764
42765func awsRestjson1_deserializeDocumentRateIncreaseCriteria(v **types.RateIncreaseCriteria, value interface{}) error {
42766	if v == nil {
42767		return fmt.Errorf("unexpected nil of type %T", v)
42768	}
42769	if value == nil {
42770		return nil
42771	}
42772
42773	shape, ok := value.(map[string]interface{})
42774	if !ok {
42775		return fmt.Errorf("unexpected JSON type %v", value)
42776	}
42777
42778	var sv *types.RateIncreaseCriteria
42779	if *v == nil {
42780		sv = &types.RateIncreaseCriteria{}
42781	} else {
42782		sv = *v
42783	}
42784
42785	for key, value := range shape {
42786		switch key {
42787		case "numberOfNotifiedThings":
42788			if value != nil {
42789				jtv, ok := value.(json.Number)
42790				if !ok {
42791					return fmt.Errorf("expected NumberOfThings to be json.Number, got %T instead", value)
42792				}
42793				i64, err := jtv.Int64()
42794				if err != nil {
42795					return err
42796				}
42797				sv.NumberOfNotifiedThings = ptr.Int32(int32(i64))
42798			}
42799
42800		case "numberOfSucceededThings":
42801			if value != nil {
42802				jtv, ok := value.(json.Number)
42803				if !ok {
42804					return fmt.Errorf("expected NumberOfThings to be json.Number, got %T instead", value)
42805				}
42806				i64, err := jtv.Int64()
42807				if err != nil {
42808					return err
42809				}
42810				sv.NumberOfSucceededThings = ptr.Int32(int32(i64))
42811			}
42812
42813		default:
42814			_, _ = key, value
42815
42816		}
42817	}
42818	*v = sv
42819	return nil
42820}
42821
42822func awsRestjson1_deserializeDocumentReasonForNonComplianceCodes(v *[]string, value interface{}) error {
42823	if v == nil {
42824		return fmt.Errorf("unexpected nil of type %T", v)
42825	}
42826	if value == nil {
42827		return nil
42828	}
42829
42830	shape, ok := value.([]interface{})
42831	if !ok {
42832		return fmt.Errorf("unexpected JSON type %v", value)
42833	}
42834
42835	var cv []string
42836	if *v == nil {
42837		cv = []string{}
42838	} else {
42839		cv = *v
42840	}
42841
42842	for _, value := range shape {
42843		var col string
42844		if value != nil {
42845			jtv, ok := value.(string)
42846			if !ok {
42847				return fmt.Errorf("expected ReasonForNonComplianceCode to be of type string, got %T instead", value)
42848			}
42849			col = jtv
42850		}
42851		cv = append(cv, col)
42852
42853	}
42854	*v = cv
42855	return nil
42856}
42857
42858func awsRestjson1_deserializeDocumentRegistrationCodeValidationException(v **types.RegistrationCodeValidationException, value interface{}) error {
42859	if v == nil {
42860		return fmt.Errorf("unexpected nil of type %T", v)
42861	}
42862	if value == nil {
42863		return nil
42864	}
42865
42866	shape, ok := value.(map[string]interface{})
42867	if !ok {
42868		return fmt.Errorf("unexpected JSON type %v", value)
42869	}
42870
42871	var sv *types.RegistrationCodeValidationException
42872	if *v == nil {
42873		sv = &types.RegistrationCodeValidationException{}
42874	} else {
42875		sv = *v
42876	}
42877
42878	for key, value := range shape {
42879		switch key {
42880		case "message":
42881			if value != nil {
42882				jtv, ok := value.(string)
42883				if !ok {
42884					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
42885				}
42886				sv.Message = ptr.String(jtv)
42887			}
42888
42889		default:
42890			_, _ = key, value
42891
42892		}
42893	}
42894	*v = sv
42895	return nil
42896}
42897
42898func awsRestjson1_deserializeDocumentRegistrationConfig(v **types.RegistrationConfig, value interface{}) error {
42899	if v == nil {
42900		return fmt.Errorf("unexpected nil of type %T", v)
42901	}
42902	if value == nil {
42903		return nil
42904	}
42905
42906	shape, ok := value.(map[string]interface{})
42907	if !ok {
42908		return fmt.Errorf("unexpected JSON type %v", value)
42909	}
42910
42911	var sv *types.RegistrationConfig
42912	if *v == nil {
42913		sv = &types.RegistrationConfig{}
42914	} else {
42915		sv = *v
42916	}
42917
42918	for key, value := range shape {
42919		switch key {
42920		case "roleArn":
42921			if value != nil {
42922				jtv, ok := value.(string)
42923				if !ok {
42924					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
42925				}
42926				sv.RoleArn = ptr.String(jtv)
42927			}
42928
42929		case "templateBody":
42930			if value != nil {
42931				jtv, ok := value.(string)
42932				if !ok {
42933					return fmt.Errorf("expected TemplateBody to be of type string, got %T instead", value)
42934				}
42935				sv.TemplateBody = ptr.String(jtv)
42936			}
42937
42938		default:
42939			_, _ = key, value
42940
42941		}
42942	}
42943	*v = sv
42944	return nil
42945}
42946
42947func awsRestjson1_deserializeDocumentRelatedResource(v **types.RelatedResource, value interface{}) error {
42948	if v == nil {
42949		return fmt.Errorf("unexpected nil of type %T", v)
42950	}
42951	if value == nil {
42952		return nil
42953	}
42954
42955	shape, ok := value.(map[string]interface{})
42956	if !ok {
42957		return fmt.Errorf("unexpected JSON type %v", value)
42958	}
42959
42960	var sv *types.RelatedResource
42961	if *v == nil {
42962		sv = &types.RelatedResource{}
42963	} else {
42964		sv = *v
42965	}
42966
42967	for key, value := range shape {
42968		switch key {
42969		case "additionalInfo":
42970			if err := awsRestjson1_deserializeDocumentStringMap(&sv.AdditionalInfo, value); err != nil {
42971				return err
42972			}
42973
42974		case "resourceIdentifier":
42975			if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil {
42976				return err
42977			}
42978
42979		case "resourceType":
42980			if value != nil {
42981				jtv, ok := value.(string)
42982				if !ok {
42983					return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
42984				}
42985				sv.ResourceType = types.ResourceType(jtv)
42986			}
42987
42988		default:
42989			_, _ = key, value
42990
42991		}
42992	}
42993	*v = sv
42994	return nil
42995}
42996
42997func awsRestjson1_deserializeDocumentRelatedResources(v *[]types.RelatedResource, value interface{}) error {
42998	if v == nil {
42999		return fmt.Errorf("unexpected nil of type %T", v)
43000	}
43001	if value == nil {
43002		return nil
43003	}
43004
43005	shape, ok := value.([]interface{})
43006	if !ok {
43007		return fmt.Errorf("unexpected JSON type %v", value)
43008	}
43009
43010	var cv []types.RelatedResource
43011	if *v == nil {
43012		cv = []types.RelatedResource{}
43013	} else {
43014		cv = *v
43015	}
43016
43017	for _, value := range shape {
43018		var col types.RelatedResource
43019		destAddr := &col
43020		if err := awsRestjson1_deserializeDocumentRelatedResource(&destAddr, value); err != nil {
43021			return err
43022		}
43023		col = *destAddr
43024		cv = append(cv, col)
43025
43026	}
43027	*v = cv
43028	return nil
43029}
43030
43031func awsRestjson1_deserializeDocumentReplaceDefaultPolicyVersionParams(v **types.ReplaceDefaultPolicyVersionParams, value interface{}) error {
43032	if v == nil {
43033		return fmt.Errorf("unexpected nil of type %T", v)
43034	}
43035	if value == nil {
43036		return nil
43037	}
43038
43039	shape, ok := value.(map[string]interface{})
43040	if !ok {
43041		return fmt.Errorf("unexpected JSON type %v", value)
43042	}
43043
43044	var sv *types.ReplaceDefaultPolicyVersionParams
43045	if *v == nil {
43046		sv = &types.ReplaceDefaultPolicyVersionParams{}
43047	} else {
43048		sv = *v
43049	}
43050
43051	for key, value := range shape {
43052		switch key {
43053		case "templateName":
43054			if value != nil {
43055				jtv, ok := value.(string)
43056				if !ok {
43057					return fmt.Errorf("expected PolicyTemplateName to be of type string, got %T instead", value)
43058				}
43059				sv.TemplateName = types.PolicyTemplateName(jtv)
43060			}
43061
43062		default:
43063			_, _ = key, value
43064
43065		}
43066	}
43067	*v = sv
43068	return nil
43069}
43070
43071func awsRestjson1_deserializeDocumentRepublishAction(v **types.RepublishAction, value interface{}) error {
43072	if v == nil {
43073		return fmt.Errorf("unexpected nil of type %T", v)
43074	}
43075	if value == nil {
43076		return nil
43077	}
43078
43079	shape, ok := value.(map[string]interface{})
43080	if !ok {
43081		return fmt.Errorf("unexpected JSON type %v", value)
43082	}
43083
43084	var sv *types.RepublishAction
43085	if *v == nil {
43086		sv = &types.RepublishAction{}
43087	} else {
43088		sv = *v
43089	}
43090
43091	for key, value := range shape {
43092		switch key {
43093		case "qos":
43094			if value != nil {
43095				jtv, ok := value.(json.Number)
43096				if !ok {
43097					return fmt.Errorf("expected Qos to be json.Number, got %T instead", value)
43098				}
43099				i64, err := jtv.Int64()
43100				if err != nil {
43101					return err
43102				}
43103				sv.Qos = ptr.Int32(int32(i64))
43104			}
43105
43106		case "roleArn":
43107			if value != nil {
43108				jtv, ok := value.(string)
43109				if !ok {
43110					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
43111				}
43112				sv.RoleArn = ptr.String(jtv)
43113			}
43114
43115		case "topic":
43116			if value != nil {
43117				jtv, ok := value.(string)
43118				if !ok {
43119					return fmt.Errorf("expected TopicPattern to be of type string, got %T instead", value)
43120				}
43121				sv.Topic = ptr.String(jtv)
43122			}
43123
43124		default:
43125			_, _ = key, value
43126
43127		}
43128	}
43129	*v = sv
43130	return nil
43131}
43132
43133func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error {
43134	if v == nil {
43135		return fmt.Errorf("unexpected nil of type %T", v)
43136	}
43137	if value == nil {
43138		return nil
43139	}
43140
43141	shape, ok := value.(map[string]interface{})
43142	if !ok {
43143		return fmt.Errorf("unexpected JSON type %v", value)
43144	}
43145
43146	var sv *types.ResourceAlreadyExistsException
43147	if *v == nil {
43148		sv = &types.ResourceAlreadyExistsException{}
43149	} else {
43150		sv = *v
43151	}
43152
43153	for key, value := range shape {
43154		switch key {
43155		case "message":
43156			if value != nil {
43157				jtv, ok := value.(string)
43158				if !ok {
43159					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
43160				}
43161				sv.Message = ptr.String(jtv)
43162			}
43163
43164		case "resourceArn":
43165			if value != nil {
43166				jtv, ok := value.(string)
43167				if !ok {
43168					return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
43169				}
43170				sv.ResourceArn = ptr.String(jtv)
43171			}
43172
43173		case "resourceId":
43174			if value != nil {
43175				jtv, ok := value.(string)
43176				if !ok {
43177					return fmt.Errorf("expected resourceId to be of type string, got %T instead", value)
43178				}
43179				sv.ResourceId = ptr.String(jtv)
43180			}
43181
43182		default:
43183			_, _ = key, value
43184
43185		}
43186	}
43187	*v = sv
43188	return nil
43189}
43190
43191func awsRestjson1_deserializeDocumentResourceArns(v *map[string]string, value interface{}) error {
43192	if v == nil {
43193		return fmt.Errorf("unexpected nil of type %T", v)
43194	}
43195	if value == nil {
43196		return nil
43197	}
43198
43199	shape, ok := value.(map[string]interface{})
43200	if !ok {
43201		return fmt.Errorf("unexpected JSON type %v", value)
43202	}
43203
43204	var mv map[string]string
43205	if *v == nil {
43206		mv = map[string]string{}
43207	} else {
43208		mv = *v
43209	}
43210
43211	for key, value := range shape {
43212		var parsedVal string
43213		if value != nil {
43214			jtv, ok := value.(string)
43215			if !ok {
43216				return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
43217			}
43218			parsedVal = jtv
43219		}
43220		mv[key] = parsedVal
43221
43222	}
43223	*v = mv
43224	return nil
43225}
43226
43227func awsRestjson1_deserializeDocumentResourceIdentifier(v **types.ResourceIdentifier, value interface{}) error {
43228	if v == nil {
43229		return fmt.Errorf("unexpected nil of type %T", v)
43230	}
43231	if value == nil {
43232		return nil
43233	}
43234
43235	shape, ok := value.(map[string]interface{})
43236	if !ok {
43237		return fmt.Errorf("unexpected JSON type %v", value)
43238	}
43239
43240	var sv *types.ResourceIdentifier
43241	if *v == nil {
43242		sv = &types.ResourceIdentifier{}
43243	} else {
43244		sv = *v
43245	}
43246
43247	for key, value := range shape {
43248		switch key {
43249		case "account":
43250			if value != nil {
43251				jtv, ok := value.(string)
43252				if !ok {
43253					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
43254				}
43255				sv.Account = ptr.String(jtv)
43256			}
43257
43258		case "caCertificateId":
43259			if value != nil {
43260				jtv, ok := value.(string)
43261				if !ok {
43262					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
43263				}
43264				sv.CaCertificateId = ptr.String(jtv)
43265			}
43266
43267		case "clientId":
43268			if value != nil {
43269				jtv, ok := value.(string)
43270				if !ok {
43271					return fmt.Errorf("expected ClientId to be of type string, got %T instead", value)
43272				}
43273				sv.ClientId = ptr.String(jtv)
43274			}
43275
43276		case "cognitoIdentityPoolId":
43277			if value != nil {
43278				jtv, ok := value.(string)
43279				if !ok {
43280					return fmt.Errorf("expected CognitoIdentityPoolId to be of type string, got %T instead", value)
43281				}
43282				sv.CognitoIdentityPoolId = ptr.String(jtv)
43283			}
43284
43285		case "deviceCertificateId":
43286			if value != nil {
43287				jtv, ok := value.(string)
43288				if !ok {
43289					return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value)
43290				}
43291				sv.DeviceCertificateId = ptr.String(jtv)
43292			}
43293
43294		case "iamRoleArn":
43295			if value != nil {
43296				jtv, ok := value.(string)
43297				if !ok {
43298					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
43299				}
43300				sv.IamRoleArn = ptr.String(jtv)
43301			}
43302
43303		case "policyVersionIdentifier":
43304			if err := awsRestjson1_deserializeDocumentPolicyVersionIdentifier(&sv.PolicyVersionIdentifier, value); err != nil {
43305				return err
43306			}
43307
43308		case "roleAliasArn":
43309			if value != nil {
43310				jtv, ok := value.(string)
43311				if !ok {
43312					return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value)
43313				}
43314				sv.RoleAliasArn = ptr.String(jtv)
43315			}
43316
43317		default:
43318			_, _ = key, value
43319
43320		}
43321	}
43322	*v = sv
43323	return nil
43324}
43325
43326func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
43327	if v == nil {
43328		return fmt.Errorf("unexpected nil of type %T", v)
43329	}
43330	if value == nil {
43331		return nil
43332	}
43333
43334	shape, ok := value.(map[string]interface{})
43335	if !ok {
43336		return fmt.Errorf("unexpected JSON type %v", value)
43337	}
43338
43339	var sv *types.ResourceNotFoundException
43340	if *v == nil {
43341		sv = &types.ResourceNotFoundException{}
43342	} else {
43343		sv = *v
43344	}
43345
43346	for key, value := range shape {
43347		switch key {
43348		case "message":
43349			if value != nil {
43350				jtv, ok := value.(string)
43351				if !ok {
43352					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
43353				}
43354				sv.Message = ptr.String(jtv)
43355			}
43356
43357		default:
43358			_, _ = key, value
43359
43360		}
43361	}
43362	*v = sv
43363	return nil
43364}
43365
43366func awsRestjson1_deserializeDocumentResourceRegistrationFailureException(v **types.ResourceRegistrationFailureException, value interface{}) error {
43367	if v == nil {
43368		return fmt.Errorf("unexpected nil of type %T", v)
43369	}
43370	if value == nil {
43371		return nil
43372	}
43373
43374	shape, ok := value.(map[string]interface{})
43375	if !ok {
43376		return fmt.Errorf("unexpected JSON type %v", value)
43377	}
43378
43379	var sv *types.ResourceRegistrationFailureException
43380	if *v == nil {
43381		sv = &types.ResourceRegistrationFailureException{}
43382	} else {
43383		sv = *v
43384	}
43385
43386	for key, value := range shape {
43387		switch key {
43388		case "message":
43389			if value != nil {
43390				jtv, ok := value.(string)
43391				if !ok {
43392					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
43393				}
43394				sv.Message = ptr.String(jtv)
43395			}
43396
43397		default:
43398			_, _ = key, value
43399
43400		}
43401	}
43402	*v = sv
43403	return nil
43404}
43405
43406func awsRestjson1_deserializeDocumentResources(v *[]string, value interface{}) error {
43407	if v == nil {
43408		return fmt.Errorf("unexpected nil of type %T", v)
43409	}
43410	if value == nil {
43411		return nil
43412	}
43413
43414	shape, ok := value.([]interface{})
43415	if !ok {
43416		return fmt.Errorf("unexpected JSON type %v", value)
43417	}
43418
43419	var cv []string
43420	if *v == nil {
43421		cv = []string{}
43422	} else {
43423		cv = *v
43424	}
43425
43426	for _, value := range shape {
43427		var col string
43428		if value != nil {
43429			jtv, ok := value.(string)
43430			if !ok {
43431				return fmt.Errorf("expected Resource to be of type string, got %T instead", value)
43432			}
43433			col = jtv
43434		}
43435		cv = append(cv, col)
43436
43437	}
43438	*v = cv
43439	return nil
43440}
43441
43442func awsRestjson1_deserializeDocumentRoleAliasDescription(v **types.RoleAliasDescription, value interface{}) error {
43443	if v == nil {
43444		return fmt.Errorf("unexpected nil of type %T", v)
43445	}
43446	if value == nil {
43447		return nil
43448	}
43449
43450	shape, ok := value.(map[string]interface{})
43451	if !ok {
43452		return fmt.Errorf("unexpected JSON type %v", value)
43453	}
43454
43455	var sv *types.RoleAliasDescription
43456	if *v == nil {
43457		sv = &types.RoleAliasDescription{}
43458	} else {
43459		sv = *v
43460	}
43461
43462	for key, value := range shape {
43463		switch key {
43464		case "creationDate":
43465			if value != nil {
43466				jtv, ok := value.(json.Number)
43467				if !ok {
43468					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
43469				}
43470				f64, err := jtv.Float64()
43471				if err != nil {
43472					return err
43473				}
43474				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
43475			}
43476
43477		case "credentialDurationSeconds":
43478			if value != nil {
43479				jtv, ok := value.(json.Number)
43480				if !ok {
43481					return fmt.Errorf("expected CredentialDurationSeconds to be json.Number, got %T instead", value)
43482				}
43483				i64, err := jtv.Int64()
43484				if err != nil {
43485					return err
43486				}
43487				sv.CredentialDurationSeconds = ptr.Int32(int32(i64))
43488			}
43489
43490		case "lastModifiedDate":
43491			if value != nil {
43492				jtv, ok := value.(json.Number)
43493				if !ok {
43494					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
43495				}
43496				f64, err := jtv.Float64()
43497				if err != nil {
43498					return err
43499				}
43500				sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
43501			}
43502
43503		case "owner":
43504			if value != nil {
43505				jtv, ok := value.(string)
43506				if !ok {
43507					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
43508				}
43509				sv.Owner = ptr.String(jtv)
43510			}
43511
43512		case "roleAlias":
43513			if value != nil {
43514				jtv, ok := value.(string)
43515				if !ok {
43516					return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value)
43517				}
43518				sv.RoleAlias = ptr.String(jtv)
43519			}
43520
43521		case "roleAliasArn":
43522			if value != nil {
43523				jtv, ok := value.(string)
43524				if !ok {
43525					return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value)
43526				}
43527				sv.RoleAliasArn = ptr.String(jtv)
43528			}
43529
43530		case "roleArn":
43531			if value != nil {
43532				jtv, ok := value.(string)
43533				if !ok {
43534					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
43535				}
43536				sv.RoleArn = ptr.String(jtv)
43537			}
43538
43539		default:
43540			_, _ = key, value
43541
43542		}
43543	}
43544	*v = sv
43545	return nil
43546}
43547
43548func awsRestjson1_deserializeDocumentRoleAliases(v *[]string, value interface{}) error {
43549	if v == nil {
43550		return fmt.Errorf("unexpected nil of type %T", v)
43551	}
43552	if value == nil {
43553		return nil
43554	}
43555
43556	shape, ok := value.([]interface{})
43557	if !ok {
43558		return fmt.Errorf("unexpected JSON type %v", value)
43559	}
43560
43561	var cv []string
43562	if *v == nil {
43563		cv = []string{}
43564	} else {
43565		cv = *v
43566	}
43567
43568	for _, value := range shape {
43569		var col string
43570		if value != nil {
43571			jtv, ok := value.(string)
43572			if !ok {
43573				return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value)
43574			}
43575			col = jtv
43576		}
43577		cv = append(cv, col)
43578
43579	}
43580	*v = cv
43581	return nil
43582}
43583
43584func awsRestjson1_deserializeDocumentS3Action(v **types.S3Action, value interface{}) error {
43585	if v == nil {
43586		return fmt.Errorf("unexpected nil of type %T", v)
43587	}
43588	if value == nil {
43589		return nil
43590	}
43591
43592	shape, ok := value.(map[string]interface{})
43593	if !ok {
43594		return fmt.Errorf("unexpected JSON type %v", value)
43595	}
43596
43597	var sv *types.S3Action
43598	if *v == nil {
43599		sv = &types.S3Action{}
43600	} else {
43601		sv = *v
43602	}
43603
43604	for key, value := range shape {
43605		switch key {
43606		case "bucketName":
43607			if value != nil {
43608				jtv, ok := value.(string)
43609				if !ok {
43610					return fmt.Errorf("expected BucketName to be of type string, got %T instead", value)
43611				}
43612				sv.BucketName = ptr.String(jtv)
43613			}
43614
43615		case "cannedAcl":
43616			if value != nil {
43617				jtv, ok := value.(string)
43618				if !ok {
43619					return fmt.Errorf("expected CannedAccessControlList to be of type string, got %T instead", value)
43620				}
43621				sv.CannedAcl = types.CannedAccessControlList(jtv)
43622			}
43623
43624		case "key":
43625			if value != nil {
43626				jtv, ok := value.(string)
43627				if !ok {
43628					return fmt.Errorf("expected Key to be of type string, got %T instead", value)
43629				}
43630				sv.Key = ptr.String(jtv)
43631			}
43632
43633		case "roleArn":
43634			if value != nil {
43635				jtv, ok := value.(string)
43636				if !ok {
43637					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
43638				}
43639				sv.RoleArn = ptr.String(jtv)
43640			}
43641
43642		default:
43643			_, _ = key, value
43644
43645		}
43646	}
43647	*v = sv
43648	return nil
43649}
43650
43651func awsRestjson1_deserializeDocumentS3Destination(v **types.S3Destination, value interface{}) error {
43652	if v == nil {
43653		return fmt.Errorf("unexpected nil of type %T", v)
43654	}
43655	if value == nil {
43656		return nil
43657	}
43658
43659	shape, ok := value.(map[string]interface{})
43660	if !ok {
43661		return fmt.Errorf("unexpected JSON type %v", value)
43662	}
43663
43664	var sv *types.S3Destination
43665	if *v == nil {
43666		sv = &types.S3Destination{}
43667	} else {
43668		sv = *v
43669	}
43670
43671	for key, value := range shape {
43672		switch key {
43673		case "bucket":
43674			if value != nil {
43675				jtv, ok := value.(string)
43676				if !ok {
43677					return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value)
43678				}
43679				sv.Bucket = ptr.String(jtv)
43680			}
43681
43682		case "prefix":
43683			if value != nil {
43684				jtv, ok := value.(string)
43685				if !ok {
43686					return fmt.Errorf("expected Prefix to be of type string, got %T instead", value)
43687				}
43688				sv.Prefix = ptr.String(jtv)
43689			}
43690
43691		default:
43692			_, _ = key, value
43693
43694		}
43695	}
43696	*v = sv
43697	return nil
43698}
43699
43700func awsRestjson1_deserializeDocumentS3FileUrlList(v *[]string, value interface{}) error {
43701	if v == nil {
43702		return fmt.Errorf("unexpected nil of type %T", v)
43703	}
43704	if value == nil {
43705		return nil
43706	}
43707
43708	shape, ok := value.([]interface{})
43709	if !ok {
43710		return fmt.Errorf("unexpected JSON type %v", value)
43711	}
43712
43713	var cv []string
43714	if *v == nil {
43715		cv = []string{}
43716	} else {
43717		cv = *v
43718	}
43719
43720	for _, value := range shape {
43721		var col string
43722		if value != nil {
43723			jtv, ok := value.(string)
43724			if !ok {
43725				return fmt.Errorf("expected S3FileUrl to be of type string, got %T instead", value)
43726			}
43727			col = jtv
43728		}
43729		cv = append(cv, col)
43730
43731	}
43732	*v = cv
43733	return nil
43734}
43735
43736func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error {
43737	if v == nil {
43738		return fmt.Errorf("unexpected nil of type %T", v)
43739	}
43740	if value == nil {
43741		return nil
43742	}
43743
43744	shape, ok := value.(map[string]interface{})
43745	if !ok {
43746		return fmt.Errorf("unexpected JSON type %v", value)
43747	}
43748
43749	var sv *types.S3Location
43750	if *v == nil {
43751		sv = &types.S3Location{}
43752	} else {
43753		sv = *v
43754	}
43755
43756	for key, value := range shape {
43757		switch key {
43758		case "bucket":
43759			if value != nil {
43760				jtv, ok := value.(string)
43761				if !ok {
43762					return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value)
43763				}
43764				sv.Bucket = ptr.String(jtv)
43765			}
43766
43767		case "key":
43768			if value != nil {
43769				jtv, ok := value.(string)
43770				if !ok {
43771					return fmt.Errorf("expected S3Key to be of type string, got %T instead", value)
43772				}
43773				sv.Key = ptr.String(jtv)
43774			}
43775
43776		case "version":
43777			if value != nil {
43778				jtv, ok := value.(string)
43779				if !ok {
43780					return fmt.Errorf("expected S3Version to be of type string, got %T instead", value)
43781				}
43782				sv.Version = ptr.String(jtv)
43783			}
43784
43785		default:
43786			_, _ = key, value
43787
43788		}
43789	}
43790	*v = sv
43791	return nil
43792}
43793
43794func awsRestjson1_deserializeDocumentSalesforceAction(v **types.SalesforceAction, value interface{}) error {
43795	if v == nil {
43796		return fmt.Errorf("unexpected nil of type %T", v)
43797	}
43798	if value == nil {
43799		return nil
43800	}
43801
43802	shape, ok := value.(map[string]interface{})
43803	if !ok {
43804		return fmt.Errorf("unexpected JSON type %v", value)
43805	}
43806
43807	var sv *types.SalesforceAction
43808	if *v == nil {
43809		sv = &types.SalesforceAction{}
43810	} else {
43811		sv = *v
43812	}
43813
43814	for key, value := range shape {
43815		switch key {
43816		case "token":
43817			if value != nil {
43818				jtv, ok := value.(string)
43819				if !ok {
43820					return fmt.Errorf("expected SalesforceToken to be of type string, got %T instead", value)
43821				}
43822				sv.Token = ptr.String(jtv)
43823			}
43824
43825		case "url":
43826			if value != nil {
43827				jtv, ok := value.(string)
43828				if !ok {
43829					return fmt.Errorf("expected SalesforceEndpoint to be of type string, got %T instead", value)
43830				}
43831				sv.Url = ptr.String(jtv)
43832			}
43833
43834		default:
43835			_, _ = key, value
43836
43837		}
43838	}
43839	*v = sv
43840	return nil
43841}
43842
43843func awsRestjson1_deserializeDocumentScheduledAuditMetadata(v **types.ScheduledAuditMetadata, value interface{}) error {
43844	if v == nil {
43845		return fmt.Errorf("unexpected nil of type %T", v)
43846	}
43847	if value == nil {
43848		return nil
43849	}
43850
43851	shape, ok := value.(map[string]interface{})
43852	if !ok {
43853		return fmt.Errorf("unexpected JSON type %v", value)
43854	}
43855
43856	var sv *types.ScheduledAuditMetadata
43857	if *v == nil {
43858		sv = &types.ScheduledAuditMetadata{}
43859	} else {
43860		sv = *v
43861	}
43862
43863	for key, value := range shape {
43864		switch key {
43865		case "dayOfMonth":
43866			if value != nil {
43867				jtv, ok := value.(string)
43868				if !ok {
43869					return fmt.Errorf("expected DayOfMonth to be of type string, got %T instead", value)
43870				}
43871				sv.DayOfMonth = ptr.String(jtv)
43872			}
43873
43874		case "dayOfWeek":
43875			if value != nil {
43876				jtv, ok := value.(string)
43877				if !ok {
43878					return fmt.Errorf("expected DayOfWeek to be of type string, got %T instead", value)
43879				}
43880				sv.DayOfWeek = types.DayOfWeek(jtv)
43881			}
43882
43883		case "frequency":
43884			if value != nil {
43885				jtv, ok := value.(string)
43886				if !ok {
43887					return fmt.Errorf("expected AuditFrequency to be of type string, got %T instead", value)
43888				}
43889				sv.Frequency = types.AuditFrequency(jtv)
43890			}
43891
43892		case "scheduledAuditArn":
43893			if value != nil {
43894				jtv, ok := value.(string)
43895				if !ok {
43896					return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value)
43897				}
43898				sv.ScheduledAuditArn = ptr.String(jtv)
43899			}
43900
43901		case "scheduledAuditName":
43902			if value != nil {
43903				jtv, ok := value.(string)
43904				if !ok {
43905					return fmt.Errorf("expected ScheduledAuditName to be of type string, got %T instead", value)
43906				}
43907				sv.ScheduledAuditName = ptr.String(jtv)
43908			}
43909
43910		default:
43911			_, _ = key, value
43912
43913		}
43914	}
43915	*v = sv
43916	return nil
43917}
43918
43919func awsRestjson1_deserializeDocumentScheduledAuditMetadataList(v *[]types.ScheduledAuditMetadata, value interface{}) error {
43920	if v == nil {
43921		return fmt.Errorf("unexpected nil of type %T", v)
43922	}
43923	if value == nil {
43924		return nil
43925	}
43926
43927	shape, ok := value.([]interface{})
43928	if !ok {
43929		return fmt.Errorf("unexpected JSON type %v", value)
43930	}
43931
43932	var cv []types.ScheduledAuditMetadata
43933	if *v == nil {
43934		cv = []types.ScheduledAuditMetadata{}
43935	} else {
43936		cv = *v
43937	}
43938
43939	for _, value := range shape {
43940		var col types.ScheduledAuditMetadata
43941		destAddr := &col
43942		if err := awsRestjson1_deserializeDocumentScheduledAuditMetadata(&destAddr, value); err != nil {
43943			return err
43944		}
43945		col = *destAddr
43946		cv = append(cv, col)
43947
43948	}
43949	*v = cv
43950	return nil
43951}
43952
43953func awsRestjson1_deserializeDocumentSearchableAttributes(v *[]string, value interface{}) error {
43954	if v == nil {
43955		return fmt.Errorf("unexpected nil of type %T", v)
43956	}
43957	if value == nil {
43958		return nil
43959	}
43960
43961	shape, ok := value.([]interface{})
43962	if !ok {
43963		return fmt.Errorf("unexpected JSON type %v", value)
43964	}
43965
43966	var cv []string
43967	if *v == nil {
43968		cv = []string{}
43969	} else {
43970		cv = *v
43971	}
43972
43973	for _, value := range shape {
43974		var col string
43975		if value != nil {
43976			jtv, ok := value.(string)
43977			if !ok {
43978				return fmt.Errorf("expected AttributeName to be of type string, got %T instead", value)
43979			}
43980			col = jtv
43981		}
43982		cv = append(cv, col)
43983
43984	}
43985	*v = cv
43986	return nil
43987}
43988
43989func awsRestjson1_deserializeDocumentSecurityProfileIdentifier(v **types.SecurityProfileIdentifier, value interface{}) error {
43990	if v == nil {
43991		return fmt.Errorf("unexpected nil of type %T", v)
43992	}
43993	if value == nil {
43994		return nil
43995	}
43996
43997	shape, ok := value.(map[string]interface{})
43998	if !ok {
43999		return fmt.Errorf("unexpected JSON type %v", value)
44000	}
44001
44002	var sv *types.SecurityProfileIdentifier
44003	if *v == nil {
44004		sv = &types.SecurityProfileIdentifier{}
44005	} else {
44006		sv = *v
44007	}
44008
44009	for key, value := range shape {
44010		switch key {
44011		case "arn":
44012			if value != nil {
44013				jtv, ok := value.(string)
44014				if !ok {
44015					return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value)
44016				}
44017				sv.Arn = ptr.String(jtv)
44018			}
44019
44020		case "name":
44021			if value != nil {
44022				jtv, ok := value.(string)
44023				if !ok {
44024					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
44025				}
44026				sv.Name = ptr.String(jtv)
44027			}
44028
44029		default:
44030			_, _ = key, value
44031
44032		}
44033	}
44034	*v = sv
44035	return nil
44036}
44037
44038func awsRestjson1_deserializeDocumentSecurityProfileIdentifiers(v *[]types.SecurityProfileIdentifier, value interface{}) error {
44039	if v == nil {
44040		return fmt.Errorf("unexpected nil of type %T", v)
44041	}
44042	if value == nil {
44043		return nil
44044	}
44045
44046	shape, ok := value.([]interface{})
44047	if !ok {
44048		return fmt.Errorf("unexpected JSON type %v", value)
44049	}
44050
44051	var cv []types.SecurityProfileIdentifier
44052	if *v == nil {
44053		cv = []types.SecurityProfileIdentifier{}
44054	} else {
44055		cv = *v
44056	}
44057
44058	for _, value := range shape {
44059		var col types.SecurityProfileIdentifier
44060		destAddr := &col
44061		if err := awsRestjson1_deserializeDocumentSecurityProfileIdentifier(&destAddr, value); err != nil {
44062			return err
44063		}
44064		col = *destAddr
44065		cv = append(cv, col)
44066
44067	}
44068	*v = cv
44069	return nil
44070}
44071
44072func awsRestjson1_deserializeDocumentSecurityProfileTarget(v **types.SecurityProfileTarget, value interface{}) error {
44073	if v == nil {
44074		return fmt.Errorf("unexpected nil of type %T", v)
44075	}
44076	if value == nil {
44077		return nil
44078	}
44079
44080	shape, ok := value.(map[string]interface{})
44081	if !ok {
44082		return fmt.Errorf("unexpected JSON type %v", value)
44083	}
44084
44085	var sv *types.SecurityProfileTarget
44086	if *v == nil {
44087		sv = &types.SecurityProfileTarget{}
44088	} else {
44089		sv = *v
44090	}
44091
44092	for key, value := range shape {
44093		switch key {
44094		case "arn":
44095			if value != nil {
44096				jtv, ok := value.(string)
44097				if !ok {
44098					return fmt.Errorf("expected SecurityProfileTargetArn to be of type string, got %T instead", value)
44099				}
44100				sv.Arn = ptr.String(jtv)
44101			}
44102
44103		default:
44104			_, _ = key, value
44105
44106		}
44107	}
44108	*v = sv
44109	return nil
44110}
44111
44112func awsRestjson1_deserializeDocumentSecurityProfileTargetMapping(v **types.SecurityProfileTargetMapping, value interface{}) error {
44113	if v == nil {
44114		return fmt.Errorf("unexpected nil of type %T", v)
44115	}
44116	if value == nil {
44117		return nil
44118	}
44119
44120	shape, ok := value.(map[string]interface{})
44121	if !ok {
44122		return fmt.Errorf("unexpected JSON type %v", value)
44123	}
44124
44125	var sv *types.SecurityProfileTargetMapping
44126	if *v == nil {
44127		sv = &types.SecurityProfileTargetMapping{}
44128	} else {
44129		sv = *v
44130	}
44131
44132	for key, value := range shape {
44133		switch key {
44134		case "securityProfileIdentifier":
44135			if err := awsRestjson1_deserializeDocumentSecurityProfileIdentifier(&sv.SecurityProfileIdentifier, value); err != nil {
44136				return err
44137			}
44138
44139		case "target":
44140			if err := awsRestjson1_deserializeDocumentSecurityProfileTarget(&sv.Target, value); err != nil {
44141				return err
44142			}
44143
44144		default:
44145			_, _ = key, value
44146
44147		}
44148	}
44149	*v = sv
44150	return nil
44151}
44152
44153func awsRestjson1_deserializeDocumentSecurityProfileTargetMappings(v *[]types.SecurityProfileTargetMapping, value interface{}) error {
44154	if v == nil {
44155		return fmt.Errorf("unexpected nil of type %T", v)
44156	}
44157	if value == nil {
44158		return nil
44159	}
44160
44161	shape, ok := value.([]interface{})
44162	if !ok {
44163		return fmt.Errorf("unexpected JSON type %v", value)
44164	}
44165
44166	var cv []types.SecurityProfileTargetMapping
44167	if *v == nil {
44168		cv = []types.SecurityProfileTargetMapping{}
44169	} else {
44170		cv = *v
44171	}
44172
44173	for _, value := range shape {
44174		var col types.SecurityProfileTargetMapping
44175		destAddr := &col
44176		if err := awsRestjson1_deserializeDocumentSecurityProfileTargetMapping(&destAddr, value); err != nil {
44177			return err
44178		}
44179		col = *destAddr
44180		cv = append(cv, col)
44181
44182	}
44183	*v = cv
44184	return nil
44185}
44186
44187func awsRestjson1_deserializeDocumentSecurityProfileTargets(v *[]types.SecurityProfileTarget, value interface{}) error {
44188	if v == nil {
44189		return fmt.Errorf("unexpected nil of type %T", v)
44190	}
44191	if value == nil {
44192		return nil
44193	}
44194
44195	shape, ok := value.([]interface{})
44196	if !ok {
44197		return fmt.Errorf("unexpected JSON type %v", value)
44198	}
44199
44200	var cv []types.SecurityProfileTarget
44201	if *v == nil {
44202		cv = []types.SecurityProfileTarget{}
44203	} else {
44204		cv = *v
44205	}
44206
44207	for _, value := range shape {
44208		var col types.SecurityProfileTarget
44209		destAddr := &col
44210		if err := awsRestjson1_deserializeDocumentSecurityProfileTarget(&destAddr, value); err != nil {
44211			return err
44212		}
44213		col = *destAddr
44214		cv = append(cv, col)
44215
44216	}
44217	*v = cv
44218	return nil
44219}
44220
44221func awsRestjson1_deserializeDocumentServerCertificates(v *[]types.ServerCertificateSummary, value interface{}) error {
44222	if v == nil {
44223		return fmt.Errorf("unexpected nil of type %T", v)
44224	}
44225	if value == nil {
44226		return nil
44227	}
44228
44229	shape, ok := value.([]interface{})
44230	if !ok {
44231		return fmt.Errorf("unexpected JSON type %v", value)
44232	}
44233
44234	var cv []types.ServerCertificateSummary
44235	if *v == nil {
44236		cv = []types.ServerCertificateSummary{}
44237	} else {
44238		cv = *v
44239	}
44240
44241	for _, value := range shape {
44242		var col types.ServerCertificateSummary
44243		destAddr := &col
44244		if err := awsRestjson1_deserializeDocumentServerCertificateSummary(&destAddr, value); err != nil {
44245			return err
44246		}
44247		col = *destAddr
44248		cv = append(cv, col)
44249
44250	}
44251	*v = cv
44252	return nil
44253}
44254
44255func awsRestjson1_deserializeDocumentServerCertificateSummary(v **types.ServerCertificateSummary, value interface{}) error {
44256	if v == nil {
44257		return fmt.Errorf("unexpected nil of type %T", v)
44258	}
44259	if value == nil {
44260		return nil
44261	}
44262
44263	shape, ok := value.(map[string]interface{})
44264	if !ok {
44265		return fmt.Errorf("unexpected JSON type %v", value)
44266	}
44267
44268	var sv *types.ServerCertificateSummary
44269	if *v == nil {
44270		sv = &types.ServerCertificateSummary{}
44271	} else {
44272		sv = *v
44273	}
44274
44275	for key, value := range shape {
44276		switch key {
44277		case "serverCertificateArn":
44278			if value != nil {
44279				jtv, ok := value.(string)
44280				if !ok {
44281					return fmt.Errorf("expected AcmCertificateArn to be of type string, got %T instead", value)
44282				}
44283				sv.ServerCertificateArn = ptr.String(jtv)
44284			}
44285
44286		case "serverCertificateStatus":
44287			if value != nil {
44288				jtv, ok := value.(string)
44289				if !ok {
44290					return fmt.Errorf("expected ServerCertificateStatus to be of type string, got %T instead", value)
44291				}
44292				sv.ServerCertificateStatus = types.ServerCertificateStatus(jtv)
44293			}
44294
44295		case "serverCertificateStatusDetail":
44296			if value != nil {
44297				jtv, ok := value.(string)
44298				if !ok {
44299					return fmt.Errorf("expected ServerCertificateStatusDetail to be of type string, got %T instead", value)
44300				}
44301				sv.ServerCertificateStatusDetail = ptr.String(jtv)
44302			}
44303
44304		default:
44305			_, _ = key, value
44306
44307		}
44308	}
44309	*v = sv
44310	return nil
44311}
44312
44313func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error {
44314	if v == nil {
44315		return fmt.Errorf("unexpected nil of type %T", v)
44316	}
44317	if value == nil {
44318		return nil
44319	}
44320
44321	shape, ok := value.(map[string]interface{})
44322	if !ok {
44323		return fmt.Errorf("unexpected JSON type %v", value)
44324	}
44325
44326	var sv *types.ServiceUnavailableException
44327	if *v == nil {
44328		sv = &types.ServiceUnavailableException{}
44329	} else {
44330		sv = *v
44331	}
44332
44333	for key, value := range shape {
44334		switch key {
44335		case "message":
44336			if value != nil {
44337				jtv, ok := value.(string)
44338				if !ok {
44339					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
44340				}
44341				sv.Message = ptr.String(jtv)
44342			}
44343
44344		default:
44345			_, _ = key, value
44346
44347		}
44348	}
44349	*v = sv
44350	return nil
44351}
44352
44353func awsRestjson1_deserializeDocumentSigningProfileParameter(v **types.SigningProfileParameter, value interface{}) error {
44354	if v == nil {
44355		return fmt.Errorf("unexpected nil of type %T", v)
44356	}
44357	if value == nil {
44358		return nil
44359	}
44360
44361	shape, ok := value.(map[string]interface{})
44362	if !ok {
44363		return fmt.Errorf("unexpected JSON type %v", value)
44364	}
44365
44366	var sv *types.SigningProfileParameter
44367	if *v == nil {
44368		sv = &types.SigningProfileParameter{}
44369	} else {
44370		sv = *v
44371	}
44372
44373	for key, value := range shape {
44374		switch key {
44375		case "certificateArn":
44376			if value != nil {
44377				jtv, ok := value.(string)
44378				if !ok {
44379					return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value)
44380				}
44381				sv.CertificateArn = ptr.String(jtv)
44382			}
44383
44384		case "certificatePathOnDevice":
44385			if value != nil {
44386				jtv, ok := value.(string)
44387				if !ok {
44388					return fmt.Errorf("expected CertificatePathOnDevice to be of type string, got %T instead", value)
44389				}
44390				sv.CertificatePathOnDevice = ptr.String(jtv)
44391			}
44392
44393		case "platform":
44394			if value != nil {
44395				jtv, ok := value.(string)
44396				if !ok {
44397					return fmt.Errorf("expected Platform to be of type string, got %T instead", value)
44398				}
44399				sv.Platform = ptr.String(jtv)
44400			}
44401
44402		default:
44403			_, _ = key, value
44404
44405		}
44406	}
44407	*v = sv
44408	return nil
44409}
44410
44411func awsRestjson1_deserializeDocumentSigV4Authorization(v **types.SigV4Authorization, value interface{}) error {
44412	if v == nil {
44413		return fmt.Errorf("unexpected nil of type %T", v)
44414	}
44415	if value == nil {
44416		return nil
44417	}
44418
44419	shape, ok := value.(map[string]interface{})
44420	if !ok {
44421		return fmt.Errorf("unexpected JSON type %v", value)
44422	}
44423
44424	var sv *types.SigV4Authorization
44425	if *v == nil {
44426		sv = &types.SigV4Authorization{}
44427	} else {
44428		sv = *v
44429	}
44430
44431	for key, value := range shape {
44432		switch key {
44433		case "roleArn":
44434			if value != nil {
44435				jtv, ok := value.(string)
44436				if !ok {
44437					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
44438				}
44439				sv.RoleArn = ptr.String(jtv)
44440			}
44441
44442		case "serviceName":
44443			if value != nil {
44444				jtv, ok := value.(string)
44445				if !ok {
44446					return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value)
44447				}
44448				sv.ServiceName = ptr.String(jtv)
44449			}
44450
44451		case "signingRegion":
44452			if value != nil {
44453				jtv, ok := value.(string)
44454				if !ok {
44455					return fmt.Errorf("expected SigningRegion to be of type string, got %T instead", value)
44456				}
44457				sv.SigningRegion = ptr.String(jtv)
44458			}
44459
44460		default:
44461			_, _ = key, value
44462
44463		}
44464	}
44465	*v = sv
44466	return nil
44467}
44468
44469func awsRestjson1_deserializeDocumentSnsAction(v **types.SnsAction, value interface{}) error {
44470	if v == nil {
44471		return fmt.Errorf("unexpected nil of type %T", v)
44472	}
44473	if value == nil {
44474		return nil
44475	}
44476
44477	shape, ok := value.(map[string]interface{})
44478	if !ok {
44479		return fmt.Errorf("unexpected JSON type %v", value)
44480	}
44481
44482	var sv *types.SnsAction
44483	if *v == nil {
44484		sv = &types.SnsAction{}
44485	} else {
44486		sv = *v
44487	}
44488
44489	for key, value := range shape {
44490		switch key {
44491		case "messageFormat":
44492			if value != nil {
44493				jtv, ok := value.(string)
44494				if !ok {
44495					return fmt.Errorf("expected MessageFormat to be of type string, got %T instead", value)
44496				}
44497				sv.MessageFormat = types.MessageFormat(jtv)
44498			}
44499
44500		case "roleArn":
44501			if value != nil {
44502				jtv, ok := value.(string)
44503				if !ok {
44504					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
44505				}
44506				sv.RoleArn = ptr.String(jtv)
44507			}
44508
44509		case "targetArn":
44510			if value != nil {
44511				jtv, ok := value.(string)
44512				if !ok {
44513					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
44514				}
44515				sv.TargetArn = ptr.String(jtv)
44516			}
44517
44518		default:
44519			_, _ = key, value
44520
44521		}
44522	}
44523	*v = sv
44524	return nil
44525}
44526
44527func awsRestjson1_deserializeDocumentSqlParseException(v **types.SqlParseException, value interface{}) error {
44528	if v == nil {
44529		return fmt.Errorf("unexpected nil of type %T", v)
44530	}
44531	if value == nil {
44532		return nil
44533	}
44534
44535	shape, ok := value.(map[string]interface{})
44536	if !ok {
44537		return fmt.Errorf("unexpected JSON type %v", value)
44538	}
44539
44540	var sv *types.SqlParseException
44541	if *v == nil {
44542		sv = &types.SqlParseException{}
44543	} else {
44544		sv = *v
44545	}
44546
44547	for key, value := range shape {
44548		switch key {
44549		case "message":
44550			if value != nil {
44551				jtv, ok := value.(string)
44552				if !ok {
44553					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
44554				}
44555				sv.Message = ptr.String(jtv)
44556			}
44557
44558		default:
44559			_, _ = key, value
44560
44561		}
44562	}
44563	*v = sv
44564	return nil
44565}
44566
44567func awsRestjson1_deserializeDocumentSqsAction(v **types.SqsAction, value interface{}) error {
44568	if v == nil {
44569		return fmt.Errorf("unexpected nil of type %T", v)
44570	}
44571	if value == nil {
44572		return nil
44573	}
44574
44575	shape, ok := value.(map[string]interface{})
44576	if !ok {
44577		return fmt.Errorf("unexpected JSON type %v", value)
44578	}
44579
44580	var sv *types.SqsAction
44581	if *v == nil {
44582		sv = &types.SqsAction{}
44583	} else {
44584		sv = *v
44585	}
44586
44587	for key, value := range shape {
44588		switch key {
44589		case "queueUrl":
44590			if value != nil {
44591				jtv, ok := value.(string)
44592				if !ok {
44593					return fmt.Errorf("expected QueueUrl to be of type string, got %T instead", value)
44594				}
44595				sv.QueueUrl = ptr.String(jtv)
44596			}
44597
44598		case "roleArn":
44599			if value != nil {
44600				jtv, ok := value.(string)
44601				if !ok {
44602					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
44603				}
44604				sv.RoleArn = ptr.String(jtv)
44605			}
44606
44607		case "useBase64":
44608			if value != nil {
44609				jtv, ok := value.(bool)
44610				if !ok {
44611					return fmt.Errorf("expected UseBase64 to be of type *bool, got %T instead", value)
44612				}
44613				sv.UseBase64 = ptr.Bool(jtv)
44614			}
44615
44616		default:
44617			_, _ = key, value
44618
44619		}
44620	}
44621	*v = sv
44622	return nil
44623}
44624
44625func awsRestjson1_deserializeDocumentStartSigningJobParameter(v **types.StartSigningJobParameter, value interface{}) error {
44626	if v == nil {
44627		return fmt.Errorf("unexpected nil of type %T", v)
44628	}
44629	if value == nil {
44630		return nil
44631	}
44632
44633	shape, ok := value.(map[string]interface{})
44634	if !ok {
44635		return fmt.Errorf("unexpected JSON type %v", value)
44636	}
44637
44638	var sv *types.StartSigningJobParameter
44639	if *v == nil {
44640		sv = &types.StartSigningJobParameter{}
44641	} else {
44642		sv = *v
44643	}
44644
44645	for key, value := range shape {
44646		switch key {
44647		case "destination":
44648			if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil {
44649				return err
44650			}
44651
44652		case "signingProfileName":
44653			if value != nil {
44654				jtv, ok := value.(string)
44655				if !ok {
44656					return fmt.Errorf("expected SigningProfileName to be of type string, got %T instead", value)
44657				}
44658				sv.SigningProfileName = ptr.String(jtv)
44659			}
44660
44661		case "signingProfileParameter":
44662			if err := awsRestjson1_deserializeDocumentSigningProfileParameter(&sv.SigningProfileParameter, value); err != nil {
44663				return err
44664			}
44665
44666		default:
44667			_, _ = key, value
44668
44669		}
44670	}
44671	*v = sv
44672	return nil
44673}
44674
44675func awsRestjson1_deserializeDocumentStatisticalThreshold(v **types.StatisticalThreshold, value interface{}) error {
44676	if v == nil {
44677		return fmt.Errorf("unexpected nil of type %T", v)
44678	}
44679	if value == nil {
44680		return nil
44681	}
44682
44683	shape, ok := value.(map[string]interface{})
44684	if !ok {
44685		return fmt.Errorf("unexpected JSON type %v", value)
44686	}
44687
44688	var sv *types.StatisticalThreshold
44689	if *v == nil {
44690		sv = &types.StatisticalThreshold{}
44691	} else {
44692		sv = *v
44693	}
44694
44695	for key, value := range shape {
44696		switch key {
44697		case "statistic":
44698			if value != nil {
44699				jtv, ok := value.(string)
44700				if !ok {
44701					return fmt.Errorf("expected EvaluationStatistic to be of type string, got %T instead", value)
44702				}
44703				sv.Statistic = ptr.String(jtv)
44704			}
44705
44706		default:
44707			_, _ = key, value
44708
44709		}
44710	}
44711	*v = sv
44712	return nil
44713}
44714
44715func awsRestjson1_deserializeDocumentStatistics(v **types.Statistics, value interface{}) error {
44716	if v == nil {
44717		return fmt.Errorf("unexpected nil of type %T", v)
44718	}
44719	if value == nil {
44720		return nil
44721	}
44722
44723	shape, ok := value.(map[string]interface{})
44724	if !ok {
44725		return fmt.Errorf("unexpected JSON type %v", value)
44726	}
44727
44728	var sv *types.Statistics
44729	if *v == nil {
44730		sv = &types.Statistics{}
44731	} else {
44732		sv = *v
44733	}
44734
44735	for key, value := range shape {
44736		switch key {
44737		case "average":
44738			if value != nil {
44739				jtv, ok := value.(json.Number)
44740				if !ok {
44741					return fmt.Errorf("expected Average to be json.Number, got %T instead", value)
44742				}
44743				f64, err := jtv.Float64()
44744				if err != nil {
44745					return err
44746				}
44747				sv.Average = f64
44748			}
44749
44750		case "count":
44751			if value != nil {
44752				jtv, ok := value.(json.Number)
44753				if !ok {
44754					return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
44755				}
44756				i64, err := jtv.Int64()
44757				if err != nil {
44758					return err
44759				}
44760				sv.Count = int32(i64)
44761			}
44762
44763		case "maximum":
44764			if value != nil {
44765				jtv, ok := value.(json.Number)
44766				if !ok {
44767					return fmt.Errorf("expected Maximum to be json.Number, got %T instead", value)
44768				}
44769				f64, err := jtv.Float64()
44770				if err != nil {
44771					return err
44772				}
44773				sv.Maximum = f64
44774			}
44775
44776		case "minimum":
44777			if value != nil {
44778				jtv, ok := value.(json.Number)
44779				if !ok {
44780					return fmt.Errorf("expected Minimum to be json.Number, got %T instead", value)
44781				}
44782				f64, err := jtv.Float64()
44783				if err != nil {
44784					return err
44785				}
44786				sv.Minimum = f64
44787			}
44788
44789		case "stdDeviation":
44790			if value != nil {
44791				jtv, ok := value.(json.Number)
44792				if !ok {
44793					return fmt.Errorf("expected StdDeviation to be json.Number, got %T instead", value)
44794				}
44795				f64, err := jtv.Float64()
44796				if err != nil {
44797					return err
44798				}
44799				sv.StdDeviation = f64
44800			}
44801
44802		case "sum":
44803			if value != nil {
44804				jtv, ok := value.(json.Number)
44805				if !ok {
44806					return fmt.Errorf("expected Sum to be json.Number, got %T instead", value)
44807				}
44808				f64, err := jtv.Float64()
44809				if err != nil {
44810					return err
44811				}
44812				sv.Sum = f64
44813			}
44814
44815		case "sumOfSquares":
44816			if value != nil {
44817				jtv, ok := value.(json.Number)
44818				if !ok {
44819					return fmt.Errorf("expected SumOfSquares to be json.Number, got %T instead", value)
44820				}
44821				f64, err := jtv.Float64()
44822				if err != nil {
44823					return err
44824				}
44825				sv.SumOfSquares = f64
44826			}
44827
44828		case "variance":
44829			if value != nil {
44830				jtv, ok := value.(json.Number)
44831				if !ok {
44832					return fmt.Errorf("expected Variance to be json.Number, got %T instead", value)
44833				}
44834				f64, err := jtv.Float64()
44835				if err != nil {
44836					return err
44837				}
44838				sv.Variance = f64
44839			}
44840
44841		default:
44842			_, _ = key, value
44843
44844		}
44845	}
44846	*v = sv
44847	return nil
44848}
44849
44850func awsRestjson1_deserializeDocumentStepFunctionsAction(v **types.StepFunctionsAction, value interface{}) error {
44851	if v == nil {
44852		return fmt.Errorf("unexpected nil of type %T", v)
44853	}
44854	if value == nil {
44855		return nil
44856	}
44857
44858	shape, ok := value.(map[string]interface{})
44859	if !ok {
44860		return fmt.Errorf("unexpected JSON type %v", value)
44861	}
44862
44863	var sv *types.StepFunctionsAction
44864	if *v == nil {
44865		sv = &types.StepFunctionsAction{}
44866	} else {
44867		sv = *v
44868	}
44869
44870	for key, value := range shape {
44871		switch key {
44872		case "executionNamePrefix":
44873			if value != nil {
44874				jtv, ok := value.(string)
44875				if !ok {
44876					return fmt.Errorf("expected ExecutionNamePrefix to be of type string, got %T instead", value)
44877				}
44878				sv.ExecutionNamePrefix = ptr.String(jtv)
44879			}
44880
44881		case "roleArn":
44882			if value != nil {
44883				jtv, ok := value.(string)
44884				if !ok {
44885					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
44886				}
44887				sv.RoleArn = ptr.String(jtv)
44888			}
44889
44890		case "stateMachineName":
44891			if value != nil {
44892				jtv, ok := value.(string)
44893				if !ok {
44894					return fmt.Errorf("expected StateMachineName to be of type string, got %T instead", value)
44895				}
44896				sv.StateMachineName = ptr.String(jtv)
44897			}
44898
44899		default:
44900			_, _ = key, value
44901
44902		}
44903	}
44904	*v = sv
44905	return nil
44906}
44907
44908func awsRestjson1_deserializeDocumentStream(v **types.Stream, value interface{}) error {
44909	if v == nil {
44910		return fmt.Errorf("unexpected nil of type %T", v)
44911	}
44912	if value == nil {
44913		return nil
44914	}
44915
44916	shape, ok := value.(map[string]interface{})
44917	if !ok {
44918		return fmt.Errorf("unexpected JSON type %v", value)
44919	}
44920
44921	var sv *types.Stream
44922	if *v == nil {
44923		sv = &types.Stream{}
44924	} else {
44925		sv = *v
44926	}
44927
44928	for key, value := range shape {
44929		switch key {
44930		case "fileId":
44931			if value != nil {
44932				jtv, ok := value.(json.Number)
44933				if !ok {
44934					return fmt.Errorf("expected FileId to be json.Number, got %T instead", value)
44935				}
44936				i64, err := jtv.Int64()
44937				if err != nil {
44938					return err
44939				}
44940				sv.FileId = ptr.Int32(int32(i64))
44941			}
44942
44943		case "streamId":
44944			if value != nil {
44945				jtv, ok := value.(string)
44946				if !ok {
44947					return fmt.Errorf("expected StreamId to be of type string, got %T instead", value)
44948				}
44949				sv.StreamId = ptr.String(jtv)
44950			}
44951
44952		default:
44953			_, _ = key, value
44954
44955		}
44956	}
44957	*v = sv
44958	return nil
44959}
44960
44961func awsRestjson1_deserializeDocumentStreamFile(v **types.StreamFile, value interface{}) error {
44962	if v == nil {
44963		return fmt.Errorf("unexpected nil of type %T", v)
44964	}
44965	if value == nil {
44966		return nil
44967	}
44968
44969	shape, ok := value.(map[string]interface{})
44970	if !ok {
44971		return fmt.Errorf("unexpected JSON type %v", value)
44972	}
44973
44974	var sv *types.StreamFile
44975	if *v == nil {
44976		sv = &types.StreamFile{}
44977	} else {
44978		sv = *v
44979	}
44980
44981	for key, value := range shape {
44982		switch key {
44983		case "fileId":
44984			if value != nil {
44985				jtv, ok := value.(json.Number)
44986				if !ok {
44987					return fmt.Errorf("expected FileId to be json.Number, got %T instead", value)
44988				}
44989				i64, err := jtv.Int64()
44990				if err != nil {
44991					return err
44992				}
44993				sv.FileId = ptr.Int32(int32(i64))
44994			}
44995
44996		case "s3Location":
44997			if err := awsRestjson1_deserializeDocumentS3Location(&sv.S3Location, value); err != nil {
44998				return err
44999			}
45000
45001		default:
45002			_, _ = key, value
45003
45004		}
45005	}
45006	*v = sv
45007	return nil
45008}
45009
45010func awsRestjson1_deserializeDocumentStreamFiles(v *[]types.StreamFile, value interface{}) error {
45011	if v == nil {
45012		return fmt.Errorf("unexpected nil of type %T", v)
45013	}
45014	if value == nil {
45015		return nil
45016	}
45017
45018	shape, ok := value.([]interface{})
45019	if !ok {
45020		return fmt.Errorf("unexpected JSON type %v", value)
45021	}
45022
45023	var cv []types.StreamFile
45024	if *v == nil {
45025		cv = []types.StreamFile{}
45026	} else {
45027		cv = *v
45028	}
45029
45030	for _, value := range shape {
45031		var col types.StreamFile
45032		destAddr := &col
45033		if err := awsRestjson1_deserializeDocumentStreamFile(&destAddr, value); err != nil {
45034			return err
45035		}
45036		col = *destAddr
45037		cv = append(cv, col)
45038
45039	}
45040	*v = cv
45041	return nil
45042}
45043
45044func awsRestjson1_deserializeDocumentStreamInfo(v **types.StreamInfo, value interface{}) error {
45045	if v == nil {
45046		return fmt.Errorf("unexpected nil of type %T", v)
45047	}
45048	if value == nil {
45049		return nil
45050	}
45051
45052	shape, ok := value.(map[string]interface{})
45053	if !ok {
45054		return fmt.Errorf("unexpected JSON type %v", value)
45055	}
45056
45057	var sv *types.StreamInfo
45058	if *v == nil {
45059		sv = &types.StreamInfo{}
45060	} else {
45061		sv = *v
45062	}
45063
45064	for key, value := range shape {
45065		switch key {
45066		case "createdAt":
45067			if value != nil {
45068				jtv, ok := value.(json.Number)
45069				if !ok {
45070					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
45071				}
45072				f64, err := jtv.Float64()
45073				if err != nil {
45074					return err
45075				}
45076				sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
45077			}
45078
45079		case "description":
45080			if value != nil {
45081				jtv, ok := value.(string)
45082				if !ok {
45083					return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value)
45084				}
45085				sv.Description = ptr.String(jtv)
45086			}
45087
45088		case "files":
45089			if err := awsRestjson1_deserializeDocumentStreamFiles(&sv.Files, value); err != nil {
45090				return err
45091			}
45092
45093		case "lastUpdatedAt":
45094			if value != nil {
45095				jtv, ok := value.(json.Number)
45096				if !ok {
45097					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
45098				}
45099				f64, err := jtv.Float64()
45100				if err != nil {
45101					return err
45102				}
45103				sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
45104			}
45105
45106		case "roleArn":
45107			if value != nil {
45108				jtv, ok := value.(string)
45109				if !ok {
45110					return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
45111				}
45112				sv.RoleArn = ptr.String(jtv)
45113			}
45114
45115		case "streamArn":
45116			if value != nil {
45117				jtv, ok := value.(string)
45118				if !ok {
45119					return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
45120				}
45121				sv.StreamArn = ptr.String(jtv)
45122			}
45123
45124		case "streamId":
45125			if value != nil {
45126				jtv, ok := value.(string)
45127				if !ok {
45128					return fmt.Errorf("expected StreamId to be of type string, got %T instead", value)
45129				}
45130				sv.StreamId = ptr.String(jtv)
45131			}
45132
45133		case "streamVersion":
45134			if value != nil {
45135				jtv, ok := value.(json.Number)
45136				if !ok {
45137					return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value)
45138				}
45139				i64, err := jtv.Int64()
45140				if err != nil {
45141					return err
45142				}
45143				sv.StreamVersion = ptr.Int32(int32(i64))
45144			}
45145
45146		default:
45147			_, _ = key, value
45148
45149		}
45150	}
45151	*v = sv
45152	return nil
45153}
45154
45155func awsRestjson1_deserializeDocumentStreamsSummary(v *[]types.StreamSummary, value interface{}) error {
45156	if v == nil {
45157		return fmt.Errorf("unexpected nil of type %T", v)
45158	}
45159	if value == nil {
45160		return nil
45161	}
45162
45163	shape, ok := value.([]interface{})
45164	if !ok {
45165		return fmt.Errorf("unexpected JSON type %v", value)
45166	}
45167
45168	var cv []types.StreamSummary
45169	if *v == nil {
45170		cv = []types.StreamSummary{}
45171	} else {
45172		cv = *v
45173	}
45174
45175	for _, value := range shape {
45176		var col types.StreamSummary
45177		destAddr := &col
45178		if err := awsRestjson1_deserializeDocumentStreamSummary(&destAddr, value); err != nil {
45179			return err
45180		}
45181		col = *destAddr
45182		cv = append(cv, col)
45183
45184	}
45185	*v = cv
45186	return nil
45187}
45188
45189func awsRestjson1_deserializeDocumentStreamSummary(v **types.StreamSummary, value interface{}) error {
45190	if v == nil {
45191		return fmt.Errorf("unexpected nil of type %T", v)
45192	}
45193	if value == nil {
45194		return nil
45195	}
45196
45197	shape, ok := value.(map[string]interface{})
45198	if !ok {
45199		return fmt.Errorf("unexpected JSON type %v", value)
45200	}
45201
45202	var sv *types.StreamSummary
45203	if *v == nil {
45204		sv = &types.StreamSummary{}
45205	} else {
45206		sv = *v
45207	}
45208
45209	for key, value := range shape {
45210		switch key {
45211		case "description":
45212			if value != nil {
45213				jtv, ok := value.(string)
45214				if !ok {
45215					return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value)
45216				}
45217				sv.Description = ptr.String(jtv)
45218			}
45219
45220		case "streamArn":
45221			if value != nil {
45222				jtv, ok := value.(string)
45223				if !ok {
45224					return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
45225				}
45226				sv.StreamArn = ptr.String(jtv)
45227			}
45228
45229		case "streamId":
45230			if value != nil {
45231				jtv, ok := value.(string)
45232				if !ok {
45233					return fmt.Errorf("expected StreamId to be of type string, got %T instead", value)
45234				}
45235				sv.StreamId = ptr.String(jtv)
45236			}
45237
45238		case "streamVersion":
45239			if value != nil {
45240				jtv, ok := value.(json.Number)
45241				if !ok {
45242					return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value)
45243				}
45244				i64, err := jtv.Int64()
45245				if err != nil {
45246					return err
45247				}
45248				sv.StreamVersion = ptr.Int32(int32(i64))
45249			}
45250
45251		default:
45252			_, _ = key, value
45253
45254		}
45255	}
45256	*v = sv
45257	return nil
45258}
45259
45260func awsRestjson1_deserializeDocumentStringMap(v *map[string]string, value interface{}) error {
45261	if v == nil {
45262		return fmt.Errorf("unexpected nil of type %T", v)
45263	}
45264	if value == nil {
45265		return nil
45266	}
45267
45268	shape, ok := value.(map[string]interface{})
45269	if !ok {
45270		return fmt.Errorf("unexpected JSON type %v", value)
45271	}
45272
45273	var mv map[string]string
45274	if *v == nil {
45275		mv = map[string]string{}
45276	} else {
45277		mv = *v
45278	}
45279
45280	for key, value := range shape {
45281		var parsedVal string
45282		if value != nil {
45283			jtv, ok := value.(string)
45284			if !ok {
45285				return fmt.Errorf("expected String to be of type string, got %T instead", value)
45286			}
45287			parsedVal = jtv
45288		}
45289		mv[key] = parsedVal
45290
45291	}
45292	*v = mv
45293	return nil
45294}
45295
45296func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error {
45297	if v == nil {
45298		return fmt.Errorf("unexpected nil of type %T", v)
45299	}
45300	if value == nil {
45301		return nil
45302	}
45303
45304	shape, ok := value.(map[string]interface{})
45305	if !ok {
45306		return fmt.Errorf("unexpected JSON type %v", value)
45307	}
45308
45309	var sv *types.Tag
45310	if *v == nil {
45311		sv = &types.Tag{}
45312	} else {
45313		sv = *v
45314	}
45315
45316	for key, value := range shape {
45317		switch key {
45318		case "Key":
45319			if value != nil {
45320				jtv, ok := value.(string)
45321				if !ok {
45322					return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
45323				}
45324				sv.Key = ptr.String(jtv)
45325			}
45326
45327		case "Value":
45328			if value != nil {
45329				jtv, ok := value.(string)
45330				if !ok {
45331					return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
45332				}
45333				sv.Value = ptr.String(jtv)
45334			}
45335
45336		default:
45337			_, _ = key, value
45338
45339		}
45340	}
45341	*v = sv
45342	return nil
45343}
45344
45345func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
45346	if v == nil {
45347		return fmt.Errorf("unexpected nil of type %T", v)
45348	}
45349	if value == nil {
45350		return nil
45351	}
45352
45353	shape, ok := value.([]interface{})
45354	if !ok {
45355		return fmt.Errorf("unexpected JSON type %v", value)
45356	}
45357
45358	var cv []types.Tag
45359	if *v == nil {
45360		cv = []types.Tag{}
45361	} else {
45362		cv = *v
45363	}
45364
45365	for _, value := range shape {
45366		var col types.Tag
45367		destAddr := &col
45368		if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil {
45369			return err
45370		}
45371		col = *destAddr
45372		cv = append(cv, col)
45373
45374	}
45375	*v = cv
45376	return nil
45377}
45378
45379func awsRestjson1_deserializeDocumentTargetAuditCheckNames(v *[]string, value interface{}) error {
45380	if v == nil {
45381		return fmt.Errorf("unexpected nil of type %T", v)
45382	}
45383	if value == nil {
45384		return nil
45385	}
45386
45387	shape, ok := value.([]interface{})
45388	if !ok {
45389		return fmt.Errorf("unexpected JSON type %v", value)
45390	}
45391
45392	var cv []string
45393	if *v == nil {
45394		cv = []string{}
45395	} else {
45396		cv = *v
45397	}
45398
45399	for _, value := range shape {
45400		var col string
45401		if value != nil {
45402			jtv, ok := value.(string)
45403			if !ok {
45404				return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value)
45405			}
45406			col = jtv
45407		}
45408		cv = append(cv, col)
45409
45410	}
45411	*v = cv
45412	return nil
45413}
45414
45415func awsRestjson1_deserializeDocumentTargets(v *[]string, value interface{}) error {
45416	if v == nil {
45417		return fmt.Errorf("unexpected nil of type %T", v)
45418	}
45419	if value == nil {
45420		return nil
45421	}
45422
45423	shape, ok := value.([]interface{})
45424	if !ok {
45425		return fmt.Errorf("unexpected JSON type %v", value)
45426	}
45427
45428	var cv []string
45429	if *v == nil {
45430		cv = []string{}
45431	} else {
45432		cv = *v
45433	}
45434
45435	for _, value := range shape {
45436		var col string
45437		if value != nil {
45438			jtv, ok := value.(string)
45439			if !ok {
45440				return fmt.Errorf("expected Target to be of type string, got %T instead", value)
45441			}
45442			col = jtv
45443		}
45444		cv = append(cv, col)
45445
45446	}
45447	*v = cv
45448	return nil
45449}
45450
45451func awsRestjson1_deserializeDocumentTaskAlreadyExistsException(v **types.TaskAlreadyExistsException, value interface{}) error {
45452	if v == nil {
45453		return fmt.Errorf("unexpected nil of type %T", v)
45454	}
45455	if value == nil {
45456		return nil
45457	}
45458
45459	shape, ok := value.(map[string]interface{})
45460	if !ok {
45461		return fmt.Errorf("unexpected JSON type %v", value)
45462	}
45463
45464	var sv *types.TaskAlreadyExistsException
45465	if *v == nil {
45466		sv = &types.TaskAlreadyExistsException{}
45467	} else {
45468		sv = *v
45469	}
45470
45471	for key, value := range shape {
45472		switch key {
45473		case "message":
45474			if value != nil {
45475				jtv, ok := value.(string)
45476				if !ok {
45477					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
45478				}
45479				sv.Message = ptr.String(jtv)
45480			}
45481
45482		default:
45483			_, _ = key, value
45484
45485		}
45486	}
45487	*v = sv
45488	return nil
45489}
45490
45491func awsRestjson1_deserializeDocumentTaskIdList(v *[]string, value interface{}) error {
45492	if v == nil {
45493		return fmt.Errorf("unexpected nil of type %T", v)
45494	}
45495	if value == nil {
45496		return nil
45497	}
45498
45499	shape, ok := value.([]interface{})
45500	if !ok {
45501		return fmt.Errorf("unexpected JSON type %v", value)
45502	}
45503
45504	var cv []string
45505	if *v == nil {
45506		cv = []string{}
45507	} else {
45508		cv = *v
45509	}
45510
45511	for _, value := range shape {
45512		var col string
45513		if value != nil {
45514			jtv, ok := value.(string)
45515			if !ok {
45516				return fmt.Errorf("expected TaskId to be of type string, got %T instead", value)
45517			}
45518			col = jtv
45519		}
45520		cv = append(cv, col)
45521
45522	}
45523	*v = cv
45524	return nil
45525}
45526
45527func awsRestjson1_deserializeDocumentTaskStatistics(v **types.TaskStatistics, value interface{}) error {
45528	if v == nil {
45529		return fmt.Errorf("unexpected nil of type %T", v)
45530	}
45531	if value == nil {
45532		return nil
45533	}
45534
45535	shape, ok := value.(map[string]interface{})
45536	if !ok {
45537		return fmt.Errorf("unexpected JSON type %v", value)
45538	}
45539
45540	var sv *types.TaskStatistics
45541	if *v == nil {
45542		sv = &types.TaskStatistics{}
45543	} else {
45544		sv = *v
45545	}
45546
45547	for key, value := range shape {
45548		switch key {
45549		case "canceledChecks":
45550			if value != nil {
45551				jtv, ok := value.(json.Number)
45552				if !ok {
45553					return fmt.Errorf("expected CanceledChecksCount to be json.Number, got %T instead", value)
45554				}
45555				i64, err := jtv.Int64()
45556				if err != nil {
45557					return err
45558				}
45559				sv.CanceledChecks = ptr.Int32(int32(i64))
45560			}
45561
45562		case "compliantChecks":
45563			if value != nil {
45564				jtv, ok := value.(json.Number)
45565				if !ok {
45566					return fmt.Errorf("expected CompliantChecksCount to be json.Number, got %T instead", value)
45567				}
45568				i64, err := jtv.Int64()
45569				if err != nil {
45570					return err
45571				}
45572				sv.CompliantChecks = ptr.Int32(int32(i64))
45573			}
45574
45575		case "failedChecks":
45576			if value != nil {
45577				jtv, ok := value.(json.Number)
45578				if !ok {
45579					return fmt.Errorf("expected FailedChecksCount to be json.Number, got %T instead", value)
45580				}
45581				i64, err := jtv.Int64()
45582				if err != nil {
45583					return err
45584				}
45585				sv.FailedChecks = ptr.Int32(int32(i64))
45586			}
45587
45588		case "inProgressChecks":
45589			if value != nil {
45590				jtv, ok := value.(json.Number)
45591				if !ok {
45592					return fmt.Errorf("expected InProgressChecksCount to be json.Number, got %T instead", value)
45593				}
45594				i64, err := jtv.Int64()
45595				if err != nil {
45596					return err
45597				}
45598				sv.InProgressChecks = ptr.Int32(int32(i64))
45599			}
45600
45601		case "nonCompliantChecks":
45602			if value != nil {
45603				jtv, ok := value.(json.Number)
45604				if !ok {
45605					return fmt.Errorf("expected NonCompliantChecksCount to be json.Number, got %T instead", value)
45606				}
45607				i64, err := jtv.Int64()
45608				if err != nil {
45609					return err
45610				}
45611				sv.NonCompliantChecks = ptr.Int32(int32(i64))
45612			}
45613
45614		case "totalChecks":
45615			if value != nil {
45616				jtv, ok := value.(json.Number)
45617				if !ok {
45618					return fmt.Errorf("expected TotalChecksCount to be json.Number, got %T instead", value)
45619				}
45620				i64, err := jtv.Int64()
45621				if err != nil {
45622					return err
45623				}
45624				sv.TotalChecks = ptr.Int32(int32(i64))
45625			}
45626
45627		case "waitingForDataCollectionChecks":
45628			if value != nil {
45629				jtv, ok := value.(json.Number)
45630				if !ok {
45631					return fmt.Errorf("expected WaitingForDataCollectionChecksCount to be json.Number, got %T instead", value)
45632				}
45633				i64, err := jtv.Int64()
45634				if err != nil {
45635					return err
45636				}
45637				sv.WaitingForDataCollectionChecks = ptr.Int32(int32(i64))
45638			}
45639
45640		default:
45641			_, _ = key, value
45642
45643		}
45644	}
45645	*v = sv
45646	return nil
45647}
45648
45649func awsRestjson1_deserializeDocumentTaskStatisticsForAuditCheck(v **types.TaskStatisticsForAuditCheck, value interface{}) error {
45650	if v == nil {
45651		return fmt.Errorf("unexpected nil of type %T", v)
45652	}
45653	if value == nil {
45654		return nil
45655	}
45656
45657	shape, ok := value.(map[string]interface{})
45658	if !ok {
45659		return fmt.Errorf("unexpected JSON type %v", value)
45660	}
45661
45662	var sv *types.TaskStatisticsForAuditCheck
45663	if *v == nil {
45664		sv = &types.TaskStatisticsForAuditCheck{}
45665	} else {
45666		sv = *v
45667	}
45668
45669	for key, value := range shape {
45670		switch key {
45671		case "canceledFindingsCount":
45672			if value != nil {
45673				jtv, ok := value.(json.Number)
45674				if !ok {
45675					return fmt.Errorf("expected CanceledFindingsCount to be json.Number, got %T instead", value)
45676				}
45677				i64, err := jtv.Int64()
45678				if err != nil {
45679					return err
45680				}
45681				sv.CanceledFindingsCount = ptr.Int64(i64)
45682			}
45683
45684		case "failedFindingsCount":
45685			if value != nil {
45686				jtv, ok := value.(json.Number)
45687				if !ok {
45688					return fmt.Errorf("expected FailedFindingsCount to be json.Number, got %T instead", value)
45689				}
45690				i64, err := jtv.Int64()
45691				if err != nil {
45692					return err
45693				}
45694				sv.FailedFindingsCount = ptr.Int64(i64)
45695			}
45696
45697		case "skippedFindingsCount":
45698			if value != nil {
45699				jtv, ok := value.(json.Number)
45700				if !ok {
45701					return fmt.Errorf("expected SkippedFindingsCount to be json.Number, got %T instead", value)
45702				}
45703				i64, err := jtv.Int64()
45704				if err != nil {
45705					return err
45706				}
45707				sv.SkippedFindingsCount = ptr.Int64(i64)
45708			}
45709
45710		case "succeededFindingsCount":
45711			if value != nil {
45712				jtv, ok := value.(json.Number)
45713				if !ok {
45714					return fmt.Errorf("expected SucceededFindingsCount to be json.Number, got %T instead", value)
45715				}
45716				i64, err := jtv.Int64()
45717				if err != nil {
45718					return err
45719				}
45720				sv.SucceededFindingsCount = ptr.Int64(i64)
45721			}
45722
45723		case "totalFindingsCount":
45724			if value != nil {
45725				jtv, ok := value.(json.Number)
45726				if !ok {
45727					return fmt.Errorf("expected TotalFindingsCount to be json.Number, got %T instead", value)
45728				}
45729				i64, err := jtv.Int64()
45730				if err != nil {
45731					return err
45732				}
45733				sv.TotalFindingsCount = ptr.Int64(i64)
45734			}
45735
45736		default:
45737			_, _ = key, value
45738
45739		}
45740	}
45741	*v = sv
45742	return nil
45743}
45744
45745func awsRestjson1_deserializeDocumentThingAttribute(v **types.ThingAttribute, value interface{}) error {
45746	if v == nil {
45747		return fmt.Errorf("unexpected nil of type %T", v)
45748	}
45749	if value == nil {
45750		return nil
45751	}
45752
45753	shape, ok := value.(map[string]interface{})
45754	if !ok {
45755		return fmt.Errorf("unexpected JSON type %v", value)
45756	}
45757
45758	var sv *types.ThingAttribute
45759	if *v == nil {
45760		sv = &types.ThingAttribute{}
45761	} else {
45762		sv = *v
45763	}
45764
45765	for key, value := range shape {
45766		switch key {
45767		case "attributes":
45768			if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil {
45769				return err
45770			}
45771
45772		case "thingArn":
45773			if value != nil {
45774				jtv, ok := value.(string)
45775				if !ok {
45776					return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
45777				}
45778				sv.ThingArn = ptr.String(jtv)
45779			}
45780
45781		case "thingName":
45782			if value != nil {
45783				jtv, ok := value.(string)
45784				if !ok {
45785					return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
45786				}
45787				sv.ThingName = ptr.String(jtv)
45788			}
45789
45790		case "thingTypeName":
45791			if value != nil {
45792				jtv, ok := value.(string)
45793				if !ok {
45794					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
45795				}
45796				sv.ThingTypeName = ptr.String(jtv)
45797			}
45798
45799		case "version":
45800			if value != nil {
45801				jtv, ok := value.(json.Number)
45802				if !ok {
45803					return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
45804				}
45805				i64, err := jtv.Int64()
45806				if err != nil {
45807					return err
45808				}
45809				sv.Version = i64
45810			}
45811
45812		default:
45813			_, _ = key, value
45814
45815		}
45816	}
45817	*v = sv
45818	return nil
45819}
45820
45821func awsRestjson1_deserializeDocumentThingAttributeList(v *[]types.ThingAttribute, value interface{}) error {
45822	if v == nil {
45823		return fmt.Errorf("unexpected nil of type %T", v)
45824	}
45825	if value == nil {
45826		return nil
45827	}
45828
45829	shape, ok := value.([]interface{})
45830	if !ok {
45831		return fmt.Errorf("unexpected JSON type %v", value)
45832	}
45833
45834	var cv []types.ThingAttribute
45835	if *v == nil {
45836		cv = []types.ThingAttribute{}
45837	} else {
45838		cv = *v
45839	}
45840
45841	for _, value := range shape {
45842		var col types.ThingAttribute
45843		destAddr := &col
45844		if err := awsRestjson1_deserializeDocumentThingAttribute(&destAddr, value); err != nil {
45845			return err
45846		}
45847		col = *destAddr
45848		cv = append(cv, col)
45849
45850	}
45851	*v = cv
45852	return nil
45853}
45854
45855func awsRestjson1_deserializeDocumentThingConnectivity(v **types.ThingConnectivity, value interface{}) error {
45856	if v == nil {
45857		return fmt.Errorf("unexpected nil of type %T", v)
45858	}
45859	if value == nil {
45860		return nil
45861	}
45862
45863	shape, ok := value.(map[string]interface{})
45864	if !ok {
45865		return fmt.Errorf("unexpected JSON type %v", value)
45866	}
45867
45868	var sv *types.ThingConnectivity
45869	if *v == nil {
45870		sv = &types.ThingConnectivity{}
45871	} else {
45872		sv = *v
45873	}
45874
45875	for key, value := range shape {
45876		switch key {
45877		case "connected":
45878			if value != nil {
45879				jtv, ok := value.(bool)
45880				if !ok {
45881					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
45882				}
45883				sv.Connected = jtv
45884			}
45885
45886		case "timestamp":
45887			if value != nil {
45888				jtv, ok := value.(json.Number)
45889				if !ok {
45890					return fmt.Errorf("expected ConnectivityTimestamp to be json.Number, got %T instead", value)
45891				}
45892				i64, err := jtv.Int64()
45893				if err != nil {
45894					return err
45895				}
45896				sv.Timestamp = ptr.Int64(i64)
45897			}
45898
45899		default:
45900			_, _ = key, value
45901
45902		}
45903	}
45904	*v = sv
45905	return nil
45906}
45907
45908func awsRestjson1_deserializeDocumentThingDocument(v **types.ThingDocument, value interface{}) error {
45909	if v == nil {
45910		return fmt.Errorf("unexpected nil of type %T", v)
45911	}
45912	if value == nil {
45913		return nil
45914	}
45915
45916	shape, ok := value.(map[string]interface{})
45917	if !ok {
45918		return fmt.Errorf("unexpected JSON type %v", value)
45919	}
45920
45921	var sv *types.ThingDocument
45922	if *v == nil {
45923		sv = &types.ThingDocument{}
45924	} else {
45925		sv = *v
45926	}
45927
45928	for key, value := range shape {
45929		switch key {
45930		case "attributes":
45931			if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil {
45932				return err
45933			}
45934
45935		case "connectivity":
45936			if err := awsRestjson1_deserializeDocumentThingConnectivity(&sv.Connectivity, value); err != nil {
45937				return err
45938			}
45939
45940		case "shadow":
45941			if value != nil {
45942				jtv, ok := value.(string)
45943				if !ok {
45944					return fmt.Errorf("expected JsonDocument to be of type string, got %T instead", value)
45945				}
45946				sv.Shadow = ptr.String(jtv)
45947			}
45948
45949		case "thingGroupNames":
45950			if err := awsRestjson1_deserializeDocumentThingGroupNameList(&sv.ThingGroupNames, value); err != nil {
45951				return err
45952			}
45953
45954		case "thingId":
45955			if value != nil {
45956				jtv, ok := value.(string)
45957				if !ok {
45958					return fmt.Errorf("expected ThingId to be of type string, got %T instead", value)
45959				}
45960				sv.ThingId = ptr.String(jtv)
45961			}
45962
45963		case "thingName":
45964			if value != nil {
45965				jtv, ok := value.(string)
45966				if !ok {
45967					return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
45968				}
45969				sv.ThingName = ptr.String(jtv)
45970			}
45971
45972		case "thingTypeName":
45973			if value != nil {
45974				jtv, ok := value.(string)
45975				if !ok {
45976					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
45977				}
45978				sv.ThingTypeName = ptr.String(jtv)
45979			}
45980
45981		default:
45982			_, _ = key, value
45983
45984		}
45985	}
45986	*v = sv
45987	return nil
45988}
45989
45990func awsRestjson1_deserializeDocumentThingDocumentList(v *[]types.ThingDocument, value interface{}) error {
45991	if v == nil {
45992		return fmt.Errorf("unexpected nil of type %T", v)
45993	}
45994	if value == nil {
45995		return nil
45996	}
45997
45998	shape, ok := value.([]interface{})
45999	if !ok {
46000		return fmt.Errorf("unexpected JSON type %v", value)
46001	}
46002
46003	var cv []types.ThingDocument
46004	if *v == nil {
46005		cv = []types.ThingDocument{}
46006	} else {
46007		cv = *v
46008	}
46009
46010	for _, value := range shape {
46011		var col types.ThingDocument
46012		destAddr := &col
46013		if err := awsRestjson1_deserializeDocumentThingDocument(&destAddr, value); err != nil {
46014			return err
46015		}
46016		col = *destAddr
46017		cv = append(cv, col)
46018
46019	}
46020	*v = cv
46021	return nil
46022}
46023
46024func awsRestjson1_deserializeDocumentThingGroupDocument(v **types.ThingGroupDocument, value interface{}) error {
46025	if v == nil {
46026		return fmt.Errorf("unexpected nil of type %T", v)
46027	}
46028	if value == nil {
46029		return nil
46030	}
46031
46032	shape, ok := value.(map[string]interface{})
46033	if !ok {
46034		return fmt.Errorf("unexpected JSON type %v", value)
46035	}
46036
46037	var sv *types.ThingGroupDocument
46038	if *v == nil {
46039		sv = &types.ThingGroupDocument{}
46040	} else {
46041		sv = *v
46042	}
46043
46044	for key, value := range shape {
46045		switch key {
46046		case "attributes":
46047			if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil {
46048				return err
46049			}
46050
46051		case "parentGroupNames":
46052			if err := awsRestjson1_deserializeDocumentThingGroupNameList(&sv.ParentGroupNames, value); err != nil {
46053				return err
46054			}
46055
46056		case "thingGroupDescription":
46057			if value != nil {
46058				jtv, ok := value.(string)
46059				if !ok {
46060					return fmt.Errorf("expected ThingGroupDescription to be of type string, got %T instead", value)
46061				}
46062				sv.ThingGroupDescription = ptr.String(jtv)
46063			}
46064
46065		case "thingGroupId":
46066			if value != nil {
46067				jtv, ok := value.(string)
46068				if !ok {
46069					return fmt.Errorf("expected ThingGroupId to be of type string, got %T instead", value)
46070				}
46071				sv.ThingGroupId = ptr.String(jtv)
46072			}
46073
46074		case "thingGroupName":
46075			if value != nil {
46076				jtv, ok := value.(string)
46077				if !ok {
46078					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
46079				}
46080				sv.ThingGroupName = ptr.String(jtv)
46081			}
46082
46083		default:
46084			_, _ = key, value
46085
46086		}
46087	}
46088	*v = sv
46089	return nil
46090}
46091
46092func awsRestjson1_deserializeDocumentThingGroupDocumentList(v *[]types.ThingGroupDocument, value interface{}) error {
46093	if v == nil {
46094		return fmt.Errorf("unexpected nil of type %T", v)
46095	}
46096	if value == nil {
46097		return nil
46098	}
46099
46100	shape, ok := value.([]interface{})
46101	if !ok {
46102		return fmt.Errorf("unexpected JSON type %v", value)
46103	}
46104
46105	var cv []types.ThingGroupDocument
46106	if *v == nil {
46107		cv = []types.ThingGroupDocument{}
46108	} else {
46109		cv = *v
46110	}
46111
46112	for _, value := range shape {
46113		var col types.ThingGroupDocument
46114		destAddr := &col
46115		if err := awsRestjson1_deserializeDocumentThingGroupDocument(&destAddr, value); err != nil {
46116			return err
46117		}
46118		col = *destAddr
46119		cv = append(cv, col)
46120
46121	}
46122	*v = cv
46123	return nil
46124}
46125
46126func awsRestjson1_deserializeDocumentThingGroupIndexingConfiguration(v **types.ThingGroupIndexingConfiguration, value interface{}) error {
46127	if v == nil {
46128		return fmt.Errorf("unexpected nil of type %T", v)
46129	}
46130	if value == nil {
46131		return nil
46132	}
46133
46134	shape, ok := value.(map[string]interface{})
46135	if !ok {
46136		return fmt.Errorf("unexpected JSON type %v", value)
46137	}
46138
46139	var sv *types.ThingGroupIndexingConfiguration
46140	if *v == nil {
46141		sv = &types.ThingGroupIndexingConfiguration{}
46142	} else {
46143		sv = *v
46144	}
46145
46146	for key, value := range shape {
46147		switch key {
46148		case "customFields":
46149			if err := awsRestjson1_deserializeDocumentFields(&sv.CustomFields, value); err != nil {
46150				return err
46151			}
46152
46153		case "managedFields":
46154			if err := awsRestjson1_deserializeDocumentFields(&sv.ManagedFields, value); err != nil {
46155				return err
46156			}
46157
46158		case "thingGroupIndexingMode":
46159			if value != nil {
46160				jtv, ok := value.(string)
46161				if !ok {
46162					return fmt.Errorf("expected ThingGroupIndexingMode to be of type string, got %T instead", value)
46163				}
46164				sv.ThingGroupIndexingMode = types.ThingGroupIndexingMode(jtv)
46165			}
46166
46167		default:
46168			_, _ = key, value
46169
46170		}
46171	}
46172	*v = sv
46173	return nil
46174}
46175
46176func awsRestjson1_deserializeDocumentThingGroupMetadata(v **types.ThingGroupMetadata, value interface{}) error {
46177	if v == nil {
46178		return fmt.Errorf("unexpected nil of type %T", v)
46179	}
46180	if value == nil {
46181		return nil
46182	}
46183
46184	shape, ok := value.(map[string]interface{})
46185	if !ok {
46186		return fmt.Errorf("unexpected JSON type %v", value)
46187	}
46188
46189	var sv *types.ThingGroupMetadata
46190	if *v == nil {
46191		sv = &types.ThingGroupMetadata{}
46192	} else {
46193		sv = *v
46194	}
46195
46196	for key, value := range shape {
46197		switch key {
46198		case "creationDate":
46199			if value != nil {
46200				jtv, ok := value.(json.Number)
46201				if !ok {
46202					return fmt.Errorf("expected CreationDate to be json.Number, got %T instead", value)
46203				}
46204				f64, err := jtv.Float64()
46205				if err != nil {
46206					return err
46207				}
46208				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
46209			}
46210
46211		case "parentGroupName":
46212			if value != nil {
46213				jtv, ok := value.(string)
46214				if !ok {
46215					return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
46216				}
46217				sv.ParentGroupName = ptr.String(jtv)
46218			}
46219
46220		case "rootToParentThingGroups":
46221			if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.RootToParentThingGroups, value); err != nil {
46222				return err
46223			}
46224
46225		default:
46226			_, _ = key, value
46227
46228		}
46229	}
46230	*v = sv
46231	return nil
46232}
46233
46234func awsRestjson1_deserializeDocumentThingGroupNameAndArnList(v *[]types.GroupNameAndArn, value interface{}) error {
46235	if v == nil {
46236		return fmt.Errorf("unexpected nil of type %T", v)
46237	}
46238	if value == nil {
46239		return nil
46240	}
46241
46242	shape, ok := value.([]interface{})
46243	if !ok {
46244		return fmt.Errorf("unexpected JSON type %v", value)
46245	}
46246
46247	var cv []types.GroupNameAndArn
46248	if *v == nil {
46249		cv = []types.GroupNameAndArn{}
46250	} else {
46251		cv = *v
46252	}
46253
46254	for _, value := range shape {
46255		var col types.GroupNameAndArn
46256		destAddr := &col
46257		if err := awsRestjson1_deserializeDocumentGroupNameAndArn(&destAddr, value); err != nil {
46258			return err
46259		}
46260		col = *destAddr
46261		cv = append(cv, col)
46262
46263	}
46264	*v = cv
46265	return nil
46266}
46267
46268func awsRestjson1_deserializeDocumentThingGroupNameList(v *[]string, value interface{}) error {
46269	if v == nil {
46270		return fmt.Errorf("unexpected nil of type %T", v)
46271	}
46272	if value == nil {
46273		return nil
46274	}
46275
46276	shape, ok := value.([]interface{})
46277	if !ok {
46278		return fmt.Errorf("unexpected JSON type %v", value)
46279	}
46280
46281	var cv []string
46282	if *v == nil {
46283		cv = []string{}
46284	} else {
46285		cv = *v
46286	}
46287
46288	for _, value := range shape {
46289		var col string
46290		if value != nil {
46291			jtv, ok := value.(string)
46292			if !ok {
46293				return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
46294			}
46295			col = jtv
46296		}
46297		cv = append(cv, col)
46298
46299	}
46300	*v = cv
46301	return nil
46302}
46303
46304func awsRestjson1_deserializeDocumentThingGroupNames(v *[]string, value interface{}) error {
46305	if v == nil {
46306		return fmt.Errorf("unexpected nil of type %T", v)
46307	}
46308	if value == nil {
46309		return nil
46310	}
46311
46312	shape, ok := value.([]interface{})
46313	if !ok {
46314		return fmt.Errorf("unexpected JSON type %v", value)
46315	}
46316
46317	var cv []string
46318	if *v == nil {
46319		cv = []string{}
46320	} else {
46321		cv = *v
46322	}
46323
46324	for _, value := range shape {
46325		var col string
46326		if value != nil {
46327			jtv, ok := value.(string)
46328			if !ok {
46329				return fmt.Errorf("expected ThingGroupName to be of type string, got %T instead", value)
46330			}
46331			col = jtv
46332		}
46333		cv = append(cv, col)
46334
46335	}
46336	*v = cv
46337	return nil
46338}
46339
46340func awsRestjson1_deserializeDocumentThingGroupProperties(v **types.ThingGroupProperties, value interface{}) error {
46341	if v == nil {
46342		return fmt.Errorf("unexpected nil of type %T", v)
46343	}
46344	if value == nil {
46345		return nil
46346	}
46347
46348	shape, ok := value.(map[string]interface{})
46349	if !ok {
46350		return fmt.Errorf("unexpected JSON type %v", value)
46351	}
46352
46353	var sv *types.ThingGroupProperties
46354	if *v == nil {
46355		sv = &types.ThingGroupProperties{}
46356	} else {
46357		sv = *v
46358	}
46359
46360	for key, value := range shape {
46361		switch key {
46362		case "attributePayload":
46363			if err := awsRestjson1_deserializeDocumentAttributePayload(&sv.AttributePayload, value); err != nil {
46364				return err
46365			}
46366
46367		case "thingGroupDescription":
46368			if value != nil {
46369				jtv, ok := value.(string)
46370				if !ok {
46371					return fmt.Errorf("expected ThingGroupDescription to be of type string, got %T instead", value)
46372				}
46373				sv.ThingGroupDescription = ptr.String(jtv)
46374			}
46375
46376		default:
46377			_, _ = key, value
46378
46379		}
46380	}
46381	*v = sv
46382	return nil
46383}
46384
46385func awsRestjson1_deserializeDocumentThingIndexingConfiguration(v **types.ThingIndexingConfiguration, value interface{}) error {
46386	if v == nil {
46387		return fmt.Errorf("unexpected nil of type %T", v)
46388	}
46389	if value == nil {
46390		return nil
46391	}
46392
46393	shape, ok := value.(map[string]interface{})
46394	if !ok {
46395		return fmt.Errorf("unexpected JSON type %v", value)
46396	}
46397
46398	var sv *types.ThingIndexingConfiguration
46399	if *v == nil {
46400		sv = &types.ThingIndexingConfiguration{}
46401	} else {
46402		sv = *v
46403	}
46404
46405	for key, value := range shape {
46406		switch key {
46407		case "customFields":
46408			if err := awsRestjson1_deserializeDocumentFields(&sv.CustomFields, value); err != nil {
46409				return err
46410			}
46411
46412		case "managedFields":
46413			if err := awsRestjson1_deserializeDocumentFields(&sv.ManagedFields, value); err != nil {
46414				return err
46415			}
46416
46417		case "thingConnectivityIndexingMode":
46418			if value != nil {
46419				jtv, ok := value.(string)
46420				if !ok {
46421					return fmt.Errorf("expected ThingConnectivityIndexingMode to be of type string, got %T instead", value)
46422				}
46423				sv.ThingConnectivityIndexingMode = types.ThingConnectivityIndexingMode(jtv)
46424			}
46425
46426		case "thingIndexingMode":
46427			if value != nil {
46428				jtv, ok := value.(string)
46429				if !ok {
46430					return fmt.Errorf("expected ThingIndexingMode to be of type string, got %T instead", value)
46431				}
46432				sv.ThingIndexingMode = types.ThingIndexingMode(jtv)
46433			}
46434
46435		default:
46436			_, _ = key, value
46437
46438		}
46439	}
46440	*v = sv
46441	return nil
46442}
46443
46444func awsRestjson1_deserializeDocumentThingNameList(v *[]string, value interface{}) error {
46445	if v == nil {
46446		return fmt.Errorf("unexpected nil of type %T", v)
46447	}
46448	if value == nil {
46449		return nil
46450	}
46451
46452	shape, ok := value.([]interface{})
46453	if !ok {
46454		return fmt.Errorf("unexpected JSON type %v", value)
46455	}
46456
46457	var cv []string
46458	if *v == nil {
46459		cv = []string{}
46460	} else {
46461		cv = *v
46462	}
46463
46464	for _, value := range shape {
46465		var col string
46466		if value != nil {
46467			jtv, ok := value.(string)
46468			if !ok {
46469				return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
46470			}
46471			col = jtv
46472		}
46473		cv = append(cv, col)
46474
46475	}
46476	*v = cv
46477	return nil
46478}
46479
46480func awsRestjson1_deserializeDocumentThingTypeDefinition(v **types.ThingTypeDefinition, value interface{}) error {
46481	if v == nil {
46482		return fmt.Errorf("unexpected nil of type %T", v)
46483	}
46484	if value == nil {
46485		return nil
46486	}
46487
46488	shape, ok := value.(map[string]interface{})
46489	if !ok {
46490		return fmt.Errorf("unexpected JSON type %v", value)
46491	}
46492
46493	var sv *types.ThingTypeDefinition
46494	if *v == nil {
46495		sv = &types.ThingTypeDefinition{}
46496	} else {
46497		sv = *v
46498	}
46499
46500	for key, value := range shape {
46501		switch key {
46502		case "thingTypeArn":
46503			if value != nil {
46504				jtv, ok := value.(string)
46505				if !ok {
46506					return fmt.Errorf("expected ThingTypeArn to be of type string, got %T instead", value)
46507				}
46508				sv.ThingTypeArn = ptr.String(jtv)
46509			}
46510
46511		case "thingTypeMetadata":
46512			if err := awsRestjson1_deserializeDocumentThingTypeMetadata(&sv.ThingTypeMetadata, value); err != nil {
46513				return err
46514			}
46515
46516		case "thingTypeName":
46517			if value != nil {
46518				jtv, ok := value.(string)
46519				if !ok {
46520					return fmt.Errorf("expected ThingTypeName to be of type string, got %T instead", value)
46521				}
46522				sv.ThingTypeName = ptr.String(jtv)
46523			}
46524
46525		case "thingTypeProperties":
46526			if err := awsRestjson1_deserializeDocumentThingTypeProperties(&sv.ThingTypeProperties, value); err != nil {
46527				return err
46528			}
46529
46530		default:
46531			_, _ = key, value
46532
46533		}
46534	}
46535	*v = sv
46536	return nil
46537}
46538
46539func awsRestjson1_deserializeDocumentThingTypeList(v *[]types.ThingTypeDefinition, value interface{}) error {
46540	if v == nil {
46541		return fmt.Errorf("unexpected nil of type %T", v)
46542	}
46543	if value == nil {
46544		return nil
46545	}
46546
46547	shape, ok := value.([]interface{})
46548	if !ok {
46549		return fmt.Errorf("unexpected JSON type %v", value)
46550	}
46551
46552	var cv []types.ThingTypeDefinition
46553	if *v == nil {
46554		cv = []types.ThingTypeDefinition{}
46555	} else {
46556		cv = *v
46557	}
46558
46559	for _, value := range shape {
46560		var col types.ThingTypeDefinition
46561		destAddr := &col
46562		if err := awsRestjson1_deserializeDocumentThingTypeDefinition(&destAddr, value); err != nil {
46563			return err
46564		}
46565		col = *destAddr
46566		cv = append(cv, col)
46567
46568	}
46569	*v = cv
46570	return nil
46571}
46572
46573func awsRestjson1_deserializeDocumentThingTypeMetadata(v **types.ThingTypeMetadata, value interface{}) error {
46574	if v == nil {
46575		return fmt.Errorf("unexpected nil of type %T", v)
46576	}
46577	if value == nil {
46578		return nil
46579	}
46580
46581	shape, ok := value.(map[string]interface{})
46582	if !ok {
46583		return fmt.Errorf("unexpected JSON type %v", value)
46584	}
46585
46586	var sv *types.ThingTypeMetadata
46587	if *v == nil {
46588		sv = &types.ThingTypeMetadata{}
46589	} else {
46590		sv = *v
46591	}
46592
46593	for key, value := range shape {
46594		switch key {
46595		case "creationDate":
46596			if value != nil {
46597				jtv, ok := value.(json.Number)
46598				if !ok {
46599					return fmt.Errorf("expected CreationDate to be json.Number, got %T instead", value)
46600				}
46601				f64, err := jtv.Float64()
46602				if err != nil {
46603					return err
46604				}
46605				sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
46606			}
46607
46608		case "deprecated":
46609			if value != nil {
46610				jtv, ok := value.(bool)
46611				if !ok {
46612					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
46613				}
46614				sv.Deprecated = jtv
46615			}
46616
46617		case "deprecationDate":
46618			if value != nil {
46619				jtv, ok := value.(json.Number)
46620				if !ok {
46621					return fmt.Errorf("expected DeprecationDate to be json.Number, got %T instead", value)
46622				}
46623				f64, err := jtv.Float64()
46624				if err != nil {
46625					return err
46626				}
46627				sv.DeprecationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
46628			}
46629
46630		default:
46631			_, _ = key, value
46632
46633		}
46634	}
46635	*v = sv
46636	return nil
46637}
46638
46639func awsRestjson1_deserializeDocumentThingTypeProperties(v **types.ThingTypeProperties, value interface{}) error {
46640	if v == nil {
46641		return fmt.Errorf("unexpected nil of type %T", v)
46642	}
46643	if value == nil {
46644		return nil
46645	}
46646
46647	shape, ok := value.(map[string]interface{})
46648	if !ok {
46649		return fmt.Errorf("unexpected JSON type %v", value)
46650	}
46651
46652	var sv *types.ThingTypeProperties
46653	if *v == nil {
46654		sv = &types.ThingTypeProperties{}
46655	} else {
46656		sv = *v
46657	}
46658
46659	for key, value := range shape {
46660		switch key {
46661		case "searchableAttributes":
46662			if err := awsRestjson1_deserializeDocumentSearchableAttributes(&sv.SearchableAttributes, value); err != nil {
46663				return err
46664			}
46665
46666		case "thingTypeDescription":
46667			if value != nil {
46668				jtv, ok := value.(string)
46669				if !ok {
46670					return fmt.Errorf("expected ThingTypeDescription to be of type string, got %T instead", value)
46671				}
46672				sv.ThingTypeDescription = ptr.String(jtv)
46673			}
46674
46675		default:
46676			_, _ = key, value
46677
46678		}
46679	}
46680	*v = sv
46681	return nil
46682}
46683
46684func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
46685	if v == nil {
46686		return fmt.Errorf("unexpected nil of type %T", v)
46687	}
46688	if value == nil {
46689		return nil
46690	}
46691
46692	shape, ok := value.(map[string]interface{})
46693	if !ok {
46694		return fmt.Errorf("unexpected JSON type %v", value)
46695	}
46696
46697	var sv *types.ThrottlingException
46698	if *v == nil {
46699		sv = &types.ThrottlingException{}
46700	} else {
46701		sv = *v
46702	}
46703
46704	for key, value := range shape {
46705		switch key {
46706		case "message":
46707			if value != nil {
46708				jtv, ok := value.(string)
46709				if !ok {
46710					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
46711				}
46712				sv.Message = ptr.String(jtv)
46713			}
46714
46715		default:
46716			_, _ = key, value
46717
46718		}
46719	}
46720	*v = sv
46721	return nil
46722}
46723
46724func awsRestjson1_deserializeDocumentTimeoutConfig(v **types.TimeoutConfig, value interface{}) error {
46725	if v == nil {
46726		return fmt.Errorf("unexpected nil of type %T", v)
46727	}
46728	if value == nil {
46729		return nil
46730	}
46731
46732	shape, ok := value.(map[string]interface{})
46733	if !ok {
46734		return fmt.Errorf("unexpected JSON type %v", value)
46735	}
46736
46737	var sv *types.TimeoutConfig
46738	if *v == nil {
46739		sv = &types.TimeoutConfig{}
46740	} else {
46741		sv = *v
46742	}
46743
46744	for key, value := range shape {
46745		switch key {
46746		case "inProgressTimeoutInMinutes":
46747			if value != nil {
46748				jtv, ok := value.(json.Number)
46749				if !ok {
46750					return fmt.Errorf("expected InProgressTimeoutInMinutes to be json.Number, got %T instead", value)
46751				}
46752				i64, err := jtv.Int64()
46753				if err != nil {
46754					return err
46755				}
46756				sv.InProgressTimeoutInMinutes = ptr.Int64(i64)
46757			}
46758
46759		default:
46760			_, _ = key, value
46761
46762		}
46763	}
46764	*v = sv
46765	return nil
46766}
46767
46768func awsRestjson1_deserializeDocumentTimestreamAction(v **types.TimestreamAction, value interface{}) error {
46769	if v == nil {
46770		return fmt.Errorf("unexpected nil of type %T", v)
46771	}
46772	if value == nil {
46773		return nil
46774	}
46775
46776	shape, ok := value.(map[string]interface{})
46777	if !ok {
46778		return fmt.Errorf("unexpected JSON type %v", value)
46779	}
46780
46781	var sv *types.TimestreamAction
46782	if *v == nil {
46783		sv = &types.TimestreamAction{}
46784	} else {
46785		sv = *v
46786	}
46787
46788	for key, value := range shape {
46789		switch key {
46790		case "databaseName":
46791			if value != nil {
46792				jtv, ok := value.(string)
46793				if !ok {
46794					return fmt.Errorf("expected TimestreamDatabaseName to be of type string, got %T instead", value)
46795				}
46796				sv.DatabaseName = ptr.String(jtv)
46797			}
46798
46799		case "dimensions":
46800			if err := awsRestjson1_deserializeDocumentTimestreamDimensionList(&sv.Dimensions, value); err != nil {
46801				return err
46802			}
46803
46804		case "roleArn":
46805			if value != nil {
46806				jtv, ok := value.(string)
46807				if !ok {
46808					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
46809				}
46810				sv.RoleArn = ptr.String(jtv)
46811			}
46812
46813		case "tableName":
46814			if value != nil {
46815				jtv, ok := value.(string)
46816				if !ok {
46817					return fmt.Errorf("expected TimestreamTableName to be of type string, got %T instead", value)
46818				}
46819				sv.TableName = ptr.String(jtv)
46820			}
46821
46822		case "timestamp":
46823			if err := awsRestjson1_deserializeDocumentTimestreamTimestamp(&sv.Timestamp, value); err != nil {
46824				return err
46825			}
46826
46827		default:
46828			_, _ = key, value
46829
46830		}
46831	}
46832	*v = sv
46833	return nil
46834}
46835
46836func awsRestjson1_deserializeDocumentTimestreamDimension(v **types.TimestreamDimension, value interface{}) error {
46837	if v == nil {
46838		return fmt.Errorf("unexpected nil of type %T", v)
46839	}
46840	if value == nil {
46841		return nil
46842	}
46843
46844	shape, ok := value.(map[string]interface{})
46845	if !ok {
46846		return fmt.Errorf("unexpected JSON type %v", value)
46847	}
46848
46849	var sv *types.TimestreamDimension
46850	if *v == nil {
46851		sv = &types.TimestreamDimension{}
46852	} else {
46853		sv = *v
46854	}
46855
46856	for key, value := range shape {
46857		switch key {
46858		case "name":
46859			if value != nil {
46860				jtv, ok := value.(string)
46861				if !ok {
46862					return fmt.Errorf("expected TimestreamDimensionName to be of type string, got %T instead", value)
46863				}
46864				sv.Name = ptr.String(jtv)
46865			}
46866
46867		case "value":
46868			if value != nil {
46869				jtv, ok := value.(string)
46870				if !ok {
46871					return fmt.Errorf("expected TimestreamDimensionValue to be of type string, got %T instead", value)
46872				}
46873				sv.Value = ptr.String(jtv)
46874			}
46875
46876		default:
46877			_, _ = key, value
46878
46879		}
46880	}
46881	*v = sv
46882	return nil
46883}
46884
46885func awsRestjson1_deserializeDocumentTimestreamDimensionList(v *[]types.TimestreamDimension, value interface{}) error {
46886	if v == nil {
46887		return fmt.Errorf("unexpected nil of type %T", v)
46888	}
46889	if value == nil {
46890		return nil
46891	}
46892
46893	shape, ok := value.([]interface{})
46894	if !ok {
46895		return fmt.Errorf("unexpected JSON type %v", value)
46896	}
46897
46898	var cv []types.TimestreamDimension
46899	if *v == nil {
46900		cv = []types.TimestreamDimension{}
46901	} else {
46902		cv = *v
46903	}
46904
46905	for _, value := range shape {
46906		var col types.TimestreamDimension
46907		destAddr := &col
46908		if err := awsRestjson1_deserializeDocumentTimestreamDimension(&destAddr, value); err != nil {
46909			return err
46910		}
46911		col = *destAddr
46912		cv = append(cv, col)
46913
46914	}
46915	*v = cv
46916	return nil
46917}
46918
46919func awsRestjson1_deserializeDocumentTimestreamTimestamp(v **types.TimestreamTimestamp, value interface{}) error {
46920	if v == nil {
46921		return fmt.Errorf("unexpected nil of type %T", v)
46922	}
46923	if value == nil {
46924		return nil
46925	}
46926
46927	shape, ok := value.(map[string]interface{})
46928	if !ok {
46929		return fmt.Errorf("unexpected JSON type %v", value)
46930	}
46931
46932	var sv *types.TimestreamTimestamp
46933	if *v == nil {
46934		sv = &types.TimestreamTimestamp{}
46935	} else {
46936		sv = *v
46937	}
46938
46939	for key, value := range shape {
46940		switch key {
46941		case "unit":
46942			if value != nil {
46943				jtv, ok := value.(string)
46944				if !ok {
46945					return fmt.Errorf("expected TimestreamTimestampUnit to be of type string, got %T instead", value)
46946				}
46947				sv.Unit = ptr.String(jtv)
46948			}
46949
46950		case "value":
46951			if value != nil {
46952				jtv, ok := value.(string)
46953				if !ok {
46954					return fmt.Errorf("expected TimestreamTimestampValue to be of type string, got %T instead", value)
46955				}
46956				sv.Value = ptr.String(jtv)
46957			}
46958
46959		default:
46960			_, _ = key, value
46961
46962		}
46963	}
46964	*v = sv
46965	return nil
46966}
46967
46968func awsRestjson1_deserializeDocumentTopicRule(v **types.TopicRule, value interface{}) error {
46969	if v == nil {
46970		return fmt.Errorf("unexpected nil of type %T", v)
46971	}
46972	if value == nil {
46973		return nil
46974	}
46975
46976	shape, ok := value.(map[string]interface{})
46977	if !ok {
46978		return fmt.Errorf("unexpected JSON type %v", value)
46979	}
46980
46981	var sv *types.TopicRule
46982	if *v == nil {
46983		sv = &types.TopicRule{}
46984	} else {
46985		sv = *v
46986	}
46987
46988	for key, value := range shape {
46989		switch key {
46990		case "actions":
46991			if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil {
46992				return err
46993			}
46994
46995		case "awsIotSqlVersion":
46996			if value != nil {
46997				jtv, ok := value.(string)
46998				if !ok {
46999					return fmt.Errorf("expected AwsIotSqlVersion to be of type string, got %T instead", value)
47000				}
47001				sv.AwsIotSqlVersion = ptr.String(jtv)
47002			}
47003
47004		case "createdAt":
47005			if value != nil {
47006				jtv, ok := value.(json.Number)
47007				if !ok {
47008					return fmt.Errorf("expected CreatedAtDate to be json.Number, got %T instead", value)
47009				}
47010				f64, err := jtv.Float64()
47011				if err != nil {
47012					return err
47013				}
47014				sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
47015			}
47016
47017		case "description":
47018			if value != nil {
47019				jtv, ok := value.(string)
47020				if !ok {
47021					return fmt.Errorf("expected Description to be of type string, got %T instead", value)
47022				}
47023				sv.Description = ptr.String(jtv)
47024			}
47025
47026		case "errorAction":
47027			if err := awsRestjson1_deserializeDocumentAction(&sv.ErrorAction, value); err != nil {
47028				return err
47029			}
47030
47031		case "ruleDisabled":
47032			if value != nil {
47033				jtv, ok := value.(bool)
47034				if !ok {
47035					return fmt.Errorf("expected IsDisabled to be of type *bool, got %T instead", value)
47036				}
47037				sv.RuleDisabled = ptr.Bool(jtv)
47038			}
47039
47040		case "ruleName":
47041			if value != nil {
47042				jtv, ok := value.(string)
47043				if !ok {
47044					return fmt.Errorf("expected RuleName to be of type string, got %T instead", value)
47045				}
47046				sv.RuleName = ptr.String(jtv)
47047			}
47048
47049		case "sql":
47050			if value != nil {
47051				jtv, ok := value.(string)
47052				if !ok {
47053					return fmt.Errorf("expected SQL to be of type string, got %T instead", value)
47054				}
47055				sv.Sql = ptr.String(jtv)
47056			}
47057
47058		default:
47059			_, _ = key, value
47060
47061		}
47062	}
47063	*v = sv
47064	return nil
47065}
47066
47067func awsRestjson1_deserializeDocumentTopicRuleDestination(v **types.TopicRuleDestination, value interface{}) error {
47068	if v == nil {
47069		return fmt.Errorf("unexpected nil of type %T", v)
47070	}
47071	if value == nil {
47072		return nil
47073	}
47074
47075	shape, ok := value.(map[string]interface{})
47076	if !ok {
47077		return fmt.Errorf("unexpected JSON type %v", value)
47078	}
47079
47080	var sv *types.TopicRuleDestination
47081	if *v == nil {
47082		sv = &types.TopicRuleDestination{}
47083	} else {
47084		sv = *v
47085	}
47086
47087	for key, value := range shape {
47088		switch key {
47089		case "arn":
47090			if value != nil {
47091				jtv, ok := value.(string)
47092				if !ok {
47093					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
47094				}
47095				sv.Arn = ptr.String(jtv)
47096			}
47097
47098		case "httpUrlProperties":
47099			if err := awsRestjson1_deserializeDocumentHttpUrlDestinationProperties(&sv.HttpUrlProperties, value); err != nil {
47100				return err
47101			}
47102
47103		case "status":
47104			if value != nil {
47105				jtv, ok := value.(string)
47106				if !ok {
47107					return fmt.Errorf("expected TopicRuleDestinationStatus to be of type string, got %T instead", value)
47108				}
47109				sv.Status = types.TopicRuleDestinationStatus(jtv)
47110			}
47111
47112		case "statusReason":
47113			if value != nil {
47114				jtv, ok := value.(string)
47115				if !ok {
47116					return fmt.Errorf("expected String to be of type string, got %T instead", value)
47117				}
47118				sv.StatusReason = ptr.String(jtv)
47119			}
47120
47121		default:
47122			_, _ = key, value
47123
47124		}
47125	}
47126	*v = sv
47127	return nil
47128}
47129
47130func awsRestjson1_deserializeDocumentTopicRuleDestinationSummaries(v *[]types.TopicRuleDestinationSummary, value interface{}) error {
47131	if v == nil {
47132		return fmt.Errorf("unexpected nil of type %T", v)
47133	}
47134	if value == nil {
47135		return nil
47136	}
47137
47138	shape, ok := value.([]interface{})
47139	if !ok {
47140		return fmt.Errorf("unexpected JSON type %v", value)
47141	}
47142
47143	var cv []types.TopicRuleDestinationSummary
47144	if *v == nil {
47145		cv = []types.TopicRuleDestinationSummary{}
47146	} else {
47147		cv = *v
47148	}
47149
47150	for _, value := range shape {
47151		var col types.TopicRuleDestinationSummary
47152		destAddr := &col
47153		if err := awsRestjson1_deserializeDocumentTopicRuleDestinationSummary(&destAddr, value); err != nil {
47154			return err
47155		}
47156		col = *destAddr
47157		cv = append(cv, col)
47158
47159	}
47160	*v = cv
47161	return nil
47162}
47163
47164func awsRestjson1_deserializeDocumentTopicRuleDestinationSummary(v **types.TopicRuleDestinationSummary, value interface{}) error {
47165	if v == nil {
47166		return fmt.Errorf("unexpected nil of type %T", v)
47167	}
47168	if value == nil {
47169		return nil
47170	}
47171
47172	shape, ok := value.(map[string]interface{})
47173	if !ok {
47174		return fmt.Errorf("unexpected JSON type %v", value)
47175	}
47176
47177	var sv *types.TopicRuleDestinationSummary
47178	if *v == nil {
47179		sv = &types.TopicRuleDestinationSummary{}
47180	} else {
47181		sv = *v
47182	}
47183
47184	for key, value := range shape {
47185		switch key {
47186		case "arn":
47187			if value != nil {
47188				jtv, ok := value.(string)
47189				if !ok {
47190					return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value)
47191				}
47192				sv.Arn = ptr.String(jtv)
47193			}
47194
47195		case "httpUrlSummary":
47196			if err := awsRestjson1_deserializeDocumentHttpUrlDestinationSummary(&sv.HttpUrlSummary, value); err != nil {
47197				return err
47198			}
47199
47200		case "status":
47201			if value != nil {
47202				jtv, ok := value.(string)
47203				if !ok {
47204					return fmt.Errorf("expected TopicRuleDestinationStatus to be of type string, got %T instead", value)
47205				}
47206				sv.Status = types.TopicRuleDestinationStatus(jtv)
47207			}
47208
47209		case "statusReason":
47210			if value != nil {
47211				jtv, ok := value.(string)
47212				if !ok {
47213					return fmt.Errorf("expected String to be of type string, got %T instead", value)
47214				}
47215				sv.StatusReason = ptr.String(jtv)
47216			}
47217
47218		default:
47219			_, _ = key, value
47220
47221		}
47222	}
47223	*v = sv
47224	return nil
47225}
47226
47227func awsRestjson1_deserializeDocumentTopicRuleList(v *[]types.TopicRuleListItem, value interface{}) error {
47228	if v == nil {
47229		return fmt.Errorf("unexpected nil of type %T", v)
47230	}
47231	if value == nil {
47232		return nil
47233	}
47234
47235	shape, ok := value.([]interface{})
47236	if !ok {
47237		return fmt.Errorf("unexpected JSON type %v", value)
47238	}
47239
47240	var cv []types.TopicRuleListItem
47241	if *v == nil {
47242		cv = []types.TopicRuleListItem{}
47243	} else {
47244		cv = *v
47245	}
47246
47247	for _, value := range shape {
47248		var col types.TopicRuleListItem
47249		destAddr := &col
47250		if err := awsRestjson1_deserializeDocumentTopicRuleListItem(&destAddr, value); err != nil {
47251			return err
47252		}
47253		col = *destAddr
47254		cv = append(cv, col)
47255
47256	}
47257	*v = cv
47258	return nil
47259}
47260
47261func awsRestjson1_deserializeDocumentTopicRuleListItem(v **types.TopicRuleListItem, value interface{}) error {
47262	if v == nil {
47263		return fmt.Errorf("unexpected nil of type %T", v)
47264	}
47265	if value == nil {
47266		return nil
47267	}
47268
47269	shape, ok := value.(map[string]interface{})
47270	if !ok {
47271		return fmt.Errorf("unexpected JSON type %v", value)
47272	}
47273
47274	var sv *types.TopicRuleListItem
47275	if *v == nil {
47276		sv = &types.TopicRuleListItem{}
47277	} else {
47278		sv = *v
47279	}
47280
47281	for key, value := range shape {
47282		switch key {
47283		case "createdAt":
47284			if value != nil {
47285				jtv, ok := value.(json.Number)
47286				if !ok {
47287					return fmt.Errorf("expected CreatedAtDate to be json.Number, got %T instead", value)
47288				}
47289				f64, err := jtv.Float64()
47290				if err != nil {
47291					return err
47292				}
47293				sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
47294			}
47295
47296		case "ruleArn":
47297			if value != nil {
47298				jtv, ok := value.(string)
47299				if !ok {
47300					return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value)
47301				}
47302				sv.RuleArn = ptr.String(jtv)
47303			}
47304
47305		case "ruleDisabled":
47306			if value != nil {
47307				jtv, ok := value.(bool)
47308				if !ok {
47309					return fmt.Errorf("expected IsDisabled to be of type *bool, got %T instead", value)
47310				}
47311				sv.RuleDisabled = ptr.Bool(jtv)
47312			}
47313
47314		case "ruleName":
47315			if value != nil {
47316				jtv, ok := value.(string)
47317				if !ok {
47318					return fmt.Errorf("expected RuleName to be of type string, got %T instead", value)
47319				}
47320				sv.RuleName = ptr.String(jtv)
47321			}
47322
47323		case "topicPattern":
47324			if value != nil {
47325				jtv, ok := value.(string)
47326				if !ok {
47327					return fmt.Errorf("expected TopicPattern to be of type string, got %T instead", value)
47328				}
47329				sv.TopicPattern = ptr.String(jtv)
47330			}
47331
47332		default:
47333			_, _ = key, value
47334
47335		}
47336	}
47337	*v = sv
47338	return nil
47339}
47340
47341func awsRestjson1_deserializeDocumentTransferAlreadyCompletedException(v **types.TransferAlreadyCompletedException, value interface{}) error {
47342	if v == nil {
47343		return fmt.Errorf("unexpected nil of type %T", v)
47344	}
47345	if value == nil {
47346		return nil
47347	}
47348
47349	shape, ok := value.(map[string]interface{})
47350	if !ok {
47351		return fmt.Errorf("unexpected JSON type %v", value)
47352	}
47353
47354	var sv *types.TransferAlreadyCompletedException
47355	if *v == nil {
47356		sv = &types.TransferAlreadyCompletedException{}
47357	} else {
47358		sv = *v
47359	}
47360
47361	for key, value := range shape {
47362		switch key {
47363		case "message":
47364			if value != nil {
47365				jtv, ok := value.(string)
47366				if !ok {
47367					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
47368				}
47369				sv.Message = ptr.String(jtv)
47370			}
47371
47372		default:
47373			_, _ = key, value
47374
47375		}
47376	}
47377	*v = sv
47378	return nil
47379}
47380
47381func awsRestjson1_deserializeDocumentTransferConflictException(v **types.TransferConflictException, value interface{}) error {
47382	if v == nil {
47383		return fmt.Errorf("unexpected nil of type %T", v)
47384	}
47385	if value == nil {
47386		return nil
47387	}
47388
47389	shape, ok := value.(map[string]interface{})
47390	if !ok {
47391		return fmt.Errorf("unexpected JSON type %v", value)
47392	}
47393
47394	var sv *types.TransferConflictException
47395	if *v == nil {
47396		sv = &types.TransferConflictException{}
47397	} else {
47398		sv = *v
47399	}
47400
47401	for key, value := range shape {
47402		switch key {
47403		case "message":
47404			if value != nil {
47405				jtv, ok := value.(string)
47406				if !ok {
47407					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
47408				}
47409				sv.Message = ptr.String(jtv)
47410			}
47411
47412		default:
47413			_, _ = key, value
47414
47415		}
47416	}
47417	*v = sv
47418	return nil
47419}
47420
47421func awsRestjson1_deserializeDocumentTransferData(v **types.TransferData, value interface{}) error {
47422	if v == nil {
47423		return fmt.Errorf("unexpected nil of type %T", v)
47424	}
47425	if value == nil {
47426		return nil
47427	}
47428
47429	shape, ok := value.(map[string]interface{})
47430	if !ok {
47431		return fmt.Errorf("unexpected JSON type %v", value)
47432	}
47433
47434	var sv *types.TransferData
47435	if *v == nil {
47436		sv = &types.TransferData{}
47437	} else {
47438		sv = *v
47439	}
47440
47441	for key, value := range shape {
47442		switch key {
47443		case "acceptDate":
47444			if value != nil {
47445				jtv, ok := value.(json.Number)
47446				if !ok {
47447					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
47448				}
47449				f64, err := jtv.Float64()
47450				if err != nil {
47451					return err
47452				}
47453				sv.AcceptDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
47454			}
47455
47456		case "rejectDate":
47457			if value != nil {
47458				jtv, ok := value.(json.Number)
47459				if !ok {
47460					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
47461				}
47462				f64, err := jtv.Float64()
47463				if err != nil {
47464					return err
47465				}
47466				sv.RejectDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
47467			}
47468
47469		case "rejectReason":
47470			if value != nil {
47471				jtv, ok := value.(string)
47472				if !ok {
47473					return fmt.Errorf("expected Message to be of type string, got %T instead", value)
47474				}
47475				sv.RejectReason = ptr.String(jtv)
47476			}
47477
47478		case "transferDate":
47479			if value != nil {
47480				jtv, ok := value.(json.Number)
47481				if !ok {
47482					return fmt.Errorf("expected DateType to be json.Number, got %T instead", value)
47483				}
47484				f64, err := jtv.Float64()
47485				if err != nil {
47486					return err
47487				}
47488				sv.TransferDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
47489			}
47490
47491		case "transferMessage":
47492			if value != nil {
47493				jtv, ok := value.(string)
47494				if !ok {
47495					return fmt.Errorf("expected Message to be of type string, got %T instead", value)
47496				}
47497				sv.TransferMessage = ptr.String(jtv)
47498			}
47499
47500		default:
47501			_, _ = key, value
47502
47503		}
47504	}
47505	*v = sv
47506	return nil
47507}
47508
47509func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, value interface{}) error {
47510	if v == nil {
47511		return fmt.Errorf("unexpected nil of type %T", v)
47512	}
47513	if value == nil {
47514		return nil
47515	}
47516
47517	shape, ok := value.(map[string]interface{})
47518	if !ok {
47519		return fmt.Errorf("unexpected JSON type %v", value)
47520	}
47521
47522	var sv *types.UnauthorizedException
47523	if *v == nil {
47524		sv = &types.UnauthorizedException{}
47525	} else {
47526		sv = *v
47527	}
47528
47529	for key, value := range shape {
47530		switch key {
47531		case "message":
47532			if value != nil {
47533				jtv, ok := value.(string)
47534				if !ok {
47535					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
47536				}
47537				sv.Message = ptr.String(jtv)
47538			}
47539
47540		default:
47541			_, _ = key, value
47542
47543		}
47544	}
47545	*v = sv
47546	return nil
47547}
47548
47549func awsRestjson1_deserializeDocumentUpdateCACertificateParams(v **types.UpdateCACertificateParams, value interface{}) error {
47550	if v == nil {
47551		return fmt.Errorf("unexpected nil of type %T", v)
47552	}
47553	if value == nil {
47554		return nil
47555	}
47556
47557	shape, ok := value.(map[string]interface{})
47558	if !ok {
47559		return fmt.Errorf("unexpected JSON type %v", value)
47560	}
47561
47562	var sv *types.UpdateCACertificateParams
47563	if *v == nil {
47564		sv = &types.UpdateCACertificateParams{}
47565	} else {
47566		sv = *v
47567	}
47568
47569	for key, value := range shape {
47570		switch key {
47571		case "action":
47572			if value != nil {
47573				jtv, ok := value.(string)
47574				if !ok {
47575					return fmt.Errorf("expected CACertificateUpdateAction to be of type string, got %T instead", value)
47576				}
47577				sv.Action = types.CACertificateUpdateAction(jtv)
47578			}
47579
47580		default:
47581			_, _ = key, value
47582
47583		}
47584	}
47585	*v = sv
47586	return nil
47587}
47588
47589func awsRestjson1_deserializeDocumentUpdateDeviceCertificateParams(v **types.UpdateDeviceCertificateParams, value interface{}) error {
47590	if v == nil {
47591		return fmt.Errorf("unexpected nil of type %T", v)
47592	}
47593	if value == nil {
47594		return nil
47595	}
47596
47597	shape, ok := value.(map[string]interface{})
47598	if !ok {
47599		return fmt.Errorf("unexpected JSON type %v", value)
47600	}
47601
47602	var sv *types.UpdateDeviceCertificateParams
47603	if *v == nil {
47604		sv = &types.UpdateDeviceCertificateParams{}
47605	} else {
47606		sv = *v
47607	}
47608
47609	for key, value := range shape {
47610		switch key {
47611		case "action":
47612			if value != nil {
47613				jtv, ok := value.(string)
47614				if !ok {
47615					return fmt.Errorf("expected DeviceCertificateUpdateAction to be of type string, got %T instead", value)
47616				}
47617				sv.Action = types.DeviceCertificateUpdateAction(jtv)
47618			}
47619
47620		default:
47621			_, _ = key, value
47622
47623		}
47624	}
47625	*v = sv
47626	return nil
47627}
47628
47629func awsRestjson1_deserializeDocumentValidationError(v **types.ValidationError, value interface{}) error {
47630	if v == nil {
47631		return fmt.Errorf("unexpected nil of type %T", v)
47632	}
47633	if value == nil {
47634		return nil
47635	}
47636
47637	shape, ok := value.(map[string]interface{})
47638	if !ok {
47639		return fmt.Errorf("unexpected JSON type %v", value)
47640	}
47641
47642	var sv *types.ValidationError
47643	if *v == nil {
47644		sv = &types.ValidationError{}
47645	} else {
47646		sv = *v
47647	}
47648
47649	for key, value := range shape {
47650		switch key {
47651		case "errorMessage":
47652			if value != nil {
47653				jtv, ok := value.(string)
47654				if !ok {
47655					return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
47656				}
47657				sv.ErrorMessage = ptr.String(jtv)
47658			}
47659
47660		default:
47661			_, _ = key, value
47662
47663		}
47664	}
47665	*v = sv
47666	return nil
47667}
47668
47669func awsRestjson1_deserializeDocumentValidationErrors(v *[]types.ValidationError, value interface{}) error {
47670	if v == nil {
47671		return fmt.Errorf("unexpected nil of type %T", v)
47672	}
47673	if value == nil {
47674		return nil
47675	}
47676
47677	shape, ok := value.([]interface{})
47678	if !ok {
47679		return fmt.Errorf("unexpected JSON type %v", value)
47680	}
47681
47682	var cv []types.ValidationError
47683	if *v == nil {
47684		cv = []types.ValidationError{}
47685	} else {
47686		cv = *v
47687	}
47688
47689	for _, value := range shape {
47690		var col types.ValidationError
47691		destAddr := &col
47692		if err := awsRestjson1_deserializeDocumentValidationError(&destAddr, value); err != nil {
47693			return err
47694		}
47695		col = *destAddr
47696		cv = append(cv, col)
47697
47698	}
47699	*v = cv
47700	return nil
47701}
47702
47703func awsRestjson1_deserializeDocumentVersionConflictException(v **types.VersionConflictException, value interface{}) error {
47704	if v == nil {
47705		return fmt.Errorf("unexpected nil of type %T", v)
47706	}
47707	if value == nil {
47708		return nil
47709	}
47710
47711	shape, ok := value.(map[string]interface{})
47712	if !ok {
47713		return fmt.Errorf("unexpected JSON type %v", value)
47714	}
47715
47716	var sv *types.VersionConflictException
47717	if *v == nil {
47718		sv = &types.VersionConflictException{}
47719	} else {
47720		sv = *v
47721	}
47722
47723	for key, value := range shape {
47724		switch key {
47725		case "message":
47726			if value != nil {
47727				jtv, ok := value.(string)
47728				if !ok {
47729					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
47730				}
47731				sv.Message = ptr.String(jtv)
47732			}
47733
47734		default:
47735			_, _ = key, value
47736
47737		}
47738	}
47739	*v = sv
47740	return nil
47741}
47742
47743func awsRestjson1_deserializeDocumentVersionsLimitExceededException(v **types.VersionsLimitExceededException, value interface{}) error {
47744	if v == nil {
47745		return fmt.Errorf("unexpected nil of type %T", v)
47746	}
47747	if value == nil {
47748		return nil
47749	}
47750
47751	shape, ok := value.(map[string]interface{})
47752	if !ok {
47753		return fmt.Errorf("unexpected JSON type %v", value)
47754	}
47755
47756	var sv *types.VersionsLimitExceededException
47757	if *v == nil {
47758		sv = &types.VersionsLimitExceededException{}
47759	} else {
47760		sv = *v
47761	}
47762
47763	for key, value := range shape {
47764		switch key {
47765		case "message":
47766			if value != nil {
47767				jtv, ok := value.(string)
47768				if !ok {
47769					return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
47770				}
47771				sv.Message = ptr.String(jtv)
47772			}
47773
47774		default:
47775			_, _ = key, value
47776
47777		}
47778	}
47779	*v = sv
47780	return nil
47781}
47782
47783func awsRestjson1_deserializeDocumentViolationEvent(v **types.ViolationEvent, value interface{}) error {
47784	if v == nil {
47785		return fmt.Errorf("unexpected nil of type %T", v)
47786	}
47787	if value == nil {
47788		return nil
47789	}
47790
47791	shape, ok := value.(map[string]interface{})
47792	if !ok {
47793		return fmt.Errorf("unexpected JSON type %v", value)
47794	}
47795
47796	var sv *types.ViolationEvent
47797	if *v == nil {
47798		sv = &types.ViolationEvent{}
47799	} else {
47800		sv = *v
47801	}
47802
47803	for key, value := range shape {
47804		switch key {
47805		case "behavior":
47806			if err := awsRestjson1_deserializeDocumentBehavior(&sv.Behavior, value); err != nil {
47807				return err
47808			}
47809
47810		case "metricValue":
47811			if err := awsRestjson1_deserializeDocumentMetricValue(&sv.MetricValue, value); err != nil {
47812				return err
47813			}
47814
47815		case "securityProfileName":
47816			if value != nil {
47817				jtv, ok := value.(string)
47818				if !ok {
47819					return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value)
47820				}
47821				sv.SecurityProfileName = ptr.String(jtv)
47822			}
47823
47824		case "thingName":
47825			if value != nil {
47826				jtv, ok := value.(string)
47827				if !ok {
47828					return fmt.Errorf("expected DeviceDefenderThingName to be of type string, got %T instead", value)
47829				}
47830				sv.ThingName = ptr.String(jtv)
47831			}
47832
47833		case "violationEventTime":
47834			if value != nil {
47835				jtv, ok := value.(json.Number)
47836				if !ok {
47837					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
47838				}
47839				f64, err := jtv.Float64()
47840				if err != nil {
47841					return err
47842				}
47843				sv.ViolationEventTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
47844			}
47845
47846		case "violationEventType":
47847			if value != nil {
47848				jtv, ok := value.(string)
47849				if !ok {
47850					return fmt.Errorf("expected ViolationEventType to be of type string, got %T instead", value)
47851				}
47852				sv.ViolationEventType = types.ViolationEventType(jtv)
47853			}
47854
47855		case "violationId":
47856			if value != nil {
47857				jtv, ok := value.(string)
47858				if !ok {
47859					return fmt.Errorf("expected ViolationId to be of type string, got %T instead", value)
47860				}
47861				sv.ViolationId = ptr.String(jtv)
47862			}
47863
47864		default:
47865			_, _ = key, value
47866
47867		}
47868	}
47869	*v = sv
47870	return nil
47871}
47872
47873func awsRestjson1_deserializeDocumentViolationEvents(v *[]types.ViolationEvent, value interface{}) error {
47874	if v == nil {
47875		return fmt.Errorf("unexpected nil of type %T", v)
47876	}
47877	if value == nil {
47878		return nil
47879	}
47880
47881	shape, ok := value.([]interface{})
47882	if !ok {
47883		return fmt.Errorf("unexpected JSON type %v", value)
47884	}
47885
47886	var cv []types.ViolationEvent
47887	if *v == nil {
47888		cv = []types.ViolationEvent{}
47889	} else {
47890		cv = *v
47891	}
47892
47893	for _, value := range shape {
47894		var col types.ViolationEvent
47895		destAddr := &col
47896		if err := awsRestjson1_deserializeDocumentViolationEvent(&destAddr, value); err != nil {
47897			return err
47898		}
47899		col = *destAddr
47900		cv = append(cv, col)
47901
47902	}
47903	*v = cv
47904	return nil
47905}
47906