1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package quicksight
4
5import (
6	"bytes"
7	"context"
8	"encoding/json"
9	"fmt"
10	"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
11	"github.com/aws/aws-sdk-go-v2/service/quicksight/types"
12	smithy "github.com/aws/smithy-go"
13	smithyio "github.com/aws/smithy-go/io"
14	"github.com/aws/smithy-go/middleware"
15	"github.com/aws/smithy-go/ptr"
16	smithytime "github.com/aws/smithy-go/time"
17	smithyhttp "github.com/aws/smithy-go/transport/http"
18	"io"
19	"strings"
20)
21
22type awsRestjson1_deserializeOpCancelIngestion struct {
23}
24
25func (*awsRestjson1_deserializeOpCancelIngestion) ID() string {
26	return "OperationDeserializer"
27}
28
29func (m *awsRestjson1_deserializeOpCancelIngestion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
30	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
31) {
32	out, metadata, err = next.HandleDeserialize(ctx, in)
33	if err != nil {
34		return out, metadata, err
35	}
36
37	response, ok := out.RawResponse.(*smithyhttp.Response)
38	if !ok {
39		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
40	}
41
42	if response.StatusCode < 200 || response.StatusCode >= 300 {
43		return out, metadata, awsRestjson1_deserializeOpErrorCancelIngestion(response, &metadata)
44	}
45	output := &CancelIngestionOutput{}
46	out.Result = output
47
48	err = awsRestjson1_deserializeOpHttpBindingsCancelIngestionOutput(output, response)
49	if err != nil {
50		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
51	}
52
53	var buff [1024]byte
54	ringBuffer := smithyio.NewRingBuffer(buff[:])
55
56	body := io.TeeReader(response.Body, ringBuffer)
57
58	decoder := json.NewDecoder(body)
59	decoder.UseNumber()
60	var shape interface{}
61	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
62		var snapshot bytes.Buffer
63		io.Copy(&snapshot, ringBuffer)
64		err = &smithy.DeserializationError{
65			Err:      fmt.Errorf("failed to decode response body, %w", err),
66			Snapshot: snapshot.Bytes(),
67		}
68		return out, metadata, err
69	}
70
71	err = awsRestjson1_deserializeOpDocumentCancelIngestionOutput(&output, shape)
72	if err != nil {
73		var snapshot bytes.Buffer
74		io.Copy(&snapshot, ringBuffer)
75		return out, metadata, &smithy.DeserializationError{
76			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
77			Snapshot: snapshot.Bytes(),
78		}
79	}
80
81	return out, metadata, err
82}
83
84func awsRestjson1_deserializeOpErrorCancelIngestion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
85	var errorBuffer bytes.Buffer
86	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
87		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
88	}
89	errorBody := bytes.NewReader(errorBuffer.Bytes())
90
91	errorCode := "UnknownError"
92	errorMessage := errorCode
93
94	code := response.Header.Get("X-Amzn-ErrorType")
95	if len(code) != 0 {
96		errorCode = restjson.SanitizeErrorCode(code)
97	}
98
99	var buff [1024]byte
100	ringBuffer := smithyio.NewRingBuffer(buff[:])
101
102	body := io.TeeReader(errorBody, ringBuffer)
103	decoder := json.NewDecoder(body)
104	decoder.UseNumber()
105	code, message, err := restjson.GetErrorInfo(decoder)
106	if err != nil {
107		var snapshot bytes.Buffer
108		io.Copy(&snapshot, ringBuffer)
109		err = &smithy.DeserializationError{
110			Err:      fmt.Errorf("failed to decode response body, %w", err),
111			Snapshot: snapshot.Bytes(),
112		}
113		return err
114	}
115
116	errorBody.Seek(0, io.SeekStart)
117	if len(code) != 0 {
118		errorCode = restjson.SanitizeErrorCode(code)
119	}
120	if len(message) != 0 {
121		errorMessage = message
122	}
123
124	switch {
125	case strings.EqualFold("AccessDeniedException", errorCode):
126		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
127
128	case strings.EqualFold("InternalFailureException", errorCode):
129		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
130
131	case strings.EqualFold("InvalidParameterValueException", errorCode):
132		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
133
134	case strings.EqualFold("ResourceExistsException", errorCode):
135		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
136
137	case strings.EqualFold("ResourceNotFoundException", errorCode):
138		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
139
140	case strings.EqualFold("ThrottlingException", errorCode):
141		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
142
143	default:
144		genericError := &smithy.GenericAPIError{
145			Code:    errorCode,
146			Message: errorMessage,
147		}
148		return genericError
149
150	}
151}
152
153func awsRestjson1_deserializeOpHttpBindingsCancelIngestionOutput(v *CancelIngestionOutput, response *smithyhttp.Response) error {
154	if v == nil {
155		return fmt.Errorf("unsupported deserialization for nil %T", v)
156	}
157
158	v.Status = int32(response.StatusCode)
159
160	return nil
161}
162func awsRestjson1_deserializeOpDocumentCancelIngestionOutput(v **CancelIngestionOutput, value interface{}) error {
163	if v == nil {
164		return fmt.Errorf("unexpected nil of type %T", v)
165	}
166	if value == nil {
167		return nil
168	}
169
170	shape, ok := value.(map[string]interface{})
171	if !ok {
172		return fmt.Errorf("unexpected JSON type %v", value)
173	}
174
175	var sv *CancelIngestionOutput
176	if *v == nil {
177		sv = &CancelIngestionOutput{}
178	} else {
179		sv = *v
180	}
181
182	for key, value := range shape {
183		switch key {
184		case "Arn":
185			if value != nil {
186				jtv, ok := value.(string)
187				if !ok {
188					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
189				}
190				sv.Arn = ptr.String(jtv)
191			}
192
193		case "IngestionId":
194			if value != nil {
195				jtv, ok := value.(string)
196				if !ok {
197					return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value)
198				}
199				sv.IngestionId = ptr.String(jtv)
200			}
201
202		case "RequestId":
203			if value != nil {
204				jtv, ok := value.(string)
205				if !ok {
206					return fmt.Errorf("expected String to be of type string, got %T instead", value)
207				}
208				sv.RequestId = ptr.String(jtv)
209			}
210
211		default:
212			_, _ = key, value
213
214		}
215	}
216	*v = sv
217	return nil
218}
219
220type awsRestjson1_deserializeOpCreateAccountCustomization struct {
221}
222
223func (*awsRestjson1_deserializeOpCreateAccountCustomization) ID() string {
224	return "OperationDeserializer"
225}
226
227func (m *awsRestjson1_deserializeOpCreateAccountCustomization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
228	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
229) {
230	out, metadata, err = next.HandleDeserialize(ctx, in)
231	if err != nil {
232		return out, metadata, err
233	}
234
235	response, ok := out.RawResponse.(*smithyhttp.Response)
236	if !ok {
237		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
238	}
239
240	if response.StatusCode < 200 || response.StatusCode >= 300 {
241		return out, metadata, awsRestjson1_deserializeOpErrorCreateAccountCustomization(response, &metadata)
242	}
243	output := &CreateAccountCustomizationOutput{}
244	out.Result = output
245
246	err = awsRestjson1_deserializeOpHttpBindingsCreateAccountCustomizationOutput(output, response)
247	if err != nil {
248		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
249	}
250
251	var buff [1024]byte
252	ringBuffer := smithyio.NewRingBuffer(buff[:])
253
254	body := io.TeeReader(response.Body, ringBuffer)
255
256	decoder := json.NewDecoder(body)
257	decoder.UseNumber()
258	var shape interface{}
259	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
260		var snapshot bytes.Buffer
261		io.Copy(&snapshot, ringBuffer)
262		err = &smithy.DeserializationError{
263			Err:      fmt.Errorf("failed to decode response body, %w", err),
264			Snapshot: snapshot.Bytes(),
265		}
266		return out, metadata, err
267	}
268
269	err = awsRestjson1_deserializeOpDocumentCreateAccountCustomizationOutput(&output, shape)
270	if err != nil {
271		var snapshot bytes.Buffer
272		io.Copy(&snapshot, ringBuffer)
273		return out, metadata, &smithy.DeserializationError{
274			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
275			Snapshot: snapshot.Bytes(),
276		}
277	}
278
279	return out, metadata, err
280}
281
282func awsRestjson1_deserializeOpErrorCreateAccountCustomization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
283	var errorBuffer bytes.Buffer
284	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
285		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
286	}
287	errorBody := bytes.NewReader(errorBuffer.Bytes())
288
289	errorCode := "UnknownError"
290	errorMessage := errorCode
291
292	code := response.Header.Get("X-Amzn-ErrorType")
293	if len(code) != 0 {
294		errorCode = restjson.SanitizeErrorCode(code)
295	}
296
297	var buff [1024]byte
298	ringBuffer := smithyio.NewRingBuffer(buff[:])
299
300	body := io.TeeReader(errorBody, ringBuffer)
301	decoder := json.NewDecoder(body)
302	decoder.UseNumber()
303	code, message, err := restjson.GetErrorInfo(decoder)
304	if err != nil {
305		var snapshot bytes.Buffer
306		io.Copy(&snapshot, ringBuffer)
307		err = &smithy.DeserializationError{
308			Err:      fmt.Errorf("failed to decode response body, %w", err),
309			Snapshot: snapshot.Bytes(),
310		}
311		return err
312	}
313
314	errorBody.Seek(0, io.SeekStart)
315	if len(code) != 0 {
316		errorCode = restjson.SanitizeErrorCode(code)
317	}
318	if len(message) != 0 {
319		errorMessage = message
320	}
321
322	switch {
323	case strings.EqualFold("AccessDeniedException", errorCode):
324		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
325
326	case strings.EqualFold("InternalFailureException", errorCode):
327		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
328
329	case strings.EqualFold("InvalidParameterValueException", errorCode):
330		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
331
332	case strings.EqualFold("ResourceExistsException", errorCode):
333		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
334
335	case strings.EqualFold("ResourceNotFoundException", errorCode):
336		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
337
338	case strings.EqualFold("ResourceUnavailableException", errorCode):
339		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
340
341	case strings.EqualFold("ThrottlingException", errorCode):
342		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
343
344	default:
345		genericError := &smithy.GenericAPIError{
346			Code:    errorCode,
347			Message: errorMessage,
348		}
349		return genericError
350
351	}
352}
353
354func awsRestjson1_deserializeOpHttpBindingsCreateAccountCustomizationOutput(v *CreateAccountCustomizationOutput, response *smithyhttp.Response) error {
355	if v == nil {
356		return fmt.Errorf("unsupported deserialization for nil %T", v)
357	}
358
359	v.Status = int32(response.StatusCode)
360
361	return nil
362}
363func awsRestjson1_deserializeOpDocumentCreateAccountCustomizationOutput(v **CreateAccountCustomizationOutput, value interface{}) error {
364	if v == nil {
365		return fmt.Errorf("unexpected nil of type %T", v)
366	}
367	if value == nil {
368		return nil
369	}
370
371	shape, ok := value.(map[string]interface{})
372	if !ok {
373		return fmt.Errorf("unexpected JSON type %v", value)
374	}
375
376	var sv *CreateAccountCustomizationOutput
377	if *v == nil {
378		sv = &CreateAccountCustomizationOutput{}
379	} else {
380		sv = *v
381	}
382
383	for key, value := range shape {
384		switch key {
385		case "AccountCustomization":
386			if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil {
387				return err
388			}
389
390		case "Arn":
391			if value != nil {
392				jtv, ok := value.(string)
393				if !ok {
394					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
395				}
396				sv.Arn = ptr.String(jtv)
397			}
398
399		case "AwsAccountId":
400			if value != nil {
401				jtv, ok := value.(string)
402				if !ok {
403					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
404				}
405				sv.AwsAccountId = ptr.String(jtv)
406			}
407
408		case "Namespace":
409			if value != nil {
410				jtv, ok := value.(string)
411				if !ok {
412					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
413				}
414				sv.Namespace = ptr.String(jtv)
415			}
416
417		case "RequestId":
418			if value != nil {
419				jtv, ok := value.(string)
420				if !ok {
421					return fmt.Errorf("expected String to be of type string, got %T instead", value)
422				}
423				sv.RequestId = ptr.String(jtv)
424			}
425
426		default:
427			_, _ = key, value
428
429		}
430	}
431	*v = sv
432	return nil
433}
434
435type awsRestjson1_deserializeOpCreateAnalysis struct {
436}
437
438func (*awsRestjson1_deserializeOpCreateAnalysis) ID() string {
439	return "OperationDeserializer"
440}
441
442func (m *awsRestjson1_deserializeOpCreateAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
443	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
444) {
445	out, metadata, err = next.HandleDeserialize(ctx, in)
446	if err != nil {
447		return out, metadata, err
448	}
449
450	response, ok := out.RawResponse.(*smithyhttp.Response)
451	if !ok {
452		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
453	}
454
455	if response.StatusCode < 200 || response.StatusCode >= 300 {
456		return out, metadata, awsRestjson1_deserializeOpErrorCreateAnalysis(response, &metadata)
457	}
458	output := &CreateAnalysisOutput{}
459	out.Result = output
460
461	err = awsRestjson1_deserializeOpHttpBindingsCreateAnalysisOutput(output, response)
462	if err != nil {
463		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
464	}
465
466	var buff [1024]byte
467	ringBuffer := smithyio.NewRingBuffer(buff[:])
468
469	body := io.TeeReader(response.Body, ringBuffer)
470
471	decoder := json.NewDecoder(body)
472	decoder.UseNumber()
473	var shape interface{}
474	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
475		var snapshot bytes.Buffer
476		io.Copy(&snapshot, ringBuffer)
477		err = &smithy.DeserializationError{
478			Err:      fmt.Errorf("failed to decode response body, %w", err),
479			Snapshot: snapshot.Bytes(),
480		}
481		return out, metadata, err
482	}
483
484	err = awsRestjson1_deserializeOpDocumentCreateAnalysisOutput(&output, shape)
485	if err != nil {
486		var snapshot bytes.Buffer
487		io.Copy(&snapshot, ringBuffer)
488		return out, metadata, &smithy.DeserializationError{
489			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
490			Snapshot: snapshot.Bytes(),
491		}
492	}
493
494	return out, metadata, err
495}
496
497func awsRestjson1_deserializeOpErrorCreateAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error {
498	var errorBuffer bytes.Buffer
499	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
500		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
501	}
502	errorBody := bytes.NewReader(errorBuffer.Bytes())
503
504	errorCode := "UnknownError"
505	errorMessage := errorCode
506
507	code := response.Header.Get("X-Amzn-ErrorType")
508	if len(code) != 0 {
509		errorCode = restjson.SanitizeErrorCode(code)
510	}
511
512	var buff [1024]byte
513	ringBuffer := smithyio.NewRingBuffer(buff[:])
514
515	body := io.TeeReader(errorBody, ringBuffer)
516	decoder := json.NewDecoder(body)
517	decoder.UseNumber()
518	code, message, err := restjson.GetErrorInfo(decoder)
519	if err != nil {
520		var snapshot bytes.Buffer
521		io.Copy(&snapshot, ringBuffer)
522		err = &smithy.DeserializationError{
523			Err:      fmt.Errorf("failed to decode response body, %w", err),
524			Snapshot: snapshot.Bytes(),
525		}
526		return err
527	}
528
529	errorBody.Seek(0, io.SeekStart)
530	if len(code) != 0 {
531		errorCode = restjson.SanitizeErrorCode(code)
532	}
533	if len(message) != 0 {
534		errorMessage = message
535	}
536
537	switch {
538	case strings.EqualFold("ConflictException", errorCode):
539		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
540
541	case strings.EqualFold("InternalFailureException", errorCode):
542		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
543
544	case strings.EqualFold("InvalidParameterValueException", errorCode):
545		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
546
547	case strings.EqualFold("ResourceExistsException", errorCode):
548		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
549
550	case strings.EqualFold("ResourceNotFoundException", errorCode):
551		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
552
553	case strings.EqualFold("ThrottlingException", errorCode):
554		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
555
556	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
557		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
558
559	default:
560		genericError := &smithy.GenericAPIError{
561			Code:    errorCode,
562			Message: errorMessage,
563		}
564		return genericError
565
566	}
567}
568
569func awsRestjson1_deserializeOpHttpBindingsCreateAnalysisOutput(v *CreateAnalysisOutput, response *smithyhttp.Response) error {
570	if v == nil {
571		return fmt.Errorf("unsupported deserialization for nil %T", v)
572	}
573
574	v.Status = int32(response.StatusCode)
575
576	return nil
577}
578func awsRestjson1_deserializeOpDocumentCreateAnalysisOutput(v **CreateAnalysisOutput, value interface{}) error {
579	if v == nil {
580		return fmt.Errorf("unexpected nil of type %T", v)
581	}
582	if value == nil {
583		return nil
584	}
585
586	shape, ok := value.(map[string]interface{})
587	if !ok {
588		return fmt.Errorf("unexpected JSON type %v", value)
589	}
590
591	var sv *CreateAnalysisOutput
592	if *v == nil {
593		sv = &CreateAnalysisOutput{}
594	} else {
595		sv = *v
596	}
597
598	for key, value := range shape {
599		switch key {
600		case "AnalysisId":
601			if value != nil {
602				jtv, ok := value.(string)
603				if !ok {
604					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
605				}
606				sv.AnalysisId = ptr.String(jtv)
607			}
608
609		case "Arn":
610			if value != nil {
611				jtv, ok := value.(string)
612				if !ok {
613					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
614				}
615				sv.Arn = ptr.String(jtv)
616			}
617
618		case "CreationStatus":
619			if value != nil {
620				jtv, ok := value.(string)
621				if !ok {
622					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
623				}
624				sv.CreationStatus = types.ResourceStatus(jtv)
625			}
626
627		case "RequestId":
628			if value != nil {
629				jtv, ok := value.(string)
630				if !ok {
631					return fmt.Errorf("expected String to be of type string, got %T instead", value)
632				}
633				sv.RequestId = ptr.String(jtv)
634			}
635
636		default:
637			_, _ = key, value
638
639		}
640	}
641	*v = sv
642	return nil
643}
644
645type awsRestjson1_deserializeOpCreateDashboard struct {
646}
647
648func (*awsRestjson1_deserializeOpCreateDashboard) ID() string {
649	return "OperationDeserializer"
650}
651
652func (m *awsRestjson1_deserializeOpCreateDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
653	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
654) {
655	out, metadata, err = next.HandleDeserialize(ctx, in)
656	if err != nil {
657		return out, metadata, err
658	}
659
660	response, ok := out.RawResponse.(*smithyhttp.Response)
661	if !ok {
662		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
663	}
664
665	if response.StatusCode < 200 || response.StatusCode >= 300 {
666		return out, metadata, awsRestjson1_deserializeOpErrorCreateDashboard(response, &metadata)
667	}
668	output := &CreateDashboardOutput{}
669	out.Result = output
670
671	err = awsRestjson1_deserializeOpHttpBindingsCreateDashboardOutput(output, response)
672	if err != nil {
673		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
674	}
675
676	var buff [1024]byte
677	ringBuffer := smithyio.NewRingBuffer(buff[:])
678
679	body := io.TeeReader(response.Body, ringBuffer)
680
681	decoder := json.NewDecoder(body)
682	decoder.UseNumber()
683	var shape interface{}
684	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
685		var snapshot bytes.Buffer
686		io.Copy(&snapshot, ringBuffer)
687		err = &smithy.DeserializationError{
688			Err:      fmt.Errorf("failed to decode response body, %w", err),
689			Snapshot: snapshot.Bytes(),
690		}
691		return out, metadata, err
692	}
693
694	err = awsRestjson1_deserializeOpDocumentCreateDashboardOutput(&output, shape)
695	if err != nil {
696		var snapshot bytes.Buffer
697		io.Copy(&snapshot, ringBuffer)
698		return out, metadata, &smithy.DeserializationError{
699			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
700			Snapshot: snapshot.Bytes(),
701		}
702	}
703
704	return out, metadata, err
705}
706
707func awsRestjson1_deserializeOpErrorCreateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error {
708	var errorBuffer bytes.Buffer
709	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
710		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
711	}
712	errorBody := bytes.NewReader(errorBuffer.Bytes())
713
714	errorCode := "UnknownError"
715	errorMessage := errorCode
716
717	code := response.Header.Get("X-Amzn-ErrorType")
718	if len(code) != 0 {
719		errorCode = restjson.SanitizeErrorCode(code)
720	}
721
722	var buff [1024]byte
723	ringBuffer := smithyio.NewRingBuffer(buff[:])
724
725	body := io.TeeReader(errorBody, ringBuffer)
726	decoder := json.NewDecoder(body)
727	decoder.UseNumber()
728	code, message, err := restjson.GetErrorInfo(decoder)
729	if err != nil {
730		var snapshot bytes.Buffer
731		io.Copy(&snapshot, ringBuffer)
732		err = &smithy.DeserializationError{
733			Err:      fmt.Errorf("failed to decode response body, %w", err),
734			Snapshot: snapshot.Bytes(),
735		}
736		return err
737	}
738
739	errorBody.Seek(0, io.SeekStart)
740	if len(code) != 0 {
741		errorCode = restjson.SanitizeErrorCode(code)
742	}
743	if len(message) != 0 {
744		errorMessage = message
745	}
746
747	switch {
748	case strings.EqualFold("ConflictException", errorCode):
749		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
750
751	case strings.EqualFold("InternalFailureException", errorCode):
752		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
753
754	case strings.EqualFold("InvalidParameterValueException", errorCode):
755		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
756
757	case strings.EqualFold("ResourceExistsException", errorCode):
758		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
759
760	case strings.EqualFold("ResourceNotFoundException", errorCode):
761		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
762
763	case strings.EqualFold("ThrottlingException", errorCode):
764		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
765
766	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
767		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
768
769	default:
770		genericError := &smithy.GenericAPIError{
771			Code:    errorCode,
772			Message: errorMessage,
773		}
774		return genericError
775
776	}
777}
778
779func awsRestjson1_deserializeOpHttpBindingsCreateDashboardOutput(v *CreateDashboardOutput, response *smithyhttp.Response) error {
780	if v == nil {
781		return fmt.Errorf("unsupported deserialization for nil %T", v)
782	}
783
784	v.Status = int32(response.StatusCode)
785
786	return nil
787}
788func awsRestjson1_deserializeOpDocumentCreateDashboardOutput(v **CreateDashboardOutput, value interface{}) error {
789	if v == nil {
790		return fmt.Errorf("unexpected nil of type %T", v)
791	}
792	if value == nil {
793		return nil
794	}
795
796	shape, ok := value.(map[string]interface{})
797	if !ok {
798		return fmt.Errorf("unexpected JSON type %v", value)
799	}
800
801	var sv *CreateDashboardOutput
802	if *v == nil {
803		sv = &CreateDashboardOutput{}
804	} else {
805		sv = *v
806	}
807
808	for key, value := range shape {
809		switch key {
810		case "Arn":
811			if value != nil {
812				jtv, ok := value.(string)
813				if !ok {
814					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
815				}
816				sv.Arn = ptr.String(jtv)
817			}
818
819		case "CreationStatus":
820			if value != nil {
821				jtv, ok := value.(string)
822				if !ok {
823					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
824				}
825				sv.CreationStatus = types.ResourceStatus(jtv)
826			}
827
828		case "DashboardId":
829			if value != nil {
830				jtv, ok := value.(string)
831				if !ok {
832					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
833				}
834				sv.DashboardId = ptr.String(jtv)
835			}
836
837		case "RequestId":
838			if value != nil {
839				jtv, ok := value.(string)
840				if !ok {
841					return fmt.Errorf("expected String to be of type string, got %T instead", value)
842				}
843				sv.RequestId = ptr.String(jtv)
844			}
845
846		case "VersionArn":
847			if value != nil {
848				jtv, ok := value.(string)
849				if !ok {
850					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
851				}
852				sv.VersionArn = ptr.String(jtv)
853			}
854
855		default:
856			_, _ = key, value
857
858		}
859	}
860	*v = sv
861	return nil
862}
863
864type awsRestjson1_deserializeOpCreateDataSet struct {
865}
866
867func (*awsRestjson1_deserializeOpCreateDataSet) ID() string {
868	return "OperationDeserializer"
869}
870
871func (m *awsRestjson1_deserializeOpCreateDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
872	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
873) {
874	out, metadata, err = next.HandleDeserialize(ctx, in)
875	if err != nil {
876		return out, metadata, err
877	}
878
879	response, ok := out.RawResponse.(*smithyhttp.Response)
880	if !ok {
881		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
882	}
883
884	if response.StatusCode < 200 || response.StatusCode >= 300 {
885		return out, metadata, awsRestjson1_deserializeOpErrorCreateDataSet(response, &metadata)
886	}
887	output := &CreateDataSetOutput{}
888	out.Result = output
889
890	err = awsRestjson1_deserializeOpHttpBindingsCreateDataSetOutput(output, response)
891	if err != nil {
892		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
893	}
894
895	var buff [1024]byte
896	ringBuffer := smithyio.NewRingBuffer(buff[:])
897
898	body := io.TeeReader(response.Body, ringBuffer)
899
900	decoder := json.NewDecoder(body)
901	decoder.UseNumber()
902	var shape interface{}
903	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
904		var snapshot bytes.Buffer
905		io.Copy(&snapshot, ringBuffer)
906		err = &smithy.DeserializationError{
907			Err:      fmt.Errorf("failed to decode response body, %w", err),
908			Snapshot: snapshot.Bytes(),
909		}
910		return out, metadata, err
911	}
912
913	err = awsRestjson1_deserializeOpDocumentCreateDataSetOutput(&output, shape)
914	if err != nil {
915		var snapshot bytes.Buffer
916		io.Copy(&snapshot, ringBuffer)
917		return out, metadata, &smithy.DeserializationError{
918			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
919			Snapshot: snapshot.Bytes(),
920		}
921	}
922
923	return out, metadata, err
924}
925
926func awsRestjson1_deserializeOpErrorCreateDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
927	var errorBuffer bytes.Buffer
928	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
929		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
930	}
931	errorBody := bytes.NewReader(errorBuffer.Bytes())
932
933	errorCode := "UnknownError"
934	errorMessage := errorCode
935
936	code := response.Header.Get("X-Amzn-ErrorType")
937	if len(code) != 0 {
938		errorCode = restjson.SanitizeErrorCode(code)
939	}
940
941	var buff [1024]byte
942	ringBuffer := smithyio.NewRingBuffer(buff[:])
943
944	body := io.TeeReader(errorBody, ringBuffer)
945	decoder := json.NewDecoder(body)
946	decoder.UseNumber()
947	code, message, err := restjson.GetErrorInfo(decoder)
948	if err != nil {
949		var snapshot bytes.Buffer
950		io.Copy(&snapshot, ringBuffer)
951		err = &smithy.DeserializationError{
952			Err:      fmt.Errorf("failed to decode response body, %w", err),
953			Snapshot: snapshot.Bytes(),
954		}
955		return err
956	}
957
958	errorBody.Seek(0, io.SeekStart)
959	if len(code) != 0 {
960		errorCode = restjson.SanitizeErrorCode(code)
961	}
962	if len(message) != 0 {
963		errorMessage = message
964	}
965
966	switch {
967	case strings.EqualFold("AccessDeniedException", errorCode):
968		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
969
970	case strings.EqualFold("ConflictException", errorCode):
971		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
972
973	case strings.EqualFold("InternalFailureException", errorCode):
974		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
975
976	case strings.EqualFold("InvalidParameterValueException", errorCode):
977		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
978
979	case strings.EqualFold("LimitExceededException", errorCode):
980		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
981
982	case strings.EqualFold("ResourceExistsException", errorCode):
983		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
984
985	case strings.EqualFold("ResourceNotFoundException", errorCode):
986		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
987
988	case strings.EqualFold("ThrottlingException", errorCode):
989		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
990
991	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
992		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
993
994	default:
995		genericError := &smithy.GenericAPIError{
996			Code:    errorCode,
997			Message: errorMessage,
998		}
999		return genericError
1000
1001	}
1002}
1003
1004func awsRestjson1_deserializeOpHttpBindingsCreateDataSetOutput(v *CreateDataSetOutput, response *smithyhttp.Response) error {
1005	if v == nil {
1006		return fmt.Errorf("unsupported deserialization for nil %T", v)
1007	}
1008
1009	v.Status = int32(response.StatusCode)
1010
1011	return nil
1012}
1013func awsRestjson1_deserializeOpDocumentCreateDataSetOutput(v **CreateDataSetOutput, value interface{}) error {
1014	if v == nil {
1015		return fmt.Errorf("unexpected nil of type %T", v)
1016	}
1017	if value == nil {
1018		return nil
1019	}
1020
1021	shape, ok := value.(map[string]interface{})
1022	if !ok {
1023		return fmt.Errorf("unexpected JSON type %v", value)
1024	}
1025
1026	var sv *CreateDataSetOutput
1027	if *v == nil {
1028		sv = &CreateDataSetOutput{}
1029	} else {
1030		sv = *v
1031	}
1032
1033	for key, value := range shape {
1034		switch key {
1035		case "Arn":
1036			if value != nil {
1037				jtv, ok := value.(string)
1038				if !ok {
1039					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
1040				}
1041				sv.Arn = ptr.String(jtv)
1042			}
1043
1044		case "DataSetId":
1045			if value != nil {
1046				jtv, ok := value.(string)
1047				if !ok {
1048					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
1049				}
1050				sv.DataSetId = ptr.String(jtv)
1051			}
1052
1053		case "IngestionArn":
1054			if value != nil {
1055				jtv, ok := value.(string)
1056				if !ok {
1057					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
1058				}
1059				sv.IngestionArn = ptr.String(jtv)
1060			}
1061
1062		case "IngestionId":
1063			if value != nil {
1064				jtv, ok := value.(string)
1065				if !ok {
1066					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
1067				}
1068				sv.IngestionId = ptr.String(jtv)
1069			}
1070
1071		case "RequestId":
1072			if value != nil {
1073				jtv, ok := value.(string)
1074				if !ok {
1075					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1076				}
1077				sv.RequestId = ptr.String(jtv)
1078			}
1079
1080		default:
1081			_, _ = key, value
1082
1083		}
1084	}
1085	*v = sv
1086	return nil
1087}
1088
1089type awsRestjson1_deserializeOpCreateDataSource struct {
1090}
1091
1092func (*awsRestjson1_deserializeOpCreateDataSource) ID() string {
1093	return "OperationDeserializer"
1094}
1095
1096func (m *awsRestjson1_deserializeOpCreateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1097	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1098) {
1099	out, metadata, err = next.HandleDeserialize(ctx, in)
1100	if err != nil {
1101		return out, metadata, err
1102	}
1103
1104	response, ok := out.RawResponse.(*smithyhttp.Response)
1105	if !ok {
1106		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1107	}
1108
1109	if response.StatusCode < 200 || response.StatusCode >= 300 {
1110		return out, metadata, awsRestjson1_deserializeOpErrorCreateDataSource(response, &metadata)
1111	}
1112	output := &CreateDataSourceOutput{}
1113	out.Result = output
1114
1115	err = awsRestjson1_deserializeOpHttpBindingsCreateDataSourceOutput(output, response)
1116	if err != nil {
1117		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
1118	}
1119
1120	var buff [1024]byte
1121	ringBuffer := smithyio.NewRingBuffer(buff[:])
1122
1123	body := io.TeeReader(response.Body, ringBuffer)
1124
1125	decoder := json.NewDecoder(body)
1126	decoder.UseNumber()
1127	var shape interface{}
1128	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1129		var snapshot bytes.Buffer
1130		io.Copy(&snapshot, ringBuffer)
1131		err = &smithy.DeserializationError{
1132			Err:      fmt.Errorf("failed to decode response body, %w", err),
1133			Snapshot: snapshot.Bytes(),
1134		}
1135		return out, metadata, err
1136	}
1137
1138	err = awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(&output, shape)
1139	if err != nil {
1140		var snapshot bytes.Buffer
1141		io.Copy(&snapshot, ringBuffer)
1142		return out, metadata, &smithy.DeserializationError{
1143			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1144			Snapshot: snapshot.Bytes(),
1145		}
1146	}
1147
1148	return out, metadata, err
1149}
1150
1151func awsRestjson1_deserializeOpErrorCreateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1152	var errorBuffer bytes.Buffer
1153	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1154		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1155	}
1156	errorBody := bytes.NewReader(errorBuffer.Bytes())
1157
1158	errorCode := "UnknownError"
1159	errorMessage := errorCode
1160
1161	code := response.Header.Get("X-Amzn-ErrorType")
1162	if len(code) != 0 {
1163		errorCode = restjson.SanitizeErrorCode(code)
1164	}
1165
1166	var buff [1024]byte
1167	ringBuffer := smithyio.NewRingBuffer(buff[:])
1168
1169	body := io.TeeReader(errorBody, ringBuffer)
1170	decoder := json.NewDecoder(body)
1171	decoder.UseNumber()
1172	code, message, err := restjson.GetErrorInfo(decoder)
1173	if err != nil {
1174		var snapshot bytes.Buffer
1175		io.Copy(&snapshot, ringBuffer)
1176		err = &smithy.DeserializationError{
1177			Err:      fmt.Errorf("failed to decode response body, %w", err),
1178			Snapshot: snapshot.Bytes(),
1179		}
1180		return err
1181	}
1182
1183	errorBody.Seek(0, io.SeekStart)
1184	if len(code) != 0 {
1185		errorCode = restjson.SanitizeErrorCode(code)
1186	}
1187	if len(message) != 0 {
1188		errorMessage = message
1189	}
1190
1191	switch {
1192	case strings.EqualFold("AccessDeniedException", errorCode):
1193		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
1194
1195	case strings.EqualFold("ConflictException", errorCode):
1196		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
1197
1198	case strings.EqualFold("InternalFailureException", errorCode):
1199		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1200
1201	case strings.EqualFold("InvalidParameterValueException", errorCode):
1202		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
1203
1204	case strings.EqualFold("LimitExceededException", errorCode):
1205		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
1206
1207	case strings.EqualFold("ResourceExistsException", errorCode):
1208		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
1209
1210	case strings.EqualFold("ResourceNotFoundException", errorCode):
1211		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1212
1213	case strings.EqualFold("ThrottlingException", errorCode):
1214		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1215
1216	default:
1217		genericError := &smithy.GenericAPIError{
1218			Code:    errorCode,
1219			Message: errorMessage,
1220		}
1221		return genericError
1222
1223	}
1224}
1225
1226func awsRestjson1_deserializeOpHttpBindingsCreateDataSourceOutput(v *CreateDataSourceOutput, response *smithyhttp.Response) error {
1227	if v == nil {
1228		return fmt.Errorf("unsupported deserialization for nil %T", v)
1229	}
1230
1231	v.Status = int32(response.StatusCode)
1232
1233	return nil
1234}
1235func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSourceOutput, value interface{}) error {
1236	if v == nil {
1237		return fmt.Errorf("unexpected nil of type %T", v)
1238	}
1239	if value == nil {
1240		return nil
1241	}
1242
1243	shape, ok := value.(map[string]interface{})
1244	if !ok {
1245		return fmt.Errorf("unexpected JSON type %v", value)
1246	}
1247
1248	var sv *CreateDataSourceOutput
1249	if *v == nil {
1250		sv = &CreateDataSourceOutput{}
1251	} else {
1252		sv = *v
1253	}
1254
1255	for key, value := range shape {
1256		switch key {
1257		case "Arn":
1258			if value != nil {
1259				jtv, ok := value.(string)
1260				if !ok {
1261					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
1262				}
1263				sv.Arn = ptr.String(jtv)
1264			}
1265
1266		case "CreationStatus":
1267			if value != nil {
1268				jtv, ok := value.(string)
1269				if !ok {
1270					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
1271				}
1272				sv.CreationStatus = types.ResourceStatus(jtv)
1273			}
1274
1275		case "DataSourceId":
1276			if value != nil {
1277				jtv, ok := value.(string)
1278				if !ok {
1279					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
1280				}
1281				sv.DataSourceId = ptr.String(jtv)
1282			}
1283
1284		case "RequestId":
1285			if value != nil {
1286				jtv, ok := value.(string)
1287				if !ok {
1288					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1289				}
1290				sv.RequestId = ptr.String(jtv)
1291			}
1292
1293		default:
1294			_, _ = key, value
1295
1296		}
1297	}
1298	*v = sv
1299	return nil
1300}
1301
1302type awsRestjson1_deserializeOpCreateGroup struct {
1303}
1304
1305func (*awsRestjson1_deserializeOpCreateGroup) ID() string {
1306	return "OperationDeserializer"
1307}
1308
1309func (m *awsRestjson1_deserializeOpCreateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1310	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1311) {
1312	out, metadata, err = next.HandleDeserialize(ctx, in)
1313	if err != nil {
1314		return out, metadata, err
1315	}
1316
1317	response, ok := out.RawResponse.(*smithyhttp.Response)
1318	if !ok {
1319		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1320	}
1321
1322	if response.StatusCode < 200 || response.StatusCode >= 300 {
1323		return out, metadata, awsRestjson1_deserializeOpErrorCreateGroup(response, &metadata)
1324	}
1325	output := &CreateGroupOutput{}
1326	out.Result = output
1327
1328	err = awsRestjson1_deserializeOpHttpBindingsCreateGroupOutput(output, response)
1329	if err != nil {
1330		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
1331	}
1332
1333	var buff [1024]byte
1334	ringBuffer := smithyio.NewRingBuffer(buff[:])
1335
1336	body := io.TeeReader(response.Body, ringBuffer)
1337
1338	decoder := json.NewDecoder(body)
1339	decoder.UseNumber()
1340	var shape interface{}
1341	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1342		var snapshot bytes.Buffer
1343		io.Copy(&snapshot, ringBuffer)
1344		err = &smithy.DeserializationError{
1345			Err:      fmt.Errorf("failed to decode response body, %w", err),
1346			Snapshot: snapshot.Bytes(),
1347		}
1348		return out, metadata, err
1349	}
1350
1351	err = awsRestjson1_deserializeOpDocumentCreateGroupOutput(&output, shape)
1352	if err != nil {
1353		var snapshot bytes.Buffer
1354		io.Copy(&snapshot, ringBuffer)
1355		return out, metadata, &smithy.DeserializationError{
1356			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1357			Snapshot: snapshot.Bytes(),
1358		}
1359	}
1360
1361	return out, metadata, err
1362}
1363
1364func awsRestjson1_deserializeOpErrorCreateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1365	var errorBuffer bytes.Buffer
1366	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1367		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1368	}
1369	errorBody := bytes.NewReader(errorBuffer.Bytes())
1370
1371	errorCode := "UnknownError"
1372	errorMessage := errorCode
1373
1374	code := response.Header.Get("X-Amzn-ErrorType")
1375	if len(code) != 0 {
1376		errorCode = restjson.SanitizeErrorCode(code)
1377	}
1378
1379	var buff [1024]byte
1380	ringBuffer := smithyio.NewRingBuffer(buff[:])
1381
1382	body := io.TeeReader(errorBody, ringBuffer)
1383	decoder := json.NewDecoder(body)
1384	decoder.UseNumber()
1385	code, message, err := restjson.GetErrorInfo(decoder)
1386	if err != nil {
1387		var snapshot bytes.Buffer
1388		io.Copy(&snapshot, ringBuffer)
1389		err = &smithy.DeserializationError{
1390			Err:      fmt.Errorf("failed to decode response body, %w", err),
1391			Snapshot: snapshot.Bytes(),
1392		}
1393		return err
1394	}
1395
1396	errorBody.Seek(0, io.SeekStart)
1397	if len(code) != 0 {
1398		errorCode = restjson.SanitizeErrorCode(code)
1399	}
1400	if len(message) != 0 {
1401		errorMessage = message
1402	}
1403
1404	switch {
1405	case strings.EqualFold("AccessDeniedException", errorCode):
1406		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
1407
1408	case strings.EqualFold("InternalFailureException", errorCode):
1409		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1410
1411	case strings.EqualFold("InvalidParameterValueException", errorCode):
1412		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
1413
1414	case strings.EqualFold("LimitExceededException", errorCode):
1415		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
1416
1417	case strings.EqualFold("PreconditionNotMetException", errorCode):
1418		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
1419
1420	case strings.EqualFold("ResourceExistsException", errorCode):
1421		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
1422
1423	case strings.EqualFold("ResourceNotFoundException", errorCode):
1424		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1425
1426	case strings.EqualFold("ResourceUnavailableException", errorCode):
1427		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
1428
1429	case strings.EqualFold("ThrottlingException", errorCode):
1430		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1431
1432	default:
1433		genericError := &smithy.GenericAPIError{
1434			Code:    errorCode,
1435			Message: errorMessage,
1436		}
1437		return genericError
1438
1439	}
1440}
1441
1442func awsRestjson1_deserializeOpHttpBindingsCreateGroupOutput(v *CreateGroupOutput, response *smithyhttp.Response) error {
1443	if v == nil {
1444		return fmt.Errorf("unsupported deserialization for nil %T", v)
1445	}
1446
1447	v.Status = int32(response.StatusCode)
1448
1449	return nil
1450}
1451func awsRestjson1_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, value interface{}) error {
1452	if v == nil {
1453		return fmt.Errorf("unexpected nil of type %T", v)
1454	}
1455	if value == nil {
1456		return nil
1457	}
1458
1459	shape, ok := value.(map[string]interface{})
1460	if !ok {
1461		return fmt.Errorf("unexpected JSON type %v", value)
1462	}
1463
1464	var sv *CreateGroupOutput
1465	if *v == nil {
1466		sv = &CreateGroupOutput{}
1467	} else {
1468		sv = *v
1469	}
1470
1471	for key, value := range shape {
1472		switch key {
1473		case "Group":
1474			if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil {
1475				return err
1476			}
1477
1478		case "RequestId":
1479			if value != nil {
1480				jtv, ok := value.(string)
1481				if !ok {
1482					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1483				}
1484				sv.RequestId = ptr.String(jtv)
1485			}
1486
1487		default:
1488			_, _ = key, value
1489
1490		}
1491	}
1492	*v = sv
1493	return nil
1494}
1495
1496type awsRestjson1_deserializeOpCreateGroupMembership struct {
1497}
1498
1499func (*awsRestjson1_deserializeOpCreateGroupMembership) ID() string {
1500	return "OperationDeserializer"
1501}
1502
1503func (m *awsRestjson1_deserializeOpCreateGroupMembership) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1504	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1505) {
1506	out, metadata, err = next.HandleDeserialize(ctx, in)
1507	if err != nil {
1508		return out, metadata, err
1509	}
1510
1511	response, ok := out.RawResponse.(*smithyhttp.Response)
1512	if !ok {
1513		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1514	}
1515
1516	if response.StatusCode < 200 || response.StatusCode >= 300 {
1517		return out, metadata, awsRestjson1_deserializeOpErrorCreateGroupMembership(response, &metadata)
1518	}
1519	output := &CreateGroupMembershipOutput{}
1520	out.Result = output
1521
1522	err = awsRestjson1_deserializeOpHttpBindingsCreateGroupMembershipOutput(output, response)
1523	if err != nil {
1524		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
1525	}
1526
1527	var buff [1024]byte
1528	ringBuffer := smithyio.NewRingBuffer(buff[:])
1529
1530	body := io.TeeReader(response.Body, ringBuffer)
1531
1532	decoder := json.NewDecoder(body)
1533	decoder.UseNumber()
1534	var shape interface{}
1535	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1536		var snapshot bytes.Buffer
1537		io.Copy(&snapshot, ringBuffer)
1538		err = &smithy.DeserializationError{
1539			Err:      fmt.Errorf("failed to decode response body, %w", err),
1540			Snapshot: snapshot.Bytes(),
1541		}
1542		return out, metadata, err
1543	}
1544
1545	err = awsRestjson1_deserializeOpDocumentCreateGroupMembershipOutput(&output, shape)
1546	if err != nil {
1547		var snapshot bytes.Buffer
1548		io.Copy(&snapshot, ringBuffer)
1549		return out, metadata, &smithy.DeserializationError{
1550			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1551			Snapshot: snapshot.Bytes(),
1552		}
1553	}
1554
1555	return out, metadata, err
1556}
1557
1558func awsRestjson1_deserializeOpErrorCreateGroupMembership(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1559	var errorBuffer bytes.Buffer
1560	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1561		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1562	}
1563	errorBody := bytes.NewReader(errorBuffer.Bytes())
1564
1565	errorCode := "UnknownError"
1566	errorMessage := errorCode
1567
1568	code := response.Header.Get("X-Amzn-ErrorType")
1569	if len(code) != 0 {
1570		errorCode = restjson.SanitizeErrorCode(code)
1571	}
1572
1573	var buff [1024]byte
1574	ringBuffer := smithyio.NewRingBuffer(buff[:])
1575
1576	body := io.TeeReader(errorBody, ringBuffer)
1577	decoder := json.NewDecoder(body)
1578	decoder.UseNumber()
1579	code, message, err := restjson.GetErrorInfo(decoder)
1580	if err != nil {
1581		var snapshot bytes.Buffer
1582		io.Copy(&snapshot, ringBuffer)
1583		err = &smithy.DeserializationError{
1584			Err:      fmt.Errorf("failed to decode response body, %w", err),
1585			Snapshot: snapshot.Bytes(),
1586		}
1587		return err
1588	}
1589
1590	errorBody.Seek(0, io.SeekStart)
1591	if len(code) != 0 {
1592		errorCode = restjson.SanitizeErrorCode(code)
1593	}
1594	if len(message) != 0 {
1595		errorMessage = message
1596	}
1597
1598	switch {
1599	case strings.EqualFold("AccessDeniedException", errorCode):
1600		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
1601
1602	case strings.EqualFold("InternalFailureException", errorCode):
1603		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1604
1605	case strings.EqualFold("InvalidParameterValueException", errorCode):
1606		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
1607
1608	case strings.EqualFold("PreconditionNotMetException", errorCode):
1609		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
1610
1611	case strings.EqualFold("ResourceNotFoundException", errorCode):
1612		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1613
1614	case strings.EqualFold("ResourceUnavailableException", errorCode):
1615		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
1616
1617	case strings.EqualFold("ThrottlingException", errorCode):
1618		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1619
1620	default:
1621		genericError := &smithy.GenericAPIError{
1622			Code:    errorCode,
1623			Message: errorMessage,
1624		}
1625		return genericError
1626
1627	}
1628}
1629
1630func awsRestjson1_deserializeOpHttpBindingsCreateGroupMembershipOutput(v *CreateGroupMembershipOutput, response *smithyhttp.Response) error {
1631	if v == nil {
1632		return fmt.Errorf("unsupported deserialization for nil %T", v)
1633	}
1634
1635	v.Status = int32(response.StatusCode)
1636
1637	return nil
1638}
1639func awsRestjson1_deserializeOpDocumentCreateGroupMembershipOutput(v **CreateGroupMembershipOutput, value interface{}) error {
1640	if v == nil {
1641		return fmt.Errorf("unexpected nil of type %T", v)
1642	}
1643	if value == nil {
1644		return nil
1645	}
1646
1647	shape, ok := value.(map[string]interface{})
1648	if !ok {
1649		return fmt.Errorf("unexpected JSON type %v", value)
1650	}
1651
1652	var sv *CreateGroupMembershipOutput
1653	if *v == nil {
1654		sv = &CreateGroupMembershipOutput{}
1655	} else {
1656		sv = *v
1657	}
1658
1659	for key, value := range shape {
1660		switch key {
1661		case "GroupMember":
1662			if err := awsRestjson1_deserializeDocumentGroupMember(&sv.GroupMember, value); err != nil {
1663				return err
1664			}
1665
1666		case "RequestId":
1667			if value != nil {
1668				jtv, ok := value.(string)
1669				if !ok {
1670					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1671				}
1672				sv.RequestId = ptr.String(jtv)
1673			}
1674
1675		default:
1676			_, _ = key, value
1677
1678		}
1679	}
1680	*v = sv
1681	return nil
1682}
1683
1684type awsRestjson1_deserializeOpCreateIAMPolicyAssignment struct {
1685}
1686
1687func (*awsRestjson1_deserializeOpCreateIAMPolicyAssignment) ID() string {
1688	return "OperationDeserializer"
1689}
1690
1691func (m *awsRestjson1_deserializeOpCreateIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1692	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1693) {
1694	out, metadata, err = next.HandleDeserialize(ctx, in)
1695	if err != nil {
1696		return out, metadata, err
1697	}
1698
1699	response, ok := out.RawResponse.(*smithyhttp.Response)
1700	if !ok {
1701		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1702	}
1703
1704	if response.StatusCode < 200 || response.StatusCode >= 300 {
1705		return out, metadata, awsRestjson1_deserializeOpErrorCreateIAMPolicyAssignment(response, &metadata)
1706	}
1707	output := &CreateIAMPolicyAssignmentOutput{}
1708	out.Result = output
1709
1710	err = awsRestjson1_deserializeOpHttpBindingsCreateIAMPolicyAssignmentOutput(output, response)
1711	if err != nil {
1712		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
1713	}
1714
1715	var buff [1024]byte
1716	ringBuffer := smithyio.NewRingBuffer(buff[:])
1717
1718	body := io.TeeReader(response.Body, ringBuffer)
1719
1720	decoder := json.NewDecoder(body)
1721	decoder.UseNumber()
1722	var shape interface{}
1723	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
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 out, metadata, err
1731	}
1732
1733	err = awsRestjson1_deserializeOpDocumentCreateIAMPolicyAssignmentOutput(&output, shape)
1734	if err != nil {
1735		var snapshot bytes.Buffer
1736		io.Copy(&snapshot, ringBuffer)
1737		return out, metadata, &smithy.DeserializationError{
1738			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1739			Snapshot: snapshot.Bytes(),
1740		}
1741	}
1742
1743	return out, metadata, err
1744}
1745
1746func awsRestjson1_deserializeOpErrorCreateIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1747	var errorBuffer bytes.Buffer
1748	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1749		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1750	}
1751	errorBody := bytes.NewReader(errorBuffer.Bytes())
1752
1753	errorCode := "UnknownError"
1754	errorMessage := errorCode
1755
1756	code := response.Header.Get("X-Amzn-ErrorType")
1757	if len(code) != 0 {
1758		errorCode = restjson.SanitizeErrorCode(code)
1759	}
1760
1761	var buff [1024]byte
1762	ringBuffer := smithyio.NewRingBuffer(buff[:])
1763
1764	body := io.TeeReader(errorBody, ringBuffer)
1765	decoder := json.NewDecoder(body)
1766	decoder.UseNumber()
1767	code, message, err := restjson.GetErrorInfo(decoder)
1768	if err != nil {
1769		var snapshot bytes.Buffer
1770		io.Copy(&snapshot, ringBuffer)
1771		err = &smithy.DeserializationError{
1772			Err:      fmt.Errorf("failed to decode response body, %w", err),
1773			Snapshot: snapshot.Bytes(),
1774		}
1775		return err
1776	}
1777
1778	errorBody.Seek(0, io.SeekStart)
1779	if len(code) != 0 {
1780		errorCode = restjson.SanitizeErrorCode(code)
1781	}
1782	if len(message) != 0 {
1783		errorMessage = message
1784	}
1785
1786	switch {
1787	case strings.EqualFold("AccessDeniedException", errorCode):
1788		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
1789
1790	case strings.EqualFold("ConcurrentUpdatingException", errorCode):
1791		return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody)
1792
1793	case strings.EqualFold("InternalFailureException", errorCode):
1794		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
1795
1796	case strings.EqualFold("InvalidParameterValueException", errorCode):
1797		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
1798
1799	case strings.EqualFold("ResourceExistsException", errorCode):
1800		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
1801
1802	case strings.EqualFold("ResourceNotFoundException", errorCode):
1803		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
1804
1805	case strings.EqualFold("ThrottlingException", errorCode):
1806		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
1807
1808	default:
1809		genericError := &smithy.GenericAPIError{
1810			Code:    errorCode,
1811			Message: errorMessage,
1812		}
1813		return genericError
1814
1815	}
1816}
1817
1818func awsRestjson1_deserializeOpHttpBindingsCreateIAMPolicyAssignmentOutput(v *CreateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error {
1819	if v == nil {
1820		return fmt.Errorf("unsupported deserialization for nil %T", v)
1821	}
1822
1823	v.Status = int32(response.StatusCode)
1824
1825	return nil
1826}
1827func awsRestjson1_deserializeOpDocumentCreateIAMPolicyAssignmentOutput(v **CreateIAMPolicyAssignmentOutput, value interface{}) error {
1828	if v == nil {
1829		return fmt.Errorf("unexpected nil of type %T", v)
1830	}
1831	if value == nil {
1832		return nil
1833	}
1834
1835	shape, ok := value.(map[string]interface{})
1836	if !ok {
1837		return fmt.Errorf("unexpected JSON type %v", value)
1838	}
1839
1840	var sv *CreateIAMPolicyAssignmentOutput
1841	if *v == nil {
1842		sv = &CreateIAMPolicyAssignmentOutput{}
1843	} else {
1844		sv = *v
1845	}
1846
1847	for key, value := range shape {
1848		switch key {
1849		case "AssignmentId":
1850			if value != nil {
1851				jtv, ok := value.(string)
1852				if !ok {
1853					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1854				}
1855				sv.AssignmentId = ptr.String(jtv)
1856			}
1857
1858		case "AssignmentName":
1859			if value != nil {
1860				jtv, ok := value.(string)
1861				if !ok {
1862					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
1863				}
1864				sv.AssignmentName = ptr.String(jtv)
1865			}
1866
1867		case "AssignmentStatus":
1868			if value != nil {
1869				jtv, ok := value.(string)
1870				if !ok {
1871					return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value)
1872				}
1873				sv.AssignmentStatus = types.AssignmentStatus(jtv)
1874			}
1875
1876		case "Identities":
1877			if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil {
1878				return err
1879			}
1880
1881		case "PolicyArn":
1882			if value != nil {
1883				jtv, ok := value.(string)
1884				if !ok {
1885					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
1886				}
1887				sv.PolicyArn = ptr.String(jtv)
1888			}
1889
1890		case "RequestId":
1891			if value != nil {
1892				jtv, ok := value.(string)
1893				if !ok {
1894					return fmt.Errorf("expected String to be of type string, got %T instead", value)
1895				}
1896				sv.RequestId = ptr.String(jtv)
1897			}
1898
1899		default:
1900			_, _ = key, value
1901
1902		}
1903	}
1904	*v = sv
1905	return nil
1906}
1907
1908type awsRestjson1_deserializeOpCreateIngestion struct {
1909}
1910
1911func (*awsRestjson1_deserializeOpCreateIngestion) ID() string {
1912	return "OperationDeserializer"
1913}
1914
1915func (m *awsRestjson1_deserializeOpCreateIngestion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
1916	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
1917) {
1918	out, metadata, err = next.HandleDeserialize(ctx, in)
1919	if err != nil {
1920		return out, metadata, err
1921	}
1922
1923	response, ok := out.RawResponse.(*smithyhttp.Response)
1924	if !ok {
1925		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
1926	}
1927
1928	if response.StatusCode < 200 || response.StatusCode >= 300 {
1929		return out, metadata, awsRestjson1_deserializeOpErrorCreateIngestion(response, &metadata)
1930	}
1931	output := &CreateIngestionOutput{}
1932	out.Result = output
1933
1934	err = awsRestjson1_deserializeOpHttpBindingsCreateIngestionOutput(output, response)
1935	if err != nil {
1936		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
1937	}
1938
1939	var buff [1024]byte
1940	ringBuffer := smithyio.NewRingBuffer(buff[:])
1941
1942	body := io.TeeReader(response.Body, ringBuffer)
1943
1944	decoder := json.NewDecoder(body)
1945	decoder.UseNumber()
1946	var shape interface{}
1947	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
1948		var snapshot bytes.Buffer
1949		io.Copy(&snapshot, ringBuffer)
1950		err = &smithy.DeserializationError{
1951			Err:      fmt.Errorf("failed to decode response body, %w", err),
1952			Snapshot: snapshot.Bytes(),
1953		}
1954		return out, metadata, err
1955	}
1956
1957	err = awsRestjson1_deserializeOpDocumentCreateIngestionOutput(&output, shape)
1958	if err != nil {
1959		var snapshot bytes.Buffer
1960		io.Copy(&snapshot, ringBuffer)
1961		return out, metadata, &smithy.DeserializationError{
1962			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
1963			Snapshot: snapshot.Bytes(),
1964		}
1965	}
1966
1967	return out, metadata, err
1968}
1969
1970func awsRestjson1_deserializeOpErrorCreateIngestion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
1971	var errorBuffer bytes.Buffer
1972	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
1973		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
1974	}
1975	errorBody := bytes.NewReader(errorBuffer.Bytes())
1976
1977	errorCode := "UnknownError"
1978	errorMessage := errorCode
1979
1980	code := response.Header.Get("X-Amzn-ErrorType")
1981	if len(code) != 0 {
1982		errorCode = restjson.SanitizeErrorCode(code)
1983	}
1984
1985	var buff [1024]byte
1986	ringBuffer := smithyio.NewRingBuffer(buff[:])
1987
1988	body := io.TeeReader(errorBody, ringBuffer)
1989	decoder := json.NewDecoder(body)
1990	decoder.UseNumber()
1991	code, message, err := restjson.GetErrorInfo(decoder)
1992	if err != nil {
1993		var snapshot bytes.Buffer
1994		io.Copy(&snapshot, ringBuffer)
1995		err = &smithy.DeserializationError{
1996			Err:      fmt.Errorf("failed to decode response body, %w", err),
1997			Snapshot: snapshot.Bytes(),
1998		}
1999		return err
2000	}
2001
2002	errorBody.Seek(0, io.SeekStart)
2003	if len(code) != 0 {
2004		errorCode = restjson.SanitizeErrorCode(code)
2005	}
2006	if len(message) != 0 {
2007		errorMessage = message
2008	}
2009
2010	switch {
2011	case strings.EqualFold("AccessDeniedException", errorCode):
2012		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
2013
2014	case strings.EqualFold("InternalFailureException", errorCode):
2015		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2016
2017	case strings.EqualFold("InvalidParameterValueException", errorCode):
2018		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
2019
2020	case strings.EqualFold("LimitExceededException", errorCode):
2021		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2022
2023	case strings.EqualFold("ResourceExistsException", errorCode):
2024		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
2025
2026	case strings.EqualFold("ResourceNotFoundException", errorCode):
2027		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2028
2029	case strings.EqualFold("ThrottlingException", errorCode):
2030		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2031
2032	default:
2033		genericError := &smithy.GenericAPIError{
2034			Code:    errorCode,
2035			Message: errorMessage,
2036		}
2037		return genericError
2038
2039	}
2040}
2041
2042func awsRestjson1_deserializeOpHttpBindingsCreateIngestionOutput(v *CreateIngestionOutput, response *smithyhttp.Response) error {
2043	if v == nil {
2044		return fmt.Errorf("unsupported deserialization for nil %T", v)
2045	}
2046
2047	v.Status = int32(response.StatusCode)
2048
2049	return nil
2050}
2051func awsRestjson1_deserializeOpDocumentCreateIngestionOutput(v **CreateIngestionOutput, value interface{}) error {
2052	if v == nil {
2053		return fmt.Errorf("unexpected nil of type %T", v)
2054	}
2055	if value == nil {
2056		return nil
2057	}
2058
2059	shape, ok := value.(map[string]interface{})
2060	if !ok {
2061		return fmt.Errorf("unexpected JSON type %v", value)
2062	}
2063
2064	var sv *CreateIngestionOutput
2065	if *v == nil {
2066		sv = &CreateIngestionOutput{}
2067	} else {
2068		sv = *v
2069	}
2070
2071	for key, value := range shape {
2072		switch key {
2073		case "Arn":
2074			if value != nil {
2075				jtv, ok := value.(string)
2076				if !ok {
2077					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2078				}
2079				sv.Arn = ptr.String(jtv)
2080			}
2081
2082		case "IngestionId":
2083			if value != nil {
2084				jtv, ok := value.(string)
2085				if !ok {
2086					return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value)
2087				}
2088				sv.IngestionId = ptr.String(jtv)
2089			}
2090
2091		case "IngestionStatus":
2092			if value != nil {
2093				jtv, ok := value.(string)
2094				if !ok {
2095					return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value)
2096				}
2097				sv.IngestionStatus = types.IngestionStatus(jtv)
2098			}
2099
2100		case "RequestId":
2101			if value != nil {
2102				jtv, ok := value.(string)
2103				if !ok {
2104					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2105				}
2106				sv.RequestId = ptr.String(jtv)
2107			}
2108
2109		default:
2110			_, _ = key, value
2111
2112		}
2113	}
2114	*v = sv
2115	return nil
2116}
2117
2118type awsRestjson1_deserializeOpCreateNamespace struct {
2119}
2120
2121func (*awsRestjson1_deserializeOpCreateNamespace) ID() string {
2122	return "OperationDeserializer"
2123}
2124
2125func (m *awsRestjson1_deserializeOpCreateNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2126	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2127) {
2128	out, metadata, err = next.HandleDeserialize(ctx, in)
2129	if err != nil {
2130		return out, metadata, err
2131	}
2132
2133	response, ok := out.RawResponse.(*smithyhttp.Response)
2134	if !ok {
2135		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2136	}
2137
2138	if response.StatusCode < 200 || response.StatusCode >= 300 {
2139		return out, metadata, awsRestjson1_deserializeOpErrorCreateNamespace(response, &metadata)
2140	}
2141	output := &CreateNamespaceOutput{}
2142	out.Result = output
2143
2144	err = awsRestjson1_deserializeOpHttpBindingsCreateNamespaceOutput(output, response)
2145	if err != nil {
2146		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
2147	}
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_deserializeOpDocumentCreateNamespaceOutput(&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_deserializeOpErrorCreateNamespace(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("AccessDeniedException", errorCode):
2222		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
2223
2224	case strings.EqualFold("ConflictException", errorCode):
2225		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
2226
2227	case strings.EqualFold("InternalFailureException", errorCode):
2228		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2229
2230	case strings.EqualFold("InvalidParameterValueException", errorCode):
2231		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
2232
2233	case strings.EqualFold("LimitExceededException", errorCode):
2234		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2235
2236	case strings.EqualFold("PreconditionNotMetException", errorCode):
2237		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
2238
2239	case strings.EqualFold("ResourceExistsException", errorCode):
2240		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
2241
2242	case strings.EqualFold("ResourceNotFoundException", errorCode):
2243		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2244
2245	case strings.EqualFold("ResourceUnavailableException", errorCode):
2246		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
2247
2248	case strings.EqualFold("ThrottlingException", errorCode):
2249		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2250
2251	default:
2252		genericError := &smithy.GenericAPIError{
2253			Code:    errorCode,
2254			Message: errorMessage,
2255		}
2256		return genericError
2257
2258	}
2259}
2260
2261func awsRestjson1_deserializeOpHttpBindingsCreateNamespaceOutput(v *CreateNamespaceOutput, response *smithyhttp.Response) error {
2262	if v == nil {
2263		return fmt.Errorf("unsupported deserialization for nil %T", v)
2264	}
2265
2266	v.Status = int32(response.StatusCode)
2267
2268	return nil
2269}
2270func awsRestjson1_deserializeOpDocumentCreateNamespaceOutput(v **CreateNamespaceOutput, value interface{}) error {
2271	if v == nil {
2272		return fmt.Errorf("unexpected nil of type %T", v)
2273	}
2274	if value == nil {
2275		return nil
2276	}
2277
2278	shape, ok := value.(map[string]interface{})
2279	if !ok {
2280		return fmt.Errorf("unexpected JSON type %v", value)
2281	}
2282
2283	var sv *CreateNamespaceOutput
2284	if *v == nil {
2285		sv = &CreateNamespaceOutput{}
2286	} else {
2287		sv = *v
2288	}
2289
2290	for key, value := range shape {
2291		switch key {
2292		case "Arn":
2293			if value != nil {
2294				jtv, ok := value.(string)
2295				if !ok {
2296					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2297				}
2298				sv.Arn = ptr.String(jtv)
2299			}
2300
2301		case "CapacityRegion":
2302			if value != nil {
2303				jtv, ok := value.(string)
2304				if !ok {
2305					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2306				}
2307				sv.CapacityRegion = ptr.String(jtv)
2308			}
2309
2310		case "CreationStatus":
2311			if value != nil {
2312				jtv, ok := value.(string)
2313				if !ok {
2314					return fmt.Errorf("expected NamespaceStatus to be of type string, got %T instead", value)
2315				}
2316				sv.CreationStatus = types.NamespaceStatus(jtv)
2317			}
2318
2319		case "IdentityStore":
2320			if value != nil {
2321				jtv, ok := value.(string)
2322				if !ok {
2323					return fmt.Errorf("expected IdentityStore to be of type string, got %T instead", value)
2324				}
2325				sv.IdentityStore = types.IdentityStore(jtv)
2326			}
2327
2328		case "Name":
2329			if value != nil {
2330				jtv, ok := value.(string)
2331				if !ok {
2332					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
2333				}
2334				sv.Name = ptr.String(jtv)
2335			}
2336
2337		case "RequestId":
2338			if value != nil {
2339				jtv, ok := value.(string)
2340				if !ok {
2341					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2342				}
2343				sv.RequestId = ptr.String(jtv)
2344			}
2345
2346		default:
2347			_, _ = key, value
2348
2349		}
2350	}
2351	*v = sv
2352	return nil
2353}
2354
2355type awsRestjson1_deserializeOpCreateTemplate struct {
2356}
2357
2358func (*awsRestjson1_deserializeOpCreateTemplate) ID() string {
2359	return "OperationDeserializer"
2360}
2361
2362func (m *awsRestjson1_deserializeOpCreateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2363	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2364) {
2365	out, metadata, err = next.HandleDeserialize(ctx, in)
2366	if err != nil {
2367		return out, metadata, err
2368	}
2369
2370	response, ok := out.RawResponse.(*smithyhttp.Response)
2371	if !ok {
2372		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2373	}
2374
2375	if response.StatusCode < 200 || response.StatusCode >= 300 {
2376		return out, metadata, awsRestjson1_deserializeOpErrorCreateTemplate(response, &metadata)
2377	}
2378	output := &CreateTemplateOutput{}
2379	out.Result = output
2380
2381	err = awsRestjson1_deserializeOpHttpBindingsCreateTemplateOutput(output, response)
2382	if err != nil {
2383		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
2384	}
2385
2386	var buff [1024]byte
2387	ringBuffer := smithyio.NewRingBuffer(buff[:])
2388
2389	body := io.TeeReader(response.Body, ringBuffer)
2390
2391	decoder := json.NewDecoder(body)
2392	decoder.UseNumber()
2393	var shape interface{}
2394	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2395		var snapshot bytes.Buffer
2396		io.Copy(&snapshot, ringBuffer)
2397		err = &smithy.DeserializationError{
2398			Err:      fmt.Errorf("failed to decode response body, %w", err),
2399			Snapshot: snapshot.Bytes(),
2400		}
2401		return out, metadata, err
2402	}
2403
2404	err = awsRestjson1_deserializeOpDocumentCreateTemplateOutput(&output, shape)
2405	if err != nil {
2406		var snapshot bytes.Buffer
2407		io.Copy(&snapshot, ringBuffer)
2408		return out, metadata, &smithy.DeserializationError{
2409			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2410			Snapshot: snapshot.Bytes(),
2411		}
2412	}
2413
2414	return out, metadata, err
2415}
2416
2417func awsRestjson1_deserializeOpErrorCreateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2418	var errorBuffer bytes.Buffer
2419	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2420		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2421	}
2422	errorBody := bytes.NewReader(errorBuffer.Bytes())
2423
2424	errorCode := "UnknownError"
2425	errorMessage := errorCode
2426
2427	code := response.Header.Get("X-Amzn-ErrorType")
2428	if len(code) != 0 {
2429		errorCode = restjson.SanitizeErrorCode(code)
2430	}
2431
2432	var buff [1024]byte
2433	ringBuffer := smithyio.NewRingBuffer(buff[:])
2434
2435	body := io.TeeReader(errorBody, ringBuffer)
2436	decoder := json.NewDecoder(body)
2437	decoder.UseNumber()
2438	code, message, err := restjson.GetErrorInfo(decoder)
2439	if err != nil {
2440		var snapshot bytes.Buffer
2441		io.Copy(&snapshot, ringBuffer)
2442		err = &smithy.DeserializationError{
2443			Err:      fmt.Errorf("failed to decode response body, %w", err),
2444			Snapshot: snapshot.Bytes(),
2445		}
2446		return err
2447	}
2448
2449	errorBody.Seek(0, io.SeekStart)
2450	if len(code) != 0 {
2451		errorCode = restjson.SanitizeErrorCode(code)
2452	}
2453	if len(message) != 0 {
2454		errorMessage = message
2455	}
2456
2457	switch {
2458	case strings.EqualFold("AccessDeniedException", errorCode):
2459		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
2460
2461	case strings.EqualFold("ConflictException", errorCode):
2462		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
2463
2464	case strings.EqualFold("InternalFailureException", errorCode):
2465		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2466
2467	case strings.EqualFold("InvalidParameterValueException", errorCode):
2468		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
2469
2470	case strings.EqualFold("LimitExceededException", errorCode):
2471		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2472
2473	case strings.EqualFold("ResourceExistsException", errorCode):
2474		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
2475
2476	case strings.EqualFold("ResourceNotFoundException", errorCode):
2477		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2478
2479	case strings.EqualFold("ThrottlingException", errorCode):
2480		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2481
2482	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
2483		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
2484
2485	default:
2486		genericError := &smithy.GenericAPIError{
2487			Code:    errorCode,
2488			Message: errorMessage,
2489		}
2490		return genericError
2491
2492	}
2493}
2494
2495func awsRestjson1_deserializeOpHttpBindingsCreateTemplateOutput(v *CreateTemplateOutput, response *smithyhttp.Response) error {
2496	if v == nil {
2497		return fmt.Errorf("unsupported deserialization for nil %T", v)
2498	}
2499
2500	v.Status = int32(response.StatusCode)
2501
2502	return nil
2503}
2504func awsRestjson1_deserializeOpDocumentCreateTemplateOutput(v **CreateTemplateOutput, value interface{}) error {
2505	if v == nil {
2506		return fmt.Errorf("unexpected nil of type %T", v)
2507	}
2508	if value == nil {
2509		return nil
2510	}
2511
2512	shape, ok := value.(map[string]interface{})
2513	if !ok {
2514		return fmt.Errorf("unexpected JSON type %v", value)
2515	}
2516
2517	var sv *CreateTemplateOutput
2518	if *v == nil {
2519		sv = &CreateTemplateOutput{}
2520	} else {
2521		sv = *v
2522	}
2523
2524	for key, value := range shape {
2525		switch key {
2526		case "Arn":
2527			if value != nil {
2528				jtv, ok := value.(string)
2529				if !ok {
2530					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2531				}
2532				sv.Arn = ptr.String(jtv)
2533			}
2534
2535		case "CreationStatus":
2536			if value != nil {
2537				jtv, ok := value.(string)
2538				if !ok {
2539					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
2540				}
2541				sv.CreationStatus = types.ResourceStatus(jtv)
2542			}
2543
2544		case "RequestId":
2545			if value != nil {
2546				jtv, ok := value.(string)
2547				if !ok {
2548					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2549				}
2550				sv.RequestId = ptr.String(jtv)
2551			}
2552
2553		case "TemplateId":
2554			if value != nil {
2555				jtv, ok := value.(string)
2556				if !ok {
2557					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
2558				}
2559				sv.TemplateId = ptr.String(jtv)
2560			}
2561
2562		case "VersionArn":
2563			if value != nil {
2564				jtv, ok := value.(string)
2565				if !ok {
2566					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2567				}
2568				sv.VersionArn = ptr.String(jtv)
2569			}
2570
2571		default:
2572			_, _ = key, value
2573
2574		}
2575	}
2576	*v = sv
2577	return nil
2578}
2579
2580type awsRestjson1_deserializeOpCreateTemplateAlias struct {
2581}
2582
2583func (*awsRestjson1_deserializeOpCreateTemplateAlias) ID() string {
2584	return "OperationDeserializer"
2585}
2586
2587func (m *awsRestjson1_deserializeOpCreateTemplateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2588	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2589) {
2590	out, metadata, err = next.HandleDeserialize(ctx, in)
2591	if err != nil {
2592		return out, metadata, err
2593	}
2594
2595	response, ok := out.RawResponse.(*smithyhttp.Response)
2596	if !ok {
2597		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2598	}
2599
2600	if response.StatusCode < 200 || response.StatusCode >= 300 {
2601		return out, metadata, awsRestjson1_deserializeOpErrorCreateTemplateAlias(response, &metadata)
2602	}
2603	output := &CreateTemplateAliasOutput{}
2604	out.Result = output
2605
2606	err = awsRestjson1_deserializeOpHttpBindingsCreateTemplateAliasOutput(output, response)
2607	if err != nil {
2608		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
2609	}
2610
2611	var buff [1024]byte
2612	ringBuffer := smithyio.NewRingBuffer(buff[:])
2613
2614	body := io.TeeReader(response.Body, ringBuffer)
2615
2616	decoder := json.NewDecoder(body)
2617	decoder.UseNumber()
2618	var shape interface{}
2619	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2620		var snapshot bytes.Buffer
2621		io.Copy(&snapshot, ringBuffer)
2622		err = &smithy.DeserializationError{
2623			Err:      fmt.Errorf("failed to decode response body, %w", err),
2624			Snapshot: snapshot.Bytes(),
2625		}
2626		return out, metadata, err
2627	}
2628
2629	err = awsRestjson1_deserializeOpDocumentCreateTemplateAliasOutput(&output, shape)
2630	if err != nil {
2631		var snapshot bytes.Buffer
2632		io.Copy(&snapshot, ringBuffer)
2633		return out, metadata, &smithy.DeserializationError{
2634			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2635			Snapshot: snapshot.Bytes(),
2636		}
2637	}
2638
2639	return out, metadata, err
2640}
2641
2642func awsRestjson1_deserializeOpErrorCreateTemplateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2643	var errorBuffer bytes.Buffer
2644	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2645		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2646	}
2647	errorBody := bytes.NewReader(errorBuffer.Bytes())
2648
2649	errorCode := "UnknownError"
2650	errorMessage := errorCode
2651
2652	code := response.Header.Get("X-Amzn-ErrorType")
2653	if len(code) != 0 {
2654		errorCode = restjson.SanitizeErrorCode(code)
2655	}
2656
2657	var buff [1024]byte
2658	ringBuffer := smithyio.NewRingBuffer(buff[:])
2659
2660	body := io.TeeReader(errorBody, ringBuffer)
2661	decoder := json.NewDecoder(body)
2662	decoder.UseNumber()
2663	code, message, err := restjson.GetErrorInfo(decoder)
2664	if err != nil {
2665		var snapshot bytes.Buffer
2666		io.Copy(&snapshot, ringBuffer)
2667		err = &smithy.DeserializationError{
2668			Err:      fmt.Errorf("failed to decode response body, %w", err),
2669			Snapshot: snapshot.Bytes(),
2670		}
2671		return err
2672	}
2673
2674	errorBody.Seek(0, io.SeekStart)
2675	if len(code) != 0 {
2676		errorCode = restjson.SanitizeErrorCode(code)
2677	}
2678	if len(message) != 0 {
2679		errorMessage = message
2680	}
2681
2682	switch {
2683	case strings.EqualFold("ConflictException", errorCode):
2684		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
2685
2686	case strings.EqualFold("InternalFailureException", errorCode):
2687		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2688
2689	case strings.EqualFold("LimitExceededException", errorCode):
2690		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2691
2692	case strings.EqualFold("ResourceExistsException", errorCode):
2693		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
2694
2695	case strings.EqualFold("ResourceNotFoundException", errorCode):
2696		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2697
2698	case strings.EqualFold("ThrottlingException", errorCode):
2699		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2700
2701	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
2702		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
2703
2704	default:
2705		genericError := &smithy.GenericAPIError{
2706			Code:    errorCode,
2707			Message: errorMessage,
2708		}
2709		return genericError
2710
2711	}
2712}
2713
2714func awsRestjson1_deserializeOpHttpBindingsCreateTemplateAliasOutput(v *CreateTemplateAliasOutput, response *smithyhttp.Response) error {
2715	if v == nil {
2716		return fmt.Errorf("unsupported deserialization for nil %T", v)
2717	}
2718
2719	v.Status = int32(response.StatusCode)
2720
2721	return nil
2722}
2723func awsRestjson1_deserializeOpDocumentCreateTemplateAliasOutput(v **CreateTemplateAliasOutput, value interface{}) error {
2724	if v == nil {
2725		return fmt.Errorf("unexpected nil of type %T", v)
2726	}
2727	if value == nil {
2728		return nil
2729	}
2730
2731	shape, ok := value.(map[string]interface{})
2732	if !ok {
2733		return fmt.Errorf("unexpected JSON type %v", value)
2734	}
2735
2736	var sv *CreateTemplateAliasOutput
2737	if *v == nil {
2738		sv = &CreateTemplateAliasOutput{}
2739	} else {
2740		sv = *v
2741	}
2742
2743	for key, value := range shape {
2744		switch key {
2745		case "RequestId":
2746			if value != nil {
2747				jtv, ok := value.(string)
2748				if !ok {
2749					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2750				}
2751				sv.RequestId = ptr.String(jtv)
2752			}
2753
2754		case "TemplateAlias":
2755			if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil {
2756				return err
2757			}
2758
2759		default:
2760			_, _ = key, value
2761
2762		}
2763	}
2764	*v = sv
2765	return nil
2766}
2767
2768type awsRestjson1_deserializeOpCreateTheme struct {
2769}
2770
2771func (*awsRestjson1_deserializeOpCreateTheme) ID() string {
2772	return "OperationDeserializer"
2773}
2774
2775func (m *awsRestjson1_deserializeOpCreateTheme) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2776	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2777) {
2778	out, metadata, err = next.HandleDeserialize(ctx, in)
2779	if err != nil {
2780		return out, metadata, err
2781	}
2782
2783	response, ok := out.RawResponse.(*smithyhttp.Response)
2784	if !ok {
2785		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
2786	}
2787
2788	if response.StatusCode < 200 || response.StatusCode >= 300 {
2789		return out, metadata, awsRestjson1_deserializeOpErrorCreateTheme(response, &metadata)
2790	}
2791	output := &CreateThemeOutput{}
2792	out.Result = output
2793
2794	err = awsRestjson1_deserializeOpHttpBindingsCreateThemeOutput(output, response)
2795	if err != nil {
2796		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
2797	}
2798
2799	var buff [1024]byte
2800	ringBuffer := smithyio.NewRingBuffer(buff[:])
2801
2802	body := io.TeeReader(response.Body, ringBuffer)
2803
2804	decoder := json.NewDecoder(body)
2805	decoder.UseNumber()
2806	var shape interface{}
2807	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
2808		var snapshot bytes.Buffer
2809		io.Copy(&snapshot, ringBuffer)
2810		err = &smithy.DeserializationError{
2811			Err:      fmt.Errorf("failed to decode response body, %w", err),
2812			Snapshot: snapshot.Bytes(),
2813		}
2814		return out, metadata, err
2815	}
2816
2817	err = awsRestjson1_deserializeOpDocumentCreateThemeOutput(&output, shape)
2818	if err != nil {
2819		var snapshot bytes.Buffer
2820		io.Copy(&snapshot, ringBuffer)
2821		return out, metadata, &smithy.DeserializationError{
2822			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
2823			Snapshot: snapshot.Bytes(),
2824		}
2825	}
2826
2827	return out, metadata, err
2828}
2829
2830func awsRestjson1_deserializeOpErrorCreateTheme(response *smithyhttp.Response, metadata *middleware.Metadata) error {
2831	var errorBuffer bytes.Buffer
2832	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
2833		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
2834	}
2835	errorBody := bytes.NewReader(errorBuffer.Bytes())
2836
2837	errorCode := "UnknownError"
2838	errorMessage := errorCode
2839
2840	code := response.Header.Get("X-Amzn-ErrorType")
2841	if len(code) != 0 {
2842		errorCode = restjson.SanitizeErrorCode(code)
2843	}
2844
2845	var buff [1024]byte
2846	ringBuffer := smithyio.NewRingBuffer(buff[:])
2847
2848	body := io.TeeReader(errorBody, ringBuffer)
2849	decoder := json.NewDecoder(body)
2850	decoder.UseNumber()
2851	code, message, err := restjson.GetErrorInfo(decoder)
2852	if err != nil {
2853		var snapshot bytes.Buffer
2854		io.Copy(&snapshot, ringBuffer)
2855		err = &smithy.DeserializationError{
2856			Err:      fmt.Errorf("failed to decode response body, %w", err),
2857			Snapshot: snapshot.Bytes(),
2858		}
2859		return err
2860	}
2861
2862	errorBody.Seek(0, io.SeekStart)
2863	if len(code) != 0 {
2864		errorCode = restjson.SanitizeErrorCode(code)
2865	}
2866	if len(message) != 0 {
2867		errorMessage = message
2868	}
2869
2870	switch {
2871	case strings.EqualFold("AccessDeniedException", errorCode):
2872		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
2873
2874	case strings.EqualFold("InternalFailureException", errorCode):
2875		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
2876
2877	case strings.EqualFold("InvalidParameterValueException", errorCode):
2878		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
2879
2880	case strings.EqualFold("LimitExceededException", errorCode):
2881		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
2882
2883	case strings.EqualFold("ResourceExistsException", errorCode):
2884		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
2885
2886	case strings.EqualFold("ResourceNotFoundException", errorCode):
2887		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
2888
2889	case strings.EqualFold("ThrottlingException", errorCode):
2890		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
2891
2892	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
2893		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
2894
2895	default:
2896		genericError := &smithy.GenericAPIError{
2897			Code:    errorCode,
2898			Message: errorMessage,
2899		}
2900		return genericError
2901
2902	}
2903}
2904
2905func awsRestjson1_deserializeOpHttpBindingsCreateThemeOutput(v *CreateThemeOutput, response *smithyhttp.Response) error {
2906	if v == nil {
2907		return fmt.Errorf("unsupported deserialization for nil %T", v)
2908	}
2909
2910	v.Status = int32(response.StatusCode)
2911
2912	return nil
2913}
2914func awsRestjson1_deserializeOpDocumentCreateThemeOutput(v **CreateThemeOutput, value interface{}) error {
2915	if v == nil {
2916		return fmt.Errorf("unexpected nil of type %T", v)
2917	}
2918	if value == nil {
2919		return nil
2920	}
2921
2922	shape, ok := value.(map[string]interface{})
2923	if !ok {
2924		return fmt.Errorf("unexpected JSON type %v", value)
2925	}
2926
2927	var sv *CreateThemeOutput
2928	if *v == nil {
2929		sv = &CreateThemeOutput{}
2930	} else {
2931		sv = *v
2932	}
2933
2934	for key, value := range shape {
2935		switch key {
2936		case "Arn":
2937			if value != nil {
2938				jtv, ok := value.(string)
2939				if !ok {
2940					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2941				}
2942				sv.Arn = ptr.String(jtv)
2943			}
2944
2945		case "CreationStatus":
2946			if value != nil {
2947				jtv, ok := value.(string)
2948				if !ok {
2949					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
2950				}
2951				sv.CreationStatus = types.ResourceStatus(jtv)
2952			}
2953
2954		case "RequestId":
2955			if value != nil {
2956				jtv, ok := value.(string)
2957				if !ok {
2958					return fmt.Errorf("expected String to be of type string, got %T instead", value)
2959				}
2960				sv.RequestId = ptr.String(jtv)
2961			}
2962
2963		case "ThemeId":
2964			if value != nil {
2965				jtv, ok := value.(string)
2966				if !ok {
2967					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
2968				}
2969				sv.ThemeId = ptr.String(jtv)
2970			}
2971
2972		case "VersionArn":
2973			if value != nil {
2974				jtv, ok := value.(string)
2975				if !ok {
2976					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
2977				}
2978				sv.VersionArn = ptr.String(jtv)
2979			}
2980
2981		default:
2982			_, _ = key, value
2983
2984		}
2985	}
2986	*v = sv
2987	return nil
2988}
2989
2990type awsRestjson1_deserializeOpCreateThemeAlias struct {
2991}
2992
2993func (*awsRestjson1_deserializeOpCreateThemeAlias) ID() string {
2994	return "OperationDeserializer"
2995}
2996
2997func (m *awsRestjson1_deserializeOpCreateThemeAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
2998	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
2999) {
3000	out, metadata, err = next.HandleDeserialize(ctx, in)
3001	if err != nil {
3002		return out, metadata, err
3003	}
3004
3005	response, ok := out.RawResponse.(*smithyhttp.Response)
3006	if !ok {
3007		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3008	}
3009
3010	if response.StatusCode < 200 || response.StatusCode >= 300 {
3011		return out, metadata, awsRestjson1_deserializeOpErrorCreateThemeAlias(response, &metadata)
3012	}
3013	output := &CreateThemeAliasOutput{}
3014	out.Result = output
3015
3016	err = awsRestjson1_deserializeOpHttpBindingsCreateThemeAliasOutput(output, response)
3017	if err != nil {
3018		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3019	}
3020
3021	var buff [1024]byte
3022	ringBuffer := smithyio.NewRingBuffer(buff[:])
3023
3024	body := io.TeeReader(response.Body, ringBuffer)
3025
3026	decoder := json.NewDecoder(body)
3027	decoder.UseNumber()
3028	var shape interface{}
3029	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3030		var snapshot bytes.Buffer
3031		io.Copy(&snapshot, ringBuffer)
3032		err = &smithy.DeserializationError{
3033			Err:      fmt.Errorf("failed to decode response body, %w", err),
3034			Snapshot: snapshot.Bytes(),
3035		}
3036		return out, metadata, err
3037	}
3038
3039	err = awsRestjson1_deserializeOpDocumentCreateThemeAliasOutput(&output, shape)
3040	if err != nil {
3041		var snapshot bytes.Buffer
3042		io.Copy(&snapshot, ringBuffer)
3043		return out, metadata, &smithy.DeserializationError{
3044			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3045			Snapshot: snapshot.Bytes(),
3046		}
3047	}
3048
3049	return out, metadata, err
3050}
3051
3052func awsRestjson1_deserializeOpErrorCreateThemeAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3053	var errorBuffer bytes.Buffer
3054	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3055		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3056	}
3057	errorBody := bytes.NewReader(errorBuffer.Bytes())
3058
3059	errorCode := "UnknownError"
3060	errorMessage := errorCode
3061
3062	code := response.Header.Get("X-Amzn-ErrorType")
3063	if len(code) != 0 {
3064		errorCode = restjson.SanitizeErrorCode(code)
3065	}
3066
3067	var buff [1024]byte
3068	ringBuffer := smithyio.NewRingBuffer(buff[:])
3069
3070	body := io.TeeReader(errorBody, ringBuffer)
3071	decoder := json.NewDecoder(body)
3072	decoder.UseNumber()
3073	code, message, err := restjson.GetErrorInfo(decoder)
3074	if err != nil {
3075		var snapshot bytes.Buffer
3076		io.Copy(&snapshot, ringBuffer)
3077		err = &smithy.DeserializationError{
3078			Err:      fmt.Errorf("failed to decode response body, %w", err),
3079			Snapshot: snapshot.Bytes(),
3080		}
3081		return err
3082	}
3083
3084	errorBody.Seek(0, io.SeekStart)
3085	if len(code) != 0 {
3086		errorCode = restjson.SanitizeErrorCode(code)
3087	}
3088	if len(message) != 0 {
3089		errorMessage = message
3090	}
3091
3092	switch {
3093	case strings.EqualFold("ConflictException", errorCode):
3094		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
3095
3096	case strings.EqualFold("InternalFailureException", errorCode):
3097		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3098
3099	case strings.EqualFold("InvalidParameterValueException", errorCode):
3100		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
3101
3102	case strings.EqualFold("LimitExceededException", errorCode):
3103		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
3104
3105	case strings.EqualFold("ResourceExistsException", errorCode):
3106		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
3107
3108	case strings.EqualFold("ResourceNotFoundException", errorCode):
3109		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3110
3111	case strings.EqualFold("ThrottlingException", errorCode):
3112		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3113
3114	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
3115		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
3116
3117	default:
3118		genericError := &smithy.GenericAPIError{
3119			Code:    errorCode,
3120			Message: errorMessage,
3121		}
3122		return genericError
3123
3124	}
3125}
3126
3127func awsRestjson1_deserializeOpHttpBindingsCreateThemeAliasOutput(v *CreateThemeAliasOutput, response *smithyhttp.Response) error {
3128	if v == nil {
3129		return fmt.Errorf("unsupported deserialization for nil %T", v)
3130	}
3131
3132	v.Status = int32(response.StatusCode)
3133
3134	return nil
3135}
3136func awsRestjson1_deserializeOpDocumentCreateThemeAliasOutput(v **CreateThemeAliasOutput, value interface{}) error {
3137	if v == nil {
3138		return fmt.Errorf("unexpected nil of type %T", v)
3139	}
3140	if value == nil {
3141		return nil
3142	}
3143
3144	shape, ok := value.(map[string]interface{})
3145	if !ok {
3146		return fmt.Errorf("unexpected JSON type %v", value)
3147	}
3148
3149	var sv *CreateThemeAliasOutput
3150	if *v == nil {
3151		sv = &CreateThemeAliasOutput{}
3152	} else {
3153		sv = *v
3154	}
3155
3156	for key, value := range shape {
3157		switch key {
3158		case "RequestId":
3159			if value != nil {
3160				jtv, ok := value.(string)
3161				if !ok {
3162					return fmt.Errorf("expected String to be of type string, got %T instead", value)
3163				}
3164				sv.RequestId = ptr.String(jtv)
3165			}
3166
3167		case "ThemeAlias":
3168			if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil {
3169				return err
3170			}
3171
3172		default:
3173			_, _ = key, value
3174
3175		}
3176	}
3177	*v = sv
3178	return nil
3179}
3180
3181type awsRestjson1_deserializeOpDeleteAccountCustomization struct {
3182}
3183
3184func (*awsRestjson1_deserializeOpDeleteAccountCustomization) ID() string {
3185	return "OperationDeserializer"
3186}
3187
3188func (m *awsRestjson1_deserializeOpDeleteAccountCustomization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3189	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3190) {
3191	out, metadata, err = next.HandleDeserialize(ctx, in)
3192	if err != nil {
3193		return out, metadata, err
3194	}
3195
3196	response, ok := out.RawResponse.(*smithyhttp.Response)
3197	if !ok {
3198		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3199	}
3200
3201	if response.StatusCode < 200 || response.StatusCode >= 300 {
3202		return out, metadata, awsRestjson1_deserializeOpErrorDeleteAccountCustomization(response, &metadata)
3203	}
3204	output := &DeleteAccountCustomizationOutput{}
3205	out.Result = output
3206
3207	err = awsRestjson1_deserializeOpHttpBindingsDeleteAccountCustomizationOutput(output, response)
3208	if err != nil {
3209		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3210	}
3211
3212	var buff [1024]byte
3213	ringBuffer := smithyio.NewRingBuffer(buff[:])
3214
3215	body := io.TeeReader(response.Body, ringBuffer)
3216
3217	decoder := json.NewDecoder(body)
3218	decoder.UseNumber()
3219	var shape interface{}
3220	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3221		var snapshot bytes.Buffer
3222		io.Copy(&snapshot, ringBuffer)
3223		err = &smithy.DeserializationError{
3224			Err:      fmt.Errorf("failed to decode response body, %w", err),
3225			Snapshot: snapshot.Bytes(),
3226		}
3227		return out, metadata, err
3228	}
3229
3230	err = awsRestjson1_deserializeOpDocumentDeleteAccountCustomizationOutput(&output, shape)
3231	if err != nil {
3232		var snapshot bytes.Buffer
3233		io.Copy(&snapshot, ringBuffer)
3234		return out, metadata, &smithy.DeserializationError{
3235			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3236			Snapshot: snapshot.Bytes(),
3237		}
3238	}
3239
3240	return out, metadata, err
3241}
3242
3243func awsRestjson1_deserializeOpErrorDeleteAccountCustomization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3244	var errorBuffer bytes.Buffer
3245	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3246		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3247	}
3248	errorBody := bytes.NewReader(errorBuffer.Bytes())
3249
3250	errorCode := "UnknownError"
3251	errorMessage := errorCode
3252
3253	code := response.Header.Get("X-Amzn-ErrorType")
3254	if len(code) != 0 {
3255		errorCode = restjson.SanitizeErrorCode(code)
3256	}
3257
3258	var buff [1024]byte
3259	ringBuffer := smithyio.NewRingBuffer(buff[:])
3260
3261	body := io.TeeReader(errorBody, ringBuffer)
3262	decoder := json.NewDecoder(body)
3263	decoder.UseNumber()
3264	code, message, err := restjson.GetErrorInfo(decoder)
3265	if err != nil {
3266		var snapshot bytes.Buffer
3267		io.Copy(&snapshot, ringBuffer)
3268		err = &smithy.DeserializationError{
3269			Err:      fmt.Errorf("failed to decode response body, %w", err),
3270			Snapshot: snapshot.Bytes(),
3271		}
3272		return err
3273	}
3274
3275	errorBody.Seek(0, io.SeekStart)
3276	if len(code) != 0 {
3277		errorCode = restjson.SanitizeErrorCode(code)
3278	}
3279	if len(message) != 0 {
3280		errorMessage = message
3281	}
3282
3283	switch {
3284	case strings.EqualFold("AccessDeniedException", errorCode):
3285		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
3286
3287	case strings.EqualFold("InternalFailureException", errorCode):
3288		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3289
3290	case strings.EqualFold("InvalidParameterValueException", errorCode):
3291		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
3292
3293	case strings.EqualFold("ResourceNotFoundException", errorCode):
3294		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3295
3296	case strings.EqualFold("ResourceUnavailableException", errorCode):
3297		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
3298
3299	case strings.EqualFold("ThrottlingException", errorCode):
3300		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3301
3302	default:
3303		genericError := &smithy.GenericAPIError{
3304			Code:    errorCode,
3305			Message: errorMessage,
3306		}
3307		return genericError
3308
3309	}
3310}
3311
3312func awsRestjson1_deserializeOpHttpBindingsDeleteAccountCustomizationOutput(v *DeleteAccountCustomizationOutput, response *smithyhttp.Response) error {
3313	if v == nil {
3314		return fmt.Errorf("unsupported deserialization for nil %T", v)
3315	}
3316
3317	v.Status = int32(response.StatusCode)
3318
3319	return nil
3320}
3321func awsRestjson1_deserializeOpDocumentDeleteAccountCustomizationOutput(v **DeleteAccountCustomizationOutput, value interface{}) error {
3322	if v == nil {
3323		return fmt.Errorf("unexpected nil of type %T", v)
3324	}
3325	if value == nil {
3326		return nil
3327	}
3328
3329	shape, ok := value.(map[string]interface{})
3330	if !ok {
3331		return fmt.Errorf("unexpected JSON type %v", value)
3332	}
3333
3334	var sv *DeleteAccountCustomizationOutput
3335	if *v == nil {
3336		sv = &DeleteAccountCustomizationOutput{}
3337	} else {
3338		sv = *v
3339	}
3340
3341	for key, value := range shape {
3342		switch key {
3343		case "RequestId":
3344			if value != nil {
3345				jtv, ok := value.(string)
3346				if !ok {
3347					return fmt.Errorf("expected String to be of type string, got %T instead", value)
3348				}
3349				sv.RequestId = ptr.String(jtv)
3350			}
3351
3352		default:
3353			_, _ = key, value
3354
3355		}
3356	}
3357	*v = sv
3358	return nil
3359}
3360
3361type awsRestjson1_deserializeOpDeleteAnalysis struct {
3362}
3363
3364func (*awsRestjson1_deserializeOpDeleteAnalysis) ID() string {
3365	return "OperationDeserializer"
3366}
3367
3368func (m *awsRestjson1_deserializeOpDeleteAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3369	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3370) {
3371	out, metadata, err = next.HandleDeserialize(ctx, in)
3372	if err != nil {
3373		return out, metadata, err
3374	}
3375
3376	response, ok := out.RawResponse.(*smithyhttp.Response)
3377	if !ok {
3378		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3379	}
3380
3381	if response.StatusCode < 200 || response.StatusCode >= 300 {
3382		return out, metadata, awsRestjson1_deserializeOpErrorDeleteAnalysis(response, &metadata)
3383	}
3384	output := &DeleteAnalysisOutput{}
3385	out.Result = output
3386
3387	err = awsRestjson1_deserializeOpHttpBindingsDeleteAnalysisOutput(output, response)
3388	if err != nil {
3389		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3390	}
3391
3392	var buff [1024]byte
3393	ringBuffer := smithyio.NewRingBuffer(buff[:])
3394
3395	body := io.TeeReader(response.Body, ringBuffer)
3396
3397	decoder := json.NewDecoder(body)
3398	decoder.UseNumber()
3399	var shape interface{}
3400	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3401		var snapshot bytes.Buffer
3402		io.Copy(&snapshot, ringBuffer)
3403		err = &smithy.DeserializationError{
3404			Err:      fmt.Errorf("failed to decode response body, %w", err),
3405			Snapshot: snapshot.Bytes(),
3406		}
3407		return out, metadata, err
3408	}
3409
3410	err = awsRestjson1_deserializeOpDocumentDeleteAnalysisOutput(&output, shape)
3411	if err != nil {
3412		var snapshot bytes.Buffer
3413		io.Copy(&snapshot, ringBuffer)
3414		return out, metadata, &smithy.DeserializationError{
3415			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3416			Snapshot: snapshot.Bytes(),
3417		}
3418	}
3419
3420	return out, metadata, err
3421}
3422
3423func awsRestjson1_deserializeOpErrorDeleteAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3424	var errorBuffer bytes.Buffer
3425	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3426		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3427	}
3428	errorBody := bytes.NewReader(errorBuffer.Bytes())
3429
3430	errorCode := "UnknownError"
3431	errorMessage := errorCode
3432
3433	code := response.Header.Get("X-Amzn-ErrorType")
3434	if len(code) != 0 {
3435		errorCode = restjson.SanitizeErrorCode(code)
3436	}
3437
3438	var buff [1024]byte
3439	ringBuffer := smithyio.NewRingBuffer(buff[:])
3440
3441	body := io.TeeReader(errorBody, ringBuffer)
3442	decoder := json.NewDecoder(body)
3443	decoder.UseNumber()
3444	code, message, err := restjson.GetErrorInfo(decoder)
3445	if err != nil {
3446		var snapshot bytes.Buffer
3447		io.Copy(&snapshot, ringBuffer)
3448		err = &smithy.DeserializationError{
3449			Err:      fmt.Errorf("failed to decode response body, %w", err),
3450			Snapshot: snapshot.Bytes(),
3451		}
3452		return err
3453	}
3454
3455	errorBody.Seek(0, io.SeekStart)
3456	if len(code) != 0 {
3457		errorCode = restjson.SanitizeErrorCode(code)
3458	}
3459	if len(message) != 0 {
3460		errorMessage = message
3461	}
3462
3463	switch {
3464	case strings.EqualFold("ConflictException", errorCode):
3465		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
3466
3467	case strings.EqualFold("InternalFailureException", errorCode):
3468		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3469
3470	case strings.EqualFold("InvalidParameterValueException", errorCode):
3471		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
3472
3473	case strings.EqualFold("ResourceNotFoundException", errorCode):
3474		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3475
3476	case strings.EqualFold("ThrottlingException", errorCode):
3477		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3478
3479	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
3480		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
3481
3482	default:
3483		genericError := &smithy.GenericAPIError{
3484			Code:    errorCode,
3485			Message: errorMessage,
3486		}
3487		return genericError
3488
3489	}
3490}
3491
3492func awsRestjson1_deserializeOpHttpBindingsDeleteAnalysisOutput(v *DeleteAnalysisOutput, response *smithyhttp.Response) error {
3493	if v == nil {
3494		return fmt.Errorf("unsupported deserialization for nil %T", v)
3495	}
3496
3497	v.Status = int32(response.StatusCode)
3498
3499	return nil
3500}
3501func awsRestjson1_deserializeOpDocumentDeleteAnalysisOutput(v **DeleteAnalysisOutput, value interface{}) error {
3502	if v == nil {
3503		return fmt.Errorf("unexpected nil of type %T", v)
3504	}
3505	if value == nil {
3506		return nil
3507	}
3508
3509	shape, ok := value.(map[string]interface{})
3510	if !ok {
3511		return fmt.Errorf("unexpected JSON type %v", value)
3512	}
3513
3514	var sv *DeleteAnalysisOutput
3515	if *v == nil {
3516		sv = &DeleteAnalysisOutput{}
3517	} else {
3518		sv = *v
3519	}
3520
3521	for key, value := range shape {
3522		switch key {
3523		case "AnalysisId":
3524			if value != nil {
3525				jtv, ok := value.(string)
3526				if !ok {
3527					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
3528				}
3529				sv.AnalysisId = ptr.String(jtv)
3530			}
3531
3532		case "Arn":
3533			if value != nil {
3534				jtv, ok := value.(string)
3535				if !ok {
3536					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
3537				}
3538				sv.Arn = ptr.String(jtv)
3539			}
3540
3541		case "DeletionTime":
3542			if value != nil {
3543				jtv, ok := value.(json.Number)
3544				if !ok {
3545					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
3546				}
3547				f64, err := jtv.Float64()
3548				if err != nil {
3549					return err
3550				}
3551				sv.DeletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
3552			}
3553
3554		case "RequestId":
3555			if value != nil {
3556				jtv, ok := value.(string)
3557				if !ok {
3558					return fmt.Errorf("expected String to be of type string, got %T instead", value)
3559				}
3560				sv.RequestId = ptr.String(jtv)
3561			}
3562
3563		default:
3564			_, _ = key, value
3565
3566		}
3567	}
3568	*v = sv
3569	return nil
3570}
3571
3572type awsRestjson1_deserializeOpDeleteDashboard struct {
3573}
3574
3575func (*awsRestjson1_deserializeOpDeleteDashboard) ID() string {
3576	return "OperationDeserializer"
3577}
3578
3579func (m *awsRestjson1_deserializeOpDeleteDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3580	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3581) {
3582	out, metadata, err = next.HandleDeserialize(ctx, in)
3583	if err != nil {
3584		return out, metadata, err
3585	}
3586
3587	response, ok := out.RawResponse.(*smithyhttp.Response)
3588	if !ok {
3589		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3590	}
3591
3592	if response.StatusCode < 200 || response.StatusCode >= 300 {
3593		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDashboard(response, &metadata)
3594	}
3595	output := &DeleteDashboardOutput{}
3596	out.Result = output
3597
3598	err = awsRestjson1_deserializeOpHttpBindingsDeleteDashboardOutput(output, response)
3599	if err != nil {
3600		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3601	}
3602
3603	var buff [1024]byte
3604	ringBuffer := smithyio.NewRingBuffer(buff[:])
3605
3606	body := io.TeeReader(response.Body, ringBuffer)
3607
3608	decoder := json.NewDecoder(body)
3609	decoder.UseNumber()
3610	var shape interface{}
3611	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3612		var snapshot bytes.Buffer
3613		io.Copy(&snapshot, ringBuffer)
3614		err = &smithy.DeserializationError{
3615			Err:      fmt.Errorf("failed to decode response body, %w", err),
3616			Snapshot: snapshot.Bytes(),
3617		}
3618		return out, metadata, err
3619	}
3620
3621	err = awsRestjson1_deserializeOpDocumentDeleteDashboardOutput(&output, shape)
3622	if err != nil {
3623		var snapshot bytes.Buffer
3624		io.Copy(&snapshot, ringBuffer)
3625		return out, metadata, &smithy.DeserializationError{
3626			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3627			Snapshot: snapshot.Bytes(),
3628		}
3629	}
3630
3631	return out, metadata, err
3632}
3633
3634func awsRestjson1_deserializeOpErrorDeleteDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3635	var errorBuffer bytes.Buffer
3636	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3637		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3638	}
3639	errorBody := bytes.NewReader(errorBuffer.Bytes())
3640
3641	errorCode := "UnknownError"
3642	errorMessage := errorCode
3643
3644	code := response.Header.Get("X-Amzn-ErrorType")
3645	if len(code) != 0 {
3646		errorCode = restjson.SanitizeErrorCode(code)
3647	}
3648
3649	var buff [1024]byte
3650	ringBuffer := smithyio.NewRingBuffer(buff[:])
3651
3652	body := io.TeeReader(errorBody, ringBuffer)
3653	decoder := json.NewDecoder(body)
3654	decoder.UseNumber()
3655	code, message, err := restjson.GetErrorInfo(decoder)
3656	if err != nil {
3657		var snapshot bytes.Buffer
3658		io.Copy(&snapshot, ringBuffer)
3659		err = &smithy.DeserializationError{
3660			Err:      fmt.Errorf("failed to decode response body, %w", err),
3661			Snapshot: snapshot.Bytes(),
3662		}
3663		return err
3664	}
3665
3666	errorBody.Seek(0, io.SeekStart)
3667	if len(code) != 0 {
3668		errorCode = restjson.SanitizeErrorCode(code)
3669	}
3670	if len(message) != 0 {
3671		errorMessage = message
3672	}
3673
3674	switch {
3675	case strings.EqualFold("ConflictException", errorCode):
3676		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
3677
3678	case strings.EqualFold("InternalFailureException", errorCode):
3679		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3680
3681	case strings.EqualFold("InvalidParameterValueException", errorCode):
3682		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
3683
3684	case strings.EqualFold("ResourceNotFoundException", errorCode):
3685		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3686
3687	case strings.EqualFold("ThrottlingException", errorCode):
3688		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3689
3690	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
3691		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
3692
3693	default:
3694		genericError := &smithy.GenericAPIError{
3695			Code:    errorCode,
3696			Message: errorMessage,
3697		}
3698		return genericError
3699
3700	}
3701}
3702
3703func awsRestjson1_deserializeOpHttpBindingsDeleteDashboardOutput(v *DeleteDashboardOutput, response *smithyhttp.Response) error {
3704	if v == nil {
3705		return fmt.Errorf("unsupported deserialization for nil %T", v)
3706	}
3707
3708	v.Status = int32(response.StatusCode)
3709
3710	return nil
3711}
3712func awsRestjson1_deserializeOpDocumentDeleteDashboardOutput(v **DeleteDashboardOutput, value interface{}) error {
3713	if v == nil {
3714		return fmt.Errorf("unexpected nil of type %T", v)
3715	}
3716	if value == nil {
3717		return nil
3718	}
3719
3720	shape, ok := value.(map[string]interface{})
3721	if !ok {
3722		return fmt.Errorf("unexpected JSON type %v", value)
3723	}
3724
3725	var sv *DeleteDashboardOutput
3726	if *v == nil {
3727		sv = &DeleteDashboardOutput{}
3728	} else {
3729		sv = *v
3730	}
3731
3732	for key, value := range shape {
3733		switch key {
3734		case "Arn":
3735			if value != nil {
3736				jtv, ok := value.(string)
3737				if !ok {
3738					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
3739				}
3740				sv.Arn = ptr.String(jtv)
3741			}
3742
3743		case "DashboardId":
3744			if value != nil {
3745				jtv, ok := value.(string)
3746				if !ok {
3747					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
3748				}
3749				sv.DashboardId = ptr.String(jtv)
3750			}
3751
3752		case "RequestId":
3753			if value != nil {
3754				jtv, ok := value.(string)
3755				if !ok {
3756					return fmt.Errorf("expected String to be of type string, got %T instead", value)
3757				}
3758				sv.RequestId = ptr.String(jtv)
3759			}
3760
3761		default:
3762			_, _ = key, value
3763
3764		}
3765	}
3766	*v = sv
3767	return nil
3768}
3769
3770type awsRestjson1_deserializeOpDeleteDataSet struct {
3771}
3772
3773func (*awsRestjson1_deserializeOpDeleteDataSet) ID() string {
3774	return "OperationDeserializer"
3775}
3776
3777func (m *awsRestjson1_deserializeOpDeleteDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3778	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3779) {
3780	out, metadata, err = next.HandleDeserialize(ctx, in)
3781	if err != nil {
3782		return out, metadata, err
3783	}
3784
3785	response, ok := out.RawResponse.(*smithyhttp.Response)
3786	if !ok {
3787		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3788	}
3789
3790	if response.StatusCode < 200 || response.StatusCode >= 300 {
3791		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSet(response, &metadata)
3792	}
3793	output := &DeleteDataSetOutput{}
3794	out.Result = output
3795
3796	err = awsRestjson1_deserializeOpHttpBindingsDeleteDataSetOutput(output, response)
3797	if err != nil {
3798		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3799	}
3800
3801	var buff [1024]byte
3802	ringBuffer := smithyio.NewRingBuffer(buff[:])
3803
3804	body := io.TeeReader(response.Body, ringBuffer)
3805
3806	decoder := json.NewDecoder(body)
3807	decoder.UseNumber()
3808	var shape interface{}
3809	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
3810		var snapshot bytes.Buffer
3811		io.Copy(&snapshot, ringBuffer)
3812		err = &smithy.DeserializationError{
3813			Err:      fmt.Errorf("failed to decode response body, %w", err),
3814			Snapshot: snapshot.Bytes(),
3815		}
3816		return out, metadata, err
3817	}
3818
3819	err = awsRestjson1_deserializeOpDocumentDeleteDataSetOutput(&output, shape)
3820	if err != nil {
3821		var snapshot bytes.Buffer
3822		io.Copy(&snapshot, ringBuffer)
3823		return out, metadata, &smithy.DeserializationError{
3824			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
3825			Snapshot: snapshot.Bytes(),
3826		}
3827	}
3828
3829	return out, metadata, err
3830}
3831
3832func awsRestjson1_deserializeOpErrorDeleteDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
3833	var errorBuffer bytes.Buffer
3834	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
3835		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
3836	}
3837	errorBody := bytes.NewReader(errorBuffer.Bytes())
3838
3839	errorCode := "UnknownError"
3840	errorMessage := errorCode
3841
3842	code := response.Header.Get("X-Amzn-ErrorType")
3843	if len(code) != 0 {
3844		errorCode = restjson.SanitizeErrorCode(code)
3845	}
3846
3847	var buff [1024]byte
3848	ringBuffer := smithyio.NewRingBuffer(buff[:])
3849
3850	body := io.TeeReader(errorBody, ringBuffer)
3851	decoder := json.NewDecoder(body)
3852	decoder.UseNumber()
3853	code, message, err := restjson.GetErrorInfo(decoder)
3854	if err != nil {
3855		var snapshot bytes.Buffer
3856		io.Copy(&snapshot, ringBuffer)
3857		err = &smithy.DeserializationError{
3858			Err:      fmt.Errorf("failed to decode response body, %w", err),
3859			Snapshot: snapshot.Bytes(),
3860		}
3861		return err
3862	}
3863
3864	errorBody.Seek(0, io.SeekStart)
3865	if len(code) != 0 {
3866		errorCode = restjson.SanitizeErrorCode(code)
3867	}
3868	if len(message) != 0 {
3869		errorMessage = message
3870	}
3871
3872	switch {
3873	case strings.EqualFold("AccessDeniedException", errorCode):
3874		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
3875
3876	case strings.EqualFold("InternalFailureException", errorCode):
3877		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
3878
3879	case strings.EqualFold("InvalidParameterValueException", errorCode):
3880		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
3881
3882	case strings.EqualFold("ResourceNotFoundException", errorCode):
3883		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
3884
3885	case strings.EqualFold("ThrottlingException", errorCode):
3886		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
3887
3888	default:
3889		genericError := &smithy.GenericAPIError{
3890			Code:    errorCode,
3891			Message: errorMessage,
3892		}
3893		return genericError
3894
3895	}
3896}
3897
3898func awsRestjson1_deserializeOpHttpBindingsDeleteDataSetOutput(v *DeleteDataSetOutput, response *smithyhttp.Response) error {
3899	if v == nil {
3900		return fmt.Errorf("unsupported deserialization for nil %T", v)
3901	}
3902
3903	v.Status = int32(response.StatusCode)
3904
3905	return nil
3906}
3907func awsRestjson1_deserializeOpDocumentDeleteDataSetOutput(v **DeleteDataSetOutput, value interface{}) error {
3908	if v == nil {
3909		return fmt.Errorf("unexpected nil of type %T", v)
3910	}
3911	if value == nil {
3912		return nil
3913	}
3914
3915	shape, ok := value.(map[string]interface{})
3916	if !ok {
3917		return fmt.Errorf("unexpected JSON type %v", value)
3918	}
3919
3920	var sv *DeleteDataSetOutput
3921	if *v == nil {
3922		sv = &DeleteDataSetOutput{}
3923	} else {
3924		sv = *v
3925	}
3926
3927	for key, value := range shape {
3928		switch key {
3929		case "Arn":
3930			if value != nil {
3931				jtv, ok := value.(string)
3932				if !ok {
3933					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
3934				}
3935				sv.Arn = ptr.String(jtv)
3936			}
3937
3938		case "DataSetId":
3939			if value != nil {
3940				jtv, ok := value.(string)
3941				if !ok {
3942					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
3943				}
3944				sv.DataSetId = ptr.String(jtv)
3945			}
3946
3947		case "RequestId":
3948			if value != nil {
3949				jtv, ok := value.(string)
3950				if !ok {
3951					return fmt.Errorf("expected String to be of type string, got %T instead", value)
3952				}
3953				sv.RequestId = ptr.String(jtv)
3954			}
3955
3956		default:
3957			_, _ = key, value
3958
3959		}
3960	}
3961	*v = sv
3962	return nil
3963}
3964
3965type awsRestjson1_deserializeOpDeleteDataSource struct {
3966}
3967
3968func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string {
3969	return "OperationDeserializer"
3970}
3971
3972func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
3973	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
3974) {
3975	out, metadata, err = next.HandleDeserialize(ctx, in)
3976	if err != nil {
3977		return out, metadata, err
3978	}
3979
3980	response, ok := out.RawResponse.(*smithyhttp.Response)
3981	if !ok {
3982		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
3983	}
3984
3985	if response.StatusCode < 200 || response.StatusCode >= 300 {
3986		return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata)
3987	}
3988	output := &DeleteDataSourceOutput{}
3989	out.Result = output
3990
3991	err = awsRestjson1_deserializeOpHttpBindingsDeleteDataSourceOutput(output, response)
3992	if err != nil {
3993		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
3994	}
3995
3996	var buff [1024]byte
3997	ringBuffer := smithyio.NewRingBuffer(buff[:])
3998
3999	body := io.TeeReader(response.Body, ringBuffer)
4000
4001	decoder := json.NewDecoder(body)
4002	decoder.UseNumber()
4003	var shape interface{}
4004	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4005		var snapshot bytes.Buffer
4006		io.Copy(&snapshot, ringBuffer)
4007		err = &smithy.DeserializationError{
4008			Err:      fmt.Errorf("failed to decode response body, %w", err),
4009			Snapshot: snapshot.Bytes(),
4010		}
4011		return out, metadata, err
4012	}
4013
4014	err = awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(&output, shape)
4015	if err != nil {
4016		var snapshot bytes.Buffer
4017		io.Copy(&snapshot, ringBuffer)
4018		return out, metadata, &smithy.DeserializationError{
4019			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4020			Snapshot: snapshot.Bytes(),
4021		}
4022	}
4023
4024	return out, metadata, err
4025}
4026
4027func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4028	var errorBuffer bytes.Buffer
4029	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4030		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4031	}
4032	errorBody := bytes.NewReader(errorBuffer.Bytes())
4033
4034	errorCode := "UnknownError"
4035	errorMessage := errorCode
4036
4037	code := response.Header.Get("X-Amzn-ErrorType")
4038	if len(code) != 0 {
4039		errorCode = restjson.SanitizeErrorCode(code)
4040	}
4041
4042	var buff [1024]byte
4043	ringBuffer := smithyio.NewRingBuffer(buff[:])
4044
4045	body := io.TeeReader(errorBody, ringBuffer)
4046	decoder := json.NewDecoder(body)
4047	decoder.UseNumber()
4048	code, message, err := restjson.GetErrorInfo(decoder)
4049	if err != nil {
4050		var snapshot bytes.Buffer
4051		io.Copy(&snapshot, ringBuffer)
4052		err = &smithy.DeserializationError{
4053			Err:      fmt.Errorf("failed to decode response body, %w", err),
4054			Snapshot: snapshot.Bytes(),
4055		}
4056		return err
4057	}
4058
4059	errorBody.Seek(0, io.SeekStart)
4060	if len(code) != 0 {
4061		errorCode = restjson.SanitizeErrorCode(code)
4062	}
4063	if len(message) != 0 {
4064		errorMessage = message
4065	}
4066
4067	switch {
4068	case strings.EqualFold("AccessDeniedException", errorCode):
4069		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
4070
4071	case strings.EqualFold("InternalFailureException", errorCode):
4072		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4073
4074	case strings.EqualFold("InvalidParameterValueException", errorCode):
4075		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
4076
4077	case strings.EqualFold("ResourceNotFoundException", errorCode):
4078		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4079
4080	case strings.EqualFold("ThrottlingException", errorCode):
4081		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4082
4083	default:
4084		genericError := &smithy.GenericAPIError{
4085			Code:    errorCode,
4086			Message: errorMessage,
4087		}
4088		return genericError
4089
4090	}
4091}
4092
4093func awsRestjson1_deserializeOpHttpBindingsDeleteDataSourceOutput(v *DeleteDataSourceOutput, response *smithyhttp.Response) error {
4094	if v == nil {
4095		return fmt.Errorf("unsupported deserialization for nil %T", v)
4096	}
4097
4098	v.Status = int32(response.StatusCode)
4099
4100	return nil
4101}
4102func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, value interface{}) error {
4103	if v == nil {
4104		return fmt.Errorf("unexpected nil of type %T", v)
4105	}
4106	if value == nil {
4107		return nil
4108	}
4109
4110	shape, ok := value.(map[string]interface{})
4111	if !ok {
4112		return fmt.Errorf("unexpected JSON type %v", value)
4113	}
4114
4115	var sv *DeleteDataSourceOutput
4116	if *v == nil {
4117		sv = &DeleteDataSourceOutput{}
4118	} else {
4119		sv = *v
4120	}
4121
4122	for key, value := range shape {
4123		switch key {
4124		case "Arn":
4125			if value != nil {
4126				jtv, ok := value.(string)
4127				if !ok {
4128					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
4129				}
4130				sv.Arn = ptr.String(jtv)
4131			}
4132
4133		case "DataSourceId":
4134			if value != nil {
4135				jtv, ok := value.(string)
4136				if !ok {
4137					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
4138				}
4139				sv.DataSourceId = ptr.String(jtv)
4140			}
4141
4142		case "RequestId":
4143			if value != nil {
4144				jtv, ok := value.(string)
4145				if !ok {
4146					return fmt.Errorf("expected String to be of type string, got %T instead", value)
4147				}
4148				sv.RequestId = ptr.String(jtv)
4149			}
4150
4151		default:
4152			_, _ = key, value
4153
4154		}
4155	}
4156	*v = sv
4157	return nil
4158}
4159
4160type awsRestjson1_deserializeOpDeleteGroup struct {
4161}
4162
4163func (*awsRestjson1_deserializeOpDeleteGroup) ID() string {
4164	return "OperationDeserializer"
4165}
4166
4167func (m *awsRestjson1_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4168	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4169) {
4170	out, metadata, err = next.HandleDeserialize(ctx, in)
4171	if err != nil {
4172		return out, metadata, err
4173	}
4174
4175	response, ok := out.RawResponse.(*smithyhttp.Response)
4176	if !ok {
4177		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4178	}
4179
4180	if response.StatusCode < 200 || response.StatusCode >= 300 {
4181		return out, metadata, awsRestjson1_deserializeOpErrorDeleteGroup(response, &metadata)
4182	}
4183	output := &DeleteGroupOutput{}
4184	out.Result = output
4185
4186	err = awsRestjson1_deserializeOpHttpBindingsDeleteGroupOutput(output, response)
4187	if err != nil {
4188		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
4189	}
4190
4191	var buff [1024]byte
4192	ringBuffer := smithyio.NewRingBuffer(buff[:])
4193
4194	body := io.TeeReader(response.Body, ringBuffer)
4195
4196	decoder := json.NewDecoder(body)
4197	decoder.UseNumber()
4198	var shape interface{}
4199	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4200		var snapshot bytes.Buffer
4201		io.Copy(&snapshot, ringBuffer)
4202		err = &smithy.DeserializationError{
4203			Err:      fmt.Errorf("failed to decode response body, %w", err),
4204			Snapshot: snapshot.Bytes(),
4205		}
4206		return out, metadata, err
4207	}
4208
4209	err = awsRestjson1_deserializeOpDocumentDeleteGroupOutput(&output, shape)
4210	if err != nil {
4211		var snapshot bytes.Buffer
4212		io.Copy(&snapshot, ringBuffer)
4213		return out, metadata, &smithy.DeserializationError{
4214			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4215			Snapshot: snapshot.Bytes(),
4216		}
4217	}
4218
4219	return out, metadata, err
4220}
4221
4222func awsRestjson1_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4223	var errorBuffer bytes.Buffer
4224	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4225		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4226	}
4227	errorBody := bytes.NewReader(errorBuffer.Bytes())
4228
4229	errorCode := "UnknownError"
4230	errorMessage := errorCode
4231
4232	code := response.Header.Get("X-Amzn-ErrorType")
4233	if len(code) != 0 {
4234		errorCode = restjson.SanitizeErrorCode(code)
4235	}
4236
4237	var buff [1024]byte
4238	ringBuffer := smithyio.NewRingBuffer(buff[:])
4239
4240	body := io.TeeReader(errorBody, ringBuffer)
4241	decoder := json.NewDecoder(body)
4242	decoder.UseNumber()
4243	code, message, err := restjson.GetErrorInfo(decoder)
4244	if err != nil {
4245		var snapshot bytes.Buffer
4246		io.Copy(&snapshot, ringBuffer)
4247		err = &smithy.DeserializationError{
4248			Err:      fmt.Errorf("failed to decode response body, %w", err),
4249			Snapshot: snapshot.Bytes(),
4250		}
4251		return err
4252	}
4253
4254	errorBody.Seek(0, io.SeekStart)
4255	if len(code) != 0 {
4256		errorCode = restjson.SanitizeErrorCode(code)
4257	}
4258	if len(message) != 0 {
4259		errorMessage = message
4260	}
4261
4262	switch {
4263	case strings.EqualFold("AccessDeniedException", errorCode):
4264		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
4265
4266	case strings.EqualFold("InternalFailureException", errorCode):
4267		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4268
4269	case strings.EqualFold("InvalidParameterValueException", errorCode):
4270		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
4271
4272	case strings.EqualFold("PreconditionNotMetException", errorCode):
4273		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
4274
4275	case strings.EqualFold("ResourceNotFoundException", errorCode):
4276		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4277
4278	case strings.EqualFold("ResourceUnavailableException", errorCode):
4279		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
4280
4281	case strings.EqualFold("ThrottlingException", errorCode):
4282		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4283
4284	default:
4285		genericError := &smithy.GenericAPIError{
4286			Code:    errorCode,
4287			Message: errorMessage,
4288		}
4289		return genericError
4290
4291	}
4292}
4293
4294func awsRestjson1_deserializeOpHttpBindingsDeleteGroupOutput(v *DeleteGroupOutput, response *smithyhttp.Response) error {
4295	if v == nil {
4296		return fmt.Errorf("unsupported deserialization for nil %T", v)
4297	}
4298
4299	v.Status = int32(response.StatusCode)
4300
4301	return nil
4302}
4303func awsRestjson1_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, value interface{}) error {
4304	if v == nil {
4305		return fmt.Errorf("unexpected nil of type %T", v)
4306	}
4307	if value == nil {
4308		return nil
4309	}
4310
4311	shape, ok := value.(map[string]interface{})
4312	if !ok {
4313		return fmt.Errorf("unexpected JSON type %v", value)
4314	}
4315
4316	var sv *DeleteGroupOutput
4317	if *v == nil {
4318		sv = &DeleteGroupOutput{}
4319	} else {
4320		sv = *v
4321	}
4322
4323	for key, value := range shape {
4324		switch key {
4325		case "RequestId":
4326			if value != nil {
4327				jtv, ok := value.(string)
4328				if !ok {
4329					return fmt.Errorf("expected String to be of type string, got %T instead", value)
4330				}
4331				sv.RequestId = ptr.String(jtv)
4332			}
4333
4334		default:
4335			_, _ = key, value
4336
4337		}
4338	}
4339	*v = sv
4340	return nil
4341}
4342
4343type awsRestjson1_deserializeOpDeleteGroupMembership struct {
4344}
4345
4346func (*awsRestjson1_deserializeOpDeleteGroupMembership) ID() string {
4347	return "OperationDeserializer"
4348}
4349
4350func (m *awsRestjson1_deserializeOpDeleteGroupMembership) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4351	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4352) {
4353	out, metadata, err = next.HandleDeserialize(ctx, in)
4354	if err != nil {
4355		return out, metadata, err
4356	}
4357
4358	response, ok := out.RawResponse.(*smithyhttp.Response)
4359	if !ok {
4360		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4361	}
4362
4363	if response.StatusCode < 200 || response.StatusCode >= 300 {
4364		return out, metadata, awsRestjson1_deserializeOpErrorDeleteGroupMembership(response, &metadata)
4365	}
4366	output := &DeleteGroupMembershipOutput{}
4367	out.Result = output
4368
4369	err = awsRestjson1_deserializeOpHttpBindingsDeleteGroupMembershipOutput(output, response)
4370	if err != nil {
4371		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
4372	}
4373
4374	var buff [1024]byte
4375	ringBuffer := smithyio.NewRingBuffer(buff[:])
4376
4377	body := io.TeeReader(response.Body, ringBuffer)
4378
4379	decoder := json.NewDecoder(body)
4380	decoder.UseNumber()
4381	var shape interface{}
4382	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4383		var snapshot bytes.Buffer
4384		io.Copy(&snapshot, ringBuffer)
4385		err = &smithy.DeserializationError{
4386			Err:      fmt.Errorf("failed to decode response body, %w", err),
4387			Snapshot: snapshot.Bytes(),
4388		}
4389		return out, metadata, err
4390	}
4391
4392	err = awsRestjson1_deserializeOpDocumentDeleteGroupMembershipOutput(&output, shape)
4393	if err != nil {
4394		var snapshot bytes.Buffer
4395		io.Copy(&snapshot, ringBuffer)
4396		return out, metadata, &smithy.DeserializationError{
4397			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4398			Snapshot: snapshot.Bytes(),
4399		}
4400	}
4401
4402	return out, metadata, err
4403}
4404
4405func awsRestjson1_deserializeOpErrorDeleteGroupMembership(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4406	var errorBuffer bytes.Buffer
4407	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4408		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4409	}
4410	errorBody := bytes.NewReader(errorBuffer.Bytes())
4411
4412	errorCode := "UnknownError"
4413	errorMessage := errorCode
4414
4415	code := response.Header.Get("X-Amzn-ErrorType")
4416	if len(code) != 0 {
4417		errorCode = restjson.SanitizeErrorCode(code)
4418	}
4419
4420	var buff [1024]byte
4421	ringBuffer := smithyio.NewRingBuffer(buff[:])
4422
4423	body := io.TeeReader(errorBody, ringBuffer)
4424	decoder := json.NewDecoder(body)
4425	decoder.UseNumber()
4426	code, message, err := restjson.GetErrorInfo(decoder)
4427	if err != nil {
4428		var snapshot bytes.Buffer
4429		io.Copy(&snapshot, ringBuffer)
4430		err = &smithy.DeserializationError{
4431			Err:      fmt.Errorf("failed to decode response body, %w", err),
4432			Snapshot: snapshot.Bytes(),
4433		}
4434		return err
4435	}
4436
4437	errorBody.Seek(0, io.SeekStart)
4438	if len(code) != 0 {
4439		errorCode = restjson.SanitizeErrorCode(code)
4440	}
4441	if len(message) != 0 {
4442		errorMessage = message
4443	}
4444
4445	switch {
4446	case strings.EqualFold("AccessDeniedException", errorCode):
4447		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
4448
4449	case strings.EqualFold("InternalFailureException", errorCode):
4450		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4451
4452	case strings.EqualFold("InvalidParameterValueException", errorCode):
4453		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
4454
4455	case strings.EqualFold("PreconditionNotMetException", errorCode):
4456		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
4457
4458	case strings.EqualFold("ResourceNotFoundException", errorCode):
4459		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4460
4461	case strings.EqualFold("ResourceUnavailableException", errorCode):
4462		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
4463
4464	case strings.EqualFold("ThrottlingException", errorCode):
4465		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4466
4467	default:
4468		genericError := &smithy.GenericAPIError{
4469			Code:    errorCode,
4470			Message: errorMessage,
4471		}
4472		return genericError
4473
4474	}
4475}
4476
4477func awsRestjson1_deserializeOpHttpBindingsDeleteGroupMembershipOutput(v *DeleteGroupMembershipOutput, response *smithyhttp.Response) error {
4478	if v == nil {
4479		return fmt.Errorf("unsupported deserialization for nil %T", v)
4480	}
4481
4482	v.Status = int32(response.StatusCode)
4483
4484	return nil
4485}
4486func awsRestjson1_deserializeOpDocumentDeleteGroupMembershipOutput(v **DeleteGroupMembershipOutput, value interface{}) error {
4487	if v == nil {
4488		return fmt.Errorf("unexpected nil of type %T", v)
4489	}
4490	if value == nil {
4491		return nil
4492	}
4493
4494	shape, ok := value.(map[string]interface{})
4495	if !ok {
4496		return fmt.Errorf("unexpected JSON type %v", value)
4497	}
4498
4499	var sv *DeleteGroupMembershipOutput
4500	if *v == nil {
4501		sv = &DeleteGroupMembershipOutput{}
4502	} else {
4503		sv = *v
4504	}
4505
4506	for key, value := range shape {
4507		switch key {
4508		case "RequestId":
4509			if value != nil {
4510				jtv, ok := value.(string)
4511				if !ok {
4512					return fmt.Errorf("expected String to be of type string, got %T instead", value)
4513				}
4514				sv.RequestId = ptr.String(jtv)
4515			}
4516
4517		default:
4518			_, _ = key, value
4519
4520		}
4521	}
4522	*v = sv
4523	return nil
4524}
4525
4526type awsRestjson1_deserializeOpDeleteIAMPolicyAssignment struct {
4527}
4528
4529func (*awsRestjson1_deserializeOpDeleteIAMPolicyAssignment) ID() string {
4530	return "OperationDeserializer"
4531}
4532
4533func (m *awsRestjson1_deserializeOpDeleteIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4534	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4535) {
4536	out, metadata, err = next.HandleDeserialize(ctx, in)
4537	if err != nil {
4538		return out, metadata, err
4539	}
4540
4541	response, ok := out.RawResponse.(*smithyhttp.Response)
4542	if !ok {
4543		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4544	}
4545
4546	if response.StatusCode < 200 || response.StatusCode >= 300 {
4547		return out, metadata, awsRestjson1_deserializeOpErrorDeleteIAMPolicyAssignment(response, &metadata)
4548	}
4549	output := &DeleteIAMPolicyAssignmentOutput{}
4550	out.Result = output
4551
4552	err = awsRestjson1_deserializeOpHttpBindingsDeleteIAMPolicyAssignmentOutput(output, response)
4553	if err != nil {
4554		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
4555	}
4556
4557	var buff [1024]byte
4558	ringBuffer := smithyio.NewRingBuffer(buff[:])
4559
4560	body := io.TeeReader(response.Body, ringBuffer)
4561
4562	decoder := json.NewDecoder(body)
4563	decoder.UseNumber()
4564	var shape interface{}
4565	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4566		var snapshot bytes.Buffer
4567		io.Copy(&snapshot, ringBuffer)
4568		err = &smithy.DeserializationError{
4569			Err:      fmt.Errorf("failed to decode response body, %w", err),
4570			Snapshot: snapshot.Bytes(),
4571		}
4572		return out, metadata, err
4573	}
4574
4575	err = awsRestjson1_deserializeOpDocumentDeleteIAMPolicyAssignmentOutput(&output, shape)
4576	if err != nil {
4577		var snapshot bytes.Buffer
4578		io.Copy(&snapshot, ringBuffer)
4579		return out, metadata, &smithy.DeserializationError{
4580			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4581			Snapshot: snapshot.Bytes(),
4582		}
4583	}
4584
4585	return out, metadata, err
4586}
4587
4588func awsRestjson1_deserializeOpErrorDeleteIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4589	var errorBuffer bytes.Buffer
4590	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4591		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4592	}
4593	errorBody := bytes.NewReader(errorBuffer.Bytes())
4594
4595	errorCode := "UnknownError"
4596	errorMessage := errorCode
4597
4598	code := response.Header.Get("X-Amzn-ErrorType")
4599	if len(code) != 0 {
4600		errorCode = restjson.SanitizeErrorCode(code)
4601	}
4602
4603	var buff [1024]byte
4604	ringBuffer := smithyio.NewRingBuffer(buff[:])
4605
4606	body := io.TeeReader(errorBody, ringBuffer)
4607	decoder := json.NewDecoder(body)
4608	decoder.UseNumber()
4609	code, message, err := restjson.GetErrorInfo(decoder)
4610	if err != nil {
4611		var snapshot bytes.Buffer
4612		io.Copy(&snapshot, ringBuffer)
4613		err = &smithy.DeserializationError{
4614			Err:      fmt.Errorf("failed to decode response body, %w", err),
4615			Snapshot: snapshot.Bytes(),
4616		}
4617		return err
4618	}
4619
4620	errorBody.Seek(0, io.SeekStart)
4621	if len(code) != 0 {
4622		errorCode = restjson.SanitizeErrorCode(code)
4623	}
4624	if len(message) != 0 {
4625		errorMessage = message
4626	}
4627
4628	switch {
4629	case strings.EqualFold("AccessDeniedException", errorCode):
4630		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
4631
4632	case strings.EqualFold("ConcurrentUpdatingException", errorCode):
4633		return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody)
4634
4635	case strings.EqualFold("InternalFailureException", errorCode):
4636		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4637
4638	case strings.EqualFold("InvalidParameterValueException", errorCode):
4639		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
4640
4641	case strings.EqualFold("ResourceExistsException", errorCode):
4642		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
4643
4644	case strings.EqualFold("ResourceNotFoundException", errorCode):
4645		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4646
4647	case strings.EqualFold("ThrottlingException", errorCode):
4648		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4649
4650	default:
4651		genericError := &smithy.GenericAPIError{
4652			Code:    errorCode,
4653			Message: errorMessage,
4654		}
4655		return genericError
4656
4657	}
4658}
4659
4660func awsRestjson1_deserializeOpHttpBindingsDeleteIAMPolicyAssignmentOutput(v *DeleteIAMPolicyAssignmentOutput, response *smithyhttp.Response) error {
4661	if v == nil {
4662		return fmt.Errorf("unsupported deserialization for nil %T", v)
4663	}
4664
4665	v.Status = int32(response.StatusCode)
4666
4667	return nil
4668}
4669func awsRestjson1_deserializeOpDocumentDeleteIAMPolicyAssignmentOutput(v **DeleteIAMPolicyAssignmentOutput, value interface{}) error {
4670	if v == nil {
4671		return fmt.Errorf("unexpected nil of type %T", v)
4672	}
4673	if value == nil {
4674		return nil
4675	}
4676
4677	shape, ok := value.(map[string]interface{})
4678	if !ok {
4679		return fmt.Errorf("unexpected JSON type %v", value)
4680	}
4681
4682	var sv *DeleteIAMPolicyAssignmentOutput
4683	if *v == nil {
4684		sv = &DeleteIAMPolicyAssignmentOutput{}
4685	} else {
4686		sv = *v
4687	}
4688
4689	for key, value := range shape {
4690		switch key {
4691		case "AssignmentName":
4692			if value != nil {
4693				jtv, ok := value.(string)
4694				if !ok {
4695					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
4696				}
4697				sv.AssignmentName = ptr.String(jtv)
4698			}
4699
4700		case "RequestId":
4701			if value != nil {
4702				jtv, ok := value.(string)
4703				if !ok {
4704					return fmt.Errorf("expected String to be of type string, got %T instead", value)
4705				}
4706				sv.RequestId = ptr.String(jtv)
4707			}
4708
4709		default:
4710			_, _ = key, value
4711
4712		}
4713	}
4714	*v = sv
4715	return nil
4716}
4717
4718type awsRestjson1_deserializeOpDeleteNamespace struct {
4719}
4720
4721func (*awsRestjson1_deserializeOpDeleteNamespace) ID() string {
4722	return "OperationDeserializer"
4723}
4724
4725func (m *awsRestjson1_deserializeOpDeleteNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4726	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4727) {
4728	out, metadata, err = next.HandleDeserialize(ctx, in)
4729	if err != nil {
4730		return out, metadata, err
4731	}
4732
4733	response, ok := out.RawResponse.(*smithyhttp.Response)
4734	if !ok {
4735		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4736	}
4737
4738	if response.StatusCode < 200 || response.StatusCode >= 300 {
4739		return out, metadata, awsRestjson1_deserializeOpErrorDeleteNamespace(response, &metadata)
4740	}
4741	output := &DeleteNamespaceOutput{}
4742	out.Result = output
4743
4744	err = awsRestjson1_deserializeOpHttpBindingsDeleteNamespaceOutput(output, response)
4745	if err != nil {
4746		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
4747	}
4748
4749	var buff [1024]byte
4750	ringBuffer := smithyio.NewRingBuffer(buff[:])
4751
4752	body := io.TeeReader(response.Body, ringBuffer)
4753
4754	decoder := json.NewDecoder(body)
4755	decoder.UseNumber()
4756	var shape interface{}
4757	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4758		var snapshot bytes.Buffer
4759		io.Copy(&snapshot, ringBuffer)
4760		err = &smithy.DeserializationError{
4761			Err:      fmt.Errorf("failed to decode response body, %w", err),
4762			Snapshot: snapshot.Bytes(),
4763		}
4764		return out, metadata, err
4765	}
4766
4767	err = awsRestjson1_deserializeOpDocumentDeleteNamespaceOutput(&output, shape)
4768	if err != nil {
4769		var snapshot bytes.Buffer
4770		io.Copy(&snapshot, ringBuffer)
4771		return out, metadata, &smithy.DeserializationError{
4772			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4773			Snapshot: snapshot.Bytes(),
4774		}
4775	}
4776
4777	return out, metadata, err
4778}
4779
4780func awsRestjson1_deserializeOpErrorDeleteNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4781	var errorBuffer bytes.Buffer
4782	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4783		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4784	}
4785	errorBody := bytes.NewReader(errorBuffer.Bytes())
4786
4787	errorCode := "UnknownError"
4788	errorMessage := errorCode
4789
4790	code := response.Header.Get("X-Amzn-ErrorType")
4791	if len(code) != 0 {
4792		errorCode = restjson.SanitizeErrorCode(code)
4793	}
4794
4795	var buff [1024]byte
4796	ringBuffer := smithyio.NewRingBuffer(buff[:])
4797
4798	body := io.TeeReader(errorBody, ringBuffer)
4799	decoder := json.NewDecoder(body)
4800	decoder.UseNumber()
4801	code, message, err := restjson.GetErrorInfo(decoder)
4802	if err != nil {
4803		var snapshot bytes.Buffer
4804		io.Copy(&snapshot, ringBuffer)
4805		err = &smithy.DeserializationError{
4806			Err:      fmt.Errorf("failed to decode response body, %w", err),
4807			Snapshot: snapshot.Bytes(),
4808		}
4809		return err
4810	}
4811
4812	errorBody.Seek(0, io.SeekStart)
4813	if len(code) != 0 {
4814		errorCode = restjson.SanitizeErrorCode(code)
4815	}
4816	if len(message) != 0 {
4817		errorMessage = message
4818	}
4819
4820	switch {
4821	case strings.EqualFold("AccessDeniedException", errorCode):
4822		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
4823
4824	case strings.EqualFold("InternalFailureException", errorCode):
4825		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
4826
4827	case strings.EqualFold("InvalidParameterValueException", errorCode):
4828		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
4829
4830	case strings.EqualFold("PreconditionNotMetException", errorCode):
4831		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
4832
4833	case strings.EqualFold("ResourceNotFoundException", errorCode):
4834		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
4835
4836	case strings.EqualFold("ResourceUnavailableException", errorCode):
4837		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
4838
4839	case strings.EqualFold("ThrottlingException", errorCode):
4840		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
4841
4842	default:
4843		genericError := &smithy.GenericAPIError{
4844			Code:    errorCode,
4845			Message: errorMessage,
4846		}
4847		return genericError
4848
4849	}
4850}
4851
4852func awsRestjson1_deserializeOpHttpBindingsDeleteNamespaceOutput(v *DeleteNamespaceOutput, response *smithyhttp.Response) error {
4853	if v == nil {
4854		return fmt.Errorf("unsupported deserialization for nil %T", v)
4855	}
4856
4857	v.Status = int32(response.StatusCode)
4858
4859	return nil
4860}
4861func awsRestjson1_deserializeOpDocumentDeleteNamespaceOutput(v **DeleteNamespaceOutput, value interface{}) error {
4862	if v == nil {
4863		return fmt.Errorf("unexpected nil of type %T", v)
4864	}
4865	if value == nil {
4866		return nil
4867	}
4868
4869	shape, ok := value.(map[string]interface{})
4870	if !ok {
4871		return fmt.Errorf("unexpected JSON type %v", value)
4872	}
4873
4874	var sv *DeleteNamespaceOutput
4875	if *v == nil {
4876		sv = &DeleteNamespaceOutput{}
4877	} else {
4878		sv = *v
4879	}
4880
4881	for key, value := range shape {
4882		switch key {
4883		case "RequestId":
4884			if value != nil {
4885				jtv, ok := value.(string)
4886				if !ok {
4887					return fmt.Errorf("expected String to be of type string, got %T instead", value)
4888				}
4889				sv.RequestId = ptr.String(jtv)
4890			}
4891
4892		default:
4893			_, _ = key, value
4894
4895		}
4896	}
4897	*v = sv
4898	return nil
4899}
4900
4901type awsRestjson1_deserializeOpDeleteTemplate struct {
4902}
4903
4904func (*awsRestjson1_deserializeOpDeleteTemplate) ID() string {
4905	return "OperationDeserializer"
4906}
4907
4908func (m *awsRestjson1_deserializeOpDeleteTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
4909	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
4910) {
4911	out, metadata, err = next.HandleDeserialize(ctx, in)
4912	if err != nil {
4913		return out, metadata, err
4914	}
4915
4916	response, ok := out.RawResponse.(*smithyhttp.Response)
4917	if !ok {
4918		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
4919	}
4920
4921	if response.StatusCode < 200 || response.StatusCode >= 300 {
4922		return out, metadata, awsRestjson1_deserializeOpErrorDeleteTemplate(response, &metadata)
4923	}
4924	output := &DeleteTemplateOutput{}
4925	out.Result = output
4926
4927	err = awsRestjson1_deserializeOpHttpBindingsDeleteTemplateOutput(output, response)
4928	if err != nil {
4929		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
4930	}
4931
4932	var buff [1024]byte
4933	ringBuffer := smithyio.NewRingBuffer(buff[:])
4934
4935	body := io.TeeReader(response.Body, ringBuffer)
4936
4937	decoder := json.NewDecoder(body)
4938	decoder.UseNumber()
4939	var shape interface{}
4940	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
4941		var snapshot bytes.Buffer
4942		io.Copy(&snapshot, ringBuffer)
4943		err = &smithy.DeserializationError{
4944			Err:      fmt.Errorf("failed to decode response body, %w", err),
4945			Snapshot: snapshot.Bytes(),
4946		}
4947		return out, metadata, err
4948	}
4949
4950	err = awsRestjson1_deserializeOpDocumentDeleteTemplateOutput(&output, shape)
4951	if err != nil {
4952		var snapshot bytes.Buffer
4953		io.Copy(&snapshot, ringBuffer)
4954		return out, metadata, &smithy.DeserializationError{
4955			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
4956			Snapshot: snapshot.Bytes(),
4957		}
4958	}
4959
4960	return out, metadata, err
4961}
4962
4963func awsRestjson1_deserializeOpErrorDeleteTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
4964	var errorBuffer bytes.Buffer
4965	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
4966		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
4967	}
4968	errorBody := bytes.NewReader(errorBuffer.Bytes())
4969
4970	errorCode := "UnknownError"
4971	errorMessage := errorCode
4972
4973	code := response.Header.Get("X-Amzn-ErrorType")
4974	if len(code) != 0 {
4975		errorCode = restjson.SanitizeErrorCode(code)
4976	}
4977
4978	var buff [1024]byte
4979	ringBuffer := smithyio.NewRingBuffer(buff[:])
4980
4981	body := io.TeeReader(errorBody, ringBuffer)
4982	decoder := json.NewDecoder(body)
4983	decoder.UseNumber()
4984	code, message, err := restjson.GetErrorInfo(decoder)
4985	if err != nil {
4986		var snapshot bytes.Buffer
4987		io.Copy(&snapshot, ringBuffer)
4988		err = &smithy.DeserializationError{
4989			Err:      fmt.Errorf("failed to decode response body, %w", err),
4990			Snapshot: snapshot.Bytes(),
4991		}
4992		return err
4993	}
4994
4995	errorBody.Seek(0, io.SeekStart)
4996	if len(code) != 0 {
4997		errorCode = restjson.SanitizeErrorCode(code)
4998	}
4999	if len(message) != 0 {
5000		errorMessage = message
5001	}
5002
5003	switch {
5004	case strings.EqualFold("ConflictException", errorCode):
5005		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
5006
5007	case strings.EqualFold("InternalFailureException", errorCode):
5008		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5009
5010	case strings.EqualFold("InvalidParameterValueException", errorCode):
5011		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
5012
5013	case strings.EqualFold("LimitExceededException", errorCode):
5014		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
5015
5016	case strings.EqualFold("ResourceNotFoundException", errorCode):
5017		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5018
5019	case strings.EqualFold("ThrottlingException", errorCode):
5020		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5021
5022	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
5023		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
5024
5025	default:
5026		genericError := &smithy.GenericAPIError{
5027			Code:    errorCode,
5028			Message: errorMessage,
5029		}
5030		return genericError
5031
5032	}
5033}
5034
5035func awsRestjson1_deserializeOpHttpBindingsDeleteTemplateOutput(v *DeleteTemplateOutput, response *smithyhttp.Response) error {
5036	if v == nil {
5037		return fmt.Errorf("unsupported deserialization for nil %T", v)
5038	}
5039
5040	v.Status = int32(response.StatusCode)
5041
5042	return nil
5043}
5044func awsRestjson1_deserializeOpDocumentDeleteTemplateOutput(v **DeleteTemplateOutput, value interface{}) error {
5045	if v == nil {
5046		return fmt.Errorf("unexpected nil of type %T", v)
5047	}
5048	if value == nil {
5049		return nil
5050	}
5051
5052	shape, ok := value.(map[string]interface{})
5053	if !ok {
5054		return fmt.Errorf("unexpected JSON type %v", value)
5055	}
5056
5057	var sv *DeleteTemplateOutput
5058	if *v == nil {
5059		sv = &DeleteTemplateOutput{}
5060	} else {
5061		sv = *v
5062	}
5063
5064	for key, value := range shape {
5065		switch key {
5066		case "Arn":
5067			if value != nil {
5068				jtv, ok := value.(string)
5069				if !ok {
5070					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
5071				}
5072				sv.Arn = ptr.String(jtv)
5073			}
5074
5075		case "RequestId":
5076			if value != nil {
5077				jtv, ok := value.(string)
5078				if !ok {
5079					return fmt.Errorf("expected String to be of type string, got %T instead", value)
5080				}
5081				sv.RequestId = ptr.String(jtv)
5082			}
5083
5084		case "TemplateId":
5085			if value != nil {
5086				jtv, ok := value.(string)
5087				if !ok {
5088					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
5089				}
5090				sv.TemplateId = ptr.String(jtv)
5091			}
5092
5093		default:
5094			_, _ = key, value
5095
5096		}
5097	}
5098	*v = sv
5099	return nil
5100}
5101
5102type awsRestjson1_deserializeOpDeleteTemplateAlias struct {
5103}
5104
5105func (*awsRestjson1_deserializeOpDeleteTemplateAlias) ID() string {
5106	return "OperationDeserializer"
5107}
5108
5109func (m *awsRestjson1_deserializeOpDeleteTemplateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5110	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5111) {
5112	out, metadata, err = next.HandleDeserialize(ctx, in)
5113	if err != nil {
5114		return out, metadata, err
5115	}
5116
5117	response, ok := out.RawResponse.(*smithyhttp.Response)
5118	if !ok {
5119		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5120	}
5121
5122	if response.StatusCode < 200 || response.StatusCode >= 300 {
5123		return out, metadata, awsRestjson1_deserializeOpErrorDeleteTemplateAlias(response, &metadata)
5124	}
5125	output := &DeleteTemplateAliasOutput{}
5126	out.Result = output
5127
5128	err = awsRestjson1_deserializeOpHttpBindingsDeleteTemplateAliasOutput(output, response)
5129	if err != nil {
5130		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
5131	}
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_deserializeOpDocumentDeleteTemplateAliasOutput(&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_deserializeOpErrorDeleteTemplateAlias(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("ConflictException", errorCode):
5206		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
5207
5208	case strings.EqualFold("InternalFailureException", errorCode):
5209		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5210
5211	case strings.EqualFold("ResourceNotFoundException", errorCode):
5212		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5213
5214	case strings.EqualFold("ThrottlingException", errorCode):
5215		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5216
5217	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
5218		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
5219
5220	default:
5221		genericError := &smithy.GenericAPIError{
5222			Code:    errorCode,
5223			Message: errorMessage,
5224		}
5225		return genericError
5226
5227	}
5228}
5229
5230func awsRestjson1_deserializeOpHttpBindingsDeleteTemplateAliasOutput(v *DeleteTemplateAliasOutput, response *smithyhttp.Response) error {
5231	if v == nil {
5232		return fmt.Errorf("unsupported deserialization for nil %T", v)
5233	}
5234
5235	v.Status = int32(response.StatusCode)
5236
5237	return nil
5238}
5239func awsRestjson1_deserializeOpDocumentDeleteTemplateAliasOutput(v **DeleteTemplateAliasOutput, 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 *DeleteTemplateAliasOutput
5253	if *v == nil {
5254		sv = &DeleteTemplateAliasOutput{}
5255	} else {
5256		sv = *v
5257	}
5258
5259	for key, value := range shape {
5260		switch key {
5261		case "AliasName":
5262			if value != nil {
5263				jtv, ok := value.(string)
5264				if !ok {
5265					return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
5266				}
5267				sv.AliasName = ptr.String(jtv)
5268			}
5269
5270		case "Arn":
5271			if value != nil {
5272				jtv, ok := value.(string)
5273				if !ok {
5274					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
5275				}
5276				sv.Arn = ptr.String(jtv)
5277			}
5278
5279		case "RequestId":
5280			if value != nil {
5281				jtv, ok := value.(string)
5282				if !ok {
5283					return fmt.Errorf("expected String to be of type string, got %T instead", value)
5284				}
5285				sv.RequestId = ptr.String(jtv)
5286			}
5287
5288		case "TemplateId":
5289			if value != nil {
5290				jtv, ok := value.(string)
5291				if !ok {
5292					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
5293				}
5294				sv.TemplateId = ptr.String(jtv)
5295			}
5296
5297		default:
5298			_, _ = key, value
5299
5300		}
5301	}
5302	*v = sv
5303	return nil
5304}
5305
5306type awsRestjson1_deserializeOpDeleteTheme struct {
5307}
5308
5309func (*awsRestjson1_deserializeOpDeleteTheme) ID() string {
5310	return "OperationDeserializer"
5311}
5312
5313func (m *awsRestjson1_deserializeOpDeleteTheme) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5314	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5315) {
5316	out, metadata, err = next.HandleDeserialize(ctx, in)
5317	if err != nil {
5318		return out, metadata, err
5319	}
5320
5321	response, ok := out.RawResponse.(*smithyhttp.Response)
5322	if !ok {
5323		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5324	}
5325
5326	if response.StatusCode < 200 || response.StatusCode >= 300 {
5327		return out, metadata, awsRestjson1_deserializeOpErrorDeleteTheme(response, &metadata)
5328	}
5329	output := &DeleteThemeOutput{}
5330	out.Result = output
5331
5332	err = awsRestjson1_deserializeOpHttpBindingsDeleteThemeOutput(output, response)
5333	if err != nil {
5334		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
5335	}
5336
5337	var buff [1024]byte
5338	ringBuffer := smithyio.NewRingBuffer(buff[:])
5339
5340	body := io.TeeReader(response.Body, ringBuffer)
5341
5342	decoder := json.NewDecoder(body)
5343	decoder.UseNumber()
5344	var shape interface{}
5345	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5346		var snapshot bytes.Buffer
5347		io.Copy(&snapshot, ringBuffer)
5348		err = &smithy.DeserializationError{
5349			Err:      fmt.Errorf("failed to decode response body, %w", err),
5350			Snapshot: snapshot.Bytes(),
5351		}
5352		return out, metadata, err
5353	}
5354
5355	err = awsRestjson1_deserializeOpDocumentDeleteThemeOutput(&output, shape)
5356	if err != nil {
5357		var snapshot bytes.Buffer
5358		io.Copy(&snapshot, ringBuffer)
5359		return out, metadata, &smithy.DeserializationError{
5360			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5361			Snapshot: snapshot.Bytes(),
5362		}
5363	}
5364
5365	return out, metadata, err
5366}
5367
5368func awsRestjson1_deserializeOpErrorDeleteTheme(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5369	var errorBuffer bytes.Buffer
5370	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5371		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5372	}
5373	errorBody := bytes.NewReader(errorBuffer.Bytes())
5374
5375	errorCode := "UnknownError"
5376	errorMessage := errorCode
5377
5378	code := response.Header.Get("X-Amzn-ErrorType")
5379	if len(code) != 0 {
5380		errorCode = restjson.SanitizeErrorCode(code)
5381	}
5382
5383	var buff [1024]byte
5384	ringBuffer := smithyio.NewRingBuffer(buff[:])
5385
5386	body := io.TeeReader(errorBody, ringBuffer)
5387	decoder := json.NewDecoder(body)
5388	decoder.UseNumber()
5389	code, message, err := restjson.GetErrorInfo(decoder)
5390	if err != nil {
5391		var snapshot bytes.Buffer
5392		io.Copy(&snapshot, ringBuffer)
5393		err = &smithy.DeserializationError{
5394			Err:      fmt.Errorf("failed to decode response body, %w", err),
5395			Snapshot: snapshot.Bytes(),
5396		}
5397		return err
5398	}
5399
5400	errorBody.Seek(0, io.SeekStart)
5401	if len(code) != 0 {
5402		errorCode = restjson.SanitizeErrorCode(code)
5403	}
5404	if len(message) != 0 {
5405		errorMessage = message
5406	}
5407
5408	switch {
5409	case strings.EqualFold("AccessDeniedException", errorCode):
5410		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
5411
5412	case strings.EqualFold("ConflictException", errorCode):
5413		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
5414
5415	case strings.EqualFold("InternalFailureException", errorCode):
5416		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5417
5418	case strings.EqualFold("InvalidParameterValueException", errorCode):
5419		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
5420
5421	case strings.EqualFold("ResourceNotFoundException", errorCode):
5422		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5423
5424	case strings.EqualFold("ThrottlingException", errorCode):
5425		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5426
5427	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
5428		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
5429
5430	default:
5431		genericError := &smithy.GenericAPIError{
5432			Code:    errorCode,
5433			Message: errorMessage,
5434		}
5435		return genericError
5436
5437	}
5438}
5439
5440func awsRestjson1_deserializeOpHttpBindingsDeleteThemeOutput(v *DeleteThemeOutput, response *smithyhttp.Response) error {
5441	if v == nil {
5442		return fmt.Errorf("unsupported deserialization for nil %T", v)
5443	}
5444
5445	v.Status = int32(response.StatusCode)
5446
5447	return nil
5448}
5449func awsRestjson1_deserializeOpDocumentDeleteThemeOutput(v **DeleteThemeOutput, value interface{}) error {
5450	if v == nil {
5451		return fmt.Errorf("unexpected nil of type %T", v)
5452	}
5453	if value == nil {
5454		return nil
5455	}
5456
5457	shape, ok := value.(map[string]interface{})
5458	if !ok {
5459		return fmt.Errorf("unexpected JSON type %v", value)
5460	}
5461
5462	var sv *DeleteThemeOutput
5463	if *v == nil {
5464		sv = &DeleteThemeOutput{}
5465	} else {
5466		sv = *v
5467	}
5468
5469	for key, value := range shape {
5470		switch key {
5471		case "Arn":
5472			if value != nil {
5473				jtv, ok := value.(string)
5474				if !ok {
5475					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
5476				}
5477				sv.Arn = ptr.String(jtv)
5478			}
5479
5480		case "RequestId":
5481			if value != nil {
5482				jtv, ok := value.(string)
5483				if !ok {
5484					return fmt.Errorf("expected String to be of type string, got %T instead", value)
5485				}
5486				sv.RequestId = ptr.String(jtv)
5487			}
5488
5489		case "ThemeId":
5490			if value != nil {
5491				jtv, ok := value.(string)
5492				if !ok {
5493					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
5494				}
5495				sv.ThemeId = ptr.String(jtv)
5496			}
5497
5498		default:
5499			_, _ = key, value
5500
5501		}
5502	}
5503	*v = sv
5504	return nil
5505}
5506
5507type awsRestjson1_deserializeOpDeleteThemeAlias struct {
5508}
5509
5510func (*awsRestjson1_deserializeOpDeleteThemeAlias) ID() string {
5511	return "OperationDeserializer"
5512}
5513
5514func (m *awsRestjson1_deserializeOpDeleteThemeAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5515	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5516) {
5517	out, metadata, err = next.HandleDeserialize(ctx, in)
5518	if err != nil {
5519		return out, metadata, err
5520	}
5521
5522	response, ok := out.RawResponse.(*smithyhttp.Response)
5523	if !ok {
5524		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5525	}
5526
5527	if response.StatusCode < 200 || response.StatusCode >= 300 {
5528		return out, metadata, awsRestjson1_deserializeOpErrorDeleteThemeAlias(response, &metadata)
5529	}
5530	output := &DeleteThemeAliasOutput{}
5531	out.Result = output
5532
5533	err = awsRestjson1_deserializeOpHttpBindingsDeleteThemeAliasOutput(output, response)
5534	if err != nil {
5535		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
5536	}
5537
5538	var buff [1024]byte
5539	ringBuffer := smithyio.NewRingBuffer(buff[:])
5540
5541	body := io.TeeReader(response.Body, ringBuffer)
5542
5543	decoder := json.NewDecoder(body)
5544	decoder.UseNumber()
5545	var shape interface{}
5546	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5547		var snapshot bytes.Buffer
5548		io.Copy(&snapshot, ringBuffer)
5549		err = &smithy.DeserializationError{
5550			Err:      fmt.Errorf("failed to decode response body, %w", err),
5551			Snapshot: snapshot.Bytes(),
5552		}
5553		return out, metadata, err
5554	}
5555
5556	err = awsRestjson1_deserializeOpDocumentDeleteThemeAliasOutput(&output, shape)
5557	if err != nil {
5558		var snapshot bytes.Buffer
5559		io.Copy(&snapshot, ringBuffer)
5560		return out, metadata, &smithy.DeserializationError{
5561			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5562			Snapshot: snapshot.Bytes(),
5563		}
5564	}
5565
5566	return out, metadata, err
5567}
5568
5569func awsRestjson1_deserializeOpErrorDeleteThemeAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5570	var errorBuffer bytes.Buffer
5571	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5572		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5573	}
5574	errorBody := bytes.NewReader(errorBuffer.Bytes())
5575
5576	errorCode := "UnknownError"
5577	errorMessage := errorCode
5578
5579	code := response.Header.Get("X-Amzn-ErrorType")
5580	if len(code) != 0 {
5581		errorCode = restjson.SanitizeErrorCode(code)
5582	}
5583
5584	var buff [1024]byte
5585	ringBuffer := smithyio.NewRingBuffer(buff[:])
5586
5587	body := io.TeeReader(errorBody, ringBuffer)
5588	decoder := json.NewDecoder(body)
5589	decoder.UseNumber()
5590	code, message, err := restjson.GetErrorInfo(decoder)
5591	if err != nil {
5592		var snapshot bytes.Buffer
5593		io.Copy(&snapshot, ringBuffer)
5594		err = &smithy.DeserializationError{
5595			Err:      fmt.Errorf("failed to decode response body, %w", err),
5596			Snapshot: snapshot.Bytes(),
5597		}
5598		return err
5599	}
5600
5601	errorBody.Seek(0, io.SeekStart)
5602	if len(code) != 0 {
5603		errorCode = restjson.SanitizeErrorCode(code)
5604	}
5605	if len(message) != 0 {
5606		errorMessage = message
5607	}
5608
5609	switch {
5610	case strings.EqualFold("ConflictException", errorCode):
5611		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
5612
5613	case strings.EqualFold("InternalFailureException", errorCode):
5614		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5615
5616	case strings.EqualFold("InvalidParameterValueException", errorCode):
5617		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
5618
5619	case strings.EqualFold("ResourceNotFoundException", errorCode):
5620		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5621
5622	case strings.EqualFold("ThrottlingException", errorCode):
5623		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5624
5625	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
5626		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
5627
5628	default:
5629		genericError := &smithy.GenericAPIError{
5630			Code:    errorCode,
5631			Message: errorMessage,
5632		}
5633		return genericError
5634
5635	}
5636}
5637
5638func awsRestjson1_deserializeOpHttpBindingsDeleteThemeAliasOutput(v *DeleteThemeAliasOutput, response *smithyhttp.Response) error {
5639	if v == nil {
5640		return fmt.Errorf("unsupported deserialization for nil %T", v)
5641	}
5642
5643	v.Status = int32(response.StatusCode)
5644
5645	return nil
5646}
5647func awsRestjson1_deserializeOpDocumentDeleteThemeAliasOutput(v **DeleteThemeAliasOutput, value interface{}) error {
5648	if v == nil {
5649		return fmt.Errorf("unexpected nil of type %T", v)
5650	}
5651	if value == nil {
5652		return nil
5653	}
5654
5655	shape, ok := value.(map[string]interface{})
5656	if !ok {
5657		return fmt.Errorf("unexpected JSON type %v", value)
5658	}
5659
5660	var sv *DeleteThemeAliasOutput
5661	if *v == nil {
5662		sv = &DeleteThemeAliasOutput{}
5663	} else {
5664		sv = *v
5665	}
5666
5667	for key, value := range shape {
5668		switch key {
5669		case "AliasName":
5670			if value != nil {
5671				jtv, ok := value.(string)
5672				if !ok {
5673					return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
5674				}
5675				sv.AliasName = ptr.String(jtv)
5676			}
5677
5678		case "Arn":
5679			if value != nil {
5680				jtv, ok := value.(string)
5681				if !ok {
5682					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
5683				}
5684				sv.Arn = ptr.String(jtv)
5685			}
5686
5687		case "RequestId":
5688			if value != nil {
5689				jtv, ok := value.(string)
5690				if !ok {
5691					return fmt.Errorf("expected String to be of type string, got %T instead", value)
5692				}
5693				sv.RequestId = ptr.String(jtv)
5694			}
5695
5696		case "ThemeId":
5697			if value != nil {
5698				jtv, ok := value.(string)
5699				if !ok {
5700					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
5701				}
5702				sv.ThemeId = ptr.String(jtv)
5703			}
5704
5705		default:
5706			_, _ = key, value
5707
5708		}
5709	}
5710	*v = sv
5711	return nil
5712}
5713
5714type awsRestjson1_deserializeOpDeleteUser struct {
5715}
5716
5717func (*awsRestjson1_deserializeOpDeleteUser) ID() string {
5718	return "OperationDeserializer"
5719}
5720
5721func (m *awsRestjson1_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5722	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5723) {
5724	out, metadata, err = next.HandleDeserialize(ctx, in)
5725	if err != nil {
5726		return out, metadata, err
5727	}
5728
5729	response, ok := out.RawResponse.(*smithyhttp.Response)
5730	if !ok {
5731		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5732	}
5733
5734	if response.StatusCode < 200 || response.StatusCode >= 300 {
5735		return out, metadata, awsRestjson1_deserializeOpErrorDeleteUser(response, &metadata)
5736	}
5737	output := &DeleteUserOutput{}
5738	out.Result = output
5739
5740	err = awsRestjson1_deserializeOpHttpBindingsDeleteUserOutput(output, response)
5741	if err != nil {
5742		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
5743	}
5744
5745	var buff [1024]byte
5746	ringBuffer := smithyio.NewRingBuffer(buff[:])
5747
5748	body := io.TeeReader(response.Body, ringBuffer)
5749
5750	decoder := json.NewDecoder(body)
5751	decoder.UseNumber()
5752	var shape interface{}
5753	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5754		var snapshot bytes.Buffer
5755		io.Copy(&snapshot, ringBuffer)
5756		err = &smithy.DeserializationError{
5757			Err:      fmt.Errorf("failed to decode response body, %w", err),
5758			Snapshot: snapshot.Bytes(),
5759		}
5760		return out, metadata, err
5761	}
5762
5763	err = awsRestjson1_deserializeOpDocumentDeleteUserOutput(&output, shape)
5764	if err != nil {
5765		var snapshot bytes.Buffer
5766		io.Copy(&snapshot, ringBuffer)
5767		return out, metadata, &smithy.DeserializationError{
5768			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5769			Snapshot: snapshot.Bytes(),
5770		}
5771	}
5772
5773	return out, metadata, err
5774}
5775
5776func awsRestjson1_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5777	var errorBuffer bytes.Buffer
5778	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5779		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5780	}
5781	errorBody := bytes.NewReader(errorBuffer.Bytes())
5782
5783	errorCode := "UnknownError"
5784	errorMessage := errorCode
5785
5786	code := response.Header.Get("X-Amzn-ErrorType")
5787	if len(code) != 0 {
5788		errorCode = restjson.SanitizeErrorCode(code)
5789	}
5790
5791	var buff [1024]byte
5792	ringBuffer := smithyio.NewRingBuffer(buff[:])
5793
5794	body := io.TeeReader(errorBody, ringBuffer)
5795	decoder := json.NewDecoder(body)
5796	decoder.UseNumber()
5797	code, message, err := restjson.GetErrorInfo(decoder)
5798	if err != nil {
5799		var snapshot bytes.Buffer
5800		io.Copy(&snapshot, ringBuffer)
5801		err = &smithy.DeserializationError{
5802			Err:      fmt.Errorf("failed to decode response body, %w", err),
5803			Snapshot: snapshot.Bytes(),
5804		}
5805		return err
5806	}
5807
5808	errorBody.Seek(0, io.SeekStart)
5809	if len(code) != 0 {
5810		errorCode = restjson.SanitizeErrorCode(code)
5811	}
5812	if len(message) != 0 {
5813		errorMessage = message
5814	}
5815
5816	switch {
5817	case strings.EqualFold("AccessDeniedException", errorCode):
5818		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
5819
5820	case strings.EqualFold("InternalFailureException", errorCode):
5821		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
5822
5823	case strings.EqualFold("InvalidParameterValueException", errorCode):
5824		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
5825
5826	case strings.EqualFold("PreconditionNotMetException", errorCode):
5827		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
5828
5829	case strings.EqualFold("ResourceNotFoundException", errorCode):
5830		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
5831
5832	case strings.EqualFold("ResourceUnavailableException", errorCode):
5833		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
5834
5835	case strings.EqualFold("ThrottlingException", errorCode):
5836		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
5837
5838	default:
5839		genericError := &smithy.GenericAPIError{
5840			Code:    errorCode,
5841			Message: errorMessage,
5842		}
5843		return genericError
5844
5845	}
5846}
5847
5848func awsRestjson1_deserializeOpHttpBindingsDeleteUserOutput(v *DeleteUserOutput, response *smithyhttp.Response) error {
5849	if v == nil {
5850		return fmt.Errorf("unsupported deserialization for nil %T", v)
5851	}
5852
5853	v.Status = int32(response.StatusCode)
5854
5855	return nil
5856}
5857func awsRestjson1_deserializeOpDocumentDeleteUserOutput(v **DeleteUserOutput, value interface{}) error {
5858	if v == nil {
5859		return fmt.Errorf("unexpected nil of type %T", v)
5860	}
5861	if value == nil {
5862		return nil
5863	}
5864
5865	shape, ok := value.(map[string]interface{})
5866	if !ok {
5867		return fmt.Errorf("unexpected JSON type %v", value)
5868	}
5869
5870	var sv *DeleteUserOutput
5871	if *v == nil {
5872		sv = &DeleteUserOutput{}
5873	} else {
5874		sv = *v
5875	}
5876
5877	for key, value := range shape {
5878		switch key {
5879		case "RequestId":
5880			if value != nil {
5881				jtv, ok := value.(string)
5882				if !ok {
5883					return fmt.Errorf("expected String to be of type string, got %T instead", value)
5884				}
5885				sv.RequestId = ptr.String(jtv)
5886			}
5887
5888		default:
5889			_, _ = key, value
5890
5891		}
5892	}
5893	*v = sv
5894	return nil
5895}
5896
5897type awsRestjson1_deserializeOpDeleteUserByPrincipalId struct {
5898}
5899
5900func (*awsRestjson1_deserializeOpDeleteUserByPrincipalId) ID() string {
5901	return "OperationDeserializer"
5902}
5903
5904func (m *awsRestjson1_deserializeOpDeleteUserByPrincipalId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
5905	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
5906) {
5907	out, metadata, err = next.HandleDeserialize(ctx, in)
5908	if err != nil {
5909		return out, metadata, err
5910	}
5911
5912	response, ok := out.RawResponse.(*smithyhttp.Response)
5913	if !ok {
5914		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
5915	}
5916
5917	if response.StatusCode < 200 || response.StatusCode >= 300 {
5918		return out, metadata, awsRestjson1_deserializeOpErrorDeleteUserByPrincipalId(response, &metadata)
5919	}
5920	output := &DeleteUserByPrincipalIdOutput{}
5921	out.Result = output
5922
5923	err = awsRestjson1_deserializeOpHttpBindingsDeleteUserByPrincipalIdOutput(output, response)
5924	if err != nil {
5925		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
5926	}
5927
5928	var buff [1024]byte
5929	ringBuffer := smithyio.NewRingBuffer(buff[:])
5930
5931	body := io.TeeReader(response.Body, ringBuffer)
5932
5933	decoder := json.NewDecoder(body)
5934	decoder.UseNumber()
5935	var shape interface{}
5936	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
5937		var snapshot bytes.Buffer
5938		io.Copy(&snapshot, ringBuffer)
5939		err = &smithy.DeserializationError{
5940			Err:      fmt.Errorf("failed to decode response body, %w", err),
5941			Snapshot: snapshot.Bytes(),
5942		}
5943		return out, metadata, err
5944	}
5945
5946	err = awsRestjson1_deserializeOpDocumentDeleteUserByPrincipalIdOutput(&output, shape)
5947	if err != nil {
5948		var snapshot bytes.Buffer
5949		io.Copy(&snapshot, ringBuffer)
5950		return out, metadata, &smithy.DeserializationError{
5951			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
5952			Snapshot: snapshot.Bytes(),
5953		}
5954	}
5955
5956	return out, metadata, err
5957}
5958
5959func awsRestjson1_deserializeOpErrorDeleteUserByPrincipalId(response *smithyhttp.Response, metadata *middleware.Metadata) error {
5960	var errorBuffer bytes.Buffer
5961	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
5962		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
5963	}
5964	errorBody := bytes.NewReader(errorBuffer.Bytes())
5965
5966	errorCode := "UnknownError"
5967	errorMessage := errorCode
5968
5969	code := response.Header.Get("X-Amzn-ErrorType")
5970	if len(code) != 0 {
5971		errorCode = restjson.SanitizeErrorCode(code)
5972	}
5973
5974	var buff [1024]byte
5975	ringBuffer := smithyio.NewRingBuffer(buff[:])
5976
5977	body := io.TeeReader(errorBody, ringBuffer)
5978	decoder := json.NewDecoder(body)
5979	decoder.UseNumber()
5980	code, message, err := restjson.GetErrorInfo(decoder)
5981	if err != nil {
5982		var snapshot bytes.Buffer
5983		io.Copy(&snapshot, ringBuffer)
5984		err = &smithy.DeserializationError{
5985			Err:      fmt.Errorf("failed to decode response body, %w", err),
5986			Snapshot: snapshot.Bytes(),
5987		}
5988		return err
5989	}
5990
5991	errorBody.Seek(0, io.SeekStart)
5992	if len(code) != 0 {
5993		errorCode = restjson.SanitizeErrorCode(code)
5994	}
5995	if len(message) != 0 {
5996		errorMessage = message
5997	}
5998
5999	switch {
6000	case strings.EqualFold("AccessDeniedException", errorCode):
6001		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
6002
6003	case strings.EqualFold("InternalFailureException", errorCode):
6004		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6005
6006	case strings.EqualFold("InvalidParameterValueException", errorCode):
6007		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6008
6009	case strings.EqualFold("PreconditionNotMetException", errorCode):
6010		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
6011
6012	case strings.EqualFold("ResourceNotFoundException", errorCode):
6013		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6014
6015	case strings.EqualFold("ResourceUnavailableException", errorCode):
6016		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
6017
6018	case strings.EqualFold("ThrottlingException", errorCode):
6019		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6020
6021	default:
6022		genericError := &smithy.GenericAPIError{
6023			Code:    errorCode,
6024			Message: errorMessage,
6025		}
6026		return genericError
6027
6028	}
6029}
6030
6031func awsRestjson1_deserializeOpHttpBindingsDeleteUserByPrincipalIdOutput(v *DeleteUserByPrincipalIdOutput, response *smithyhttp.Response) error {
6032	if v == nil {
6033		return fmt.Errorf("unsupported deserialization for nil %T", v)
6034	}
6035
6036	v.Status = int32(response.StatusCode)
6037
6038	return nil
6039}
6040func awsRestjson1_deserializeOpDocumentDeleteUserByPrincipalIdOutput(v **DeleteUserByPrincipalIdOutput, value interface{}) error {
6041	if v == nil {
6042		return fmt.Errorf("unexpected nil of type %T", v)
6043	}
6044	if value == nil {
6045		return nil
6046	}
6047
6048	shape, ok := value.(map[string]interface{})
6049	if !ok {
6050		return fmt.Errorf("unexpected JSON type %v", value)
6051	}
6052
6053	var sv *DeleteUserByPrincipalIdOutput
6054	if *v == nil {
6055		sv = &DeleteUserByPrincipalIdOutput{}
6056	} else {
6057		sv = *v
6058	}
6059
6060	for key, value := range shape {
6061		switch key {
6062		case "RequestId":
6063			if value != nil {
6064				jtv, ok := value.(string)
6065				if !ok {
6066					return fmt.Errorf("expected String to be of type string, got %T instead", value)
6067				}
6068				sv.RequestId = ptr.String(jtv)
6069			}
6070
6071		default:
6072			_, _ = key, value
6073
6074		}
6075	}
6076	*v = sv
6077	return nil
6078}
6079
6080type awsRestjson1_deserializeOpDescribeAccountCustomization struct {
6081}
6082
6083func (*awsRestjson1_deserializeOpDescribeAccountCustomization) ID() string {
6084	return "OperationDeserializer"
6085}
6086
6087func (m *awsRestjson1_deserializeOpDescribeAccountCustomization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6088	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6089) {
6090	out, metadata, err = next.HandleDeserialize(ctx, in)
6091	if err != nil {
6092		return out, metadata, err
6093	}
6094
6095	response, ok := out.RawResponse.(*smithyhttp.Response)
6096	if !ok {
6097		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6098	}
6099
6100	if response.StatusCode < 200 || response.StatusCode >= 300 {
6101		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccountCustomization(response, &metadata)
6102	}
6103	output := &DescribeAccountCustomizationOutput{}
6104	out.Result = output
6105
6106	err = awsRestjson1_deserializeOpHttpBindingsDescribeAccountCustomizationOutput(output, response)
6107	if err != nil {
6108		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
6109	}
6110
6111	var buff [1024]byte
6112	ringBuffer := smithyio.NewRingBuffer(buff[:])
6113
6114	body := io.TeeReader(response.Body, ringBuffer)
6115
6116	decoder := json.NewDecoder(body)
6117	decoder.UseNumber()
6118	var shape interface{}
6119	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
6120		var snapshot bytes.Buffer
6121		io.Copy(&snapshot, ringBuffer)
6122		err = &smithy.DeserializationError{
6123			Err:      fmt.Errorf("failed to decode response body, %w", err),
6124			Snapshot: snapshot.Bytes(),
6125		}
6126		return out, metadata, err
6127	}
6128
6129	err = awsRestjson1_deserializeOpDocumentDescribeAccountCustomizationOutput(&output, shape)
6130	if err != nil {
6131		var snapshot bytes.Buffer
6132		io.Copy(&snapshot, ringBuffer)
6133		return out, metadata, &smithy.DeserializationError{
6134			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6135			Snapshot: snapshot.Bytes(),
6136		}
6137	}
6138
6139	return out, metadata, err
6140}
6141
6142func awsRestjson1_deserializeOpErrorDescribeAccountCustomization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6143	var errorBuffer bytes.Buffer
6144	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6145		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6146	}
6147	errorBody := bytes.NewReader(errorBuffer.Bytes())
6148
6149	errorCode := "UnknownError"
6150	errorMessage := errorCode
6151
6152	code := response.Header.Get("X-Amzn-ErrorType")
6153	if len(code) != 0 {
6154		errorCode = restjson.SanitizeErrorCode(code)
6155	}
6156
6157	var buff [1024]byte
6158	ringBuffer := smithyio.NewRingBuffer(buff[:])
6159
6160	body := io.TeeReader(errorBody, ringBuffer)
6161	decoder := json.NewDecoder(body)
6162	decoder.UseNumber()
6163	code, message, err := restjson.GetErrorInfo(decoder)
6164	if err != nil {
6165		var snapshot bytes.Buffer
6166		io.Copy(&snapshot, ringBuffer)
6167		err = &smithy.DeserializationError{
6168			Err:      fmt.Errorf("failed to decode response body, %w", err),
6169			Snapshot: snapshot.Bytes(),
6170		}
6171		return err
6172	}
6173
6174	errorBody.Seek(0, io.SeekStart)
6175	if len(code) != 0 {
6176		errorCode = restjson.SanitizeErrorCode(code)
6177	}
6178	if len(message) != 0 {
6179		errorMessage = message
6180	}
6181
6182	switch {
6183	case strings.EqualFold("AccessDeniedException", errorCode):
6184		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
6185
6186	case strings.EqualFold("InternalFailureException", errorCode):
6187		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6188
6189	case strings.EqualFold("InvalidParameterValueException", errorCode):
6190		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6191
6192	case strings.EqualFold("ResourceNotFoundException", errorCode):
6193		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6194
6195	case strings.EqualFold("ResourceUnavailableException", errorCode):
6196		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
6197
6198	case strings.EqualFold("ThrottlingException", errorCode):
6199		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6200
6201	default:
6202		genericError := &smithy.GenericAPIError{
6203			Code:    errorCode,
6204			Message: errorMessage,
6205		}
6206		return genericError
6207
6208	}
6209}
6210
6211func awsRestjson1_deserializeOpHttpBindingsDescribeAccountCustomizationOutput(v *DescribeAccountCustomizationOutput, response *smithyhttp.Response) error {
6212	if v == nil {
6213		return fmt.Errorf("unsupported deserialization for nil %T", v)
6214	}
6215
6216	v.Status = int32(response.StatusCode)
6217
6218	return nil
6219}
6220func awsRestjson1_deserializeOpDocumentDescribeAccountCustomizationOutput(v **DescribeAccountCustomizationOutput, value interface{}) error {
6221	if v == nil {
6222		return fmt.Errorf("unexpected nil of type %T", v)
6223	}
6224	if value == nil {
6225		return nil
6226	}
6227
6228	shape, ok := value.(map[string]interface{})
6229	if !ok {
6230		return fmt.Errorf("unexpected JSON type %v", value)
6231	}
6232
6233	var sv *DescribeAccountCustomizationOutput
6234	if *v == nil {
6235		sv = &DescribeAccountCustomizationOutput{}
6236	} else {
6237		sv = *v
6238	}
6239
6240	for key, value := range shape {
6241		switch key {
6242		case "AccountCustomization":
6243			if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil {
6244				return err
6245			}
6246
6247		case "Arn":
6248			if value != nil {
6249				jtv, ok := value.(string)
6250				if !ok {
6251					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
6252				}
6253				sv.Arn = ptr.String(jtv)
6254			}
6255
6256		case "AwsAccountId":
6257			if value != nil {
6258				jtv, ok := value.(string)
6259				if !ok {
6260					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
6261				}
6262				sv.AwsAccountId = ptr.String(jtv)
6263			}
6264
6265		case "Namespace":
6266			if value != nil {
6267				jtv, ok := value.(string)
6268				if !ok {
6269					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
6270				}
6271				sv.Namespace = ptr.String(jtv)
6272			}
6273
6274		case "RequestId":
6275			if value != nil {
6276				jtv, ok := value.(string)
6277				if !ok {
6278					return fmt.Errorf("expected String to be of type string, got %T instead", value)
6279				}
6280				sv.RequestId = ptr.String(jtv)
6281			}
6282
6283		default:
6284			_, _ = key, value
6285
6286		}
6287	}
6288	*v = sv
6289	return nil
6290}
6291
6292type awsRestjson1_deserializeOpDescribeAccountSettings struct {
6293}
6294
6295func (*awsRestjson1_deserializeOpDescribeAccountSettings) ID() string {
6296	return "OperationDeserializer"
6297}
6298
6299func (m *awsRestjson1_deserializeOpDescribeAccountSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6300	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6301) {
6302	out, metadata, err = next.HandleDeserialize(ctx, in)
6303	if err != nil {
6304		return out, metadata, err
6305	}
6306
6307	response, ok := out.RawResponse.(*smithyhttp.Response)
6308	if !ok {
6309		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6310	}
6311
6312	if response.StatusCode < 200 || response.StatusCode >= 300 {
6313		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccountSettings(response, &metadata)
6314	}
6315	output := &DescribeAccountSettingsOutput{}
6316	out.Result = output
6317
6318	err = awsRestjson1_deserializeOpHttpBindingsDescribeAccountSettingsOutput(output, response)
6319	if err != nil {
6320		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
6321	}
6322
6323	var buff [1024]byte
6324	ringBuffer := smithyio.NewRingBuffer(buff[:])
6325
6326	body := io.TeeReader(response.Body, ringBuffer)
6327
6328	decoder := json.NewDecoder(body)
6329	decoder.UseNumber()
6330	var shape interface{}
6331	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
6332		var snapshot bytes.Buffer
6333		io.Copy(&snapshot, ringBuffer)
6334		err = &smithy.DeserializationError{
6335			Err:      fmt.Errorf("failed to decode response body, %w", err),
6336			Snapshot: snapshot.Bytes(),
6337		}
6338		return out, metadata, err
6339	}
6340
6341	err = awsRestjson1_deserializeOpDocumentDescribeAccountSettingsOutput(&output, shape)
6342	if err != nil {
6343		var snapshot bytes.Buffer
6344		io.Copy(&snapshot, ringBuffer)
6345		return out, metadata, &smithy.DeserializationError{
6346			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6347			Snapshot: snapshot.Bytes(),
6348		}
6349	}
6350
6351	return out, metadata, err
6352}
6353
6354func awsRestjson1_deserializeOpErrorDescribeAccountSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6355	var errorBuffer bytes.Buffer
6356	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6357		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6358	}
6359	errorBody := bytes.NewReader(errorBuffer.Bytes())
6360
6361	errorCode := "UnknownError"
6362	errorMessage := errorCode
6363
6364	code := response.Header.Get("X-Amzn-ErrorType")
6365	if len(code) != 0 {
6366		errorCode = restjson.SanitizeErrorCode(code)
6367	}
6368
6369	var buff [1024]byte
6370	ringBuffer := smithyio.NewRingBuffer(buff[:])
6371
6372	body := io.TeeReader(errorBody, ringBuffer)
6373	decoder := json.NewDecoder(body)
6374	decoder.UseNumber()
6375	code, message, err := restjson.GetErrorInfo(decoder)
6376	if err != nil {
6377		var snapshot bytes.Buffer
6378		io.Copy(&snapshot, ringBuffer)
6379		err = &smithy.DeserializationError{
6380			Err:      fmt.Errorf("failed to decode response body, %w", err),
6381			Snapshot: snapshot.Bytes(),
6382		}
6383		return err
6384	}
6385
6386	errorBody.Seek(0, io.SeekStart)
6387	if len(code) != 0 {
6388		errorCode = restjson.SanitizeErrorCode(code)
6389	}
6390	if len(message) != 0 {
6391		errorMessage = message
6392	}
6393
6394	switch {
6395	case strings.EqualFold("AccessDeniedException", errorCode):
6396		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
6397
6398	case strings.EqualFold("InternalFailureException", errorCode):
6399		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6400
6401	case strings.EqualFold("InvalidParameterValueException", errorCode):
6402		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6403
6404	case strings.EqualFold("ResourceNotFoundException", errorCode):
6405		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6406
6407	case strings.EqualFold("ResourceUnavailableException", errorCode):
6408		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
6409
6410	case strings.EqualFold("ThrottlingException", errorCode):
6411		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6412
6413	default:
6414		genericError := &smithy.GenericAPIError{
6415			Code:    errorCode,
6416			Message: errorMessage,
6417		}
6418		return genericError
6419
6420	}
6421}
6422
6423func awsRestjson1_deserializeOpHttpBindingsDescribeAccountSettingsOutput(v *DescribeAccountSettingsOutput, response *smithyhttp.Response) error {
6424	if v == nil {
6425		return fmt.Errorf("unsupported deserialization for nil %T", v)
6426	}
6427
6428	v.Status = int32(response.StatusCode)
6429
6430	return nil
6431}
6432func awsRestjson1_deserializeOpDocumentDescribeAccountSettingsOutput(v **DescribeAccountSettingsOutput, value interface{}) error {
6433	if v == nil {
6434		return fmt.Errorf("unexpected nil of type %T", v)
6435	}
6436	if value == nil {
6437		return nil
6438	}
6439
6440	shape, ok := value.(map[string]interface{})
6441	if !ok {
6442		return fmt.Errorf("unexpected JSON type %v", value)
6443	}
6444
6445	var sv *DescribeAccountSettingsOutput
6446	if *v == nil {
6447		sv = &DescribeAccountSettingsOutput{}
6448	} else {
6449		sv = *v
6450	}
6451
6452	for key, value := range shape {
6453		switch key {
6454		case "AccountSettings":
6455			if err := awsRestjson1_deserializeDocumentAccountSettings(&sv.AccountSettings, value); err != nil {
6456				return err
6457			}
6458
6459		case "RequestId":
6460			if value != nil {
6461				jtv, ok := value.(string)
6462				if !ok {
6463					return fmt.Errorf("expected String to be of type string, got %T instead", value)
6464				}
6465				sv.RequestId = ptr.String(jtv)
6466			}
6467
6468		default:
6469			_, _ = key, value
6470
6471		}
6472	}
6473	*v = sv
6474	return nil
6475}
6476
6477type awsRestjson1_deserializeOpDescribeAnalysis struct {
6478}
6479
6480func (*awsRestjson1_deserializeOpDescribeAnalysis) ID() string {
6481	return "OperationDeserializer"
6482}
6483
6484func (m *awsRestjson1_deserializeOpDescribeAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6485	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6486) {
6487	out, metadata, err = next.HandleDeserialize(ctx, in)
6488	if err != nil {
6489		return out, metadata, err
6490	}
6491
6492	response, ok := out.RawResponse.(*smithyhttp.Response)
6493	if !ok {
6494		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6495	}
6496
6497	if response.StatusCode < 200 || response.StatusCode >= 300 {
6498		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAnalysis(response, &metadata)
6499	}
6500	output := &DescribeAnalysisOutput{}
6501	out.Result = output
6502
6503	err = awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisOutput(output, response)
6504	if err != nil {
6505		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
6506	}
6507
6508	var buff [1024]byte
6509	ringBuffer := smithyio.NewRingBuffer(buff[:])
6510
6511	body := io.TeeReader(response.Body, ringBuffer)
6512
6513	decoder := json.NewDecoder(body)
6514	decoder.UseNumber()
6515	var shape interface{}
6516	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
6517		var snapshot bytes.Buffer
6518		io.Copy(&snapshot, ringBuffer)
6519		err = &smithy.DeserializationError{
6520			Err:      fmt.Errorf("failed to decode response body, %w", err),
6521			Snapshot: snapshot.Bytes(),
6522		}
6523		return out, metadata, err
6524	}
6525
6526	err = awsRestjson1_deserializeOpDocumentDescribeAnalysisOutput(&output, shape)
6527	if err != nil {
6528		var snapshot bytes.Buffer
6529		io.Copy(&snapshot, ringBuffer)
6530		return out, metadata, &smithy.DeserializationError{
6531			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6532			Snapshot: snapshot.Bytes(),
6533		}
6534	}
6535
6536	return out, metadata, err
6537}
6538
6539func awsRestjson1_deserializeOpErrorDescribeAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6540	var errorBuffer bytes.Buffer
6541	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6542		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6543	}
6544	errorBody := bytes.NewReader(errorBuffer.Bytes())
6545
6546	errorCode := "UnknownError"
6547	errorMessage := errorCode
6548
6549	code := response.Header.Get("X-Amzn-ErrorType")
6550	if len(code) != 0 {
6551		errorCode = restjson.SanitizeErrorCode(code)
6552	}
6553
6554	var buff [1024]byte
6555	ringBuffer := smithyio.NewRingBuffer(buff[:])
6556
6557	body := io.TeeReader(errorBody, ringBuffer)
6558	decoder := json.NewDecoder(body)
6559	decoder.UseNumber()
6560	code, message, err := restjson.GetErrorInfo(decoder)
6561	if err != nil {
6562		var snapshot bytes.Buffer
6563		io.Copy(&snapshot, ringBuffer)
6564		err = &smithy.DeserializationError{
6565			Err:      fmt.Errorf("failed to decode response body, %w", err),
6566			Snapshot: snapshot.Bytes(),
6567		}
6568		return err
6569	}
6570
6571	errorBody.Seek(0, io.SeekStart)
6572	if len(code) != 0 {
6573		errorCode = restjson.SanitizeErrorCode(code)
6574	}
6575	if len(message) != 0 {
6576		errorMessage = message
6577	}
6578
6579	switch {
6580	case strings.EqualFold("AccessDeniedException", errorCode):
6581		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
6582
6583	case strings.EqualFold("InternalFailureException", errorCode):
6584		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6585
6586	case strings.EqualFold("InvalidParameterValueException", errorCode):
6587		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6588
6589	case strings.EqualFold("ResourceNotFoundException", errorCode):
6590		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6591
6592	case strings.EqualFold("ThrottlingException", errorCode):
6593		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6594
6595	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
6596		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
6597
6598	default:
6599		genericError := &smithy.GenericAPIError{
6600			Code:    errorCode,
6601			Message: errorMessage,
6602		}
6603		return genericError
6604
6605	}
6606}
6607
6608func awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisOutput(v *DescribeAnalysisOutput, response *smithyhttp.Response) error {
6609	if v == nil {
6610		return fmt.Errorf("unsupported deserialization for nil %T", v)
6611	}
6612
6613	v.Status = int32(response.StatusCode)
6614
6615	return nil
6616}
6617func awsRestjson1_deserializeOpDocumentDescribeAnalysisOutput(v **DescribeAnalysisOutput, value interface{}) error {
6618	if v == nil {
6619		return fmt.Errorf("unexpected nil of type %T", v)
6620	}
6621	if value == nil {
6622		return nil
6623	}
6624
6625	shape, ok := value.(map[string]interface{})
6626	if !ok {
6627		return fmt.Errorf("unexpected JSON type %v", value)
6628	}
6629
6630	var sv *DescribeAnalysisOutput
6631	if *v == nil {
6632		sv = &DescribeAnalysisOutput{}
6633	} else {
6634		sv = *v
6635	}
6636
6637	for key, value := range shape {
6638		switch key {
6639		case "Analysis":
6640			if err := awsRestjson1_deserializeDocumentAnalysis(&sv.Analysis, value); err != nil {
6641				return err
6642			}
6643
6644		case "RequestId":
6645			if value != nil {
6646				jtv, ok := value.(string)
6647				if !ok {
6648					return fmt.Errorf("expected String to be of type string, got %T instead", value)
6649				}
6650				sv.RequestId = ptr.String(jtv)
6651			}
6652
6653		default:
6654			_, _ = key, value
6655
6656		}
6657	}
6658	*v = sv
6659	return nil
6660}
6661
6662type awsRestjson1_deserializeOpDescribeAnalysisPermissions struct {
6663}
6664
6665func (*awsRestjson1_deserializeOpDescribeAnalysisPermissions) ID() string {
6666	return "OperationDeserializer"
6667}
6668
6669func (m *awsRestjson1_deserializeOpDescribeAnalysisPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6670	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6671) {
6672	out, metadata, err = next.HandleDeserialize(ctx, in)
6673	if err != nil {
6674		return out, metadata, err
6675	}
6676
6677	response, ok := out.RawResponse.(*smithyhttp.Response)
6678	if !ok {
6679		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6680	}
6681
6682	if response.StatusCode < 200 || response.StatusCode >= 300 {
6683		return out, metadata, awsRestjson1_deserializeOpErrorDescribeAnalysisPermissions(response, &metadata)
6684	}
6685	output := &DescribeAnalysisPermissionsOutput{}
6686	out.Result = output
6687
6688	err = awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisPermissionsOutput(output, response)
6689	if err != nil {
6690		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
6691	}
6692
6693	var buff [1024]byte
6694	ringBuffer := smithyio.NewRingBuffer(buff[:])
6695
6696	body := io.TeeReader(response.Body, ringBuffer)
6697
6698	decoder := json.NewDecoder(body)
6699	decoder.UseNumber()
6700	var shape interface{}
6701	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
6702		var snapshot bytes.Buffer
6703		io.Copy(&snapshot, ringBuffer)
6704		err = &smithy.DeserializationError{
6705			Err:      fmt.Errorf("failed to decode response body, %w", err),
6706			Snapshot: snapshot.Bytes(),
6707		}
6708		return out, metadata, err
6709	}
6710
6711	err = awsRestjson1_deserializeOpDocumentDescribeAnalysisPermissionsOutput(&output, shape)
6712	if err != nil {
6713		var snapshot bytes.Buffer
6714		io.Copy(&snapshot, ringBuffer)
6715		return out, metadata, &smithy.DeserializationError{
6716			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6717			Snapshot: snapshot.Bytes(),
6718		}
6719	}
6720
6721	return out, metadata, err
6722}
6723
6724func awsRestjson1_deserializeOpErrorDescribeAnalysisPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6725	var errorBuffer bytes.Buffer
6726	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6727		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6728	}
6729	errorBody := bytes.NewReader(errorBuffer.Bytes())
6730
6731	errorCode := "UnknownError"
6732	errorMessage := errorCode
6733
6734	code := response.Header.Get("X-Amzn-ErrorType")
6735	if len(code) != 0 {
6736		errorCode = restjson.SanitizeErrorCode(code)
6737	}
6738
6739	var buff [1024]byte
6740	ringBuffer := smithyio.NewRingBuffer(buff[:])
6741
6742	body := io.TeeReader(errorBody, ringBuffer)
6743	decoder := json.NewDecoder(body)
6744	decoder.UseNumber()
6745	code, message, err := restjson.GetErrorInfo(decoder)
6746	if err != nil {
6747		var snapshot bytes.Buffer
6748		io.Copy(&snapshot, ringBuffer)
6749		err = &smithy.DeserializationError{
6750			Err:      fmt.Errorf("failed to decode response body, %w", err),
6751			Snapshot: snapshot.Bytes(),
6752		}
6753		return err
6754	}
6755
6756	errorBody.Seek(0, io.SeekStart)
6757	if len(code) != 0 {
6758		errorCode = restjson.SanitizeErrorCode(code)
6759	}
6760	if len(message) != 0 {
6761		errorMessage = message
6762	}
6763
6764	switch {
6765	case strings.EqualFold("InternalFailureException", errorCode):
6766		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6767
6768	case strings.EqualFold("InvalidParameterValueException", errorCode):
6769		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6770
6771	case strings.EqualFold("ResourceNotFoundException", errorCode):
6772		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6773
6774	case strings.EqualFold("ThrottlingException", errorCode):
6775		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6776
6777	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
6778		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
6779
6780	default:
6781		genericError := &smithy.GenericAPIError{
6782			Code:    errorCode,
6783			Message: errorMessage,
6784		}
6785		return genericError
6786
6787	}
6788}
6789
6790func awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisPermissionsOutput(v *DescribeAnalysisPermissionsOutput, response *smithyhttp.Response) error {
6791	if v == nil {
6792		return fmt.Errorf("unsupported deserialization for nil %T", v)
6793	}
6794
6795	v.Status = int32(response.StatusCode)
6796
6797	return nil
6798}
6799func awsRestjson1_deserializeOpDocumentDescribeAnalysisPermissionsOutput(v **DescribeAnalysisPermissionsOutput, value interface{}) error {
6800	if v == nil {
6801		return fmt.Errorf("unexpected nil of type %T", v)
6802	}
6803	if value == nil {
6804		return nil
6805	}
6806
6807	shape, ok := value.(map[string]interface{})
6808	if !ok {
6809		return fmt.Errorf("unexpected JSON type %v", value)
6810	}
6811
6812	var sv *DescribeAnalysisPermissionsOutput
6813	if *v == nil {
6814		sv = &DescribeAnalysisPermissionsOutput{}
6815	} else {
6816		sv = *v
6817	}
6818
6819	for key, value := range shape {
6820		switch key {
6821		case "AnalysisArn":
6822			if value != nil {
6823				jtv, ok := value.(string)
6824				if !ok {
6825					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
6826				}
6827				sv.AnalysisArn = ptr.String(jtv)
6828			}
6829
6830		case "AnalysisId":
6831			if value != nil {
6832				jtv, ok := value.(string)
6833				if !ok {
6834					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
6835				}
6836				sv.AnalysisId = ptr.String(jtv)
6837			}
6838
6839		case "Permissions":
6840			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
6841				return err
6842			}
6843
6844		case "RequestId":
6845			if value != nil {
6846				jtv, ok := value.(string)
6847				if !ok {
6848					return fmt.Errorf("expected String to be of type string, got %T instead", value)
6849				}
6850				sv.RequestId = ptr.String(jtv)
6851			}
6852
6853		default:
6854			_, _ = key, value
6855
6856		}
6857	}
6858	*v = sv
6859	return nil
6860}
6861
6862type awsRestjson1_deserializeOpDescribeDashboard struct {
6863}
6864
6865func (*awsRestjson1_deserializeOpDescribeDashboard) ID() string {
6866	return "OperationDeserializer"
6867}
6868
6869func (m *awsRestjson1_deserializeOpDescribeDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
6870	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
6871) {
6872	out, metadata, err = next.HandleDeserialize(ctx, in)
6873	if err != nil {
6874		return out, metadata, err
6875	}
6876
6877	response, ok := out.RawResponse.(*smithyhttp.Response)
6878	if !ok {
6879		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
6880	}
6881
6882	if response.StatusCode < 200 || response.StatusCode >= 300 {
6883		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDashboard(response, &metadata)
6884	}
6885	output := &DescribeDashboardOutput{}
6886	out.Result = output
6887
6888	err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardOutput(output, response)
6889	if err != nil {
6890		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
6891	}
6892
6893	var buff [1024]byte
6894	ringBuffer := smithyio.NewRingBuffer(buff[:])
6895
6896	body := io.TeeReader(response.Body, ringBuffer)
6897
6898	decoder := json.NewDecoder(body)
6899	decoder.UseNumber()
6900	var shape interface{}
6901	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
6902		var snapshot bytes.Buffer
6903		io.Copy(&snapshot, ringBuffer)
6904		err = &smithy.DeserializationError{
6905			Err:      fmt.Errorf("failed to decode response body, %w", err),
6906			Snapshot: snapshot.Bytes(),
6907		}
6908		return out, metadata, err
6909	}
6910
6911	err = awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(&output, shape)
6912	if err != nil {
6913		var snapshot bytes.Buffer
6914		io.Copy(&snapshot, ringBuffer)
6915		return out, metadata, &smithy.DeserializationError{
6916			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
6917			Snapshot: snapshot.Bytes(),
6918		}
6919	}
6920
6921	return out, metadata, err
6922}
6923
6924func awsRestjson1_deserializeOpErrorDescribeDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error {
6925	var errorBuffer bytes.Buffer
6926	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
6927		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
6928	}
6929	errorBody := bytes.NewReader(errorBuffer.Bytes())
6930
6931	errorCode := "UnknownError"
6932	errorMessage := errorCode
6933
6934	code := response.Header.Get("X-Amzn-ErrorType")
6935	if len(code) != 0 {
6936		errorCode = restjson.SanitizeErrorCode(code)
6937	}
6938
6939	var buff [1024]byte
6940	ringBuffer := smithyio.NewRingBuffer(buff[:])
6941
6942	body := io.TeeReader(errorBody, ringBuffer)
6943	decoder := json.NewDecoder(body)
6944	decoder.UseNumber()
6945	code, message, err := restjson.GetErrorInfo(decoder)
6946	if err != nil {
6947		var snapshot bytes.Buffer
6948		io.Copy(&snapshot, ringBuffer)
6949		err = &smithy.DeserializationError{
6950			Err:      fmt.Errorf("failed to decode response body, %w", err),
6951			Snapshot: snapshot.Bytes(),
6952		}
6953		return err
6954	}
6955
6956	errorBody.Seek(0, io.SeekStart)
6957	if len(code) != 0 {
6958		errorCode = restjson.SanitizeErrorCode(code)
6959	}
6960	if len(message) != 0 {
6961		errorMessage = message
6962	}
6963
6964	switch {
6965	case strings.EqualFold("AccessDeniedException", errorCode):
6966		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
6967
6968	case strings.EqualFold("InternalFailureException", errorCode):
6969		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
6970
6971	case strings.EqualFold("InvalidParameterValueException", errorCode):
6972		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
6973
6974	case strings.EqualFold("ResourceNotFoundException", errorCode):
6975		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
6976
6977	case strings.EqualFold("ThrottlingException", errorCode):
6978		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
6979
6980	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
6981		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
6982
6983	default:
6984		genericError := &smithy.GenericAPIError{
6985			Code:    errorCode,
6986			Message: errorMessage,
6987		}
6988		return genericError
6989
6990	}
6991}
6992
6993func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardOutput(v *DescribeDashboardOutput, response *smithyhttp.Response) error {
6994	if v == nil {
6995		return fmt.Errorf("unsupported deserialization for nil %T", v)
6996	}
6997
6998	v.Status = int32(response.StatusCode)
6999
7000	return nil
7001}
7002func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashboardOutput, value interface{}) error {
7003	if v == nil {
7004		return fmt.Errorf("unexpected nil of type %T", v)
7005	}
7006	if value == nil {
7007		return nil
7008	}
7009
7010	shape, ok := value.(map[string]interface{})
7011	if !ok {
7012		return fmt.Errorf("unexpected JSON type %v", value)
7013	}
7014
7015	var sv *DescribeDashboardOutput
7016	if *v == nil {
7017		sv = &DescribeDashboardOutput{}
7018	} else {
7019		sv = *v
7020	}
7021
7022	for key, value := range shape {
7023		switch key {
7024		case "Dashboard":
7025			if err := awsRestjson1_deserializeDocumentDashboard(&sv.Dashboard, value); err != nil {
7026				return err
7027			}
7028
7029		case "RequestId":
7030			if value != nil {
7031				jtv, ok := value.(string)
7032				if !ok {
7033					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7034				}
7035				sv.RequestId = ptr.String(jtv)
7036			}
7037
7038		default:
7039			_, _ = key, value
7040
7041		}
7042	}
7043	*v = sv
7044	return nil
7045}
7046
7047type awsRestjson1_deserializeOpDescribeDashboardPermissions struct {
7048}
7049
7050func (*awsRestjson1_deserializeOpDescribeDashboardPermissions) ID() string {
7051	return "OperationDeserializer"
7052}
7053
7054func (m *awsRestjson1_deserializeOpDescribeDashboardPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7055	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7056) {
7057	out, metadata, err = next.HandleDeserialize(ctx, in)
7058	if err != nil {
7059		return out, metadata, err
7060	}
7061
7062	response, ok := out.RawResponse.(*smithyhttp.Response)
7063	if !ok {
7064		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7065	}
7066
7067	if response.StatusCode < 200 || response.StatusCode >= 300 {
7068		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDashboardPermissions(response, &metadata)
7069	}
7070	output := &DescribeDashboardPermissionsOutput{}
7071	out.Result = output
7072
7073	err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardPermissionsOutput(output, response)
7074	if err != nil {
7075		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
7076	}
7077
7078	var buff [1024]byte
7079	ringBuffer := smithyio.NewRingBuffer(buff[:])
7080
7081	body := io.TeeReader(response.Body, ringBuffer)
7082
7083	decoder := json.NewDecoder(body)
7084	decoder.UseNumber()
7085	var shape interface{}
7086	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
7087		var snapshot bytes.Buffer
7088		io.Copy(&snapshot, ringBuffer)
7089		err = &smithy.DeserializationError{
7090			Err:      fmt.Errorf("failed to decode response body, %w", err),
7091			Snapshot: snapshot.Bytes(),
7092		}
7093		return out, metadata, err
7094	}
7095
7096	err = awsRestjson1_deserializeOpDocumentDescribeDashboardPermissionsOutput(&output, shape)
7097	if err != nil {
7098		var snapshot bytes.Buffer
7099		io.Copy(&snapshot, ringBuffer)
7100		return out, metadata, &smithy.DeserializationError{
7101			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
7102			Snapshot: snapshot.Bytes(),
7103		}
7104	}
7105
7106	return out, metadata, err
7107}
7108
7109func awsRestjson1_deserializeOpErrorDescribeDashboardPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7110	var errorBuffer bytes.Buffer
7111	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7112		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7113	}
7114	errorBody := bytes.NewReader(errorBuffer.Bytes())
7115
7116	errorCode := "UnknownError"
7117	errorMessage := errorCode
7118
7119	code := response.Header.Get("X-Amzn-ErrorType")
7120	if len(code) != 0 {
7121		errorCode = restjson.SanitizeErrorCode(code)
7122	}
7123
7124	var buff [1024]byte
7125	ringBuffer := smithyio.NewRingBuffer(buff[:])
7126
7127	body := io.TeeReader(errorBody, ringBuffer)
7128	decoder := json.NewDecoder(body)
7129	decoder.UseNumber()
7130	code, message, err := restjson.GetErrorInfo(decoder)
7131	if err != nil {
7132		var snapshot bytes.Buffer
7133		io.Copy(&snapshot, ringBuffer)
7134		err = &smithy.DeserializationError{
7135			Err:      fmt.Errorf("failed to decode response body, %w", err),
7136			Snapshot: snapshot.Bytes(),
7137		}
7138		return err
7139	}
7140
7141	errorBody.Seek(0, io.SeekStart)
7142	if len(code) != 0 {
7143		errorCode = restjson.SanitizeErrorCode(code)
7144	}
7145	if len(message) != 0 {
7146		errorMessage = message
7147	}
7148
7149	switch {
7150	case strings.EqualFold("InternalFailureException", errorCode):
7151		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7152
7153	case strings.EqualFold("InvalidParameterValueException", errorCode):
7154		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
7155
7156	case strings.EqualFold("ResourceNotFoundException", errorCode):
7157		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7158
7159	case strings.EqualFold("ThrottlingException", errorCode):
7160		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7161
7162	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
7163		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
7164
7165	default:
7166		genericError := &smithy.GenericAPIError{
7167			Code:    errorCode,
7168			Message: errorMessage,
7169		}
7170		return genericError
7171
7172	}
7173}
7174
7175func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardPermissionsOutput(v *DescribeDashboardPermissionsOutput, response *smithyhttp.Response) error {
7176	if v == nil {
7177		return fmt.Errorf("unsupported deserialization for nil %T", v)
7178	}
7179
7180	v.Status = int32(response.StatusCode)
7181
7182	return nil
7183}
7184func awsRestjson1_deserializeOpDocumentDescribeDashboardPermissionsOutput(v **DescribeDashboardPermissionsOutput, value interface{}) error {
7185	if v == nil {
7186		return fmt.Errorf("unexpected nil of type %T", v)
7187	}
7188	if value == nil {
7189		return nil
7190	}
7191
7192	shape, ok := value.(map[string]interface{})
7193	if !ok {
7194		return fmt.Errorf("unexpected JSON type %v", value)
7195	}
7196
7197	var sv *DescribeDashboardPermissionsOutput
7198	if *v == nil {
7199		sv = &DescribeDashboardPermissionsOutput{}
7200	} else {
7201		sv = *v
7202	}
7203
7204	for key, value := range shape {
7205		switch key {
7206		case "DashboardArn":
7207			if value != nil {
7208				jtv, ok := value.(string)
7209				if !ok {
7210					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
7211				}
7212				sv.DashboardArn = ptr.String(jtv)
7213			}
7214
7215		case "DashboardId":
7216			if value != nil {
7217				jtv, ok := value.(string)
7218				if !ok {
7219					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
7220				}
7221				sv.DashboardId = ptr.String(jtv)
7222			}
7223
7224		case "Permissions":
7225			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
7226				return err
7227			}
7228
7229		case "RequestId":
7230			if value != nil {
7231				jtv, ok := value.(string)
7232				if !ok {
7233					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7234				}
7235				sv.RequestId = ptr.String(jtv)
7236			}
7237
7238		default:
7239			_, _ = key, value
7240
7241		}
7242	}
7243	*v = sv
7244	return nil
7245}
7246
7247type awsRestjson1_deserializeOpDescribeDataSet struct {
7248}
7249
7250func (*awsRestjson1_deserializeOpDescribeDataSet) ID() string {
7251	return "OperationDeserializer"
7252}
7253
7254func (m *awsRestjson1_deserializeOpDescribeDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7255	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7256) {
7257	out, metadata, err = next.HandleDeserialize(ctx, in)
7258	if err != nil {
7259		return out, metadata, err
7260	}
7261
7262	response, ok := out.RawResponse.(*smithyhttp.Response)
7263	if !ok {
7264		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7265	}
7266
7267	if response.StatusCode < 200 || response.StatusCode >= 300 {
7268		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDataSet(response, &metadata)
7269	}
7270	output := &DescribeDataSetOutput{}
7271	out.Result = output
7272
7273	err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSetOutput(output, response)
7274	if err != nil {
7275		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
7276	}
7277
7278	var buff [1024]byte
7279	ringBuffer := smithyio.NewRingBuffer(buff[:])
7280
7281	body := io.TeeReader(response.Body, ringBuffer)
7282
7283	decoder := json.NewDecoder(body)
7284	decoder.UseNumber()
7285	var shape interface{}
7286	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
7287		var snapshot bytes.Buffer
7288		io.Copy(&snapshot, ringBuffer)
7289		err = &smithy.DeserializationError{
7290			Err:      fmt.Errorf("failed to decode response body, %w", err),
7291			Snapshot: snapshot.Bytes(),
7292		}
7293		return out, metadata, err
7294	}
7295
7296	err = awsRestjson1_deserializeOpDocumentDescribeDataSetOutput(&output, shape)
7297	if err != nil {
7298		var snapshot bytes.Buffer
7299		io.Copy(&snapshot, ringBuffer)
7300		return out, metadata, &smithy.DeserializationError{
7301			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
7302			Snapshot: snapshot.Bytes(),
7303		}
7304	}
7305
7306	return out, metadata, err
7307}
7308
7309func awsRestjson1_deserializeOpErrorDescribeDataSet(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("AccessDeniedException", errorCode):
7351		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
7352
7353	case strings.EqualFold("InternalFailureException", errorCode):
7354		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7355
7356	case strings.EqualFold("InvalidParameterValueException", errorCode):
7357		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
7358
7359	case strings.EqualFold("ResourceNotFoundException", errorCode):
7360		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7361
7362	case strings.EqualFold("ThrottlingException", errorCode):
7363		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7364
7365	default:
7366		genericError := &smithy.GenericAPIError{
7367			Code:    errorCode,
7368			Message: errorMessage,
7369		}
7370		return genericError
7371
7372	}
7373}
7374
7375func awsRestjson1_deserializeOpHttpBindingsDescribeDataSetOutput(v *DescribeDataSetOutput, response *smithyhttp.Response) error {
7376	if v == nil {
7377		return fmt.Errorf("unsupported deserialization for nil %T", v)
7378	}
7379
7380	v.Status = int32(response.StatusCode)
7381
7382	return nil
7383}
7384func awsRestjson1_deserializeOpDocumentDescribeDataSetOutput(v **DescribeDataSetOutput, value interface{}) error {
7385	if v == nil {
7386		return fmt.Errorf("unexpected nil of type %T", v)
7387	}
7388	if value == nil {
7389		return nil
7390	}
7391
7392	shape, ok := value.(map[string]interface{})
7393	if !ok {
7394		return fmt.Errorf("unexpected JSON type %v", value)
7395	}
7396
7397	var sv *DescribeDataSetOutput
7398	if *v == nil {
7399		sv = &DescribeDataSetOutput{}
7400	} else {
7401		sv = *v
7402	}
7403
7404	for key, value := range shape {
7405		switch key {
7406		case "DataSet":
7407			if err := awsRestjson1_deserializeDocumentDataSet(&sv.DataSet, value); err != nil {
7408				return err
7409			}
7410
7411		case "RequestId":
7412			if value != nil {
7413				jtv, ok := value.(string)
7414				if !ok {
7415					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7416				}
7417				sv.RequestId = ptr.String(jtv)
7418			}
7419
7420		default:
7421			_, _ = key, value
7422
7423		}
7424	}
7425	*v = sv
7426	return nil
7427}
7428
7429type awsRestjson1_deserializeOpDescribeDataSetPermissions struct {
7430}
7431
7432func (*awsRestjson1_deserializeOpDescribeDataSetPermissions) ID() string {
7433	return "OperationDeserializer"
7434}
7435
7436func (m *awsRestjson1_deserializeOpDescribeDataSetPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7437	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7438) {
7439	out, metadata, err = next.HandleDeserialize(ctx, in)
7440	if err != nil {
7441		return out, metadata, err
7442	}
7443
7444	response, ok := out.RawResponse.(*smithyhttp.Response)
7445	if !ok {
7446		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7447	}
7448
7449	if response.StatusCode < 200 || response.StatusCode >= 300 {
7450		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDataSetPermissions(response, &metadata)
7451	}
7452	output := &DescribeDataSetPermissionsOutput{}
7453	out.Result = output
7454
7455	err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSetPermissionsOutput(output, response)
7456	if err != nil {
7457		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
7458	}
7459
7460	var buff [1024]byte
7461	ringBuffer := smithyio.NewRingBuffer(buff[:])
7462
7463	body := io.TeeReader(response.Body, ringBuffer)
7464
7465	decoder := json.NewDecoder(body)
7466	decoder.UseNumber()
7467	var shape interface{}
7468	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
7469		var snapshot bytes.Buffer
7470		io.Copy(&snapshot, ringBuffer)
7471		err = &smithy.DeserializationError{
7472			Err:      fmt.Errorf("failed to decode response body, %w", err),
7473			Snapshot: snapshot.Bytes(),
7474		}
7475		return out, metadata, err
7476	}
7477
7478	err = awsRestjson1_deserializeOpDocumentDescribeDataSetPermissionsOutput(&output, shape)
7479	if err != nil {
7480		var snapshot bytes.Buffer
7481		io.Copy(&snapshot, ringBuffer)
7482		return out, metadata, &smithy.DeserializationError{
7483			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
7484			Snapshot: snapshot.Bytes(),
7485		}
7486	}
7487
7488	return out, metadata, err
7489}
7490
7491func awsRestjson1_deserializeOpErrorDescribeDataSetPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7492	var errorBuffer bytes.Buffer
7493	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7494		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7495	}
7496	errorBody := bytes.NewReader(errorBuffer.Bytes())
7497
7498	errorCode := "UnknownError"
7499	errorMessage := errorCode
7500
7501	code := response.Header.Get("X-Amzn-ErrorType")
7502	if len(code) != 0 {
7503		errorCode = restjson.SanitizeErrorCode(code)
7504	}
7505
7506	var buff [1024]byte
7507	ringBuffer := smithyio.NewRingBuffer(buff[:])
7508
7509	body := io.TeeReader(errorBody, ringBuffer)
7510	decoder := json.NewDecoder(body)
7511	decoder.UseNumber()
7512	code, message, err := restjson.GetErrorInfo(decoder)
7513	if err != nil {
7514		var snapshot bytes.Buffer
7515		io.Copy(&snapshot, ringBuffer)
7516		err = &smithy.DeserializationError{
7517			Err:      fmt.Errorf("failed to decode response body, %w", err),
7518			Snapshot: snapshot.Bytes(),
7519		}
7520		return err
7521	}
7522
7523	errorBody.Seek(0, io.SeekStart)
7524	if len(code) != 0 {
7525		errorCode = restjson.SanitizeErrorCode(code)
7526	}
7527	if len(message) != 0 {
7528		errorMessage = message
7529	}
7530
7531	switch {
7532	case strings.EqualFold("AccessDeniedException", errorCode):
7533		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
7534
7535	case strings.EqualFold("InternalFailureException", errorCode):
7536		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7537
7538	case strings.EqualFold("InvalidParameterValueException", errorCode):
7539		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
7540
7541	case strings.EqualFold("ResourceNotFoundException", errorCode):
7542		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7543
7544	case strings.EqualFold("ThrottlingException", errorCode):
7545		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7546
7547	default:
7548		genericError := &smithy.GenericAPIError{
7549			Code:    errorCode,
7550			Message: errorMessage,
7551		}
7552		return genericError
7553
7554	}
7555}
7556
7557func awsRestjson1_deserializeOpHttpBindingsDescribeDataSetPermissionsOutput(v *DescribeDataSetPermissionsOutput, response *smithyhttp.Response) error {
7558	if v == nil {
7559		return fmt.Errorf("unsupported deserialization for nil %T", v)
7560	}
7561
7562	v.Status = int32(response.StatusCode)
7563
7564	return nil
7565}
7566func awsRestjson1_deserializeOpDocumentDescribeDataSetPermissionsOutput(v **DescribeDataSetPermissionsOutput, value interface{}) error {
7567	if v == nil {
7568		return fmt.Errorf("unexpected nil of type %T", v)
7569	}
7570	if value == nil {
7571		return nil
7572	}
7573
7574	shape, ok := value.(map[string]interface{})
7575	if !ok {
7576		return fmt.Errorf("unexpected JSON type %v", value)
7577	}
7578
7579	var sv *DescribeDataSetPermissionsOutput
7580	if *v == nil {
7581		sv = &DescribeDataSetPermissionsOutput{}
7582	} else {
7583		sv = *v
7584	}
7585
7586	for key, value := range shape {
7587		switch key {
7588		case "DataSetArn":
7589			if value != nil {
7590				jtv, ok := value.(string)
7591				if !ok {
7592					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
7593				}
7594				sv.DataSetArn = ptr.String(jtv)
7595			}
7596
7597		case "DataSetId":
7598			if value != nil {
7599				jtv, ok := value.(string)
7600				if !ok {
7601					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
7602				}
7603				sv.DataSetId = ptr.String(jtv)
7604			}
7605
7606		case "Permissions":
7607			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
7608				return err
7609			}
7610
7611		case "RequestId":
7612			if value != nil {
7613				jtv, ok := value.(string)
7614				if !ok {
7615					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7616				}
7617				sv.RequestId = ptr.String(jtv)
7618			}
7619
7620		default:
7621			_, _ = key, value
7622
7623		}
7624	}
7625	*v = sv
7626	return nil
7627}
7628
7629type awsRestjson1_deserializeOpDescribeDataSource struct {
7630}
7631
7632func (*awsRestjson1_deserializeOpDescribeDataSource) ID() string {
7633	return "OperationDeserializer"
7634}
7635
7636func (m *awsRestjson1_deserializeOpDescribeDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7637	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7638) {
7639	out, metadata, err = next.HandleDeserialize(ctx, in)
7640	if err != nil {
7641		return out, metadata, err
7642	}
7643
7644	response, ok := out.RawResponse.(*smithyhttp.Response)
7645	if !ok {
7646		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7647	}
7648
7649	if response.StatusCode < 200 || response.StatusCode >= 300 {
7650		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDataSource(response, &metadata)
7651	}
7652	output := &DescribeDataSourceOutput{}
7653	out.Result = output
7654
7655	err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSourceOutput(output, response)
7656	if err != nil {
7657		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
7658	}
7659
7660	var buff [1024]byte
7661	ringBuffer := smithyio.NewRingBuffer(buff[:])
7662
7663	body := io.TeeReader(response.Body, ringBuffer)
7664
7665	decoder := json.NewDecoder(body)
7666	decoder.UseNumber()
7667	var shape interface{}
7668	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
7669		var snapshot bytes.Buffer
7670		io.Copy(&snapshot, ringBuffer)
7671		err = &smithy.DeserializationError{
7672			Err:      fmt.Errorf("failed to decode response body, %w", err),
7673			Snapshot: snapshot.Bytes(),
7674		}
7675		return out, metadata, err
7676	}
7677
7678	err = awsRestjson1_deserializeOpDocumentDescribeDataSourceOutput(&output, shape)
7679	if err != nil {
7680		var snapshot bytes.Buffer
7681		io.Copy(&snapshot, ringBuffer)
7682		return out, metadata, &smithy.DeserializationError{
7683			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
7684			Snapshot: snapshot.Bytes(),
7685		}
7686	}
7687
7688	return out, metadata, err
7689}
7690
7691func awsRestjson1_deserializeOpErrorDescribeDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7692	var errorBuffer bytes.Buffer
7693	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7694		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7695	}
7696	errorBody := bytes.NewReader(errorBuffer.Bytes())
7697
7698	errorCode := "UnknownError"
7699	errorMessage := errorCode
7700
7701	code := response.Header.Get("X-Amzn-ErrorType")
7702	if len(code) != 0 {
7703		errorCode = restjson.SanitizeErrorCode(code)
7704	}
7705
7706	var buff [1024]byte
7707	ringBuffer := smithyio.NewRingBuffer(buff[:])
7708
7709	body := io.TeeReader(errorBody, ringBuffer)
7710	decoder := json.NewDecoder(body)
7711	decoder.UseNumber()
7712	code, message, err := restjson.GetErrorInfo(decoder)
7713	if err != nil {
7714		var snapshot bytes.Buffer
7715		io.Copy(&snapshot, ringBuffer)
7716		err = &smithy.DeserializationError{
7717			Err:      fmt.Errorf("failed to decode response body, %w", err),
7718			Snapshot: snapshot.Bytes(),
7719		}
7720		return err
7721	}
7722
7723	errorBody.Seek(0, io.SeekStart)
7724	if len(code) != 0 {
7725		errorCode = restjson.SanitizeErrorCode(code)
7726	}
7727	if len(message) != 0 {
7728		errorMessage = message
7729	}
7730
7731	switch {
7732	case strings.EqualFold("AccessDeniedException", errorCode):
7733		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
7734
7735	case strings.EqualFold("InternalFailureException", errorCode):
7736		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7737
7738	case strings.EqualFold("InvalidParameterValueException", errorCode):
7739		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
7740
7741	case strings.EqualFold("ResourceNotFoundException", errorCode):
7742		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7743
7744	case strings.EqualFold("ThrottlingException", errorCode):
7745		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7746
7747	default:
7748		genericError := &smithy.GenericAPIError{
7749			Code:    errorCode,
7750			Message: errorMessage,
7751		}
7752		return genericError
7753
7754	}
7755}
7756
7757func awsRestjson1_deserializeOpHttpBindingsDescribeDataSourceOutput(v *DescribeDataSourceOutput, response *smithyhttp.Response) error {
7758	if v == nil {
7759		return fmt.Errorf("unsupported deserialization for nil %T", v)
7760	}
7761
7762	v.Status = int32(response.StatusCode)
7763
7764	return nil
7765}
7766func awsRestjson1_deserializeOpDocumentDescribeDataSourceOutput(v **DescribeDataSourceOutput, value interface{}) error {
7767	if v == nil {
7768		return fmt.Errorf("unexpected nil of type %T", v)
7769	}
7770	if value == nil {
7771		return nil
7772	}
7773
7774	shape, ok := value.(map[string]interface{})
7775	if !ok {
7776		return fmt.Errorf("unexpected JSON type %v", value)
7777	}
7778
7779	var sv *DescribeDataSourceOutput
7780	if *v == nil {
7781		sv = &DescribeDataSourceOutput{}
7782	} else {
7783		sv = *v
7784	}
7785
7786	for key, value := range shape {
7787		switch key {
7788		case "DataSource":
7789			if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil {
7790				return err
7791			}
7792
7793		case "RequestId":
7794			if value != nil {
7795				jtv, ok := value.(string)
7796				if !ok {
7797					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7798				}
7799				sv.RequestId = ptr.String(jtv)
7800			}
7801
7802		default:
7803			_, _ = key, value
7804
7805		}
7806	}
7807	*v = sv
7808	return nil
7809}
7810
7811type awsRestjson1_deserializeOpDescribeDataSourcePermissions struct {
7812}
7813
7814func (*awsRestjson1_deserializeOpDescribeDataSourcePermissions) ID() string {
7815	return "OperationDeserializer"
7816}
7817
7818func (m *awsRestjson1_deserializeOpDescribeDataSourcePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
7819	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
7820) {
7821	out, metadata, err = next.HandleDeserialize(ctx, in)
7822	if err != nil {
7823		return out, metadata, err
7824	}
7825
7826	response, ok := out.RawResponse.(*smithyhttp.Response)
7827	if !ok {
7828		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
7829	}
7830
7831	if response.StatusCode < 200 || response.StatusCode >= 300 {
7832		return out, metadata, awsRestjson1_deserializeOpErrorDescribeDataSourcePermissions(response, &metadata)
7833	}
7834	output := &DescribeDataSourcePermissionsOutput{}
7835	out.Result = output
7836
7837	err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSourcePermissionsOutput(output, response)
7838	if err != nil {
7839		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
7840	}
7841
7842	var buff [1024]byte
7843	ringBuffer := smithyio.NewRingBuffer(buff[:])
7844
7845	body := io.TeeReader(response.Body, ringBuffer)
7846
7847	decoder := json.NewDecoder(body)
7848	decoder.UseNumber()
7849	var shape interface{}
7850	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
7851		var snapshot bytes.Buffer
7852		io.Copy(&snapshot, ringBuffer)
7853		err = &smithy.DeserializationError{
7854			Err:      fmt.Errorf("failed to decode response body, %w", err),
7855			Snapshot: snapshot.Bytes(),
7856		}
7857		return out, metadata, err
7858	}
7859
7860	err = awsRestjson1_deserializeOpDocumentDescribeDataSourcePermissionsOutput(&output, shape)
7861	if err != nil {
7862		var snapshot bytes.Buffer
7863		io.Copy(&snapshot, ringBuffer)
7864		return out, metadata, &smithy.DeserializationError{
7865			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
7866			Snapshot: snapshot.Bytes(),
7867		}
7868	}
7869
7870	return out, metadata, err
7871}
7872
7873func awsRestjson1_deserializeOpErrorDescribeDataSourcePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
7874	var errorBuffer bytes.Buffer
7875	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
7876		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
7877	}
7878	errorBody := bytes.NewReader(errorBuffer.Bytes())
7879
7880	errorCode := "UnknownError"
7881	errorMessage := errorCode
7882
7883	code := response.Header.Get("X-Amzn-ErrorType")
7884	if len(code) != 0 {
7885		errorCode = restjson.SanitizeErrorCode(code)
7886	}
7887
7888	var buff [1024]byte
7889	ringBuffer := smithyio.NewRingBuffer(buff[:])
7890
7891	body := io.TeeReader(errorBody, ringBuffer)
7892	decoder := json.NewDecoder(body)
7893	decoder.UseNumber()
7894	code, message, err := restjson.GetErrorInfo(decoder)
7895	if err != nil {
7896		var snapshot bytes.Buffer
7897		io.Copy(&snapshot, ringBuffer)
7898		err = &smithy.DeserializationError{
7899			Err:      fmt.Errorf("failed to decode response body, %w", err),
7900			Snapshot: snapshot.Bytes(),
7901		}
7902		return err
7903	}
7904
7905	errorBody.Seek(0, io.SeekStart)
7906	if len(code) != 0 {
7907		errorCode = restjson.SanitizeErrorCode(code)
7908	}
7909	if len(message) != 0 {
7910		errorMessage = message
7911	}
7912
7913	switch {
7914	case strings.EqualFold("AccessDeniedException", errorCode):
7915		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
7916
7917	case strings.EqualFold("InternalFailureException", errorCode):
7918		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
7919
7920	case strings.EqualFold("InvalidParameterValueException", errorCode):
7921		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
7922
7923	case strings.EqualFold("ResourceNotFoundException", errorCode):
7924		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
7925
7926	case strings.EqualFold("ThrottlingException", errorCode):
7927		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
7928
7929	default:
7930		genericError := &smithy.GenericAPIError{
7931			Code:    errorCode,
7932			Message: errorMessage,
7933		}
7934		return genericError
7935
7936	}
7937}
7938
7939func awsRestjson1_deserializeOpHttpBindingsDescribeDataSourcePermissionsOutput(v *DescribeDataSourcePermissionsOutput, response *smithyhttp.Response) error {
7940	if v == nil {
7941		return fmt.Errorf("unsupported deserialization for nil %T", v)
7942	}
7943
7944	v.Status = int32(response.StatusCode)
7945
7946	return nil
7947}
7948func awsRestjson1_deserializeOpDocumentDescribeDataSourcePermissionsOutput(v **DescribeDataSourcePermissionsOutput, value interface{}) error {
7949	if v == nil {
7950		return fmt.Errorf("unexpected nil of type %T", v)
7951	}
7952	if value == nil {
7953		return nil
7954	}
7955
7956	shape, ok := value.(map[string]interface{})
7957	if !ok {
7958		return fmt.Errorf("unexpected JSON type %v", value)
7959	}
7960
7961	var sv *DescribeDataSourcePermissionsOutput
7962	if *v == nil {
7963		sv = &DescribeDataSourcePermissionsOutput{}
7964	} else {
7965		sv = *v
7966	}
7967
7968	for key, value := range shape {
7969		switch key {
7970		case "DataSourceArn":
7971			if value != nil {
7972				jtv, ok := value.(string)
7973				if !ok {
7974					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
7975				}
7976				sv.DataSourceArn = ptr.String(jtv)
7977			}
7978
7979		case "DataSourceId":
7980			if value != nil {
7981				jtv, ok := value.(string)
7982				if !ok {
7983					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
7984				}
7985				sv.DataSourceId = ptr.String(jtv)
7986			}
7987
7988		case "Permissions":
7989			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
7990				return err
7991			}
7992
7993		case "RequestId":
7994			if value != nil {
7995				jtv, ok := value.(string)
7996				if !ok {
7997					return fmt.Errorf("expected String to be of type string, got %T instead", value)
7998				}
7999				sv.RequestId = ptr.String(jtv)
8000			}
8001
8002		default:
8003			_, _ = key, value
8004
8005		}
8006	}
8007	*v = sv
8008	return nil
8009}
8010
8011type awsRestjson1_deserializeOpDescribeGroup struct {
8012}
8013
8014func (*awsRestjson1_deserializeOpDescribeGroup) ID() string {
8015	return "OperationDeserializer"
8016}
8017
8018func (m *awsRestjson1_deserializeOpDescribeGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8019	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8020) {
8021	out, metadata, err = next.HandleDeserialize(ctx, in)
8022	if err != nil {
8023		return out, metadata, err
8024	}
8025
8026	response, ok := out.RawResponse.(*smithyhttp.Response)
8027	if !ok {
8028		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8029	}
8030
8031	if response.StatusCode < 200 || response.StatusCode >= 300 {
8032		return out, metadata, awsRestjson1_deserializeOpErrorDescribeGroup(response, &metadata)
8033	}
8034	output := &DescribeGroupOutput{}
8035	out.Result = output
8036
8037	err = awsRestjson1_deserializeOpHttpBindingsDescribeGroupOutput(output, response)
8038	if err != nil {
8039		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8040	}
8041
8042	var buff [1024]byte
8043	ringBuffer := smithyio.NewRingBuffer(buff[:])
8044
8045	body := io.TeeReader(response.Body, ringBuffer)
8046
8047	decoder := json.NewDecoder(body)
8048	decoder.UseNumber()
8049	var shape interface{}
8050	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8051		var snapshot bytes.Buffer
8052		io.Copy(&snapshot, ringBuffer)
8053		err = &smithy.DeserializationError{
8054			Err:      fmt.Errorf("failed to decode response body, %w", err),
8055			Snapshot: snapshot.Bytes(),
8056		}
8057		return out, metadata, err
8058	}
8059
8060	err = awsRestjson1_deserializeOpDocumentDescribeGroupOutput(&output, shape)
8061	if err != nil {
8062		var snapshot bytes.Buffer
8063		io.Copy(&snapshot, ringBuffer)
8064		return out, metadata, &smithy.DeserializationError{
8065			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
8066			Snapshot: snapshot.Bytes(),
8067		}
8068	}
8069
8070	return out, metadata, err
8071}
8072
8073func awsRestjson1_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8074	var errorBuffer bytes.Buffer
8075	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8076		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8077	}
8078	errorBody := bytes.NewReader(errorBuffer.Bytes())
8079
8080	errorCode := "UnknownError"
8081	errorMessage := errorCode
8082
8083	code := response.Header.Get("X-Amzn-ErrorType")
8084	if len(code) != 0 {
8085		errorCode = restjson.SanitizeErrorCode(code)
8086	}
8087
8088	var buff [1024]byte
8089	ringBuffer := smithyio.NewRingBuffer(buff[:])
8090
8091	body := io.TeeReader(errorBody, ringBuffer)
8092	decoder := json.NewDecoder(body)
8093	decoder.UseNumber()
8094	code, message, err := restjson.GetErrorInfo(decoder)
8095	if err != nil {
8096		var snapshot bytes.Buffer
8097		io.Copy(&snapshot, ringBuffer)
8098		err = &smithy.DeserializationError{
8099			Err:      fmt.Errorf("failed to decode response body, %w", err),
8100			Snapshot: snapshot.Bytes(),
8101		}
8102		return err
8103	}
8104
8105	errorBody.Seek(0, io.SeekStart)
8106	if len(code) != 0 {
8107		errorCode = restjson.SanitizeErrorCode(code)
8108	}
8109	if len(message) != 0 {
8110		errorMessage = message
8111	}
8112
8113	switch {
8114	case strings.EqualFold("AccessDeniedException", errorCode):
8115		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
8116
8117	case strings.EqualFold("InternalFailureException", errorCode):
8118		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8119
8120	case strings.EqualFold("InvalidParameterValueException", errorCode):
8121		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
8122
8123	case strings.EqualFold("PreconditionNotMetException", errorCode):
8124		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
8125
8126	case strings.EqualFold("ResourceNotFoundException", errorCode):
8127		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8128
8129	case strings.EqualFold("ResourceUnavailableException", errorCode):
8130		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
8131
8132	case strings.EqualFold("ThrottlingException", errorCode):
8133		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8134
8135	default:
8136		genericError := &smithy.GenericAPIError{
8137			Code:    errorCode,
8138			Message: errorMessage,
8139		}
8140		return genericError
8141
8142	}
8143}
8144
8145func awsRestjson1_deserializeOpHttpBindingsDescribeGroupOutput(v *DescribeGroupOutput, response *smithyhttp.Response) error {
8146	if v == nil {
8147		return fmt.Errorf("unsupported deserialization for nil %T", v)
8148	}
8149
8150	v.Status = int32(response.StatusCode)
8151
8152	return nil
8153}
8154func awsRestjson1_deserializeOpDocumentDescribeGroupOutput(v **DescribeGroupOutput, value interface{}) error {
8155	if v == nil {
8156		return fmt.Errorf("unexpected nil of type %T", v)
8157	}
8158	if value == nil {
8159		return nil
8160	}
8161
8162	shape, ok := value.(map[string]interface{})
8163	if !ok {
8164		return fmt.Errorf("unexpected JSON type %v", value)
8165	}
8166
8167	var sv *DescribeGroupOutput
8168	if *v == nil {
8169		sv = &DescribeGroupOutput{}
8170	} else {
8171		sv = *v
8172	}
8173
8174	for key, value := range shape {
8175		switch key {
8176		case "Group":
8177			if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil {
8178				return err
8179			}
8180
8181		case "RequestId":
8182			if value != nil {
8183				jtv, ok := value.(string)
8184				if !ok {
8185					return fmt.Errorf("expected String to be of type string, got %T instead", value)
8186				}
8187				sv.RequestId = ptr.String(jtv)
8188			}
8189
8190		default:
8191			_, _ = key, value
8192
8193		}
8194	}
8195	*v = sv
8196	return nil
8197}
8198
8199type awsRestjson1_deserializeOpDescribeIAMPolicyAssignment struct {
8200}
8201
8202func (*awsRestjson1_deserializeOpDescribeIAMPolicyAssignment) ID() string {
8203	return "OperationDeserializer"
8204}
8205
8206func (m *awsRestjson1_deserializeOpDescribeIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8207	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8208) {
8209	out, metadata, err = next.HandleDeserialize(ctx, in)
8210	if err != nil {
8211		return out, metadata, err
8212	}
8213
8214	response, ok := out.RawResponse.(*smithyhttp.Response)
8215	if !ok {
8216		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8217	}
8218
8219	if response.StatusCode < 200 || response.StatusCode >= 300 {
8220		return out, metadata, awsRestjson1_deserializeOpErrorDescribeIAMPolicyAssignment(response, &metadata)
8221	}
8222	output := &DescribeIAMPolicyAssignmentOutput{}
8223	out.Result = output
8224
8225	err = awsRestjson1_deserializeOpHttpBindingsDescribeIAMPolicyAssignmentOutput(output, response)
8226	if err != nil {
8227		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8228	}
8229
8230	var buff [1024]byte
8231	ringBuffer := smithyio.NewRingBuffer(buff[:])
8232
8233	body := io.TeeReader(response.Body, ringBuffer)
8234
8235	decoder := json.NewDecoder(body)
8236	decoder.UseNumber()
8237	var shape interface{}
8238	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8239		var snapshot bytes.Buffer
8240		io.Copy(&snapshot, ringBuffer)
8241		err = &smithy.DeserializationError{
8242			Err:      fmt.Errorf("failed to decode response body, %w", err),
8243			Snapshot: snapshot.Bytes(),
8244		}
8245		return out, metadata, err
8246	}
8247
8248	err = awsRestjson1_deserializeOpDocumentDescribeIAMPolicyAssignmentOutput(&output, shape)
8249	if err != nil {
8250		var snapshot bytes.Buffer
8251		io.Copy(&snapshot, ringBuffer)
8252		return out, metadata, &smithy.DeserializationError{
8253			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
8254			Snapshot: snapshot.Bytes(),
8255		}
8256	}
8257
8258	return out, metadata, err
8259}
8260
8261func awsRestjson1_deserializeOpErrorDescribeIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8262	var errorBuffer bytes.Buffer
8263	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8264		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8265	}
8266	errorBody := bytes.NewReader(errorBuffer.Bytes())
8267
8268	errorCode := "UnknownError"
8269	errorMessage := errorCode
8270
8271	code := response.Header.Get("X-Amzn-ErrorType")
8272	if len(code) != 0 {
8273		errorCode = restjson.SanitizeErrorCode(code)
8274	}
8275
8276	var buff [1024]byte
8277	ringBuffer := smithyio.NewRingBuffer(buff[:])
8278
8279	body := io.TeeReader(errorBody, ringBuffer)
8280	decoder := json.NewDecoder(body)
8281	decoder.UseNumber()
8282	code, message, err := restjson.GetErrorInfo(decoder)
8283	if err != nil {
8284		var snapshot bytes.Buffer
8285		io.Copy(&snapshot, ringBuffer)
8286		err = &smithy.DeserializationError{
8287			Err:      fmt.Errorf("failed to decode response body, %w", err),
8288			Snapshot: snapshot.Bytes(),
8289		}
8290		return err
8291	}
8292
8293	errorBody.Seek(0, io.SeekStart)
8294	if len(code) != 0 {
8295		errorCode = restjson.SanitizeErrorCode(code)
8296	}
8297	if len(message) != 0 {
8298		errorMessage = message
8299	}
8300
8301	switch {
8302	case strings.EqualFold("AccessDeniedException", errorCode):
8303		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
8304
8305	case strings.EqualFold("InternalFailureException", errorCode):
8306		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8307
8308	case strings.EqualFold("InvalidNextTokenException", errorCode):
8309		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
8310
8311	case strings.EqualFold("InvalidParameterValueException", errorCode):
8312		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
8313
8314	case strings.EqualFold("ResourceNotFoundException", errorCode):
8315		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8316
8317	case strings.EqualFold("ThrottlingException", errorCode):
8318		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8319
8320	default:
8321		genericError := &smithy.GenericAPIError{
8322			Code:    errorCode,
8323			Message: errorMessage,
8324		}
8325		return genericError
8326
8327	}
8328}
8329
8330func awsRestjson1_deserializeOpHttpBindingsDescribeIAMPolicyAssignmentOutput(v *DescribeIAMPolicyAssignmentOutput, response *smithyhttp.Response) error {
8331	if v == nil {
8332		return fmt.Errorf("unsupported deserialization for nil %T", v)
8333	}
8334
8335	v.Status = int32(response.StatusCode)
8336
8337	return nil
8338}
8339func awsRestjson1_deserializeOpDocumentDescribeIAMPolicyAssignmentOutput(v **DescribeIAMPolicyAssignmentOutput, value interface{}) error {
8340	if v == nil {
8341		return fmt.Errorf("unexpected nil of type %T", v)
8342	}
8343	if value == nil {
8344		return nil
8345	}
8346
8347	shape, ok := value.(map[string]interface{})
8348	if !ok {
8349		return fmt.Errorf("unexpected JSON type %v", value)
8350	}
8351
8352	var sv *DescribeIAMPolicyAssignmentOutput
8353	if *v == nil {
8354		sv = &DescribeIAMPolicyAssignmentOutput{}
8355	} else {
8356		sv = *v
8357	}
8358
8359	for key, value := range shape {
8360		switch key {
8361		case "IAMPolicyAssignment":
8362			if err := awsRestjson1_deserializeDocumentIAMPolicyAssignment(&sv.IAMPolicyAssignment, value); err != nil {
8363				return err
8364			}
8365
8366		case "RequestId":
8367			if value != nil {
8368				jtv, ok := value.(string)
8369				if !ok {
8370					return fmt.Errorf("expected String to be of type string, got %T instead", value)
8371				}
8372				sv.RequestId = ptr.String(jtv)
8373			}
8374
8375		default:
8376			_, _ = key, value
8377
8378		}
8379	}
8380	*v = sv
8381	return nil
8382}
8383
8384type awsRestjson1_deserializeOpDescribeIngestion struct {
8385}
8386
8387func (*awsRestjson1_deserializeOpDescribeIngestion) ID() string {
8388	return "OperationDeserializer"
8389}
8390
8391func (m *awsRestjson1_deserializeOpDescribeIngestion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8392	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8393) {
8394	out, metadata, err = next.HandleDeserialize(ctx, in)
8395	if err != nil {
8396		return out, metadata, err
8397	}
8398
8399	response, ok := out.RawResponse.(*smithyhttp.Response)
8400	if !ok {
8401		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8402	}
8403
8404	if response.StatusCode < 200 || response.StatusCode >= 300 {
8405		return out, metadata, awsRestjson1_deserializeOpErrorDescribeIngestion(response, &metadata)
8406	}
8407	output := &DescribeIngestionOutput{}
8408	out.Result = output
8409
8410	err = awsRestjson1_deserializeOpHttpBindingsDescribeIngestionOutput(output, response)
8411	if err != nil {
8412		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8413	}
8414
8415	var buff [1024]byte
8416	ringBuffer := smithyio.NewRingBuffer(buff[:])
8417
8418	body := io.TeeReader(response.Body, ringBuffer)
8419
8420	decoder := json.NewDecoder(body)
8421	decoder.UseNumber()
8422	var shape interface{}
8423	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8424		var snapshot bytes.Buffer
8425		io.Copy(&snapshot, ringBuffer)
8426		err = &smithy.DeserializationError{
8427			Err:      fmt.Errorf("failed to decode response body, %w", err),
8428			Snapshot: snapshot.Bytes(),
8429		}
8430		return out, metadata, err
8431	}
8432
8433	err = awsRestjson1_deserializeOpDocumentDescribeIngestionOutput(&output, shape)
8434	if err != nil {
8435		var snapshot bytes.Buffer
8436		io.Copy(&snapshot, ringBuffer)
8437		return out, metadata, &smithy.DeserializationError{
8438			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
8439			Snapshot: snapshot.Bytes(),
8440		}
8441	}
8442
8443	return out, metadata, err
8444}
8445
8446func awsRestjson1_deserializeOpErrorDescribeIngestion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8447	var errorBuffer bytes.Buffer
8448	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8449		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8450	}
8451	errorBody := bytes.NewReader(errorBuffer.Bytes())
8452
8453	errorCode := "UnknownError"
8454	errorMessage := errorCode
8455
8456	code := response.Header.Get("X-Amzn-ErrorType")
8457	if len(code) != 0 {
8458		errorCode = restjson.SanitizeErrorCode(code)
8459	}
8460
8461	var buff [1024]byte
8462	ringBuffer := smithyio.NewRingBuffer(buff[:])
8463
8464	body := io.TeeReader(errorBody, ringBuffer)
8465	decoder := json.NewDecoder(body)
8466	decoder.UseNumber()
8467	code, message, err := restjson.GetErrorInfo(decoder)
8468	if err != nil {
8469		var snapshot bytes.Buffer
8470		io.Copy(&snapshot, ringBuffer)
8471		err = &smithy.DeserializationError{
8472			Err:      fmt.Errorf("failed to decode response body, %w", err),
8473			Snapshot: snapshot.Bytes(),
8474		}
8475		return err
8476	}
8477
8478	errorBody.Seek(0, io.SeekStart)
8479	if len(code) != 0 {
8480		errorCode = restjson.SanitizeErrorCode(code)
8481	}
8482	if len(message) != 0 {
8483		errorMessage = message
8484	}
8485
8486	switch {
8487	case strings.EqualFold("AccessDeniedException", errorCode):
8488		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
8489
8490	case strings.EqualFold("InternalFailureException", errorCode):
8491		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8492
8493	case strings.EqualFold("InvalidParameterValueException", errorCode):
8494		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
8495
8496	case strings.EqualFold("ResourceExistsException", errorCode):
8497		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
8498
8499	case strings.EqualFold("ResourceNotFoundException", errorCode):
8500		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8501
8502	case strings.EqualFold("ThrottlingException", errorCode):
8503		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8504
8505	default:
8506		genericError := &smithy.GenericAPIError{
8507			Code:    errorCode,
8508			Message: errorMessage,
8509		}
8510		return genericError
8511
8512	}
8513}
8514
8515func awsRestjson1_deserializeOpHttpBindingsDescribeIngestionOutput(v *DescribeIngestionOutput, response *smithyhttp.Response) error {
8516	if v == nil {
8517		return fmt.Errorf("unsupported deserialization for nil %T", v)
8518	}
8519
8520	v.Status = int32(response.StatusCode)
8521
8522	return nil
8523}
8524func awsRestjson1_deserializeOpDocumentDescribeIngestionOutput(v **DescribeIngestionOutput, value interface{}) error {
8525	if v == nil {
8526		return fmt.Errorf("unexpected nil of type %T", v)
8527	}
8528	if value == nil {
8529		return nil
8530	}
8531
8532	shape, ok := value.(map[string]interface{})
8533	if !ok {
8534		return fmt.Errorf("unexpected JSON type %v", value)
8535	}
8536
8537	var sv *DescribeIngestionOutput
8538	if *v == nil {
8539		sv = &DescribeIngestionOutput{}
8540	} else {
8541		sv = *v
8542	}
8543
8544	for key, value := range shape {
8545		switch key {
8546		case "Ingestion":
8547			if err := awsRestjson1_deserializeDocumentIngestion(&sv.Ingestion, value); err != nil {
8548				return err
8549			}
8550
8551		case "RequestId":
8552			if value != nil {
8553				jtv, ok := value.(string)
8554				if !ok {
8555					return fmt.Errorf("expected String to be of type string, got %T instead", value)
8556				}
8557				sv.RequestId = ptr.String(jtv)
8558			}
8559
8560		default:
8561			_, _ = key, value
8562
8563		}
8564	}
8565	*v = sv
8566	return nil
8567}
8568
8569type awsRestjson1_deserializeOpDescribeNamespace struct {
8570}
8571
8572func (*awsRestjson1_deserializeOpDescribeNamespace) ID() string {
8573	return "OperationDeserializer"
8574}
8575
8576func (m *awsRestjson1_deserializeOpDescribeNamespace) 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_deserializeOpErrorDescribeNamespace(response, &metadata)
8591	}
8592	output := &DescribeNamespaceOutput{}
8593	out.Result = output
8594
8595	err = awsRestjson1_deserializeOpHttpBindingsDescribeNamespaceOutput(output, response)
8596	if err != nil {
8597		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8598	}
8599
8600	var buff [1024]byte
8601	ringBuffer := smithyio.NewRingBuffer(buff[:])
8602
8603	body := io.TeeReader(response.Body, ringBuffer)
8604
8605	decoder := json.NewDecoder(body)
8606	decoder.UseNumber()
8607	var shape interface{}
8608	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8609		var snapshot bytes.Buffer
8610		io.Copy(&snapshot, ringBuffer)
8611		err = &smithy.DeserializationError{
8612			Err:      fmt.Errorf("failed to decode response body, %w", err),
8613			Snapshot: snapshot.Bytes(),
8614		}
8615		return out, metadata, err
8616	}
8617
8618	err = awsRestjson1_deserializeOpDocumentDescribeNamespaceOutput(&output, shape)
8619	if err != nil {
8620		var snapshot bytes.Buffer
8621		io.Copy(&snapshot, ringBuffer)
8622		return out, metadata, &smithy.DeserializationError{
8623			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
8624			Snapshot: snapshot.Bytes(),
8625		}
8626	}
8627
8628	return out, metadata, err
8629}
8630
8631func awsRestjson1_deserializeOpErrorDescribeNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8632	var errorBuffer bytes.Buffer
8633	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8634		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8635	}
8636	errorBody := bytes.NewReader(errorBuffer.Bytes())
8637
8638	errorCode := "UnknownError"
8639	errorMessage := errorCode
8640
8641	code := response.Header.Get("X-Amzn-ErrorType")
8642	if len(code) != 0 {
8643		errorCode = restjson.SanitizeErrorCode(code)
8644	}
8645
8646	var buff [1024]byte
8647	ringBuffer := smithyio.NewRingBuffer(buff[:])
8648
8649	body := io.TeeReader(errorBody, ringBuffer)
8650	decoder := json.NewDecoder(body)
8651	decoder.UseNumber()
8652	code, message, err := restjson.GetErrorInfo(decoder)
8653	if err != nil {
8654		var snapshot bytes.Buffer
8655		io.Copy(&snapshot, ringBuffer)
8656		err = &smithy.DeserializationError{
8657			Err:      fmt.Errorf("failed to decode response body, %w", err),
8658			Snapshot: snapshot.Bytes(),
8659		}
8660		return err
8661	}
8662
8663	errorBody.Seek(0, io.SeekStart)
8664	if len(code) != 0 {
8665		errorCode = restjson.SanitizeErrorCode(code)
8666	}
8667	if len(message) != 0 {
8668		errorMessage = message
8669	}
8670
8671	switch {
8672	case strings.EqualFold("AccessDeniedException", errorCode):
8673		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
8674
8675	case strings.EqualFold("InternalFailureException", errorCode):
8676		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8677
8678	case strings.EqualFold("InvalidParameterValueException", errorCode):
8679		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
8680
8681	case strings.EqualFold("ResourceNotFoundException", errorCode):
8682		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8683
8684	case strings.EqualFold("ResourceUnavailableException", errorCode):
8685		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
8686
8687	case strings.EqualFold("ThrottlingException", errorCode):
8688		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8689
8690	default:
8691		genericError := &smithy.GenericAPIError{
8692			Code:    errorCode,
8693			Message: errorMessage,
8694		}
8695		return genericError
8696
8697	}
8698}
8699
8700func awsRestjson1_deserializeOpHttpBindingsDescribeNamespaceOutput(v *DescribeNamespaceOutput, response *smithyhttp.Response) error {
8701	if v == nil {
8702		return fmt.Errorf("unsupported deserialization for nil %T", v)
8703	}
8704
8705	v.Status = int32(response.StatusCode)
8706
8707	return nil
8708}
8709func awsRestjson1_deserializeOpDocumentDescribeNamespaceOutput(v **DescribeNamespaceOutput, value interface{}) error {
8710	if v == nil {
8711		return fmt.Errorf("unexpected nil of type %T", v)
8712	}
8713	if value == nil {
8714		return nil
8715	}
8716
8717	shape, ok := value.(map[string]interface{})
8718	if !ok {
8719		return fmt.Errorf("unexpected JSON type %v", value)
8720	}
8721
8722	var sv *DescribeNamespaceOutput
8723	if *v == nil {
8724		sv = &DescribeNamespaceOutput{}
8725	} else {
8726		sv = *v
8727	}
8728
8729	for key, value := range shape {
8730		switch key {
8731		case "Namespace":
8732			if err := awsRestjson1_deserializeDocumentNamespaceInfoV2(&sv.Namespace, value); err != nil {
8733				return err
8734			}
8735
8736		case "RequestId":
8737			if value != nil {
8738				jtv, ok := value.(string)
8739				if !ok {
8740					return fmt.Errorf("expected String to be of type string, got %T instead", value)
8741				}
8742				sv.RequestId = ptr.String(jtv)
8743			}
8744
8745		default:
8746			_, _ = key, value
8747
8748		}
8749	}
8750	*v = sv
8751	return nil
8752}
8753
8754type awsRestjson1_deserializeOpDescribeTemplate struct {
8755}
8756
8757func (*awsRestjson1_deserializeOpDescribeTemplate) ID() string {
8758	return "OperationDeserializer"
8759}
8760
8761func (m *awsRestjson1_deserializeOpDescribeTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8762	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8763) {
8764	out, metadata, err = next.HandleDeserialize(ctx, in)
8765	if err != nil {
8766		return out, metadata, err
8767	}
8768
8769	response, ok := out.RawResponse.(*smithyhttp.Response)
8770	if !ok {
8771		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8772	}
8773
8774	if response.StatusCode < 200 || response.StatusCode >= 300 {
8775		return out, metadata, awsRestjson1_deserializeOpErrorDescribeTemplate(response, &metadata)
8776	}
8777	output := &DescribeTemplateOutput{}
8778	out.Result = output
8779
8780	err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplateOutput(output, response)
8781	if err != nil {
8782		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8783	}
8784
8785	var buff [1024]byte
8786	ringBuffer := smithyio.NewRingBuffer(buff[:])
8787
8788	body := io.TeeReader(response.Body, ringBuffer)
8789
8790	decoder := json.NewDecoder(body)
8791	decoder.UseNumber()
8792	var shape interface{}
8793	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8794		var snapshot bytes.Buffer
8795		io.Copy(&snapshot, ringBuffer)
8796		err = &smithy.DeserializationError{
8797			Err:      fmt.Errorf("failed to decode response body, %w", err),
8798			Snapshot: snapshot.Bytes(),
8799		}
8800		return out, metadata, err
8801	}
8802
8803	err = awsRestjson1_deserializeOpDocumentDescribeTemplateOutput(&output, shape)
8804	if err != nil {
8805		var snapshot bytes.Buffer
8806		io.Copy(&snapshot, ringBuffer)
8807		return out, metadata, &smithy.DeserializationError{
8808			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
8809			Snapshot: snapshot.Bytes(),
8810		}
8811	}
8812
8813	return out, metadata, err
8814}
8815
8816func awsRestjson1_deserializeOpErrorDescribeTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
8817	var errorBuffer bytes.Buffer
8818	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
8819		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
8820	}
8821	errorBody := bytes.NewReader(errorBuffer.Bytes())
8822
8823	errorCode := "UnknownError"
8824	errorMessage := errorCode
8825
8826	code := response.Header.Get("X-Amzn-ErrorType")
8827	if len(code) != 0 {
8828		errorCode = restjson.SanitizeErrorCode(code)
8829	}
8830
8831	var buff [1024]byte
8832	ringBuffer := smithyio.NewRingBuffer(buff[:])
8833
8834	body := io.TeeReader(errorBody, ringBuffer)
8835	decoder := json.NewDecoder(body)
8836	decoder.UseNumber()
8837	code, message, err := restjson.GetErrorInfo(decoder)
8838	if err != nil {
8839		var snapshot bytes.Buffer
8840		io.Copy(&snapshot, ringBuffer)
8841		err = &smithy.DeserializationError{
8842			Err:      fmt.Errorf("failed to decode response body, %w", err),
8843			Snapshot: snapshot.Bytes(),
8844		}
8845		return err
8846	}
8847
8848	errorBody.Seek(0, io.SeekStart)
8849	if len(code) != 0 {
8850		errorCode = restjson.SanitizeErrorCode(code)
8851	}
8852	if len(message) != 0 {
8853		errorMessage = message
8854	}
8855
8856	switch {
8857	case strings.EqualFold("AccessDeniedException", errorCode):
8858		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
8859
8860	case strings.EqualFold("ConflictException", errorCode):
8861		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
8862
8863	case strings.EqualFold("InternalFailureException", errorCode):
8864		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
8865
8866	case strings.EqualFold("InvalidParameterValueException", errorCode):
8867		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
8868
8869	case strings.EqualFold("ResourceExistsException", errorCode):
8870		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
8871
8872	case strings.EqualFold("ResourceNotFoundException", errorCode):
8873		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
8874
8875	case strings.EqualFold("ThrottlingException", errorCode):
8876		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
8877
8878	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
8879		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
8880
8881	default:
8882		genericError := &smithy.GenericAPIError{
8883			Code:    errorCode,
8884			Message: errorMessage,
8885		}
8886		return genericError
8887
8888	}
8889}
8890
8891func awsRestjson1_deserializeOpHttpBindingsDescribeTemplateOutput(v *DescribeTemplateOutput, response *smithyhttp.Response) error {
8892	if v == nil {
8893		return fmt.Errorf("unsupported deserialization for nil %T", v)
8894	}
8895
8896	v.Status = int32(response.StatusCode)
8897
8898	return nil
8899}
8900func awsRestjson1_deserializeOpDocumentDescribeTemplateOutput(v **DescribeTemplateOutput, value interface{}) error {
8901	if v == nil {
8902		return fmt.Errorf("unexpected nil of type %T", v)
8903	}
8904	if value == nil {
8905		return nil
8906	}
8907
8908	shape, ok := value.(map[string]interface{})
8909	if !ok {
8910		return fmt.Errorf("unexpected JSON type %v", value)
8911	}
8912
8913	var sv *DescribeTemplateOutput
8914	if *v == nil {
8915		sv = &DescribeTemplateOutput{}
8916	} else {
8917		sv = *v
8918	}
8919
8920	for key, value := range shape {
8921		switch key {
8922		case "RequestId":
8923			if value != nil {
8924				jtv, ok := value.(string)
8925				if !ok {
8926					return fmt.Errorf("expected String to be of type string, got %T instead", value)
8927				}
8928				sv.RequestId = ptr.String(jtv)
8929			}
8930
8931		case "Template":
8932			if err := awsRestjson1_deserializeDocumentTemplate(&sv.Template, value); err != nil {
8933				return err
8934			}
8935
8936		default:
8937			_, _ = key, value
8938
8939		}
8940	}
8941	*v = sv
8942	return nil
8943}
8944
8945type awsRestjson1_deserializeOpDescribeTemplateAlias struct {
8946}
8947
8948func (*awsRestjson1_deserializeOpDescribeTemplateAlias) ID() string {
8949	return "OperationDeserializer"
8950}
8951
8952func (m *awsRestjson1_deserializeOpDescribeTemplateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
8953	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
8954) {
8955	out, metadata, err = next.HandleDeserialize(ctx, in)
8956	if err != nil {
8957		return out, metadata, err
8958	}
8959
8960	response, ok := out.RawResponse.(*smithyhttp.Response)
8961	if !ok {
8962		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
8963	}
8964
8965	if response.StatusCode < 200 || response.StatusCode >= 300 {
8966		return out, metadata, awsRestjson1_deserializeOpErrorDescribeTemplateAlias(response, &metadata)
8967	}
8968	output := &DescribeTemplateAliasOutput{}
8969	out.Result = output
8970
8971	err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplateAliasOutput(output, response)
8972	if err != nil {
8973		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
8974	}
8975
8976	var buff [1024]byte
8977	ringBuffer := smithyio.NewRingBuffer(buff[:])
8978
8979	body := io.TeeReader(response.Body, ringBuffer)
8980
8981	decoder := json.NewDecoder(body)
8982	decoder.UseNumber()
8983	var shape interface{}
8984	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
8985		var snapshot bytes.Buffer
8986		io.Copy(&snapshot, ringBuffer)
8987		err = &smithy.DeserializationError{
8988			Err:      fmt.Errorf("failed to decode response body, %w", err),
8989			Snapshot: snapshot.Bytes(),
8990		}
8991		return out, metadata, err
8992	}
8993
8994	err = awsRestjson1_deserializeOpDocumentDescribeTemplateAliasOutput(&output, shape)
8995	if err != nil {
8996		var snapshot bytes.Buffer
8997		io.Copy(&snapshot, ringBuffer)
8998		return out, metadata, &smithy.DeserializationError{
8999			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9000			Snapshot: snapshot.Bytes(),
9001		}
9002	}
9003
9004	return out, metadata, err
9005}
9006
9007func awsRestjson1_deserializeOpErrorDescribeTemplateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9008	var errorBuffer bytes.Buffer
9009	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9010		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9011	}
9012	errorBody := bytes.NewReader(errorBuffer.Bytes())
9013
9014	errorCode := "UnknownError"
9015	errorMessage := errorCode
9016
9017	code := response.Header.Get("X-Amzn-ErrorType")
9018	if len(code) != 0 {
9019		errorCode = restjson.SanitizeErrorCode(code)
9020	}
9021
9022	var buff [1024]byte
9023	ringBuffer := smithyio.NewRingBuffer(buff[:])
9024
9025	body := io.TeeReader(errorBody, ringBuffer)
9026	decoder := json.NewDecoder(body)
9027	decoder.UseNumber()
9028	code, message, err := restjson.GetErrorInfo(decoder)
9029	if err != nil {
9030		var snapshot bytes.Buffer
9031		io.Copy(&snapshot, ringBuffer)
9032		err = &smithy.DeserializationError{
9033			Err:      fmt.Errorf("failed to decode response body, %w", err),
9034			Snapshot: snapshot.Bytes(),
9035		}
9036		return err
9037	}
9038
9039	errorBody.Seek(0, io.SeekStart)
9040	if len(code) != 0 {
9041		errorCode = restjson.SanitizeErrorCode(code)
9042	}
9043	if len(message) != 0 {
9044		errorMessage = message
9045	}
9046
9047	switch {
9048	case strings.EqualFold("InternalFailureException", errorCode):
9049		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9050
9051	case strings.EqualFold("ResourceNotFoundException", errorCode):
9052		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9053
9054	case strings.EqualFold("ThrottlingException", errorCode):
9055		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9056
9057	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
9058		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
9059
9060	default:
9061		genericError := &smithy.GenericAPIError{
9062			Code:    errorCode,
9063			Message: errorMessage,
9064		}
9065		return genericError
9066
9067	}
9068}
9069
9070func awsRestjson1_deserializeOpHttpBindingsDescribeTemplateAliasOutput(v *DescribeTemplateAliasOutput, response *smithyhttp.Response) error {
9071	if v == nil {
9072		return fmt.Errorf("unsupported deserialization for nil %T", v)
9073	}
9074
9075	v.Status = int32(response.StatusCode)
9076
9077	return nil
9078}
9079func awsRestjson1_deserializeOpDocumentDescribeTemplateAliasOutput(v **DescribeTemplateAliasOutput, value interface{}) error {
9080	if v == nil {
9081		return fmt.Errorf("unexpected nil of type %T", v)
9082	}
9083	if value == nil {
9084		return nil
9085	}
9086
9087	shape, ok := value.(map[string]interface{})
9088	if !ok {
9089		return fmt.Errorf("unexpected JSON type %v", value)
9090	}
9091
9092	var sv *DescribeTemplateAliasOutput
9093	if *v == nil {
9094		sv = &DescribeTemplateAliasOutput{}
9095	} else {
9096		sv = *v
9097	}
9098
9099	for key, value := range shape {
9100		switch key {
9101		case "RequestId":
9102			if value != nil {
9103				jtv, ok := value.(string)
9104				if !ok {
9105					return fmt.Errorf("expected String to be of type string, got %T instead", value)
9106				}
9107				sv.RequestId = ptr.String(jtv)
9108			}
9109
9110		case "TemplateAlias":
9111			if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil {
9112				return err
9113			}
9114
9115		default:
9116			_, _ = key, value
9117
9118		}
9119	}
9120	*v = sv
9121	return nil
9122}
9123
9124type awsRestjson1_deserializeOpDescribeTemplatePermissions struct {
9125}
9126
9127func (*awsRestjson1_deserializeOpDescribeTemplatePermissions) ID() string {
9128	return "OperationDeserializer"
9129}
9130
9131func (m *awsRestjson1_deserializeOpDescribeTemplatePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9132	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9133) {
9134	out, metadata, err = next.HandleDeserialize(ctx, in)
9135	if err != nil {
9136		return out, metadata, err
9137	}
9138
9139	response, ok := out.RawResponse.(*smithyhttp.Response)
9140	if !ok {
9141		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9142	}
9143
9144	if response.StatusCode < 200 || response.StatusCode >= 300 {
9145		return out, metadata, awsRestjson1_deserializeOpErrorDescribeTemplatePermissions(response, &metadata)
9146	}
9147	output := &DescribeTemplatePermissionsOutput{}
9148	out.Result = output
9149
9150	err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplatePermissionsOutput(output, response)
9151	if err != nil {
9152		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
9153	}
9154
9155	var buff [1024]byte
9156	ringBuffer := smithyio.NewRingBuffer(buff[:])
9157
9158	body := io.TeeReader(response.Body, ringBuffer)
9159
9160	decoder := json.NewDecoder(body)
9161	decoder.UseNumber()
9162	var shape interface{}
9163	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9164		var snapshot bytes.Buffer
9165		io.Copy(&snapshot, ringBuffer)
9166		err = &smithy.DeserializationError{
9167			Err:      fmt.Errorf("failed to decode response body, %w", err),
9168			Snapshot: snapshot.Bytes(),
9169		}
9170		return out, metadata, err
9171	}
9172
9173	err = awsRestjson1_deserializeOpDocumentDescribeTemplatePermissionsOutput(&output, shape)
9174	if err != nil {
9175		var snapshot bytes.Buffer
9176		io.Copy(&snapshot, ringBuffer)
9177		return out, metadata, &smithy.DeserializationError{
9178			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9179			Snapshot: snapshot.Bytes(),
9180		}
9181	}
9182
9183	return out, metadata, err
9184}
9185
9186func awsRestjson1_deserializeOpErrorDescribeTemplatePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9187	var errorBuffer bytes.Buffer
9188	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9189		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9190	}
9191	errorBody := bytes.NewReader(errorBuffer.Bytes())
9192
9193	errorCode := "UnknownError"
9194	errorMessage := errorCode
9195
9196	code := response.Header.Get("X-Amzn-ErrorType")
9197	if len(code) != 0 {
9198		errorCode = restjson.SanitizeErrorCode(code)
9199	}
9200
9201	var buff [1024]byte
9202	ringBuffer := smithyio.NewRingBuffer(buff[:])
9203
9204	body := io.TeeReader(errorBody, ringBuffer)
9205	decoder := json.NewDecoder(body)
9206	decoder.UseNumber()
9207	code, message, err := restjson.GetErrorInfo(decoder)
9208	if err != nil {
9209		var snapshot bytes.Buffer
9210		io.Copy(&snapshot, ringBuffer)
9211		err = &smithy.DeserializationError{
9212			Err:      fmt.Errorf("failed to decode response body, %w", err),
9213			Snapshot: snapshot.Bytes(),
9214		}
9215		return err
9216	}
9217
9218	errorBody.Seek(0, io.SeekStart)
9219	if len(code) != 0 {
9220		errorCode = restjson.SanitizeErrorCode(code)
9221	}
9222	if len(message) != 0 {
9223		errorMessage = message
9224	}
9225
9226	switch {
9227	case strings.EqualFold("ConflictException", errorCode):
9228		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
9229
9230	case strings.EqualFold("InternalFailureException", errorCode):
9231		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9232
9233	case strings.EqualFold("InvalidParameterValueException", errorCode):
9234		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
9235
9236	case strings.EqualFold("ResourceNotFoundException", errorCode):
9237		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9238
9239	case strings.EqualFold("ThrottlingException", errorCode):
9240		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9241
9242	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
9243		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
9244
9245	default:
9246		genericError := &smithy.GenericAPIError{
9247			Code:    errorCode,
9248			Message: errorMessage,
9249		}
9250		return genericError
9251
9252	}
9253}
9254
9255func awsRestjson1_deserializeOpHttpBindingsDescribeTemplatePermissionsOutput(v *DescribeTemplatePermissionsOutput, response *smithyhttp.Response) error {
9256	if v == nil {
9257		return fmt.Errorf("unsupported deserialization for nil %T", v)
9258	}
9259
9260	v.Status = int32(response.StatusCode)
9261
9262	return nil
9263}
9264func awsRestjson1_deserializeOpDocumentDescribeTemplatePermissionsOutput(v **DescribeTemplatePermissionsOutput, value interface{}) error {
9265	if v == nil {
9266		return fmt.Errorf("unexpected nil of type %T", v)
9267	}
9268	if value == nil {
9269		return nil
9270	}
9271
9272	shape, ok := value.(map[string]interface{})
9273	if !ok {
9274		return fmt.Errorf("unexpected JSON type %v", value)
9275	}
9276
9277	var sv *DescribeTemplatePermissionsOutput
9278	if *v == nil {
9279		sv = &DescribeTemplatePermissionsOutput{}
9280	} else {
9281		sv = *v
9282	}
9283
9284	for key, value := range shape {
9285		switch key {
9286		case "Permissions":
9287			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
9288				return err
9289			}
9290
9291		case "RequestId":
9292			if value != nil {
9293				jtv, ok := value.(string)
9294				if !ok {
9295					return fmt.Errorf("expected String to be of type string, got %T instead", value)
9296				}
9297				sv.RequestId = ptr.String(jtv)
9298			}
9299
9300		case "TemplateArn":
9301			if value != nil {
9302				jtv, ok := value.(string)
9303				if !ok {
9304					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
9305				}
9306				sv.TemplateArn = ptr.String(jtv)
9307			}
9308
9309		case "TemplateId":
9310			if value != nil {
9311				jtv, ok := value.(string)
9312				if !ok {
9313					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
9314				}
9315				sv.TemplateId = ptr.String(jtv)
9316			}
9317
9318		default:
9319			_, _ = key, value
9320
9321		}
9322	}
9323	*v = sv
9324	return nil
9325}
9326
9327type awsRestjson1_deserializeOpDescribeTheme struct {
9328}
9329
9330func (*awsRestjson1_deserializeOpDescribeTheme) ID() string {
9331	return "OperationDeserializer"
9332}
9333
9334func (m *awsRestjson1_deserializeOpDescribeTheme) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9335	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9336) {
9337	out, metadata, err = next.HandleDeserialize(ctx, in)
9338	if err != nil {
9339		return out, metadata, err
9340	}
9341
9342	response, ok := out.RawResponse.(*smithyhttp.Response)
9343	if !ok {
9344		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9345	}
9346
9347	if response.StatusCode < 200 || response.StatusCode >= 300 {
9348		return out, metadata, awsRestjson1_deserializeOpErrorDescribeTheme(response, &metadata)
9349	}
9350	output := &DescribeThemeOutput{}
9351	out.Result = output
9352
9353	err = awsRestjson1_deserializeOpHttpBindingsDescribeThemeOutput(output, response)
9354	if err != nil {
9355		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
9356	}
9357
9358	var buff [1024]byte
9359	ringBuffer := smithyio.NewRingBuffer(buff[:])
9360
9361	body := io.TeeReader(response.Body, ringBuffer)
9362
9363	decoder := json.NewDecoder(body)
9364	decoder.UseNumber()
9365	var shape interface{}
9366	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9367		var snapshot bytes.Buffer
9368		io.Copy(&snapshot, ringBuffer)
9369		err = &smithy.DeserializationError{
9370			Err:      fmt.Errorf("failed to decode response body, %w", err),
9371			Snapshot: snapshot.Bytes(),
9372		}
9373		return out, metadata, err
9374	}
9375
9376	err = awsRestjson1_deserializeOpDocumentDescribeThemeOutput(&output, shape)
9377	if err != nil {
9378		var snapshot bytes.Buffer
9379		io.Copy(&snapshot, ringBuffer)
9380		return out, metadata, &smithy.DeserializationError{
9381			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9382			Snapshot: snapshot.Bytes(),
9383		}
9384	}
9385
9386	return out, metadata, err
9387}
9388
9389func awsRestjson1_deserializeOpErrorDescribeTheme(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9390	var errorBuffer bytes.Buffer
9391	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9392		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9393	}
9394	errorBody := bytes.NewReader(errorBuffer.Bytes())
9395
9396	errorCode := "UnknownError"
9397	errorMessage := errorCode
9398
9399	code := response.Header.Get("X-Amzn-ErrorType")
9400	if len(code) != 0 {
9401		errorCode = restjson.SanitizeErrorCode(code)
9402	}
9403
9404	var buff [1024]byte
9405	ringBuffer := smithyio.NewRingBuffer(buff[:])
9406
9407	body := io.TeeReader(errorBody, ringBuffer)
9408	decoder := json.NewDecoder(body)
9409	decoder.UseNumber()
9410	code, message, err := restjson.GetErrorInfo(decoder)
9411	if err != nil {
9412		var snapshot bytes.Buffer
9413		io.Copy(&snapshot, ringBuffer)
9414		err = &smithy.DeserializationError{
9415			Err:      fmt.Errorf("failed to decode response body, %w", err),
9416			Snapshot: snapshot.Bytes(),
9417		}
9418		return err
9419	}
9420
9421	errorBody.Seek(0, io.SeekStart)
9422	if len(code) != 0 {
9423		errorCode = restjson.SanitizeErrorCode(code)
9424	}
9425	if len(message) != 0 {
9426		errorMessage = message
9427	}
9428
9429	switch {
9430	case strings.EqualFold("AccessDeniedException", errorCode):
9431		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
9432
9433	case strings.EqualFold("InternalFailureException", errorCode):
9434		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9435
9436	case strings.EqualFold("InvalidParameterValueException", errorCode):
9437		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
9438
9439	case strings.EqualFold("ResourceExistsException", errorCode):
9440		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
9441
9442	case strings.EqualFold("ResourceNotFoundException", errorCode):
9443		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9444
9445	case strings.EqualFold("ThrottlingException", errorCode):
9446		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9447
9448	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
9449		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
9450
9451	default:
9452		genericError := &smithy.GenericAPIError{
9453			Code:    errorCode,
9454			Message: errorMessage,
9455		}
9456		return genericError
9457
9458	}
9459}
9460
9461func awsRestjson1_deserializeOpHttpBindingsDescribeThemeOutput(v *DescribeThemeOutput, response *smithyhttp.Response) error {
9462	if v == nil {
9463		return fmt.Errorf("unsupported deserialization for nil %T", v)
9464	}
9465
9466	v.Status = int32(response.StatusCode)
9467
9468	return nil
9469}
9470func awsRestjson1_deserializeOpDocumentDescribeThemeOutput(v **DescribeThemeOutput, value interface{}) error {
9471	if v == nil {
9472		return fmt.Errorf("unexpected nil of type %T", v)
9473	}
9474	if value == nil {
9475		return nil
9476	}
9477
9478	shape, ok := value.(map[string]interface{})
9479	if !ok {
9480		return fmt.Errorf("unexpected JSON type %v", value)
9481	}
9482
9483	var sv *DescribeThemeOutput
9484	if *v == nil {
9485		sv = &DescribeThemeOutput{}
9486	} else {
9487		sv = *v
9488	}
9489
9490	for key, value := range shape {
9491		switch key {
9492		case "RequestId":
9493			if value != nil {
9494				jtv, ok := value.(string)
9495				if !ok {
9496					return fmt.Errorf("expected String to be of type string, got %T instead", value)
9497				}
9498				sv.RequestId = ptr.String(jtv)
9499			}
9500
9501		case "Theme":
9502			if err := awsRestjson1_deserializeDocumentTheme(&sv.Theme, value); err != nil {
9503				return err
9504			}
9505
9506		default:
9507			_, _ = key, value
9508
9509		}
9510	}
9511	*v = sv
9512	return nil
9513}
9514
9515type awsRestjson1_deserializeOpDescribeThemeAlias struct {
9516}
9517
9518func (*awsRestjson1_deserializeOpDescribeThemeAlias) ID() string {
9519	return "OperationDeserializer"
9520}
9521
9522func (m *awsRestjson1_deserializeOpDescribeThemeAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9523	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9524) {
9525	out, metadata, err = next.HandleDeserialize(ctx, in)
9526	if err != nil {
9527		return out, metadata, err
9528	}
9529
9530	response, ok := out.RawResponse.(*smithyhttp.Response)
9531	if !ok {
9532		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9533	}
9534
9535	if response.StatusCode < 200 || response.StatusCode >= 300 {
9536		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThemeAlias(response, &metadata)
9537	}
9538	output := &DescribeThemeAliasOutput{}
9539	out.Result = output
9540
9541	err = awsRestjson1_deserializeOpHttpBindingsDescribeThemeAliasOutput(output, response)
9542	if err != nil {
9543		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
9544	}
9545
9546	var buff [1024]byte
9547	ringBuffer := smithyio.NewRingBuffer(buff[:])
9548
9549	body := io.TeeReader(response.Body, ringBuffer)
9550
9551	decoder := json.NewDecoder(body)
9552	decoder.UseNumber()
9553	var shape interface{}
9554	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9555		var snapshot bytes.Buffer
9556		io.Copy(&snapshot, ringBuffer)
9557		err = &smithy.DeserializationError{
9558			Err:      fmt.Errorf("failed to decode response body, %w", err),
9559			Snapshot: snapshot.Bytes(),
9560		}
9561		return out, metadata, err
9562	}
9563
9564	err = awsRestjson1_deserializeOpDocumentDescribeThemeAliasOutput(&output, shape)
9565	if err != nil {
9566		var snapshot bytes.Buffer
9567		io.Copy(&snapshot, ringBuffer)
9568		return out, metadata, &smithy.DeserializationError{
9569			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9570			Snapshot: snapshot.Bytes(),
9571		}
9572	}
9573
9574	return out, metadata, err
9575}
9576
9577func awsRestjson1_deserializeOpErrorDescribeThemeAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9578	var errorBuffer bytes.Buffer
9579	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9580		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9581	}
9582	errorBody := bytes.NewReader(errorBuffer.Bytes())
9583
9584	errorCode := "UnknownError"
9585	errorMessage := errorCode
9586
9587	code := response.Header.Get("X-Amzn-ErrorType")
9588	if len(code) != 0 {
9589		errorCode = restjson.SanitizeErrorCode(code)
9590	}
9591
9592	var buff [1024]byte
9593	ringBuffer := smithyio.NewRingBuffer(buff[:])
9594
9595	body := io.TeeReader(errorBody, ringBuffer)
9596	decoder := json.NewDecoder(body)
9597	decoder.UseNumber()
9598	code, message, err := restjson.GetErrorInfo(decoder)
9599	if err != nil {
9600		var snapshot bytes.Buffer
9601		io.Copy(&snapshot, ringBuffer)
9602		err = &smithy.DeserializationError{
9603			Err:      fmt.Errorf("failed to decode response body, %w", err),
9604			Snapshot: snapshot.Bytes(),
9605		}
9606		return err
9607	}
9608
9609	errorBody.Seek(0, io.SeekStart)
9610	if len(code) != 0 {
9611		errorCode = restjson.SanitizeErrorCode(code)
9612	}
9613	if len(message) != 0 {
9614		errorMessage = message
9615	}
9616
9617	switch {
9618	case strings.EqualFold("ConflictException", errorCode):
9619		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
9620
9621	case strings.EqualFold("InternalFailureException", errorCode):
9622		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9623
9624	case strings.EqualFold("InvalidParameterValueException", errorCode):
9625		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
9626
9627	case strings.EqualFold("ResourceNotFoundException", errorCode):
9628		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9629
9630	case strings.EqualFold("ThrottlingException", errorCode):
9631		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9632
9633	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
9634		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
9635
9636	default:
9637		genericError := &smithy.GenericAPIError{
9638			Code:    errorCode,
9639			Message: errorMessage,
9640		}
9641		return genericError
9642
9643	}
9644}
9645
9646func awsRestjson1_deserializeOpHttpBindingsDescribeThemeAliasOutput(v *DescribeThemeAliasOutput, response *smithyhttp.Response) error {
9647	if v == nil {
9648		return fmt.Errorf("unsupported deserialization for nil %T", v)
9649	}
9650
9651	v.Status = int32(response.StatusCode)
9652
9653	return nil
9654}
9655func awsRestjson1_deserializeOpDocumentDescribeThemeAliasOutput(v **DescribeThemeAliasOutput, value interface{}) error {
9656	if v == nil {
9657		return fmt.Errorf("unexpected nil of type %T", v)
9658	}
9659	if value == nil {
9660		return nil
9661	}
9662
9663	shape, ok := value.(map[string]interface{})
9664	if !ok {
9665		return fmt.Errorf("unexpected JSON type %v", value)
9666	}
9667
9668	var sv *DescribeThemeAliasOutput
9669	if *v == nil {
9670		sv = &DescribeThemeAliasOutput{}
9671	} else {
9672		sv = *v
9673	}
9674
9675	for key, value := range shape {
9676		switch key {
9677		case "RequestId":
9678			if value != nil {
9679				jtv, ok := value.(string)
9680				if !ok {
9681					return fmt.Errorf("expected String to be of type string, got %T instead", value)
9682				}
9683				sv.RequestId = ptr.String(jtv)
9684			}
9685
9686		case "ThemeAlias":
9687			if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil {
9688				return err
9689			}
9690
9691		default:
9692			_, _ = key, value
9693
9694		}
9695	}
9696	*v = sv
9697	return nil
9698}
9699
9700type awsRestjson1_deserializeOpDescribeThemePermissions struct {
9701}
9702
9703func (*awsRestjson1_deserializeOpDescribeThemePermissions) ID() string {
9704	return "OperationDeserializer"
9705}
9706
9707func (m *awsRestjson1_deserializeOpDescribeThemePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9708	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9709) {
9710	out, metadata, err = next.HandleDeserialize(ctx, in)
9711	if err != nil {
9712		return out, metadata, err
9713	}
9714
9715	response, ok := out.RawResponse.(*smithyhttp.Response)
9716	if !ok {
9717		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9718	}
9719
9720	if response.StatusCode < 200 || response.StatusCode >= 300 {
9721		return out, metadata, awsRestjson1_deserializeOpErrorDescribeThemePermissions(response, &metadata)
9722	}
9723	output := &DescribeThemePermissionsOutput{}
9724	out.Result = output
9725
9726	err = awsRestjson1_deserializeOpHttpBindingsDescribeThemePermissionsOutput(output, response)
9727	if err != nil {
9728		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
9729	}
9730
9731	var buff [1024]byte
9732	ringBuffer := smithyio.NewRingBuffer(buff[:])
9733
9734	body := io.TeeReader(response.Body, ringBuffer)
9735
9736	decoder := json.NewDecoder(body)
9737	decoder.UseNumber()
9738	var shape interface{}
9739	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9740		var snapshot bytes.Buffer
9741		io.Copy(&snapshot, ringBuffer)
9742		err = &smithy.DeserializationError{
9743			Err:      fmt.Errorf("failed to decode response body, %w", err),
9744			Snapshot: snapshot.Bytes(),
9745		}
9746		return out, metadata, err
9747	}
9748
9749	err = awsRestjson1_deserializeOpDocumentDescribeThemePermissionsOutput(&output, shape)
9750	if err != nil {
9751		var snapshot bytes.Buffer
9752		io.Copy(&snapshot, ringBuffer)
9753		return out, metadata, &smithy.DeserializationError{
9754			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9755			Snapshot: snapshot.Bytes(),
9756		}
9757	}
9758
9759	return out, metadata, err
9760}
9761
9762func awsRestjson1_deserializeOpErrorDescribeThemePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9763	var errorBuffer bytes.Buffer
9764	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9765		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9766	}
9767	errorBody := bytes.NewReader(errorBuffer.Bytes())
9768
9769	errorCode := "UnknownError"
9770	errorMessage := errorCode
9771
9772	code := response.Header.Get("X-Amzn-ErrorType")
9773	if len(code) != 0 {
9774		errorCode = restjson.SanitizeErrorCode(code)
9775	}
9776
9777	var buff [1024]byte
9778	ringBuffer := smithyio.NewRingBuffer(buff[:])
9779
9780	body := io.TeeReader(errorBody, ringBuffer)
9781	decoder := json.NewDecoder(body)
9782	decoder.UseNumber()
9783	code, message, err := restjson.GetErrorInfo(decoder)
9784	if err != nil {
9785		var snapshot bytes.Buffer
9786		io.Copy(&snapshot, ringBuffer)
9787		err = &smithy.DeserializationError{
9788			Err:      fmt.Errorf("failed to decode response body, %w", err),
9789			Snapshot: snapshot.Bytes(),
9790		}
9791		return err
9792	}
9793
9794	errorBody.Seek(0, io.SeekStart)
9795	if len(code) != 0 {
9796		errorCode = restjson.SanitizeErrorCode(code)
9797	}
9798	if len(message) != 0 {
9799		errorMessage = message
9800	}
9801
9802	switch {
9803	case strings.EqualFold("AccessDeniedException", errorCode):
9804		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
9805
9806	case strings.EqualFold("InternalFailureException", errorCode):
9807		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
9808
9809	case strings.EqualFold("InvalidParameterValueException", errorCode):
9810		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
9811
9812	case strings.EqualFold("ResourceNotFoundException", errorCode):
9813		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
9814
9815	case strings.EqualFold("ThrottlingException", errorCode):
9816		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
9817
9818	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
9819		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
9820
9821	default:
9822		genericError := &smithy.GenericAPIError{
9823			Code:    errorCode,
9824			Message: errorMessage,
9825		}
9826		return genericError
9827
9828	}
9829}
9830
9831func awsRestjson1_deserializeOpHttpBindingsDescribeThemePermissionsOutput(v *DescribeThemePermissionsOutput, response *smithyhttp.Response) error {
9832	if v == nil {
9833		return fmt.Errorf("unsupported deserialization for nil %T", v)
9834	}
9835
9836	v.Status = int32(response.StatusCode)
9837
9838	return nil
9839}
9840func awsRestjson1_deserializeOpDocumentDescribeThemePermissionsOutput(v **DescribeThemePermissionsOutput, value interface{}) error {
9841	if v == nil {
9842		return fmt.Errorf("unexpected nil of type %T", v)
9843	}
9844	if value == nil {
9845		return nil
9846	}
9847
9848	shape, ok := value.(map[string]interface{})
9849	if !ok {
9850		return fmt.Errorf("unexpected JSON type %v", value)
9851	}
9852
9853	var sv *DescribeThemePermissionsOutput
9854	if *v == nil {
9855		sv = &DescribeThemePermissionsOutput{}
9856	} else {
9857		sv = *v
9858	}
9859
9860	for key, value := range shape {
9861		switch key {
9862		case "Permissions":
9863			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
9864				return err
9865			}
9866
9867		case "RequestId":
9868			if value != nil {
9869				jtv, ok := value.(string)
9870				if !ok {
9871					return fmt.Errorf("expected String to be of type string, got %T instead", value)
9872				}
9873				sv.RequestId = ptr.String(jtv)
9874			}
9875
9876		case "ThemeArn":
9877			if value != nil {
9878				jtv, ok := value.(string)
9879				if !ok {
9880					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
9881				}
9882				sv.ThemeArn = ptr.String(jtv)
9883			}
9884
9885		case "ThemeId":
9886			if value != nil {
9887				jtv, ok := value.(string)
9888				if !ok {
9889					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
9890				}
9891				sv.ThemeId = ptr.String(jtv)
9892			}
9893
9894		default:
9895			_, _ = key, value
9896
9897		}
9898	}
9899	*v = sv
9900	return nil
9901}
9902
9903type awsRestjson1_deserializeOpDescribeUser struct {
9904}
9905
9906func (*awsRestjson1_deserializeOpDescribeUser) ID() string {
9907	return "OperationDeserializer"
9908}
9909
9910func (m *awsRestjson1_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
9911	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
9912) {
9913	out, metadata, err = next.HandleDeserialize(ctx, in)
9914	if err != nil {
9915		return out, metadata, err
9916	}
9917
9918	response, ok := out.RawResponse.(*smithyhttp.Response)
9919	if !ok {
9920		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
9921	}
9922
9923	if response.StatusCode < 200 || response.StatusCode >= 300 {
9924		return out, metadata, awsRestjson1_deserializeOpErrorDescribeUser(response, &metadata)
9925	}
9926	output := &DescribeUserOutput{}
9927	out.Result = output
9928
9929	err = awsRestjson1_deserializeOpHttpBindingsDescribeUserOutput(output, response)
9930	if err != nil {
9931		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
9932	}
9933
9934	var buff [1024]byte
9935	ringBuffer := smithyio.NewRingBuffer(buff[:])
9936
9937	body := io.TeeReader(response.Body, ringBuffer)
9938
9939	decoder := json.NewDecoder(body)
9940	decoder.UseNumber()
9941	var shape interface{}
9942	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
9943		var snapshot bytes.Buffer
9944		io.Copy(&snapshot, ringBuffer)
9945		err = &smithy.DeserializationError{
9946			Err:      fmt.Errorf("failed to decode response body, %w", err),
9947			Snapshot: snapshot.Bytes(),
9948		}
9949		return out, metadata, err
9950	}
9951
9952	err = awsRestjson1_deserializeOpDocumentDescribeUserOutput(&output, shape)
9953	if err != nil {
9954		var snapshot bytes.Buffer
9955		io.Copy(&snapshot, ringBuffer)
9956		return out, metadata, &smithy.DeserializationError{
9957			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
9958			Snapshot: snapshot.Bytes(),
9959		}
9960	}
9961
9962	return out, metadata, err
9963}
9964
9965func awsRestjson1_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
9966	var errorBuffer bytes.Buffer
9967	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
9968		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
9969	}
9970	errorBody := bytes.NewReader(errorBuffer.Bytes())
9971
9972	errorCode := "UnknownError"
9973	errorMessage := errorCode
9974
9975	code := response.Header.Get("X-Amzn-ErrorType")
9976	if len(code) != 0 {
9977		errorCode = restjson.SanitizeErrorCode(code)
9978	}
9979
9980	var buff [1024]byte
9981	ringBuffer := smithyio.NewRingBuffer(buff[:])
9982
9983	body := io.TeeReader(errorBody, ringBuffer)
9984	decoder := json.NewDecoder(body)
9985	decoder.UseNumber()
9986	code, message, err := restjson.GetErrorInfo(decoder)
9987	if err != nil {
9988		var snapshot bytes.Buffer
9989		io.Copy(&snapshot, ringBuffer)
9990		err = &smithy.DeserializationError{
9991			Err:      fmt.Errorf("failed to decode response body, %w", err),
9992			Snapshot: snapshot.Bytes(),
9993		}
9994		return err
9995	}
9996
9997	errorBody.Seek(0, io.SeekStart)
9998	if len(code) != 0 {
9999		errorCode = restjson.SanitizeErrorCode(code)
10000	}
10001	if len(message) != 0 {
10002		errorMessage = message
10003	}
10004
10005	switch {
10006	case strings.EqualFold("AccessDeniedException", errorCode):
10007		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
10008
10009	case strings.EqualFold("InternalFailureException", errorCode):
10010		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10011
10012	case strings.EqualFold("InvalidParameterValueException", errorCode):
10013		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
10014
10015	case strings.EqualFold("PreconditionNotMetException", errorCode):
10016		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
10017
10018	case strings.EqualFold("ResourceNotFoundException", errorCode):
10019		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10020
10021	case strings.EqualFold("ResourceUnavailableException", errorCode):
10022		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
10023
10024	case strings.EqualFold("ThrottlingException", errorCode):
10025		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10026
10027	default:
10028		genericError := &smithy.GenericAPIError{
10029			Code:    errorCode,
10030			Message: errorMessage,
10031		}
10032		return genericError
10033
10034	}
10035}
10036
10037func awsRestjson1_deserializeOpHttpBindingsDescribeUserOutput(v *DescribeUserOutput, response *smithyhttp.Response) error {
10038	if v == nil {
10039		return fmt.Errorf("unsupported deserialization for nil %T", v)
10040	}
10041
10042	v.Status = int32(response.StatusCode)
10043
10044	return nil
10045}
10046func awsRestjson1_deserializeOpDocumentDescribeUserOutput(v **DescribeUserOutput, value interface{}) error {
10047	if v == nil {
10048		return fmt.Errorf("unexpected nil of type %T", v)
10049	}
10050	if value == nil {
10051		return nil
10052	}
10053
10054	shape, ok := value.(map[string]interface{})
10055	if !ok {
10056		return fmt.Errorf("unexpected JSON type %v", value)
10057	}
10058
10059	var sv *DescribeUserOutput
10060	if *v == nil {
10061		sv = &DescribeUserOutput{}
10062	} else {
10063		sv = *v
10064	}
10065
10066	for key, value := range shape {
10067		switch key {
10068		case "RequestId":
10069			if value != nil {
10070				jtv, ok := value.(string)
10071				if !ok {
10072					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10073				}
10074				sv.RequestId = ptr.String(jtv)
10075			}
10076
10077		case "User":
10078			if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil {
10079				return err
10080			}
10081
10082		default:
10083			_, _ = key, value
10084
10085		}
10086	}
10087	*v = sv
10088	return nil
10089}
10090
10091type awsRestjson1_deserializeOpGetDashboardEmbedUrl struct {
10092}
10093
10094func (*awsRestjson1_deserializeOpGetDashboardEmbedUrl) ID() string {
10095	return "OperationDeserializer"
10096}
10097
10098func (m *awsRestjson1_deserializeOpGetDashboardEmbedUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10099	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10100) {
10101	out, metadata, err = next.HandleDeserialize(ctx, in)
10102	if err != nil {
10103		return out, metadata, err
10104	}
10105
10106	response, ok := out.RawResponse.(*smithyhttp.Response)
10107	if !ok {
10108		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10109	}
10110
10111	if response.StatusCode < 200 || response.StatusCode >= 300 {
10112		return out, metadata, awsRestjson1_deserializeOpErrorGetDashboardEmbedUrl(response, &metadata)
10113	}
10114	output := &GetDashboardEmbedUrlOutput{}
10115	out.Result = output
10116
10117	err = awsRestjson1_deserializeOpHttpBindingsGetDashboardEmbedUrlOutput(output, response)
10118	if err != nil {
10119		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
10120	}
10121
10122	var buff [1024]byte
10123	ringBuffer := smithyio.NewRingBuffer(buff[:])
10124
10125	body := io.TeeReader(response.Body, ringBuffer)
10126
10127	decoder := json.NewDecoder(body)
10128	decoder.UseNumber()
10129	var shape interface{}
10130	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10131		var snapshot bytes.Buffer
10132		io.Copy(&snapshot, ringBuffer)
10133		err = &smithy.DeserializationError{
10134			Err:      fmt.Errorf("failed to decode response body, %w", err),
10135			Snapshot: snapshot.Bytes(),
10136		}
10137		return out, metadata, err
10138	}
10139
10140	err = awsRestjson1_deserializeOpDocumentGetDashboardEmbedUrlOutput(&output, shape)
10141	if err != nil {
10142		var snapshot bytes.Buffer
10143		io.Copy(&snapshot, ringBuffer)
10144		return out, metadata, &smithy.DeserializationError{
10145			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10146			Snapshot: snapshot.Bytes(),
10147		}
10148	}
10149
10150	return out, metadata, err
10151}
10152
10153func awsRestjson1_deserializeOpErrorGetDashboardEmbedUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10154	var errorBuffer bytes.Buffer
10155	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10156		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10157	}
10158	errorBody := bytes.NewReader(errorBuffer.Bytes())
10159
10160	errorCode := "UnknownError"
10161	errorMessage := errorCode
10162
10163	code := response.Header.Get("X-Amzn-ErrorType")
10164	if len(code) != 0 {
10165		errorCode = restjson.SanitizeErrorCode(code)
10166	}
10167
10168	var buff [1024]byte
10169	ringBuffer := smithyio.NewRingBuffer(buff[:])
10170
10171	body := io.TeeReader(errorBody, ringBuffer)
10172	decoder := json.NewDecoder(body)
10173	decoder.UseNumber()
10174	code, message, err := restjson.GetErrorInfo(decoder)
10175	if err != nil {
10176		var snapshot bytes.Buffer
10177		io.Copy(&snapshot, ringBuffer)
10178		err = &smithy.DeserializationError{
10179			Err:      fmt.Errorf("failed to decode response body, %w", err),
10180			Snapshot: snapshot.Bytes(),
10181		}
10182		return err
10183	}
10184
10185	errorBody.Seek(0, io.SeekStart)
10186	if len(code) != 0 {
10187		errorCode = restjson.SanitizeErrorCode(code)
10188	}
10189	if len(message) != 0 {
10190		errorMessage = message
10191	}
10192
10193	switch {
10194	case strings.EqualFold("AccessDeniedException", errorCode):
10195		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
10196
10197	case strings.EqualFold("DomainNotWhitelistedException", errorCode):
10198		return awsRestjson1_deserializeErrorDomainNotWhitelistedException(response, errorBody)
10199
10200	case strings.EqualFold("IdentityTypeNotSupportedException", errorCode):
10201		return awsRestjson1_deserializeErrorIdentityTypeNotSupportedException(response, errorBody)
10202
10203	case strings.EqualFold("InternalFailureException", errorCode):
10204		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10205
10206	case strings.EqualFold("InvalidParameterValueException", errorCode):
10207		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
10208
10209	case strings.EqualFold("QuickSightUserNotFoundException", errorCode):
10210		return awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response, errorBody)
10211
10212	case strings.EqualFold("ResourceExistsException", errorCode):
10213		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
10214
10215	case strings.EqualFold("ResourceNotFoundException", errorCode):
10216		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10217
10218	case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode):
10219		return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody)
10220
10221	case strings.EqualFold("ThrottlingException", errorCode):
10222		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10223
10224	case strings.EqualFold("UnsupportedPricingPlanException", errorCode):
10225		return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody)
10226
10227	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
10228		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
10229
10230	default:
10231		genericError := &smithy.GenericAPIError{
10232			Code:    errorCode,
10233			Message: errorMessage,
10234		}
10235		return genericError
10236
10237	}
10238}
10239
10240func awsRestjson1_deserializeOpHttpBindingsGetDashboardEmbedUrlOutput(v *GetDashboardEmbedUrlOutput, response *smithyhttp.Response) error {
10241	if v == nil {
10242		return fmt.Errorf("unsupported deserialization for nil %T", v)
10243	}
10244
10245	v.Status = int32(response.StatusCode)
10246
10247	return nil
10248}
10249func awsRestjson1_deserializeOpDocumentGetDashboardEmbedUrlOutput(v **GetDashboardEmbedUrlOutput, value interface{}) error {
10250	if v == nil {
10251		return fmt.Errorf("unexpected nil of type %T", v)
10252	}
10253	if value == nil {
10254		return nil
10255	}
10256
10257	shape, ok := value.(map[string]interface{})
10258	if !ok {
10259		return fmt.Errorf("unexpected JSON type %v", value)
10260	}
10261
10262	var sv *GetDashboardEmbedUrlOutput
10263	if *v == nil {
10264		sv = &GetDashboardEmbedUrlOutput{}
10265	} else {
10266		sv = *v
10267	}
10268
10269	for key, value := range shape {
10270		switch key {
10271		case "EmbedUrl":
10272			if value != nil {
10273				jtv, ok := value.(string)
10274				if !ok {
10275					return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value)
10276				}
10277				sv.EmbedUrl = ptr.String(jtv)
10278			}
10279
10280		case "RequestId":
10281			if value != nil {
10282				jtv, ok := value.(string)
10283				if !ok {
10284					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10285				}
10286				sv.RequestId = ptr.String(jtv)
10287			}
10288
10289		default:
10290			_, _ = key, value
10291
10292		}
10293	}
10294	*v = sv
10295	return nil
10296}
10297
10298type awsRestjson1_deserializeOpGetSessionEmbedUrl struct {
10299}
10300
10301func (*awsRestjson1_deserializeOpGetSessionEmbedUrl) ID() string {
10302	return "OperationDeserializer"
10303}
10304
10305func (m *awsRestjson1_deserializeOpGetSessionEmbedUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10306	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10307) {
10308	out, metadata, err = next.HandleDeserialize(ctx, in)
10309	if err != nil {
10310		return out, metadata, err
10311	}
10312
10313	response, ok := out.RawResponse.(*smithyhttp.Response)
10314	if !ok {
10315		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10316	}
10317
10318	if response.StatusCode < 200 || response.StatusCode >= 300 {
10319		return out, metadata, awsRestjson1_deserializeOpErrorGetSessionEmbedUrl(response, &metadata)
10320	}
10321	output := &GetSessionEmbedUrlOutput{}
10322	out.Result = output
10323
10324	err = awsRestjson1_deserializeOpHttpBindingsGetSessionEmbedUrlOutput(output, response)
10325	if err != nil {
10326		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
10327	}
10328
10329	var buff [1024]byte
10330	ringBuffer := smithyio.NewRingBuffer(buff[:])
10331
10332	body := io.TeeReader(response.Body, ringBuffer)
10333
10334	decoder := json.NewDecoder(body)
10335	decoder.UseNumber()
10336	var shape interface{}
10337	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10338		var snapshot bytes.Buffer
10339		io.Copy(&snapshot, ringBuffer)
10340		err = &smithy.DeserializationError{
10341			Err:      fmt.Errorf("failed to decode response body, %w", err),
10342			Snapshot: snapshot.Bytes(),
10343		}
10344		return out, metadata, err
10345	}
10346
10347	err = awsRestjson1_deserializeOpDocumentGetSessionEmbedUrlOutput(&output, shape)
10348	if err != nil {
10349		var snapshot bytes.Buffer
10350		io.Copy(&snapshot, ringBuffer)
10351		return out, metadata, &smithy.DeserializationError{
10352			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10353			Snapshot: snapshot.Bytes(),
10354		}
10355	}
10356
10357	return out, metadata, err
10358}
10359
10360func awsRestjson1_deserializeOpErrorGetSessionEmbedUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10361	var errorBuffer bytes.Buffer
10362	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10363		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10364	}
10365	errorBody := bytes.NewReader(errorBuffer.Bytes())
10366
10367	errorCode := "UnknownError"
10368	errorMessage := errorCode
10369
10370	code := response.Header.Get("X-Amzn-ErrorType")
10371	if len(code) != 0 {
10372		errorCode = restjson.SanitizeErrorCode(code)
10373	}
10374
10375	var buff [1024]byte
10376	ringBuffer := smithyio.NewRingBuffer(buff[:])
10377
10378	body := io.TeeReader(errorBody, ringBuffer)
10379	decoder := json.NewDecoder(body)
10380	decoder.UseNumber()
10381	code, message, err := restjson.GetErrorInfo(decoder)
10382	if err != nil {
10383		var snapshot bytes.Buffer
10384		io.Copy(&snapshot, ringBuffer)
10385		err = &smithy.DeserializationError{
10386			Err:      fmt.Errorf("failed to decode response body, %w", err),
10387			Snapshot: snapshot.Bytes(),
10388		}
10389		return err
10390	}
10391
10392	errorBody.Seek(0, io.SeekStart)
10393	if len(code) != 0 {
10394		errorCode = restjson.SanitizeErrorCode(code)
10395	}
10396	if len(message) != 0 {
10397		errorMessage = message
10398	}
10399
10400	switch {
10401	case strings.EqualFold("AccessDeniedException", errorCode):
10402		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
10403
10404	case strings.EqualFold("InternalFailureException", errorCode):
10405		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10406
10407	case strings.EqualFold("InvalidParameterValueException", errorCode):
10408		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
10409
10410	case strings.EqualFold("QuickSightUserNotFoundException", errorCode):
10411		return awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response, errorBody)
10412
10413	case strings.EqualFold("ResourceExistsException", errorCode):
10414		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
10415
10416	case strings.EqualFold("ResourceNotFoundException", errorCode):
10417		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10418
10419	case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode):
10420		return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody)
10421
10422	case strings.EqualFold("ThrottlingException", errorCode):
10423		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10424
10425	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
10426		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
10427
10428	default:
10429		genericError := &smithy.GenericAPIError{
10430			Code:    errorCode,
10431			Message: errorMessage,
10432		}
10433		return genericError
10434
10435	}
10436}
10437
10438func awsRestjson1_deserializeOpHttpBindingsGetSessionEmbedUrlOutput(v *GetSessionEmbedUrlOutput, response *smithyhttp.Response) error {
10439	if v == nil {
10440		return fmt.Errorf("unsupported deserialization for nil %T", v)
10441	}
10442
10443	v.Status = int32(response.StatusCode)
10444
10445	return nil
10446}
10447func awsRestjson1_deserializeOpDocumentGetSessionEmbedUrlOutput(v **GetSessionEmbedUrlOutput, value interface{}) error {
10448	if v == nil {
10449		return fmt.Errorf("unexpected nil of type %T", v)
10450	}
10451	if value == nil {
10452		return nil
10453	}
10454
10455	shape, ok := value.(map[string]interface{})
10456	if !ok {
10457		return fmt.Errorf("unexpected JSON type %v", value)
10458	}
10459
10460	var sv *GetSessionEmbedUrlOutput
10461	if *v == nil {
10462		sv = &GetSessionEmbedUrlOutput{}
10463	} else {
10464		sv = *v
10465	}
10466
10467	for key, value := range shape {
10468		switch key {
10469		case "EmbedUrl":
10470			if value != nil {
10471				jtv, ok := value.(string)
10472				if !ok {
10473					return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value)
10474				}
10475				sv.EmbedUrl = ptr.String(jtv)
10476			}
10477
10478		case "RequestId":
10479			if value != nil {
10480				jtv, ok := value.(string)
10481				if !ok {
10482					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10483				}
10484				sv.RequestId = ptr.String(jtv)
10485			}
10486
10487		default:
10488			_, _ = key, value
10489
10490		}
10491	}
10492	*v = sv
10493	return nil
10494}
10495
10496type awsRestjson1_deserializeOpListAnalyses struct {
10497}
10498
10499func (*awsRestjson1_deserializeOpListAnalyses) ID() string {
10500	return "OperationDeserializer"
10501}
10502
10503func (m *awsRestjson1_deserializeOpListAnalyses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10504	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10505) {
10506	out, metadata, err = next.HandleDeserialize(ctx, in)
10507	if err != nil {
10508		return out, metadata, err
10509	}
10510
10511	response, ok := out.RawResponse.(*smithyhttp.Response)
10512	if !ok {
10513		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10514	}
10515
10516	if response.StatusCode < 200 || response.StatusCode >= 300 {
10517		return out, metadata, awsRestjson1_deserializeOpErrorListAnalyses(response, &metadata)
10518	}
10519	output := &ListAnalysesOutput{}
10520	out.Result = output
10521
10522	err = awsRestjson1_deserializeOpHttpBindingsListAnalysesOutput(output, response)
10523	if err != nil {
10524		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
10525	}
10526
10527	var buff [1024]byte
10528	ringBuffer := smithyio.NewRingBuffer(buff[:])
10529
10530	body := io.TeeReader(response.Body, ringBuffer)
10531
10532	decoder := json.NewDecoder(body)
10533	decoder.UseNumber()
10534	var shape interface{}
10535	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10536		var snapshot bytes.Buffer
10537		io.Copy(&snapshot, ringBuffer)
10538		err = &smithy.DeserializationError{
10539			Err:      fmt.Errorf("failed to decode response body, %w", err),
10540			Snapshot: snapshot.Bytes(),
10541		}
10542		return out, metadata, err
10543	}
10544
10545	err = awsRestjson1_deserializeOpDocumentListAnalysesOutput(&output, shape)
10546	if err != nil {
10547		var snapshot bytes.Buffer
10548		io.Copy(&snapshot, ringBuffer)
10549		return out, metadata, &smithy.DeserializationError{
10550			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10551			Snapshot: snapshot.Bytes(),
10552		}
10553	}
10554
10555	return out, metadata, err
10556}
10557
10558func awsRestjson1_deserializeOpErrorListAnalyses(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10559	var errorBuffer bytes.Buffer
10560	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10561		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10562	}
10563	errorBody := bytes.NewReader(errorBuffer.Bytes())
10564
10565	errorCode := "UnknownError"
10566	errorMessage := errorCode
10567
10568	code := response.Header.Get("X-Amzn-ErrorType")
10569	if len(code) != 0 {
10570		errorCode = restjson.SanitizeErrorCode(code)
10571	}
10572
10573	var buff [1024]byte
10574	ringBuffer := smithyio.NewRingBuffer(buff[:])
10575
10576	body := io.TeeReader(errorBody, ringBuffer)
10577	decoder := json.NewDecoder(body)
10578	decoder.UseNumber()
10579	code, message, err := restjson.GetErrorInfo(decoder)
10580	if err != nil {
10581		var snapshot bytes.Buffer
10582		io.Copy(&snapshot, ringBuffer)
10583		err = &smithy.DeserializationError{
10584			Err:      fmt.Errorf("failed to decode response body, %w", err),
10585			Snapshot: snapshot.Bytes(),
10586		}
10587		return err
10588	}
10589
10590	errorBody.Seek(0, io.SeekStart)
10591	if len(code) != 0 {
10592		errorCode = restjson.SanitizeErrorCode(code)
10593	}
10594	if len(message) != 0 {
10595		errorMessage = message
10596	}
10597
10598	switch {
10599	case strings.EqualFold("InternalFailureException", errorCode):
10600		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10601
10602	case strings.EqualFold("InvalidNextTokenException", errorCode):
10603		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
10604
10605	case strings.EqualFold("ThrottlingException", errorCode):
10606		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10607
10608	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
10609		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
10610
10611	default:
10612		genericError := &smithy.GenericAPIError{
10613			Code:    errorCode,
10614			Message: errorMessage,
10615		}
10616		return genericError
10617
10618	}
10619}
10620
10621func awsRestjson1_deserializeOpHttpBindingsListAnalysesOutput(v *ListAnalysesOutput, response *smithyhttp.Response) error {
10622	if v == nil {
10623		return fmt.Errorf("unsupported deserialization for nil %T", v)
10624	}
10625
10626	v.Status = int32(response.StatusCode)
10627
10628	return nil
10629}
10630func awsRestjson1_deserializeOpDocumentListAnalysesOutput(v **ListAnalysesOutput, value interface{}) error {
10631	if v == nil {
10632		return fmt.Errorf("unexpected nil of type %T", v)
10633	}
10634	if value == nil {
10635		return nil
10636	}
10637
10638	shape, ok := value.(map[string]interface{})
10639	if !ok {
10640		return fmt.Errorf("unexpected JSON type %v", value)
10641	}
10642
10643	var sv *ListAnalysesOutput
10644	if *v == nil {
10645		sv = &ListAnalysesOutput{}
10646	} else {
10647		sv = *v
10648	}
10649
10650	for key, value := range shape {
10651		switch key {
10652		case "AnalysisSummaryList":
10653			if err := awsRestjson1_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, value); err != nil {
10654				return err
10655			}
10656
10657		case "NextToken":
10658			if value != nil {
10659				jtv, ok := value.(string)
10660				if !ok {
10661					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10662				}
10663				sv.NextToken = ptr.String(jtv)
10664			}
10665
10666		case "RequestId":
10667			if value != nil {
10668				jtv, ok := value.(string)
10669				if !ok {
10670					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10671				}
10672				sv.RequestId = ptr.String(jtv)
10673			}
10674
10675		default:
10676			_, _ = key, value
10677
10678		}
10679	}
10680	*v = sv
10681	return nil
10682}
10683
10684type awsRestjson1_deserializeOpListDashboards struct {
10685}
10686
10687func (*awsRestjson1_deserializeOpListDashboards) ID() string {
10688	return "OperationDeserializer"
10689}
10690
10691func (m *awsRestjson1_deserializeOpListDashboards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10692	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10693) {
10694	out, metadata, err = next.HandleDeserialize(ctx, in)
10695	if err != nil {
10696		return out, metadata, err
10697	}
10698
10699	response, ok := out.RawResponse.(*smithyhttp.Response)
10700	if !ok {
10701		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10702	}
10703
10704	if response.StatusCode < 200 || response.StatusCode >= 300 {
10705		return out, metadata, awsRestjson1_deserializeOpErrorListDashboards(response, &metadata)
10706	}
10707	output := &ListDashboardsOutput{}
10708	out.Result = output
10709
10710	err = awsRestjson1_deserializeOpHttpBindingsListDashboardsOutput(output, response)
10711	if err != nil {
10712		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
10713	}
10714
10715	var buff [1024]byte
10716	ringBuffer := smithyio.NewRingBuffer(buff[:])
10717
10718	body := io.TeeReader(response.Body, ringBuffer)
10719
10720	decoder := json.NewDecoder(body)
10721	decoder.UseNumber()
10722	var shape interface{}
10723	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10724		var snapshot bytes.Buffer
10725		io.Copy(&snapshot, ringBuffer)
10726		err = &smithy.DeserializationError{
10727			Err:      fmt.Errorf("failed to decode response body, %w", err),
10728			Snapshot: snapshot.Bytes(),
10729		}
10730		return out, metadata, err
10731	}
10732
10733	err = awsRestjson1_deserializeOpDocumentListDashboardsOutput(&output, shape)
10734	if err != nil {
10735		var snapshot bytes.Buffer
10736		io.Copy(&snapshot, ringBuffer)
10737		return out, metadata, &smithy.DeserializationError{
10738			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10739			Snapshot: snapshot.Bytes(),
10740		}
10741	}
10742
10743	return out, metadata, err
10744}
10745
10746func awsRestjson1_deserializeOpErrorListDashboards(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10747	var errorBuffer bytes.Buffer
10748	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10749		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10750	}
10751	errorBody := bytes.NewReader(errorBuffer.Bytes())
10752
10753	errorCode := "UnknownError"
10754	errorMessage := errorCode
10755
10756	code := response.Header.Get("X-Amzn-ErrorType")
10757	if len(code) != 0 {
10758		errorCode = restjson.SanitizeErrorCode(code)
10759	}
10760
10761	var buff [1024]byte
10762	ringBuffer := smithyio.NewRingBuffer(buff[:])
10763
10764	body := io.TeeReader(errorBody, ringBuffer)
10765	decoder := json.NewDecoder(body)
10766	decoder.UseNumber()
10767	code, message, err := restjson.GetErrorInfo(decoder)
10768	if err != nil {
10769		var snapshot bytes.Buffer
10770		io.Copy(&snapshot, ringBuffer)
10771		err = &smithy.DeserializationError{
10772			Err:      fmt.Errorf("failed to decode response body, %w", err),
10773			Snapshot: snapshot.Bytes(),
10774		}
10775		return err
10776	}
10777
10778	errorBody.Seek(0, io.SeekStart)
10779	if len(code) != 0 {
10780		errorCode = restjson.SanitizeErrorCode(code)
10781	}
10782	if len(message) != 0 {
10783		errorMessage = message
10784	}
10785
10786	switch {
10787	case strings.EqualFold("InternalFailureException", errorCode):
10788		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10789
10790	case strings.EqualFold("InvalidNextTokenException", errorCode):
10791		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
10792
10793	case strings.EqualFold("ThrottlingException", errorCode):
10794		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10795
10796	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
10797		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
10798
10799	default:
10800		genericError := &smithy.GenericAPIError{
10801			Code:    errorCode,
10802			Message: errorMessage,
10803		}
10804		return genericError
10805
10806	}
10807}
10808
10809func awsRestjson1_deserializeOpHttpBindingsListDashboardsOutput(v *ListDashboardsOutput, response *smithyhttp.Response) error {
10810	if v == nil {
10811		return fmt.Errorf("unsupported deserialization for nil %T", v)
10812	}
10813
10814	v.Status = int32(response.StatusCode)
10815
10816	return nil
10817}
10818func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOutput, value interface{}) error {
10819	if v == nil {
10820		return fmt.Errorf("unexpected nil of type %T", v)
10821	}
10822	if value == nil {
10823		return nil
10824	}
10825
10826	shape, ok := value.(map[string]interface{})
10827	if !ok {
10828		return fmt.Errorf("unexpected JSON type %v", value)
10829	}
10830
10831	var sv *ListDashboardsOutput
10832	if *v == nil {
10833		sv = &ListDashboardsOutput{}
10834	} else {
10835		sv = *v
10836	}
10837
10838	for key, value := range shape {
10839		switch key {
10840		case "DashboardSummaryList":
10841			if err := awsRestjson1_deserializeDocumentDashboardSummaryList(&sv.DashboardSummaryList, value); err != nil {
10842				return err
10843			}
10844
10845		case "NextToken":
10846			if value != nil {
10847				jtv, ok := value.(string)
10848				if !ok {
10849					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10850				}
10851				sv.NextToken = ptr.String(jtv)
10852			}
10853
10854		case "RequestId":
10855			if value != nil {
10856				jtv, ok := value.(string)
10857				if !ok {
10858					return fmt.Errorf("expected String to be of type string, got %T instead", value)
10859				}
10860				sv.RequestId = ptr.String(jtv)
10861			}
10862
10863		default:
10864			_, _ = key, value
10865
10866		}
10867	}
10868	*v = sv
10869	return nil
10870}
10871
10872type awsRestjson1_deserializeOpListDashboardVersions struct {
10873}
10874
10875func (*awsRestjson1_deserializeOpListDashboardVersions) ID() string {
10876	return "OperationDeserializer"
10877}
10878
10879func (m *awsRestjson1_deserializeOpListDashboardVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
10880	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
10881) {
10882	out, metadata, err = next.HandleDeserialize(ctx, in)
10883	if err != nil {
10884		return out, metadata, err
10885	}
10886
10887	response, ok := out.RawResponse.(*smithyhttp.Response)
10888	if !ok {
10889		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
10890	}
10891
10892	if response.StatusCode < 200 || response.StatusCode >= 300 {
10893		return out, metadata, awsRestjson1_deserializeOpErrorListDashboardVersions(response, &metadata)
10894	}
10895	output := &ListDashboardVersionsOutput{}
10896	out.Result = output
10897
10898	err = awsRestjson1_deserializeOpHttpBindingsListDashboardVersionsOutput(output, response)
10899	if err != nil {
10900		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
10901	}
10902
10903	var buff [1024]byte
10904	ringBuffer := smithyio.NewRingBuffer(buff[:])
10905
10906	body := io.TeeReader(response.Body, ringBuffer)
10907
10908	decoder := json.NewDecoder(body)
10909	decoder.UseNumber()
10910	var shape interface{}
10911	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
10912		var snapshot bytes.Buffer
10913		io.Copy(&snapshot, ringBuffer)
10914		err = &smithy.DeserializationError{
10915			Err:      fmt.Errorf("failed to decode response body, %w", err),
10916			Snapshot: snapshot.Bytes(),
10917		}
10918		return out, metadata, err
10919	}
10920
10921	err = awsRestjson1_deserializeOpDocumentListDashboardVersionsOutput(&output, shape)
10922	if err != nil {
10923		var snapshot bytes.Buffer
10924		io.Copy(&snapshot, ringBuffer)
10925		return out, metadata, &smithy.DeserializationError{
10926			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
10927			Snapshot: snapshot.Bytes(),
10928		}
10929	}
10930
10931	return out, metadata, err
10932}
10933
10934func awsRestjson1_deserializeOpErrorListDashboardVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
10935	var errorBuffer bytes.Buffer
10936	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
10937		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
10938	}
10939	errorBody := bytes.NewReader(errorBuffer.Bytes())
10940
10941	errorCode := "UnknownError"
10942	errorMessage := errorCode
10943
10944	code := response.Header.Get("X-Amzn-ErrorType")
10945	if len(code) != 0 {
10946		errorCode = restjson.SanitizeErrorCode(code)
10947	}
10948
10949	var buff [1024]byte
10950	ringBuffer := smithyio.NewRingBuffer(buff[:])
10951
10952	body := io.TeeReader(errorBody, ringBuffer)
10953	decoder := json.NewDecoder(body)
10954	decoder.UseNumber()
10955	code, message, err := restjson.GetErrorInfo(decoder)
10956	if err != nil {
10957		var snapshot bytes.Buffer
10958		io.Copy(&snapshot, ringBuffer)
10959		err = &smithy.DeserializationError{
10960			Err:      fmt.Errorf("failed to decode response body, %w", err),
10961			Snapshot: snapshot.Bytes(),
10962		}
10963		return err
10964	}
10965
10966	errorBody.Seek(0, io.SeekStart)
10967	if len(code) != 0 {
10968		errorCode = restjson.SanitizeErrorCode(code)
10969	}
10970	if len(message) != 0 {
10971		errorMessage = message
10972	}
10973
10974	switch {
10975	case strings.EqualFold("InternalFailureException", errorCode):
10976		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
10977
10978	case strings.EqualFold("InvalidNextTokenException", errorCode):
10979		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
10980
10981	case strings.EqualFold("InvalidParameterValueException", errorCode):
10982		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
10983
10984	case strings.EqualFold("ResourceNotFoundException", errorCode):
10985		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
10986
10987	case strings.EqualFold("ThrottlingException", errorCode):
10988		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
10989
10990	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
10991		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
10992
10993	default:
10994		genericError := &smithy.GenericAPIError{
10995			Code:    errorCode,
10996			Message: errorMessage,
10997		}
10998		return genericError
10999
11000	}
11001}
11002
11003func awsRestjson1_deserializeOpHttpBindingsListDashboardVersionsOutput(v *ListDashboardVersionsOutput, response *smithyhttp.Response) error {
11004	if v == nil {
11005		return fmt.Errorf("unsupported deserialization for nil %T", v)
11006	}
11007
11008	v.Status = int32(response.StatusCode)
11009
11010	return nil
11011}
11012func awsRestjson1_deserializeOpDocumentListDashboardVersionsOutput(v **ListDashboardVersionsOutput, value interface{}) error {
11013	if v == nil {
11014		return fmt.Errorf("unexpected nil of type %T", v)
11015	}
11016	if value == nil {
11017		return nil
11018	}
11019
11020	shape, ok := value.(map[string]interface{})
11021	if !ok {
11022		return fmt.Errorf("unexpected JSON type %v", value)
11023	}
11024
11025	var sv *ListDashboardVersionsOutput
11026	if *v == nil {
11027		sv = &ListDashboardVersionsOutput{}
11028	} else {
11029		sv = *v
11030	}
11031
11032	for key, value := range shape {
11033		switch key {
11034		case "DashboardVersionSummaryList":
11035			if err := awsRestjson1_deserializeDocumentDashboardVersionSummaryList(&sv.DashboardVersionSummaryList, value); err != nil {
11036				return err
11037			}
11038
11039		case "NextToken":
11040			if value != nil {
11041				jtv, ok := value.(string)
11042				if !ok {
11043					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11044				}
11045				sv.NextToken = ptr.String(jtv)
11046			}
11047
11048		case "RequestId":
11049			if value != nil {
11050				jtv, ok := value.(string)
11051				if !ok {
11052					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11053				}
11054				sv.RequestId = ptr.String(jtv)
11055			}
11056
11057		default:
11058			_, _ = key, value
11059
11060		}
11061	}
11062	*v = sv
11063	return nil
11064}
11065
11066type awsRestjson1_deserializeOpListDataSets struct {
11067}
11068
11069func (*awsRestjson1_deserializeOpListDataSets) ID() string {
11070	return "OperationDeserializer"
11071}
11072
11073func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11074	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11075) {
11076	out, metadata, err = next.HandleDeserialize(ctx, in)
11077	if err != nil {
11078		return out, metadata, err
11079	}
11080
11081	response, ok := out.RawResponse.(*smithyhttp.Response)
11082	if !ok {
11083		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11084	}
11085
11086	if response.StatusCode < 200 || response.StatusCode >= 300 {
11087		return out, metadata, awsRestjson1_deserializeOpErrorListDataSets(response, &metadata)
11088	}
11089	output := &ListDataSetsOutput{}
11090	out.Result = output
11091
11092	err = awsRestjson1_deserializeOpHttpBindingsListDataSetsOutput(output, response)
11093	if err != nil {
11094		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
11095	}
11096
11097	var buff [1024]byte
11098	ringBuffer := smithyio.NewRingBuffer(buff[:])
11099
11100	body := io.TeeReader(response.Body, ringBuffer)
11101
11102	decoder := json.NewDecoder(body)
11103	decoder.UseNumber()
11104	var shape interface{}
11105	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11106		var snapshot bytes.Buffer
11107		io.Copy(&snapshot, ringBuffer)
11108		err = &smithy.DeserializationError{
11109			Err:      fmt.Errorf("failed to decode response body, %w", err),
11110			Snapshot: snapshot.Bytes(),
11111		}
11112		return out, metadata, err
11113	}
11114
11115	err = awsRestjson1_deserializeOpDocumentListDataSetsOutput(&output, shape)
11116	if err != nil {
11117		var snapshot bytes.Buffer
11118		io.Copy(&snapshot, ringBuffer)
11119		return out, metadata, &smithy.DeserializationError{
11120			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11121			Snapshot: snapshot.Bytes(),
11122		}
11123	}
11124
11125	return out, metadata, err
11126}
11127
11128func awsRestjson1_deserializeOpErrorListDataSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11129	var errorBuffer bytes.Buffer
11130	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11131		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11132	}
11133	errorBody := bytes.NewReader(errorBuffer.Bytes())
11134
11135	errorCode := "UnknownError"
11136	errorMessage := errorCode
11137
11138	code := response.Header.Get("X-Amzn-ErrorType")
11139	if len(code) != 0 {
11140		errorCode = restjson.SanitizeErrorCode(code)
11141	}
11142
11143	var buff [1024]byte
11144	ringBuffer := smithyio.NewRingBuffer(buff[:])
11145
11146	body := io.TeeReader(errorBody, ringBuffer)
11147	decoder := json.NewDecoder(body)
11148	decoder.UseNumber()
11149	code, message, err := restjson.GetErrorInfo(decoder)
11150	if err != nil {
11151		var snapshot bytes.Buffer
11152		io.Copy(&snapshot, ringBuffer)
11153		err = &smithy.DeserializationError{
11154			Err:      fmt.Errorf("failed to decode response body, %w", err),
11155			Snapshot: snapshot.Bytes(),
11156		}
11157		return err
11158	}
11159
11160	errorBody.Seek(0, io.SeekStart)
11161	if len(code) != 0 {
11162		errorCode = restjson.SanitizeErrorCode(code)
11163	}
11164	if len(message) != 0 {
11165		errorMessage = message
11166	}
11167
11168	switch {
11169	case strings.EqualFold("AccessDeniedException", errorCode):
11170		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
11171
11172	case strings.EqualFold("InternalFailureException", errorCode):
11173		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11174
11175	case strings.EqualFold("InvalidNextTokenException", errorCode):
11176		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
11177
11178	case strings.EqualFold("InvalidParameterValueException", errorCode):
11179		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
11180
11181	case strings.EqualFold("ThrottlingException", errorCode):
11182		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11183
11184	default:
11185		genericError := &smithy.GenericAPIError{
11186			Code:    errorCode,
11187			Message: errorMessage,
11188		}
11189		return genericError
11190
11191	}
11192}
11193
11194func awsRestjson1_deserializeOpHttpBindingsListDataSetsOutput(v *ListDataSetsOutput, response *smithyhttp.Response) error {
11195	if v == nil {
11196		return fmt.Errorf("unsupported deserialization for nil %T", v)
11197	}
11198
11199	v.Status = int32(response.StatusCode)
11200
11201	return nil
11202}
11203func awsRestjson1_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput, value interface{}) error {
11204	if v == nil {
11205		return fmt.Errorf("unexpected nil of type %T", v)
11206	}
11207	if value == nil {
11208		return nil
11209	}
11210
11211	shape, ok := value.(map[string]interface{})
11212	if !ok {
11213		return fmt.Errorf("unexpected JSON type %v", value)
11214	}
11215
11216	var sv *ListDataSetsOutput
11217	if *v == nil {
11218		sv = &ListDataSetsOutput{}
11219	} else {
11220		sv = *v
11221	}
11222
11223	for key, value := range shape {
11224		switch key {
11225		case "DataSetSummaries":
11226			if err := awsRestjson1_deserializeDocumentDataSetSummaryList(&sv.DataSetSummaries, value); err != nil {
11227				return err
11228			}
11229
11230		case "NextToken":
11231			if value != nil {
11232				jtv, ok := value.(string)
11233				if !ok {
11234					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11235				}
11236				sv.NextToken = ptr.String(jtv)
11237			}
11238
11239		case "RequestId":
11240			if value != nil {
11241				jtv, ok := value.(string)
11242				if !ok {
11243					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11244				}
11245				sv.RequestId = ptr.String(jtv)
11246			}
11247
11248		default:
11249			_, _ = key, value
11250
11251		}
11252	}
11253	*v = sv
11254	return nil
11255}
11256
11257type awsRestjson1_deserializeOpListDataSources struct {
11258}
11259
11260func (*awsRestjson1_deserializeOpListDataSources) ID() string {
11261	return "OperationDeserializer"
11262}
11263
11264func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11265	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11266) {
11267	out, metadata, err = next.HandleDeserialize(ctx, in)
11268	if err != nil {
11269		return out, metadata, err
11270	}
11271
11272	response, ok := out.RawResponse.(*smithyhttp.Response)
11273	if !ok {
11274		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11275	}
11276
11277	if response.StatusCode < 200 || response.StatusCode >= 300 {
11278		return out, metadata, awsRestjson1_deserializeOpErrorListDataSources(response, &metadata)
11279	}
11280	output := &ListDataSourcesOutput{}
11281	out.Result = output
11282
11283	err = awsRestjson1_deserializeOpHttpBindingsListDataSourcesOutput(output, response)
11284	if err != nil {
11285		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
11286	}
11287
11288	var buff [1024]byte
11289	ringBuffer := smithyio.NewRingBuffer(buff[:])
11290
11291	body := io.TeeReader(response.Body, ringBuffer)
11292
11293	decoder := json.NewDecoder(body)
11294	decoder.UseNumber()
11295	var shape interface{}
11296	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11297		var snapshot bytes.Buffer
11298		io.Copy(&snapshot, ringBuffer)
11299		err = &smithy.DeserializationError{
11300			Err:      fmt.Errorf("failed to decode response body, %w", err),
11301			Snapshot: snapshot.Bytes(),
11302		}
11303		return out, metadata, err
11304	}
11305
11306	err = awsRestjson1_deserializeOpDocumentListDataSourcesOutput(&output, shape)
11307	if err != nil {
11308		var snapshot bytes.Buffer
11309		io.Copy(&snapshot, ringBuffer)
11310		return out, metadata, &smithy.DeserializationError{
11311			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11312			Snapshot: snapshot.Bytes(),
11313		}
11314	}
11315
11316	return out, metadata, err
11317}
11318
11319func awsRestjson1_deserializeOpErrorListDataSources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11320	var errorBuffer bytes.Buffer
11321	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11322		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11323	}
11324	errorBody := bytes.NewReader(errorBuffer.Bytes())
11325
11326	errorCode := "UnknownError"
11327	errorMessage := errorCode
11328
11329	code := response.Header.Get("X-Amzn-ErrorType")
11330	if len(code) != 0 {
11331		errorCode = restjson.SanitizeErrorCode(code)
11332	}
11333
11334	var buff [1024]byte
11335	ringBuffer := smithyio.NewRingBuffer(buff[:])
11336
11337	body := io.TeeReader(errorBody, ringBuffer)
11338	decoder := json.NewDecoder(body)
11339	decoder.UseNumber()
11340	code, message, err := restjson.GetErrorInfo(decoder)
11341	if err != nil {
11342		var snapshot bytes.Buffer
11343		io.Copy(&snapshot, ringBuffer)
11344		err = &smithy.DeserializationError{
11345			Err:      fmt.Errorf("failed to decode response body, %w", err),
11346			Snapshot: snapshot.Bytes(),
11347		}
11348		return err
11349	}
11350
11351	errorBody.Seek(0, io.SeekStart)
11352	if len(code) != 0 {
11353		errorCode = restjson.SanitizeErrorCode(code)
11354	}
11355	if len(message) != 0 {
11356		errorMessage = message
11357	}
11358
11359	switch {
11360	case strings.EqualFold("AccessDeniedException", errorCode):
11361		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
11362
11363	case strings.EqualFold("InternalFailureException", errorCode):
11364		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11365
11366	case strings.EqualFold("InvalidNextTokenException", errorCode):
11367		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
11368
11369	case strings.EqualFold("InvalidParameterValueException", errorCode):
11370		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
11371
11372	case strings.EqualFold("ThrottlingException", errorCode):
11373		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11374
11375	default:
11376		genericError := &smithy.GenericAPIError{
11377			Code:    errorCode,
11378			Message: errorMessage,
11379		}
11380		return genericError
11381
11382	}
11383}
11384
11385func awsRestjson1_deserializeOpHttpBindingsListDataSourcesOutput(v *ListDataSourcesOutput, response *smithyhttp.Response) error {
11386	if v == nil {
11387		return fmt.Errorf("unsupported deserialization for nil %T", v)
11388	}
11389
11390	v.Status = int32(response.StatusCode)
11391
11392	return nil
11393}
11394func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSourcesOutput, value interface{}) error {
11395	if v == nil {
11396		return fmt.Errorf("unexpected nil of type %T", v)
11397	}
11398	if value == nil {
11399		return nil
11400	}
11401
11402	shape, ok := value.(map[string]interface{})
11403	if !ok {
11404		return fmt.Errorf("unexpected JSON type %v", value)
11405	}
11406
11407	var sv *ListDataSourcesOutput
11408	if *v == nil {
11409		sv = &ListDataSourcesOutput{}
11410	} else {
11411		sv = *v
11412	}
11413
11414	for key, value := range shape {
11415		switch key {
11416		case "DataSources":
11417			if err := awsRestjson1_deserializeDocumentDataSourceList(&sv.DataSources, value); err != nil {
11418				return err
11419			}
11420
11421		case "NextToken":
11422			if value != nil {
11423				jtv, ok := value.(string)
11424				if !ok {
11425					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11426				}
11427				sv.NextToken = ptr.String(jtv)
11428			}
11429
11430		case "RequestId":
11431			if value != nil {
11432				jtv, ok := value.(string)
11433				if !ok {
11434					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11435				}
11436				sv.RequestId = ptr.String(jtv)
11437			}
11438
11439		default:
11440			_, _ = key, value
11441
11442		}
11443	}
11444	*v = sv
11445	return nil
11446}
11447
11448type awsRestjson1_deserializeOpListGroupMemberships struct {
11449}
11450
11451func (*awsRestjson1_deserializeOpListGroupMemberships) ID() string {
11452	return "OperationDeserializer"
11453}
11454
11455func (m *awsRestjson1_deserializeOpListGroupMemberships) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11456	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11457) {
11458	out, metadata, err = next.HandleDeserialize(ctx, in)
11459	if err != nil {
11460		return out, metadata, err
11461	}
11462
11463	response, ok := out.RawResponse.(*smithyhttp.Response)
11464	if !ok {
11465		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11466	}
11467
11468	if response.StatusCode < 200 || response.StatusCode >= 300 {
11469		return out, metadata, awsRestjson1_deserializeOpErrorListGroupMemberships(response, &metadata)
11470	}
11471	output := &ListGroupMembershipsOutput{}
11472	out.Result = output
11473
11474	err = awsRestjson1_deserializeOpHttpBindingsListGroupMembershipsOutput(output, response)
11475	if err != nil {
11476		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
11477	}
11478
11479	var buff [1024]byte
11480	ringBuffer := smithyio.NewRingBuffer(buff[:])
11481
11482	body := io.TeeReader(response.Body, ringBuffer)
11483
11484	decoder := json.NewDecoder(body)
11485	decoder.UseNumber()
11486	var shape interface{}
11487	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11488		var snapshot bytes.Buffer
11489		io.Copy(&snapshot, ringBuffer)
11490		err = &smithy.DeserializationError{
11491			Err:      fmt.Errorf("failed to decode response body, %w", err),
11492			Snapshot: snapshot.Bytes(),
11493		}
11494		return out, metadata, err
11495	}
11496
11497	err = awsRestjson1_deserializeOpDocumentListGroupMembershipsOutput(&output, shape)
11498	if err != nil {
11499		var snapshot bytes.Buffer
11500		io.Copy(&snapshot, ringBuffer)
11501		return out, metadata, &smithy.DeserializationError{
11502			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11503			Snapshot: snapshot.Bytes(),
11504		}
11505	}
11506
11507	return out, metadata, err
11508}
11509
11510func awsRestjson1_deserializeOpErrorListGroupMemberships(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11511	var errorBuffer bytes.Buffer
11512	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11513		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11514	}
11515	errorBody := bytes.NewReader(errorBuffer.Bytes())
11516
11517	errorCode := "UnknownError"
11518	errorMessage := errorCode
11519
11520	code := response.Header.Get("X-Amzn-ErrorType")
11521	if len(code) != 0 {
11522		errorCode = restjson.SanitizeErrorCode(code)
11523	}
11524
11525	var buff [1024]byte
11526	ringBuffer := smithyio.NewRingBuffer(buff[:])
11527
11528	body := io.TeeReader(errorBody, ringBuffer)
11529	decoder := json.NewDecoder(body)
11530	decoder.UseNumber()
11531	code, message, err := restjson.GetErrorInfo(decoder)
11532	if err != nil {
11533		var snapshot bytes.Buffer
11534		io.Copy(&snapshot, ringBuffer)
11535		err = &smithy.DeserializationError{
11536			Err:      fmt.Errorf("failed to decode response body, %w", err),
11537			Snapshot: snapshot.Bytes(),
11538		}
11539		return err
11540	}
11541
11542	errorBody.Seek(0, io.SeekStart)
11543	if len(code) != 0 {
11544		errorCode = restjson.SanitizeErrorCode(code)
11545	}
11546	if len(message) != 0 {
11547		errorMessage = message
11548	}
11549
11550	switch {
11551	case strings.EqualFold("AccessDeniedException", errorCode):
11552		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
11553
11554	case strings.EqualFold("InternalFailureException", errorCode):
11555		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11556
11557	case strings.EqualFold("InvalidNextTokenException", errorCode):
11558		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
11559
11560	case strings.EqualFold("InvalidParameterValueException", errorCode):
11561		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
11562
11563	case strings.EqualFold("PreconditionNotMetException", errorCode):
11564		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
11565
11566	case strings.EqualFold("ResourceNotFoundException", errorCode):
11567		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11568
11569	case strings.EqualFold("ResourceUnavailableException", errorCode):
11570		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
11571
11572	case strings.EqualFold("ThrottlingException", errorCode):
11573		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11574
11575	default:
11576		genericError := &smithy.GenericAPIError{
11577			Code:    errorCode,
11578			Message: errorMessage,
11579		}
11580		return genericError
11581
11582	}
11583}
11584
11585func awsRestjson1_deserializeOpHttpBindingsListGroupMembershipsOutput(v *ListGroupMembershipsOutput, response *smithyhttp.Response) error {
11586	if v == nil {
11587		return fmt.Errorf("unsupported deserialization for nil %T", v)
11588	}
11589
11590	v.Status = int32(response.StatusCode)
11591
11592	return nil
11593}
11594func awsRestjson1_deserializeOpDocumentListGroupMembershipsOutput(v **ListGroupMembershipsOutput, value interface{}) error {
11595	if v == nil {
11596		return fmt.Errorf("unexpected nil of type %T", v)
11597	}
11598	if value == nil {
11599		return nil
11600	}
11601
11602	shape, ok := value.(map[string]interface{})
11603	if !ok {
11604		return fmt.Errorf("unexpected JSON type %v", value)
11605	}
11606
11607	var sv *ListGroupMembershipsOutput
11608	if *v == nil {
11609		sv = &ListGroupMembershipsOutput{}
11610	} else {
11611		sv = *v
11612	}
11613
11614	for key, value := range shape {
11615		switch key {
11616		case "GroupMemberList":
11617			if err := awsRestjson1_deserializeDocumentGroupMemberList(&sv.GroupMemberList, value); err != nil {
11618				return err
11619			}
11620
11621		case "NextToken":
11622			if value != nil {
11623				jtv, ok := value.(string)
11624				if !ok {
11625					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11626				}
11627				sv.NextToken = ptr.String(jtv)
11628			}
11629
11630		case "RequestId":
11631			if value != nil {
11632				jtv, ok := value.(string)
11633				if !ok {
11634					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11635				}
11636				sv.RequestId = ptr.String(jtv)
11637			}
11638
11639		default:
11640			_, _ = key, value
11641
11642		}
11643	}
11644	*v = sv
11645	return nil
11646}
11647
11648type awsRestjson1_deserializeOpListGroups struct {
11649}
11650
11651func (*awsRestjson1_deserializeOpListGroups) ID() string {
11652	return "OperationDeserializer"
11653}
11654
11655func (m *awsRestjson1_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11656	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11657) {
11658	out, metadata, err = next.HandleDeserialize(ctx, in)
11659	if err != nil {
11660		return out, metadata, err
11661	}
11662
11663	response, ok := out.RawResponse.(*smithyhttp.Response)
11664	if !ok {
11665		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11666	}
11667
11668	if response.StatusCode < 200 || response.StatusCode >= 300 {
11669		return out, metadata, awsRestjson1_deserializeOpErrorListGroups(response, &metadata)
11670	}
11671	output := &ListGroupsOutput{}
11672	out.Result = output
11673
11674	err = awsRestjson1_deserializeOpHttpBindingsListGroupsOutput(output, response)
11675	if err != nil {
11676		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
11677	}
11678
11679	var buff [1024]byte
11680	ringBuffer := smithyio.NewRingBuffer(buff[:])
11681
11682	body := io.TeeReader(response.Body, ringBuffer)
11683
11684	decoder := json.NewDecoder(body)
11685	decoder.UseNumber()
11686	var shape interface{}
11687	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11688		var snapshot bytes.Buffer
11689		io.Copy(&snapshot, ringBuffer)
11690		err = &smithy.DeserializationError{
11691			Err:      fmt.Errorf("failed to decode response body, %w", err),
11692			Snapshot: snapshot.Bytes(),
11693		}
11694		return out, metadata, err
11695	}
11696
11697	err = awsRestjson1_deserializeOpDocumentListGroupsOutput(&output, shape)
11698	if err != nil {
11699		var snapshot bytes.Buffer
11700		io.Copy(&snapshot, ringBuffer)
11701		return out, metadata, &smithy.DeserializationError{
11702			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11703			Snapshot: snapshot.Bytes(),
11704		}
11705	}
11706
11707	return out, metadata, err
11708}
11709
11710func awsRestjson1_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11711	var errorBuffer bytes.Buffer
11712	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11713		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11714	}
11715	errorBody := bytes.NewReader(errorBuffer.Bytes())
11716
11717	errorCode := "UnknownError"
11718	errorMessage := errorCode
11719
11720	code := response.Header.Get("X-Amzn-ErrorType")
11721	if len(code) != 0 {
11722		errorCode = restjson.SanitizeErrorCode(code)
11723	}
11724
11725	var buff [1024]byte
11726	ringBuffer := smithyio.NewRingBuffer(buff[:])
11727
11728	body := io.TeeReader(errorBody, ringBuffer)
11729	decoder := json.NewDecoder(body)
11730	decoder.UseNumber()
11731	code, message, err := restjson.GetErrorInfo(decoder)
11732	if err != nil {
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 err
11740	}
11741
11742	errorBody.Seek(0, io.SeekStart)
11743	if len(code) != 0 {
11744		errorCode = restjson.SanitizeErrorCode(code)
11745	}
11746	if len(message) != 0 {
11747		errorMessage = message
11748	}
11749
11750	switch {
11751	case strings.EqualFold("AccessDeniedException", errorCode):
11752		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
11753
11754	case strings.EqualFold("InternalFailureException", errorCode):
11755		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11756
11757	case strings.EqualFold("InvalidNextTokenException", errorCode):
11758		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
11759
11760	case strings.EqualFold("InvalidParameterValueException", errorCode):
11761		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
11762
11763	case strings.EqualFold("PreconditionNotMetException", errorCode):
11764		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
11765
11766	case strings.EqualFold("ResourceNotFoundException", errorCode):
11767		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11768
11769	case strings.EqualFold("ResourceUnavailableException", errorCode):
11770		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
11771
11772	case strings.EqualFold("ThrottlingException", errorCode):
11773		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11774
11775	default:
11776		genericError := &smithy.GenericAPIError{
11777			Code:    errorCode,
11778			Message: errorMessage,
11779		}
11780		return genericError
11781
11782	}
11783}
11784
11785func awsRestjson1_deserializeOpHttpBindingsListGroupsOutput(v *ListGroupsOutput, response *smithyhttp.Response) error {
11786	if v == nil {
11787		return fmt.Errorf("unsupported deserialization for nil %T", v)
11788	}
11789
11790	v.Status = int32(response.StatusCode)
11791
11792	return nil
11793}
11794func awsRestjson1_deserializeOpDocumentListGroupsOutput(v **ListGroupsOutput, value interface{}) error {
11795	if v == nil {
11796		return fmt.Errorf("unexpected nil of type %T", v)
11797	}
11798	if value == nil {
11799		return nil
11800	}
11801
11802	shape, ok := value.(map[string]interface{})
11803	if !ok {
11804		return fmt.Errorf("unexpected JSON type %v", value)
11805	}
11806
11807	var sv *ListGroupsOutput
11808	if *v == nil {
11809		sv = &ListGroupsOutput{}
11810	} else {
11811		sv = *v
11812	}
11813
11814	for key, value := range shape {
11815		switch key {
11816		case "GroupList":
11817			if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, value); err != nil {
11818				return err
11819			}
11820
11821		case "NextToken":
11822			if value != nil {
11823				jtv, ok := value.(string)
11824				if !ok {
11825					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11826				}
11827				sv.NextToken = ptr.String(jtv)
11828			}
11829
11830		case "RequestId":
11831			if value != nil {
11832				jtv, ok := value.(string)
11833				if !ok {
11834					return fmt.Errorf("expected String to be of type string, got %T instead", value)
11835				}
11836				sv.RequestId = ptr.String(jtv)
11837			}
11838
11839		default:
11840			_, _ = key, value
11841
11842		}
11843	}
11844	*v = sv
11845	return nil
11846}
11847
11848type awsRestjson1_deserializeOpListIAMPolicyAssignments struct {
11849}
11850
11851func (*awsRestjson1_deserializeOpListIAMPolicyAssignments) ID() string {
11852	return "OperationDeserializer"
11853}
11854
11855func (m *awsRestjson1_deserializeOpListIAMPolicyAssignments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
11856	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
11857) {
11858	out, metadata, err = next.HandleDeserialize(ctx, in)
11859	if err != nil {
11860		return out, metadata, err
11861	}
11862
11863	response, ok := out.RawResponse.(*smithyhttp.Response)
11864	if !ok {
11865		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
11866	}
11867
11868	if response.StatusCode < 200 || response.StatusCode >= 300 {
11869		return out, metadata, awsRestjson1_deserializeOpErrorListIAMPolicyAssignments(response, &metadata)
11870	}
11871	output := &ListIAMPolicyAssignmentsOutput{}
11872	out.Result = output
11873
11874	err = awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsOutput(output, response)
11875	if err != nil {
11876		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
11877	}
11878
11879	var buff [1024]byte
11880	ringBuffer := smithyio.NewRingBuffer(buff[:])
11881
11882	body := io.TeeReader(response.Body, ringBuffer)
11883
11884	decoder := json.NewDecoder(body)
11885	decoder.UseNumber()
11886	var shape interface{}
11887	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
11888		var snapshot bytes.Buffer
11889		io.Copy(&snapshot, ringBuffer)
11890		err = &smithy.DeserializationError{
11891			Err:      fmt.Errorf("failed to decode response body, %w", err),
11892			Snapshot: snapshot.Bytes(),
11893		}
11894		return out, metadata, err
11895	}
11896
11897	err = awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsOutput(&output, shape)
11898	if err != nil {
11899		var snapshot bytes.Buffer
11900		io.Copy(&snapshot, ringBuffer)
11901		return out, metadata, &smithy.DeserializationError{
11902			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
11903			Snapshot: snapshot.Bytes(),
11904		}
11905	}
11906
11907	return out, metadata, err
11908}
11909
11910func awsRestjson1_deserializeOpErrorListIAMPolicyAssignments(response *smithyhttp.Response, metadata *middleware.Metadata) error {
11911	var errorBuffer bytes.Buffer
11912	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
11913		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
11914	}
11915	errorBody := bytes.NewReader(errorBuffer.Bytes())
11916
11917	errorCode := "UnknownError"
11918	errorMessage := errorCode
11919
11920	code := response.Header.Get("X-Amzn-ErrorType")
11921	if len(code) != 0 {
11922		errorCode = restjson.SanitizeErrorCode(code)
11923	}
11924
11925	var buff [1024]byte
11926	ringBuffer := smithyio.NewRingBuffer(buff[:])
11927
11928	body := io.TeeReader(errorBody, ringBuffer)
11929	decoder := json.NewDecoder(body)
11930	decoder.UseNumber()
11931	code, message, err := restjson.GetErrorInfo(decoder)
11932	if err != nil {
11933		var snapshot bytes.Buffer
11934		io.Copy(&snapshot, ringBuffer)
11935		err = &smithy.DeserializationError{
11936			Err:      fmt.Errorf("failed to decode response body, %w", err),
11937			Snapshot: snapshot.Bytes(),
11938		}
11939		return err
11940	}
11941
11942	errorBody.Seek(0, io.SeekStart)
11943	if len(code) != 0 {
11944		errorCode = restjson.SanitizeErrorCode(code)
11945	}
11946	if len(message) != 0 {
11947		errorMessage = message
11948	}
11949
11950	switch {
11951	case strings.EqualFold("AccessDeniedException", errorCode):
11952		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
11953
11954	case strings.EqualFold("InternalFailureException", errorCode):
11955		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
11956
11957	case strings.EqualFold("InvalidNextTokenException", errorCode):
11958		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
11959
11960	case strings.EqualFold("InvalidParameterValueException", errorCode):
11961		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
11962
11963	case strings.EqualFold("ResourceNotFoundException", errorCode):
11964		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
11965
11966	case strings.EqualFold("ThrottlingException", errorCode):
11967		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
11968
11969	default:
11970		genericError := &smithy.GenericAPIError{
11971			Code:    errorCode,
11972			Message: errorMessage,
11973		}
11974		return genericError
11975
11976	}
11977}
11978
11979func awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsOutput(v *ListIAMPolicyAssignmentsOutput, response *smithyhttp.Response) error {
11980	if v == nil {
11981		return fmt.Errorf("unsupported deserialization for nil %T", v)
11982	}
11983
11984	v.Status = int32(response.StatusCode)
11985
11986	return nil
11987}
11988func awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsOutput(v **ListIAMPolicyAssignmentsOutput, value interface{}) error {
11989	if v == nil {
11990		return fmt.Errorf("unexpected nil of type %T", v)
11991	}
11992	if value == nil {
11993		return nil
11994	}
11995
11996	shape, ok := value.(map[string]interface{})
11997	if !ok {
11998		return fmt.Errorf("unexpected JSON type %v", value)
11999	}
12000
12001	var sv *ListIAMPolicyAssignmentsOutput
12002	if *v == nil {
12003		sv = &ListIAMPolicyAssignmentsOutput{}
12004	} else {
12005		sv = *v
12006	}
12007
12008	for key, value := range shape {
12009		switch key {
12010		case "IAMPolicyAssignments":
12011			if err := awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummaryList(&sv.IAMPolicyAssignments, value); err != nil {
12012				return err
12013			}
12014
12015		case "NextToken":
12016			if value != nil {
12017				jtv, ok := value.(string)
12018				if !ok {
12019					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12020				}
12021				sv.NextToken = ptr.String(jtv)
12022			}
12023
12024		case "RequestId":
12025			if value != nil {
12026				jtv, ok := value.(string)
12027				if !ok {
12028					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12029				}
12030				sv.RequestId = ptr.String(jtv)
12031			}
12032
12033		default:
12034			_, _ = key, value
12035
12036		}
12037	}
12038	*v = sv
12039	return nil
12040}
12041
12042type awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser struct {
12043}
12044
12045func (*awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser) ID() string {
12046	return "OperationDeserializer"
12047}
12048
12049func (m *awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12050	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12051) {
12052	out, metadata, err = next.HandleDeserialize(ctx, in)
12053	if err != nil {
12054		return out, metadata, err
12055	}
12056
12057	response, ok := out.RawResponse.(*smithyhttp.Response)
12058	if !ok {
12059		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12060	}
12061
12062	if response.StatusCode < 200 || response.StatusCode >= 300 {
12063		return out, metadata, awsRestjson1_deserializeOpErrorListIAMPolicyAssignmentsForUser(response, &metadata)
12064	}
12065	output := &ListIAMPolicyAssignmentsForUserOutput{}
12066	out.Result = output
12067
12068	err = awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsForUserOutput(output, response)
12069	if err != nil {
12070		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
12071	}
12072
12073	var buff [1024]byte
12074	ringBuffer := smithyio.NewRingBuffer(buff[:])
12075
12076	body := io.TeeReader(response.Body, ringBuffer)
12077
12078	decoder := json.NewDecoder(body)
12079	decoder.UseNumber()
12080	var shape interface{}
12081	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12082		var snapshot bytes.Buffer
12083		io.Copy(&snapshot, ringBuffer)
12084		err = &smithy.DeserializationError{
12085			Err:      fmt.Errorf("failed to decode response body, %w", err),
12086			Snapshot: snapshot.Bytes(),
12087		}
12088		return out, metadata, err
12089	}
12090
12091	err = awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsForUserOutput(&output, shape)
12092	if err != nil {
12093		var snapshot bytes.Buffer
12094		io.Copy(&snapshot, ringBuffer)
12095		return out, metadata, &smithy.DeserializationError{
12096			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12097			Snapshot: snapshot.Bytes(),
12098		}
12099	}
12100
12101	return out, metadata, err
12102}
12103
12104func awsRestjson1_deserializeOpErrorListIAMPolicyAssignmentsForUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12105	var errorBuffer bytes.Buffer
12106	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12107		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12108	}
12109	errorBody := bytes.NewReader(errorBuffer.Bytes())
12110
12111	errorCode := "UnknownError"
12112	errorMessage := errorCode
12113
12114	code := response.Header.Get("X-Amzn-ErrorType")
12115	if len(code) != 0 {
12116		errorCode = restjson.SanitizeErrorCode(code)
12117	}
12118
12119	var buff [1024]byte
12120	ringBuffer := smithyio.NewRingBuffer(buff[:])
12121
12122	body := io.TeeReader(errorBody, ringBuffer)
12123	decoder := json.NewDecoder(body)
12124	decoder.UseNumber()
12125	code, message, err := restjson.GetErrorInfo(decoder)
12126	if err != nil {
12127		var snapshot bytes.Buffer
12128		io.Copy(&snapshot, ringBuffer)
12129		err = &smithy.DeserializationError{
12130			Err:      fmt.Errorf("failed to decode response body, %w", err),
12131			Snapshot: snapshot.Bytes(),
12132		}
12133		return err
12134	}
12135
12136	errorBody.Seek(0, io.SeekStart)
12137	if len(code) != 0 {
12138		errorCode = restjson.SanitizeErrorCode(code)
12139	}
12140	if len(message) != 0 {
12141		errorMessage = message
12142	}
12143
12144	switch {
12145	case strings.EqualFold("AccessDeniedException", errorCode):
12146		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
12147
12148	case strings.EqualFold("ConcurrentUpdatingException", errorCode):
12149		return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody)
12150
12151	case strings.EqualFold("InternalFailureException", errorCode):
12152		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12153
12154	case strings.EqualFold("InvalidParameterValueException", errorCode):
12155		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
12156
12157	case strings.EqualFold("ResourceExistsException", errorCode):
12158		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
12159
12160	case strings.EqualFold("ResourceNotFoundException", errorCode):
12161		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12162
12163	case strings.EqualFold("ThrottlingException", errorCode):
12164		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12165
12166	default:
12167		genericError := &smithy.GenericAPIError{
12168			Code:    errorCode,
12169			Message: errorMessage,
12170		}
12171		return genericError
12172
12173	}
12174}
12175
12176func awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsForUserOutput(v *ListIAMPolicyAssignmentsForUserOutput, response *smithyhttp.Response) error {
12177	if v == nil {
12178		return fmt.Errorf("unsupported deserialization for nil %T", v)
12179	}
12180
12181	v.Status = int32(response.StatusCode)
12182
12183	return nil
12184}
12185func awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsForUserOutput(v **ListIAMPolicyAssignmentsForUserOutput, value interface{}) error {
12186	if v == nil {
12187		return fmt.Errorf("unexpected nil of type %T", v)
12188	}
12189	if value == nil {
12190		return nil
12191	}
12192
12193	shape, ok := value.(map[string]interface{})
12194	if !ok {
12195		return fmt.Errorf("unexpected JSON type %v", value)
12196	}
12197
12198	var sv *ListIAMPolicyAssignmentsForUserOutput
12199	if *v == nil {
12200		sv = &ListIAMPolicyAssignmentsForUserOutput{}
12201	} else {
12202		sv = *v
12203	}
12204
12205	for key, value := range shape {
12206		switch key {
12207		case "ActiveAssignments":
12208			if err := awsRestjson1_deserializeDocumentActiveIAMPolicyAssignmentList(&sv.ActiveAssignments, value); err != nil {
12209				return err
12210			}
12211
12212		case "NextToken":
12213			if value != nil {
12214				jtv, ok := value.(string)
12215				if !ok {
12216					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12217				}
12218				sv.NextToken = ptr.String(jtv)
12219			}
12220
12221		case "RequestId":
12222			if value != nil {
12223				jtv, ok := value.(string)
12224				if !ok {
12225					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12226				}
12227				sv.RequestId = ptr.String(jtv)
12228			}
12229
12230		default:
12231			_, _ = key, value
12232
12233		}
12234	}
12235	*v = sv
12236	return nil
12237}
12238
12239type awsRestjson1_deserializeOpListIngestions struct {
12240}
12241
12242func (*awsRestjson1_deserializeOpListIngestions) ID() string {
12243	return "OperationDeserializer"
12244}
12245
12246func (m *awsRestjson1_deserializeOpListIngestions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12247	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12248) {
12249	out, metadata, err = next.HandleDeserialize(ctx, in)
12250	if err != nil {
12251		return out, metadata, err
12252	}
12253
12254	response, ok := out.RawResponse.(*smithyhttp.Response)
12255	if !ok {
12256		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12257	}
12258
12259	if response.StatusCode < 200 || response.StatusCode >= 300 {
12260		return out, metadata, awsRestjson1_deserializeOpErrorListIngestions(response, &metadata)
12261	}
12262	output := &ListIngestionsOutput{}
12263	out.Result = output
12264
12265	err = awsRestjson1_deserializeOpHttpBindingsListIngestionsOutput(output, response)
12266	if err != nil {
12267		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
12268	}
12269
12270	var buff [1024]byte
12271	ringBuffer := smithyio.NewRingBuffer(buff[:])
12272
12273	body := io.TeeReader(response.Body, ringBuffer)
12274
12275	decoder := json.NewDecoder(body)
12276	decoder.UseNumber()
12277	var shape interface{}
12278	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12279		var snapshot bytes.Buffer
12280		io.Copy(&snapshot, ringBuffer)
12281		err = &smithy.DeserializationError{
12282			Err:      fmt.Errorf("failed to decode response body, %w", err),
12283			Snapshot: snapshot.Bytes(),
12284		}
12285		return out, metadata, err
12286	}
12287
12288	err = awsRestjson1_deserializeOpDocumentListIngestionsOutput(&output, shape)
12289	if err != nil {
12290		var snapshot bytes.Buffer
12291		io.Copy(&snapshot, ringBuffer)
12292		return out, metadata, &smithy.DeserializationError{
12293			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12294			Snapshot: snapshot.Bytes(),
12295		}
12296	}
12297
12298	return out, metadata, err
12299}
12300
12301func awsRestjson1_deserializeOpErrorListIngestions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12302	var errorBuffer bytes.Buffer
12303	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12304		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12305	}
12306	errorBody := bytes.NewReader(errorBuffer.Bytes())
12307
12308	errorCode := "UnknownError"
12309	errorMessage := errorCode
12310
12311	code := response.Header.Get("X-Amzn-ErrorType")
12312	if len(code) != 0 {
12313		errorCode = restjson.SanitizeErrorCode(code)
12314	}
12315
12316	var buff [1024]byte
12317	ringBuffer := smithyio.NewRingBuffer(buff[:])
12318
12319	body := io.TeeReader(errorBody, ringBuffer)
12320	decoder := json.NewDecoder(body)
12321	decoder.UseNumber()
12322	code, message, err := restjson.GetErrorInfo(decoder)
12323	if err != nil {
12324		var snapshot bytes.Buffer
12325		io.Copy(&snapshot, ringBuffer)
12326		err = &smithy.DeserializationError{
12327			Err:      fmt.Errorf("failed to decode response body, %w", err),
12328			Snapshot: snapshot.Bytes(),
12329		}
12330		return err
12331	}
12332
12333	errorBody.Seek(0, io.SeekStart)
12334	if len(code) != 0 {
12335		errorCode = restjson.SanitizeErrorCode(code)
12336	}
12337	if len(message) != 0 {
12338		errorMessage = message
12339	}
12340
12341	switch {
12342	case strings.EqualFold("AccessDeniedException", errorCode):
12343		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
12344
12345	case strings.EqualFold("InternalFailureException", errorCode):
12346		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12347
12348	case strings.EqualFold("InvalidNextTokenException", errorCode):
12349		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
12350
12351	case strings.EqualFold("InvalidParameterValueException", errorCode):
12352		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
12353
12354	case strings.EqualFold("ResourceExistsException", errorCode):
12355		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
12356
12357	case strings.EqualFold("ResourceNotFoundException", errorCode):
12358		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12359
12360	case strings.EqualFold("ThrottlingException", errorCode):
12361		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12362
12363	default:
12364		genericError := &smithy.GenericAPIError{
12365			Code:    errorCode,
12366			Message: errorMessage,
12367		}
12368		return genericError
12369
12370	}
12371}
12372
12373func awsRestjson1_deserializeOpHttpBindingsListIngestionsOutput(v *ListIngestionsOutput, response *smithyhttp.Response) error {
12374	if v == nil {
12375		return fmt.Errorf("unsupported deserialization for nil %T", v)
12376	}
12377
12378	v.Status = int32(response.StatusCode)
12379
12380	return nil
12381}
12382func awsRestjson1_deserializeOpDocumentListIngestionsOutput(v **ListIngestionsOutput, value interface{}) error {
12383	if v == nil {
12384		return fmt.Errorf("unexpected nil of type %T", v)
12385	}
12386	if value == nil {
12387		return nil
12388	}
12389
12390	shape, ok := value.(map[string]interface{})
12391	if !ok {
12392		return fmt.Errorf("unexpected JSON type %v", value)
12393	}
12394
12395	var sv *ListIngestionsOutput
12396	if *v == nil {
12397		sv = &ListIngestionsOutput{}
12398	} else {
12399		sv = *v
12400	}
12401
12402	for key, value := range shape {
12403		switch key {
12404		case "Ingestions":
12405			if err := awsRestjson1_deserializeDocumentIngestions(&sv.Ingestions, value); err != nil {
12406				return err
12407			}
12408
12409		case "NextToken":
12410			if value != nil {
12411				jtv, ok := value.(string)
12412				if !ok {
12413					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12414				}
12415				sv.NextToken = ptr.String(jtv)
12416			}
12417
12418		case "RequestId":
12419			if value != nil {
12420				jtv, ok := value.(string)
12421				if !ok {
12422					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12423				}
12424				sv.RequestId = ptr.String(jtv)
12425			}
12426
12427		default:
12428			_, _ = key, value
12429
12430		}
12431	}
12432	*v = sv
12433	return nil
12434}
12435
12436type awsRestjson1_deserializeOpListNamespaces struct {
12437}
12438
12439func (*awsRestjson1_deserializeOpListNamespaces) ID() string {
12440	return "OperationDeserializer"
12441}
12442
12443func (m *awsRestjson1_deserializeOpListNamespaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12444	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12445) {
12446	out, metadata, err = next.HandleDeserialize(ctx, in)
12447	if err != nil {
12448		return out, metadata, err
12449	}
12450
12451	response, ok := out.RawResponse.(*smithyhttp.Response)
12452	if !ok {
12453		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12454	}
12455
12456	if response.StatusCode < 200 || response.StatusCode >= 300 {
12457		return out, metadata, awsRestjson1_deserializeOpErrorListNamespaces(response, &metadata)
12458	}
12459	output := &ListNamespacesOutput{}
12460	out.Result = output
12461
12462	err = awsRestjson1_deserializeOpHttpBindingsListNamespacesOutput(output, response)
12463	if err != nil {
12464		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
12465	}
12466
12467	var buff [1024]byte
12468	ringBuffer := smithyio.NewRingBuffer(buff[:])
12469
12470	body := io.TeeReader(response.Body, ringBuffer)
12471
12472	decoder := json.NewDecoder(body)
12473	decoder.UseNumber()
12474	var shape interface{}
12475	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12476		var snapshot bytes.Buffer
12477		io.Copy(&snapshot, ringBuffer)
12478		err = &smithy.DeserializationError{
12479			Err:      fmt.Errorf("failed to decode response body, %w", err),
12480			Snapshot: snapshot.Bytes(),
12481		}
12482		return out, metadata, err
12483	}
12484
12485	err = awsRestjson1_deserializeOpDocumentListNamespacesOutput(&output, shape)
12486	if err != nil {
12487		var snapshot bytes.Buffer
12488		io.Copy(&snapshot, ringBuffer)
12489		return out, metadata, &smithy.DeserializationError{
12490			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12491			Snapshot: snapshot.Bytes(),
12492		}
12493	}
12494
12495	return out, metadata, err
12496}
12497
12498func awsRestjson1_deserializeOpErrorListNamespaces(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12499	var errorBuffer bytes.Buffer
12500	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12501		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12502	}
12503	errorBody := bytes.NewReader(errorBuffer.Bytes())
12504
12505	errorCode := "UnknownError"
12506	errorMessage := errorCode
12507
12508	code := response.Header.Get("X-Amzn-ErrorType")
12509	if len(code) != 0 {
12510		errorCode = restjson.SanitizeErrorCode(code)
12511	}
12512
12513	var buff [1024]byte
12514	ringBuffer := smithyio.NewRingBuffer(buff[:])
12515
12516	body := io.TeeReader(errorBody, ringBuffer)
12517	decoder := json.NewDecoder(body)
12518	decoder.UseNumber()
12519	code, message, err := restjson.GetErrorInfo(decoder)
12520	if err != nil {
12521		var snapshot bytes.Buffer
12522		io.Copy(&snapshot, ringBuffer)
12523		err = &smithy.DeserializationError{
12524			Err:      fmt.Errorf("failed to decode response body, %w", err),
12525			Snapshot: snapshot.Bytes(),
12526		}
12527		return err
12528	}
12529
12530	errorBody.Seek(0, io.SeekStart)
12531	if len(code) != 0 {
12532		errorCode = restjson.SanitizeErrorCode(code)
12533	}
12534	if len(message) != 0 {
12535		errorMessage = message
12536	}
12537
12538	switch {
12539	case strings.EqualFold("AccessDeniedException", errorCode):
12540		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
12541
12542	case strings.EqualFold("InternalFailureException", errorCode):
12543		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12544
12545	case strings.EqualFold("InvalidNextTokenException", errorCode):
12546		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
12547
12548	case strings.EqualFold("InvalidParameterValueException", errorCode):
12549		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
12550
12551	case strings.EqualFold("PreconditionNotMetException", errorCode):
12552		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
12553
12554	case strings.EqualFold("ResourceNotFoundException", errorCode):
12555		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12556
12557	case strings.EqualFold("ResourceUnavailableException", errorCode):
12558		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
12559
12560	case strings.EqualFold("ThrottlingException", errorCode):
12561		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12562
12563	default:
12564		genericError := &smithy.GenericAPIError{
12565			Code:    errorCode,
12566			Message: errorMessage,
12567		}
12568		return genericError
12569
12570	}
12571}
12572
12573func awsRestjson1_deserializeOpHttpBindingsListNamespacesOutput(v *ListNamespacesOutput, response *smithyhttp.Response) error {
12574	if v == nil {
12575		return fmt.Errorf("unsupported deserialization for nil %T", v)
12576	}
12577
12578	v.Status = int32(response.StatusCode)
12579
12580	return nil
12581}
12582func awsRestjson1_deserializeOpDocumentListNamespacesOutput(v **ListNamespacesOutput, value interface{}) error {
12583	if v == nil {
12584		return fmt.Errorf("unexpected nil of type %T", v)
12585	}
12586	if value == nil {
12587		return nil
12588	}
12589
12590	shape, ok := value.(map[string]interface{})
12591	if !ok {
12592		return fmt.Errorf("unexpected JSON type %v", value)
12593	}
12594
12595	var sv *ListNamespacesOutput
12596	if *v == nil {
12597		sv = &ListNamespacesOutput{}
12598	} else {
12599		sv = *v
12600	}
12601
12602	for key, value := range shape {
12603		switch key {
12604		case "Namespaces":
12605			if err := awsRestjson1_deserializeDocumentNamespaces(&sv.Namespaces, value); err != nil {
12606				return err
12607			}
12608
12609		case "NextToken":
12610			if value != nil {
12611				jtv, ok := value.(string)
12612				if !ok {
12613					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12614				}
12615				sv.NextToken = ptr.String(jtv)
12616			}
12617
12618		case "RequestId":
12619			if value != nil {
12620				jtv, ok := value.(string)
12621				if !ok {
12622					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12623				}
12624				sv.RequestId = ptr.String(jtv)
12625			}
12626
12627		default:
12628			_, _ = key, value
12629
12630		}
12631	}
12632	*v = sv
12633	return nil
12634}
12635
12636type awsRestjson1_deserializeOpListTagsForResource struct {
12637}
12638
12639func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
12640	return "OperationDeserializer"
12641}
12642
12643func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12644	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12645) {
12646	out, metadata, err = next.HandleDeserialize(ctx, in)
12647	if err != nil {
12648		return out, metadata, err
12649	}
12650
12651	response, ok := out.RawResponse.(*smithyhttp.Response)
12652	if !ok {
12653		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12654	}
12655
12656	if response.StatusCode < 200 || response.StatusCode >= 300 {
12657		return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
12658	}
12659	output := &ListTagsForResourceOutput{}
12660	out.Result = output
12661
12662	err = awsRestjson1_deserializeOpHttpBindingsListTagsForResourceOutput(output, response)
12663	if err != nil {
12664		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
12665	}
12666
12667	var buff [1024]byte
12668	ringBuffer := smithyio.NewRingBuffer(buff[:])
12669
12670	body := io.TeeReader(response.Body, ringBuffer)
12671
12672	decoder := json.NewDecoder(body)
12673	decoder.UseNumber()
12674	var shape interface{}
12675	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12676		var snapshot bytes.Buffer
12677		io.Copy(&snapshot, ringBuffer)
12678		err = &smithy.DeserializationError{
12679			Err:      fmt.Errorf("failed to decode response body, %w", err),
12680			Snapshot: snapshot.Bytes(),
12681		}
12682		return out, metadata, err
12683	}
12684
12685	err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
12686	if err != nil {
12687		var snapshot bytes.Buffer
12688		io.Copy(&snapshot, ringBuffer)
12689		return out, metadata, &smithy.DeserializationError{
12690			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12691			Snapshot: snapshot.Bytes(),
12692		}
12693	}
12694
12695	return out, metadata, err
12696}
12697
12698func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12699	var errorBuffer bytes.Buffer
12700	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12701		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12702	}
12703	errorBody := bytes.NewReader(errorBuffer.Bytes())
12704
12705	errorCode := "UnknownError"
12706	errorMessage := errorCode
12707
12708	code := response.Header.Get("X-Amzn-ErrorType")
12709	if len(code) != 0 {
12710		errorCode = restjson.SanitizeErrorCode(code)
12711	}
12712
12713	var buff [1024]byte
12714	ringBuffer := smithyio.NewRingBuffer(buff[:])
12715
12716	body := io.TeeReader(errorBody, ringBuffer)
12717	decoder := json.NewDecoder(body)
12718	decoder.UseNumber()
12719	code, message, err := restjson.GetErrorInfo(decoder)
12720	if err != nil {
12721		var snapshot bytes.Buffer
12722		io.Copy(&snapshot, ringBuffer)
12723		err = &smithy.DeserializationError{
12724			Err:      fmt.Errorf("failed to decode response body, %w", err),
12725			Snapshot: snapshot.Bytes(),
12726		}
12727		return err
12728	}
12729
12730	errorBody.Seek(0, io.SeekStart)
12731	if len(code) != 0 {
12732		errorCode = restjson.SanitizeErrorCode(code)
12733	}
12734	if len(message) != 0 {
12735		errorMessage = message
12736	}
12737
12738	switch {
12739	case strings.EqualFold("AccessDeniedException", errorCode):
12740		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
12741
12742	case strings.EqualFold("InternalFailureException", errorCode):
12743		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12744
12745	case strings.EqualFold("InvalidParameterValueException", errorCode):
12746		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
12747
12748	case strings.EqualFold("ResourceNotFoundException", errorCode):
12749		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12750
12751	case strings.EqualFold("ThrottlingException", errorCode):
12752		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12753
12754	default:
12755		genericError := &smithy.GenericAPIError{
12756			Code:    errorCode,
12757			Message: errorMessage,
12758		}
12759		return genericError
12760
12761	}
12762}
12763
12764func awsRestjson1_deserializeOpHttpBindingsListTagsForResourceOutput(v *ListTagsForResourceOutput, response *smithyhttp.Response) error {
12765	if v == nil {
12766		return fmt.Errorf("unsupported deserialization for nil %T", v)
12767	}
12768
12769	v.Status = int32(response.StatusCode)
12770
12771	return nil
12772}
12773func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
12774	if v == nil {
12775		return fmt.Errorf("unexpected nil of type %T", v)
12776	}
12777	if value == nil {
12778		return nil
12779	}
12780
12781	shape, ok := value.(map[string]interface{})
12782	if !ok {
12783		return fmt.Errorf("unexpected JSON type %v", value)
12784	}
12785
12786	var sv *ListTagsForResourceOutput
12787	if *v == nil {
12788		sv = &ListTagsForResourceOutput{}
12789	} else {
12790		sv = *v
12791	}
12792
12793	for key, value := range shape {
12794		switch key {
12795		case "RequestId":
12796			if value != nil {
12797				jtv, ok := value.(string)
12798				if !ok {
12799					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12800				}
12801				sv.RequestId = ptr.String(jtv)
12802			}
12803
12804		case "Tags":
12805			if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
12806				return err
12807			}
12808
12809		default:
12810			_, _ = key, value
12811
12812		}
12813	}
12814	*v = sv
12815	return nil
12816}
12817
12818type awsRestjson1_deserializeOpListTemplateAliases struct {
12819}
12820
12821func (*awsRestjson1_deserializeOpListTemplateAliases) ID() string {
12822	return "OperationDeserializer"
12823}
12824
12825func (m *awsRestjson1_deserializeOpListTemplateAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
12826	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
12827) {
12828	out, metadata, err = next.HandleDeserialize(ctx, in)
12829	if err != nil {
12830		return out, metadata, err
12831	}
12832
12833	response, ok := out.RawResponse.(*smithyhttp.Response)
12834	if !ok {
12835		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
12836	}
12837
12838	if response.StatusCode < 200 || response.StatusCode >= 300 {
12839		return out, metadata, awsRestjson1_deserializeOpErrorListTemplateAliases(response, &metadata)
12840	}
12841	output := &ListTemplateAliasesOutput{}
12842	out.Result = output
12843
12844	err = awsRestjson1_deserializeOpHttpBindingsListTemplateAliasesOutput(output, response)
12845	if err != nil {
12846		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
12847	}
12848
12849	var buff [1024]byte
12850	ringBuffer := smithyio.NewRingBuffer(buff[:])
12851
12852	body := io.TeeReader(response.Body, ringBuffer)
12853
12854	decoder := json.NewDecoder(body)
12855	decoder.UseNumber()
12856	var shape interface{}
12857	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
12858		var snapshot bytes.Buffer
12859		io.Copy(&snapshot, ringBuffer)
12860		err = &smithy.DeserializationError{
12861			Err:      fmt.Errorf("failed to decode response body, %w", err),
12862			Snapshot: snapshot.Bytes(),
12863		}
12864		return out, metadata, err
12865	}
12866
12867	err = awsRestjson1_deserializeOpDocumentListTemplateAliasesOutput(&output, shape)
12868	if err != nil {
12869		var snapshot bytes.Buffer
12870		io.Copy(&snapshot, ringBuffer)
12871		return out, metadata, &smithy.DeserializationError{
12872			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
12873			Snapshot: snapshot.Bytes(),
12874		}
12875	}
12876
12877	return out, metadata, err
12878}
12879
12880func awsRestjson1_deserializeOpErrorListTemplateAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
12881	var errorBuffer bytes.Buffer
12882	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
12883		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
12884	}
12885	errorBody := bytes.NewReader(errorBuffer.Bytes())
12886
12887	errorCode := "UnknownError"
12888	errorMessage := errorCode
12889
12890	code := response.Header.Get("X-Amzn-ErrorType")
12891	if len(code) != 0 {
12892		errorCode = restjson.SanitizeErrorCode(code)
12893	}
12894
12895	var buff [1024]byte
12896	ringBuffer := smithyio.NewRingBuffer(buff[:])
12897
12898	body := io.TeeReader(errorBody, ringBuffer)
12899	decoder := json.NewDecoder(body)
12900	decoder.UseNumber()
12901	code, message, err := restjson.GetErrorInfo(decoder)
12902	if err != nil {
12903		var snapshot bytes.Buffer
12904		io.Copy(&snapshot, ringBuffer)
12905		err = &smithy.DeserializationError{
12906			Err:      fmt.Errorf("failed to decode response body, %w", err),
12907			Snapshot: snapshot.Bytes(),
12908		}
12909		return err
12910	}
12911
12912	errorBody.Seek(0, io.SeekStart)
12913	if len(code) != 0 {
12914		errorCode = restjson.SanitizeErrorCode(code)
12915	}
12916	if len(message) != 0 {
12917		errorMessage = message
12918	}
12919
12920	switch {
12921	case strings.EqualFold("InternalFailureException", errorCode):
12922		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
12923
12924	case strings.EqualFold("InvalidNextTokenException", errorCode):
12925		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
12926
12927	case strings.EqualFold("ResourceNotFoundException", errorCode):
12928		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
12929
12930	case strings.EqualFold("ThrottlingException", errorCode):
12931		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
12932
12933	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
12934		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
12935
12936	default:
12937		genericError := &smithy.GenericAPIError{
12938			Code:    errorCode,
12939			Message: errorMessage,
12940		}
12941		return genericError
12942
12943	}
12944}
12945
12946func awsRestjson1_deserializeOpHttpBindingsListTemplateAliasesOutput(v *ListTemplateAliasesOutput, response *smithyhttp.Response) error {
12947	if v == nil {
12948		return fmt.Errorf("unsupported deserialization for nil %T", v)
12949	}
12950
12951	v.Status = int32(response.StatusCode)
12952
12953	return nil
12954}
12955func awsRestjson1_deserializeOpDocumentListTemplateAliasesOutput(v **ListTemplateAliasesOutput, value interface{}) error {
12956	if v == nil {
12957		return fmt.Errorf("unexpected nil of type %T", v)
12958	}
12959	if value == nil {
12960		return nil
12961	}
12962
12963	shape, ok := value.(map[string]interface{})
12964	if !ok {
12965		return fmt.Errorf("unexpected JSON type %v", value)
12966	}
12967
12968	var sv *ListTemplateAliasesOutput
12969	if *v == nil {
12970		sv = &ListTemplateAliasesOutput{}
12971	} else {
12972		sv = *v
12973	}
12974
12975	for key, value := range shape {
12976		switch key {
12977		case "NextToken":
12978			if value != nil {
12979				jtv, ok := value.(string)
12980				if !ok {
12981					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12982				}
12983				sv.NextToken = ptr.String(jtv)
12984			}
12985
12986		case "RequestId":
12987			if value != nil {
12988				jtv, ok := value.(string)
12989				if !ok {
12990					return fmt.Errorf("expected String to be of type string, got %T instead", value)
12991				}
12992				sv.RequestId = ptr.String(jtv)
12993			}
12994
12995		case "TemplateAliasList":
12996			if err := awsRestjson1_deserializeDocumentTemplateAliasList(&sv.TemplateAliasList, value); err != nil {
12997				return err
12998			}
12999
13000		default:
13001			_, _ = key, value
13002
13003		}
13004	}
13005	*v = sv
13006	return nil
13007}
13008
13009type awsRestjson1_deserializeOpListTemplates struct {
13010}
13011
13012func (*awsRestjson1_deserializeOpListTemplates) ID() string {
13013	return "OperationDeserializer"
13014}
13015
13016func (m *awsRestjson1_deserializeOpListTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13017	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13018) {
13019	out, metadata, err = next.HandleDeserialize(ctx, in)
13020	if err != nil {
13021		return out, metadata, err
13022	}
13023
13024	response, ok := out.RawResponse.(*smithyhttp.Response)
13025	if !ok {
13026		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13027	}
13028
13029	if response.StatusCode < 200 || response.StatusCode >= 300 {
13030		return out, metadata, awsRestjson1_deserializeOpErrorListTemplates(response, &metadata)
13031	}
13032	output := &ListTemplatesOutput{}
13033	out.Result = output
13034
13035	err = awsRestjson1_deserializeOpHttpBindingsListTemplatesOutput(output, response)
13036	if err != nil {
13037		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
13038	}
13039
13040	var buff [1024]byte
13041	ringBuffer := smithyio.NewRingBuffer(buff[:])
13042
13043	body := io.TeeReader(response.Body, ringBuffer)
13044
13045	decoder := json.NewDecoder(body)
13046	decoder.UseNumber()
13047	var shape interface{}
13048	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13049		var snapshot bytes.Buffer
13050		io.Copy(&snapshot, ringBuffer)
13051		err = &smithy.DeserializationError{
13052			Err:      fmt.Errorf("failed to decode response body, %w", err),
13053			Snapshot: snapshot.Bytes(),
13054		}
13055		return out, metadata, err
13056	}
13057
13058	err = awsRestjson1_deserializeOpDocumentListTemplatesOutput(&output, shape)
13059	if err != nil {
13060		var snapshot bytes.Buffer
13061		io.Copy(&snapshot, ringBuffer)
13062		return out, metadata, &smithy.DeserializationError{
13063			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13064			Snapshot: snapshot.Bytes(),
13065		}
13066	}
13067
13068	return out, metadata, err
13069}
13070
13071func awsRestjson1_deserializeOpErrorListTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13072	var errorBuffer bytes.Buffer
13073	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13074		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13075	}
13076	errorBody := bytes.NewReader(errorBuffer.Bytes())
13077
13078	errorCode := "UnknownError"
13079	errorMessage := errorCode
13080
13081	code := response.Header.Get("X-Amzn-ErrorType")
13082	if len(code) != 0 {
13083		errorCode = restjson.SanitizeErrorCode(code)
13084	}
13085
13086	var buff [1024]byte
13087	ringBuffer := smithyio.NewRingBuffer(buff[:])
13088
13089	body := io.TeeReader(errorBody, ringBuffer)
13090	decoder := json.NewDecoder(body)
13091	decoder.UseNumber()
13092	code, message, err := restjson.GetErrorInfo(decoder)
13093	if err != nil {
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 err
13101	}
13102
13103	errorBody.Seek(0, io.SeekStart)
13104	if len(code) != 0 {
13105		errorCode = restjson.SanitizeErrorCode(code)
13106	}
13107	if len(message) != 0 {
13108		errorMessage = message
13109	}
13110
13111	switch {
13112	case strings.EqualFold("InternalFailureException", errorCode):
13113		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13114
13115	case strings.EqualFold("InvalidNextTokenException", errorCode):
13116		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
13117
13118	case strings.EqualFold("InvalidParameterValueException", errorCode):
13119		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
13120
13121	case strings.EqualFold("ResourceNotFoundException", errorCode):
13122		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13123
13124	case strings.EqualFold("ThrottlingException", errorCode):
13125		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13126
13127	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
13128		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
13129
13130	default:
13131		genericError := &smithy.GenericAPIError{
13132			Code:    errorCode,
13133			Message: errorMessage,
13134		}
13135		return genericError
13136
13137	}
13138}
13139
13140func awsRestjson1_deserializeOpHttpBindingsListTemplatesOutput(v *ListTemplatesOutput, response *smithyhttp.Response) error {
13141	if v == nil {
13142		return fmt.Errorf("unsupported deserialization for nil %T", v)
13143	}
13144
13145	v.Status = int32(response.StatusCode)
13146
13147	return nil
13148}
13149func awsRestjson1_deserializeOpDocumentListTemplatesOutput(v **ListTemplatesOutput, value interface{}) error {
13150	if v == nil {
13151		return fmt.Errorf("unexpected nil of type %T", v)
13152	}
13153	if value == nil {
13154		return nil
13155	}
13156
13157	shape, ok := value.(map[string]interface{})
13158	if !ok {
13159		return fmt.Errorf("unexpected JSON type %v", value)
13160	}
13161
13162	var sv *ListTemplatesOutput
13163	if *v == nil {
13164		sv = &ListTemplatesOutput{}
13165	} else {
13166		sv = *v
13167	}
13168
13169	for key, value := range shape {
13170		switch key {
13171		case "NextToken":
13172			if value != nil {
13173				jtv, ok := value.(string)
13174				if !ok {
13175					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13176				}
13177				sv.NextToken = ptr.String(jtv)
13178			}
13179
13180		case "RequestId":
13181			if value != nil {
13182				jtv, ok := value.(string)
13183				if !ok {
13184					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13185				}
13186				sv.RequestId = ptr.String(jtv)
13187			}
13188
13189		case "TemplateSummaryList":
13190			if err := awsRestjson1_deserializeDocumentTemplateSummaryList(&sv.TemplateSummaryList, value); err != nil {
13191				return err
13192			}
13193
13194		default:
13195			_, _ = key, value
13196
13197		}
13198	}
13199	*v = sv
13200	return nil
13201}
13202
13203type awsRestjson1_deserializeOpListTemplateVersions struct {
13204}
13205
13206func (*awsRestjson1_deserializeOpListTemplateVersions) ID() string {
13207	return "OperationDeserializer"
13208}
13209
13210func (m *awsRestjson1_deserializeOpListTemplateVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13211	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13212) {
13213	out, metadata, err = next.HandleDeserialize(ctx, in)
13214	if err != nil {
13215		return out, metadata, err
13216	}
13217
13218	response, ok := out.RawResponse.(*smithyhttp.Response)
13219	if !ok {
13220		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13221	}
13222
13223	if response.StatusCode < 200 || response.StatusCode >= 300 {
13224		return out, metadata, awsRestjson1_deserializeOpErrorListTemplateVersions(response, &metadata)
13225	}
13226	output := &ListTemplateVersionsOutput{}
13227	out.Result = output
13228
13229	err = awsRestjson1_deserializeOpHttpBindingsListTemplateVersionsOutput(output, response)
13230	if err != nil {
13231		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
13232	}
13233
13234	var buff [1024]byte
13235	ringBuffer := smithyio.NewRingBuffer(buff[:])
13236
13237	body := io.TeeReader(response.Body, ringBuffer)
13238
13239	decoder := json.NewDecoder(body)
13240	decoder.UseNumber()
13241	var shape interface{}
13242	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13243		var snapshot bytes.Buffer
13244		io.Copy(&snapshot, ringBuffer)
13245		err = &smithy.DeserializationError{
13246			Err:      fmt.Errorf("failed to decode response body, %w", err),
13247			Snapshot: snapshot.Bytes(),
13248		}
13249		return out, metadata, err
13250	}
13251
13252	err = awsRestjson1_deserializeOpDocumentListTemplateVersionsOutput(&output, shape)
13253	if err != nil {
13254		var snapshot bytes.Buffer
13255		io.Copy(&snapshot, ringBuffer)
13256		return out, metadata, &smithy.DeserializationError{
13257			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13258			Snapshot: snapshot.Bytes(),
13259		}
13260	}
13261
13262	return out, metadata, err
13263}
13264
13265func awsRestjson1_deserializeOpErrorListTemplateVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13266	var errorBuffer bytes.Buffer
13267	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13268		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13269	}
13270	errorBody := bytes.NewReader(errorBuffer.Bytes())
13271
13272	errorCode := "UnknownError"
13273	errorMessage := errorCode
13274
13275	code := response.Header.Get("X-Amzn-ErrorType")
13276	if len(code) != 0 {
13277		errorCode = restjson.SanitizeErrorCode(code)
13278	}
13279
13280	var buff [1024]byte
13281	ringBuffer := smithyio.NewRingBuffer(buff[:])
13282
13283	body := io.TeeReader(errorBody, ringBuffer)
13284	decoder := json.NewDecoder(body)
13285	decoder.UseNumber()
13286	code, message, err := restjson.GetErrorInfo(decoder)
13287	if err != nil {
13288		var snapshot bytes.Buffer
13289		io.Copy(&snapshot, ringBuffer)
13290		err = &smithy.DeserializationError{
13291			Err:      fmt.Errorf("failed to decode response body, %w", err),
13292			Snapshot: snapshot.Bytes(),
13293		}
13294		return err
13295	}
13296
13297	errorBody.Seek(0, io.SeekStart)
13298	if len(code) != 0 {
13299		errorCode = restjson.SanitizeErrorCode(code)
13300	}
13301	if len(message) != 0 {
13302		errorMessage = message
13303	}
13304
13305	switch {
13306	case strings.EqualFold("InternalFailureException", errorCode):
13307		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13308
13309	case strings.EqualFold("InvalidNextTokenException", errorCode):
13310		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
13311
13312	case strings.EqualFold("InvalidParameterValueException", errorCode):
13313		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
13314
13315	case strings.EqualFold("ResourceNotFoundException", errorCode):
13316		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13317
13318	case strings.EqualFold("ThrottlingException", errorCode):
13319		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13320
13321	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
13322		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
13323
13324	default:
13325		genericError := &smithy.GenericAPIError{
13326			Code:    errorCode,
13327			Message: errorMessage,
13328		}
13329		return genericError
13330
13331	}
13332}
13333
13334func awsRestjson1_deserializeOpHttpBindingsListTemplateVersionsOutput(v *ListTemplateVersionsOutput, response *smithyhttp.Response) error {
13335	if v == nil {
13336		return fmt.Errorf("unsupported deserialization for nil %T", v)
13337	}
13338
13339	v.Status = int32(response.StatusCode)
13340
13341	return nil
13342}
13343func awsRestjson1_deserializeOpDocumentListTemplateVersionsOutput(v **ListTemplateVersionsOutput, value interface{}) error {
13344	if v == nil {
13345		return fmt.Errorf("unexpected nil of type %T", v)
13346	}
13347	if value == nil {
13348		return nil
13349	}
13350
13351	shape, ok := value.(map[string]interface{})
13352	if !ok {
13353		return fmt.Errorf("unexpected JSON type %v", value)
13354	}
13355
13356	var sv *ListTemplateVersionsOutput
13357	if *v == nil {
13358		sv = &ListTemplateVersionsOutput{}
13359	} else {
13360		sv = *v
13361	}
13362
13363	for key, value := range shape {
13364		switch key {
13365		case "NextToken":
13366			if value != nil {
13367				jtv, ok := value.(string)
13368				if !ok {
13369					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13370				}
13371				sv.NextToken = ptr.String(jtv)
13372			}
13373
13374		case "RequestId":
13375			if value != nil {
13376				jtv, ok := value.(string)
13377				if !ok {
13378					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13379				}
13380				sv.RequestId = ptr.String(jtv)
13381			}
13382
13383		case "TemplateVersionSummaryList":
13384			if err := awsRestjson1_deserializeDocumentTemplateVersionSummaryList(&sv.TemplateVersionSummaryList, value); err != nil {
13385				return err
13386			}
13387
13388		default:
13389			_, _ = key, value
13390
13391		}
13392	}
13393	*v = sv
13394	return nil
13395}
13396
13397type awsRestjson1_deserializeOpListThemeAliases struct {
13398}
13399
13400func (*awsRestjson1_deserializeOpListThemeAliases) ID() string {
13401	return "OperationDeserializer"
13402}
13403
13404func (m *awsRestjson1_deserializeOpListThemeAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13405	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13406) {
13407	out, metadata, err = next.HandleDeserialize(ctx, in)
13408	if err != nil {
13409		return out, metadata, err
13410	}
13411
13412	response, ok := out.RawResponse.(*smithyhttp.Response)
13413	if !ok {
13414		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13415	}
13416
13417	if response.StatusCode < 200 || response.StatusCode >= 300 {
13418		return out, metadata, awsRestjson1_deserializeOpErrorListThemeAliases(response, &metadata)
13419	}
13420	output := &ListThemeAliasesOutput{}
13421	out.Result = output
13422
13423	err = awsRestjson1_deserializeOpHttpBindingsListThemeAliasesOutput(output, response)
13424	if err != nil {
13425		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
13426	}
13427
13428	var buff [1024]byte
13429	ringBuffer := smithyio.NewRingBuffer(buff[:])
13430
13431	body := io.TeeReader(response.Body, ringBuffer)
13432
13433	decoder := json.NewDecoder(body)
13434	decoder.UseNumber()
13435	var shape interface{}
13436	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13437		var snapshot bytes.Buffer
13438		io.Copy(&snapshot, ringBuffer)
13439		err = &smithy.DeserializationError{
13440			Err:      fmt.Errorf("failed to decode response body, %w", err),
13441			Snapshot: snapshot.Bytes(),
13442		}
13443		return out, metadata, err
13444	}
13445
13446	err = awsRestjson1_deserializeOpDocumentListThemeAliasesOutput(&output, shape)
13447	if err != nil {
13448		var snapshot bytes.Buffer
13449		io.Copy(&snapshot, ringBuffer)
13450		return out, metadata, &smithy.DeserializationError{
13451			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13452			Snapshot: snapshot.Bytes(),
13453		}
13454	}
13455
13456	return out, metadata, err
13457}
13458
13459func awsRestjson1_deserializeOpErrorListThemeAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13460	var errorBuffer bytes.Buffer
13461	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13462		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13463	}
13464	errorBody := bytes.NewReader(errorBuffer.Bytes())
13465
13466	errorCode := "UnknownError"
13467	errorMessage := errorCode
13468
13469	code := response.Header.Get("X-Amzn-ErrorType")
13470	if len(code) != 0 {
13471		errorCode = restjson.SanitizeErrorCode(code)
13472	}
13473
13474	var buff [1024]byte
13475	ringBuffer := smithyio.NewRingBuffer(buff[:])
13476
13477	body := io.TeeReader(errorBody, ringBuffer)
13478	decoder := json.NewDecoder(body)
13479	decoder.UseNumber()
13480	code, message, err := restjson.GetErrorInfo(decoder)
13481	if err != nil {
13482		var snapshot bytes.Buffer
13483		io.Copy(&snapshot, ringBuffer)
13484		err = &smithy.DeserializationError{
13485			Err:      fmt.Errorf("failed to decode response body, %w", err),
13486			Snapshot: snapshot.Bytes(),
13487		}
13488		return err
13489	}
13490
13491	errorBody.Seek(0, io.SeekStart)
13492	if len(code) != 0 {
13493		errorCode = restjson.SanitizeErrorCode(code)
13494	}
13495	if len(message) != 0 {
13496		errorMessage = message
13497	}
13498
13499	switch {
13500	case strings.EqualFold("ConflictException", errorCode):
13501		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
13502
13503	case strings.EqualFold("InternalFailureException", errorCode):
13504		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13505
13506	case strings.EqualFold("InvalidNextTokenException", errorCode):
13507		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
13508
13509	case strings.EqualFold("InvalidParameterValueException", errorCode):
13510		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
13511
13512	case strings.EqualFold("ResourceNotFoundException", errorCode):
13513		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13514
13515	case strings.EqualFold("ThrottlingException", errorCode):
13516		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13517
13518	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
13519		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
13520
13521	default:
13522		genericError := &smithy.GenericAPIError{
13523			Code:    errorCode,
13524			Message: errorMessage,
13525		}
13526		return genericError
13527
13528	}
13529}
13530
13531func awsRestjson1_deserializeOpHttpBindingsListThemeAliasesOutput(v *ListThemeAliasesOutput, response *smithyhttp.Response) error {
13532	if v == nil {
13533		return fmt.Errorf("unsupported deserialization for nil %T", v)
13534	}
13535
13536	v.Status = int32(response.StatusCode)
13537
13538	return nil
13539}
13540func awsRestjson1_deserializeOpDocumentListThemeAliasesOutput(v **ListThemeAliasesOutput, value interface{}) error {
13541	if v == nil {
13542		return fmt.Errorf("unexpected nil of type %T", v)
13543	}
13544	if value == nil {
13545		return nil
13546	}
13547
13548	shape, ok := value.(map[string]interface{})
13549	if !ok {
13550		return fmt.Errorf("unexpected JSON type %v", value)
13551	}
13552
13553	var sv *ListThemeAliasesOutput
13554	if *v == nil {
13555		sv = &ListThemeAliasesOutput{}
13556	} else {
13557		sv = *v
13558	}
13559
13560	for key, value := range shape {
13561		switch key {
13562		case "NextToken":
13563			if value != nil {
13564				jtv, ok := value.(string)
13565				if !ok {
13566					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13567				}
13568				sv.NextToken = ptr.String(jtv)
13569			}
13570
13571		case "RequestId":
13572			if value != nil {
13573				jtv, ok := value.(string)
13574				if !ok {
13575					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13576				}
13577				sv.RequestId = ptr.String(jtv)
13578			}
13579
13580		case "ThemeAliasList":
13581			if err := awsRestjson1_deserializeDocumentThemeAliasList(&sv.ThemeAliasList, value); err != nil {
13582				return err
13583			}
13584
13585		default:
13586			_, _ = key, value
13587
13588		}
13589	}
13590	*v = sv
13591	return nil
13592}
13593
13594type awsRestjson1_deserializeOpListThemes struct {
13595}
13596
13597func (*awsRestjson1_deserializeOpListThemes) ID() string {
13598	return "OperationDeserializer"
13599}
13600
13601func (m *awsRestjson1_deserializeOpListThemes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13602	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13603) {
13604	out, metadata, err = next.HandleDeserialize(ctx, in)
13605	if err != nil {
13606		return out, metadata, err
13607	}
13608
13609	response, ok := out.RawResponse.(*smithyhttp.Response)
13610	if !ok {
13611		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13612	}
13613
13614	if response.StatusCode < 200 || response.StatusCode >= 300 {
13615		return out, metadata, awsRestjson1_deserializeOpErrorListThemes(response, &metadata)
13616	}
13617	output := &ListThemesOutput{}
13618	out.Result = output
13619
13620	err = awsRestjson1_deserializeOpHttpBindingsListThemesOutput(output, response)
13621	if err != nil {
13622		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
13623	}
13624
13625	var buff [1024]byte
13626	ringBuffer := smithyio.NewRingBuffer(buff[:])
13627
13628	body := io.TeeReader(response.Body, ringBuffer)
13629
13630	decoder := json.NewDecoder(body)
13631	decoder.UseNumber()
13632	var shape interface{}
13633	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13634		var snapshot bytes.Buffer
13635		io.Copy(&snapshot, ringBuffer)
13636		err = &smithy.DeserializationError{
13637			Err:      fmt.Errorf("failed to decode response body, %w", err),
13638			Snapshot: snapshot.Bytes(),
13639		}
13640		return out, metadata, err
13641	}
13642
13643	err = awsRestjson1_deserializeOpDocumentListThemesOutput(&output, shape)
13644	if err != nil {
13645		var snapshot bytes.Buffer
13646		io.Copy(&snapshot, ringBuffer)
13647		return out, metadata, &smithy.DeserializationError{
13648			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13649			Snapshot: snapshot.Bytes(),
13650		}
13651	}
13652
13653	return out, metadata, err
13654}
13655
13656func awsRestjson1_deserializeOpErrorListThemes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13657	var errorBuffer bytes.Buffer
13658	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13659		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13660	}
13661	errorBody := bytes.NewReader(errorBuffer.Bytes())
13662
13663	errorCode := "UnknownError"
13664	errorMessage := errorCode
13665
13666	code := response.Header.Get("X-Amzn-ErrorType")
13667	if len(code) != 0 {
13668		errorCode = restjson.SanitizeErrorCode(code)
13669	}
13670
13671	var buff [1024]byte
13672	ringBuffer := smithyio.NewRingBuffer(buff[:])
13673
13674	body := io.TeeReader(errorBody, ringBuffer)
13675	decoder := json.NewDecoder(body)
13676	decoder.UseNumber()
13677	code, message, err := restjson.GetErrorInfo(decoder)
13678	if err != nil {
13679		var snapshot bytes.Buffer
13680		io.Copy(&snapshot, ringBuffer)
13681		err = &smithy.DeserializationError{
13682			Err:      fmt.Errorf("failed to decode response body, %w", err),
13683			Snapshot: snapshot.Bytes(),
13684		}
13685		return err
13686	}
13687
13688	errorBody.Seek(0, io.SeekStart)
13689	if len(code) != 0 {
13690		errorCode = restjson.SanitizeErrorCode(code)
13691	}
13692	if len(message) != 0 {
13693		errorMessage = message
13694	}
13695
13696	switch {
13697	case strings.EqualFold("AccessDeniedException", errorCode):
13698		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
13699
13700	case strings.EqualFold("InternalFailureException", errorCode):
13701		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13702
13703	case strings.EqualFold("InvalidNextTokenException", errorCode):
13704		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
13705
13706	case strings.EqualFold("InvalidParameterValueException", errorCode):
13707		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
13708
13709	case strings.EqualFold("ResourceNotFoundException", errorCode):
13710		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13711
13712	case strings.EqualFold("ThrottlingException", errorCode):
13713		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13714
13715	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
13716		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
13717
13718	default:
13719		genericError := &smithy.GenericAPIError{
13720			Code:    errorCode,
13721			Message: errorMessage,
13722		}
13723		return genericError
13724
13725	}
13726}
13727
13728func awsRestjson1_deserializeOpHttpBindingsListThemesOutput(v *ListThemesOutput, response *smithyhttp.Response) error {
13729	if v == nil {
13730		return fmt.Errorf("unsupported deserialization for nil %T", v)
13731	}
13732
13733	v.Status = int32(response.StatusCode)
13734
13735	return nil
13736}
13737func awsRestjson1_deserializeOpDocumentListThemesOutput(v **ListThemesOutput, value interface{}) error {
13738	if v == nil {
13739		return fmt.Errorf("unexpected nil of type %T", v)
13740	}
13741	if value == nil {
13742		return nil
13743	}
13744
13745	shape, ok := value.(map[string]interface{})
13746	if !ok {
13747		return fmt.Errorf("unexpected JSON type %v", value)
13748	}
13749
13750	var sv *ListThemesOutput
13751	if *v == nil {
13752		sv = &ListThemesOutput{}
13753	} else {
13754		sv = *v
13755	}
13756
13757	for key, value := range shape {
13758		switch key {
13759		case "NextToken":
13760			if value != nil {
13761				jtv, ok := value.(string)
13762				if !ok {
13763					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13764				}
13765				sv.NextToken = ptr.String(jtv)
13766			}
13767
13768		case "RequestId":
13769			if value != nil {
13770				jtv, ok := value.(string)
13771				if !ok {
13772					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13773				}
13774				sv.RequestId = ptr.String(jtv)
13775			}
13776
13777		case "ThemeSummaryList":
13778			if err := awsRestjson1_deserializeDocumentThemeSummaryList(&sv.ThemeSummaryList, value); err != nil {
13779				return err
13780			}
13781
13782		default:
13783			_, _ = key, value
13784
13785		}
13786	}
13787	*v = sv
13788	return nil
13789}
13790
13791type awsRestjson1_deserializeOpListThemeVersions struct {
13792}
13793
13794func (*awsRestjson1_deserializeOpListThemeVersions) ID() string {
13795	return "OperationDeserializer"
13796}
13797
13798func (m *awsRestjson1_deserializeOpListThemeVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13799	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13800) {
13801	out, metadata, err = next.HandleDeserialize(ctx, in)
13802	if err != nil {
13803		return out, metadata, err
13804	}
13805
13806	response, ok := out.RawResponse.(*smithyhttp.Response)
13807	if !ok {
13808		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
13809	}
13810
13811	if response.StatusCode < 200 || response.StatusCode >= 300 {
13812		return out, metadata, awsRestjson1_deserializeOpErrorListThemeVersions(response, &metadata)
13813	}
13814	output := &ListThemeVersionsOutput{}
13815	out.Result = output
13816
13817	err = awsRestjson1_deserializeOpHttpBindingsListThemeVersionsOutput(output, response)
13818	if err != nil {
13819		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
13820	}
13821
13822	var buff [1024]byte
13823	ringBuffer := smithyio.NewRingBuffer(buff[:])
13824
13825	body := io.TeeReader(response.Body, ringBuffer)
13826
13827	decoder := json.NewDecoder(body)
13828	decoder.UseNumber()
13829	var shape interface{}
13830	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
13831		var snapshot bytes.Buffer
13832		io.Copy(&snapshot, ringBuffer)
13833		err = &smithy.DeserializationError{
13834			Err:      fmt.Errorf("failed to decode response body, %w", err),
13835			Snapshot: snapshot.Bytes(),
13836		}
13837		return out, metadata, err
13838	}
13839
13840	err = awsRestjson1_deserializeOpDocumentListThemeVersionsOutput(&output, shape)
13841	if err != nil {
13842		var snapshot bytes.Buffer
13843		io.Copy(&snapshot, ringBuffer)
13844		return out, metadata, &smithy.DeserializationError{
13845			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
13846			Snapshot: snapshot.Bytes(),
13847		}
13848	}
13849
13850	return out, metadata, err
13851}
13852
13853func awsRestjson1_deserializeOpErrorListThemeVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
13854	var errorBuffer bytes.Buffer
13855	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
13856		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
13857	}
13858	errorBody := bytes.NewReader(errorBuffer.Bytes())
13859
13860	errorCode := "UnknownError"
13861	errorMessage := errorCode
13862
13863	code := response.Header.Get("X-Amzn-ErrorType")
13864	if len(code) != 0 {
13865		errorCode = restjson.SanitizeErrorCode(code)
13866	}
13867
13868	var buff [1024]byte
13869	ringBuffer := smithyio.NewRingBuffer(buff[:])
13870
13871	body := io.TeeReader(errorBody, ringBuffer)
13872	decoder := json.NewDecoder(body)
13873	decoder.UseNumber()
13874	code, message, err := restjson.GetErrorInfo(decoder)
13875	if err != nil {
13876		var snapshot bytes.Buffer
13877		io.Copy(&snapshot, ringBuffer)
13878		err = &smithy.DeserializationError{
13879			Err:      fmt.Errorf("failed to decode response body, %w", err),
13880			Snapshot: snapshot.Bytes(),
13881		}
13882		return err
13883	}
13884
13885	errorBody.Seek(0, io.SeekStart)
13886	if len(code) != 0 {
13887		errorCode = restjson.SanitizeErrorCode(code)
13888	}
13889	if len(message) != 0 {
13890		errorMessage = message
13891	}
13892
13893	switch {
13894	case strings.EqualFold("AccessDeniedException", errorCode):
13895		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
13896
13897	case strings.EqualFold("InternalFailureException", errorCode):
13898		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
13899
13900	case strings.EqualFold("InvalidNextTokenException", errorCode):
13901		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
13902
13903	case strings.EqualFold("InvalidParameterValueException", errorCode):
13904		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
13905
13906	case strings.EqualFold("ResourceNotFoundException", errorCode):
13907		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
13908
13909	case strings.EqualFold("ThrottlingException", errorCode):
13910		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
13911
13912	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
13913		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
13914
13915	default:
13916		genericError := &smithy.GenericAPIError{
13917			Code:    errorCode,
13918			Message: errorMessage,
13919		}
13920		return genericError
13921
13922	}
13923}
13924
13925func awsRestjson1_deserializeOpHttpBindingsListThemeVersionsOutput(v *ListThemeVersionsOutput, response *smithyhttp.Response) error {
13926	if v == nil {
13927		return fmt.Errorf("unsupported deserialization for nil %T", v)
13928	}
13929
13930	v.Status = int32(response.StatusCode)
13931
13932	return nil
13933}
13934func awsRestjson1_deserializeOpDocumentListThemeVersionsOutput(v **ListThemeVersionsOutput, value interface{}) error {
13935	if v == nil {
13936		return fmt.Errorf("unexpected nil of type %T", v)
13937	}
13938	if value == nil {
13939		return nil
13940	}
13941
13942	shape, ok := value.(map[string]interface{})
13943	if !ok {
13944		return fmt.Errorf("unexpected JSON type %v", value)
13945	}
13946
13947	var sv *ListThemeVersionsOutput
13948	if *v == nil {
13949		sv = &ListThemeVersionsOutput{}
13950	} else {
13951		sv = *v
13952	}
13953
13954	for key, value := range shape {
13955		switch key {
13956		case "NextToken":
13957			if value != nil {
13958				jtv, ok := value.(string)
13959				if !ok {
13960					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13961				}
13962				sv.NextToken = ptr.String(jtv)
13963			}
13964
13965		case "RequestId":
13966			if value != nil {
13967				jtv, ok := value.(string)
13968				if !ok {
13969					return fmt.Errorf("expected String to be of type string, got %T instead", value)
13970				}
13971				sv.RequestId = ptr.String(jtv)
13972			}
13973
13974		case "ThemeVersionSummaryList":
13975			if err := awsRestjson1_deserializeDocumentThemeVersionSummaryList(&sv.ThemeVersionSummaryList, value); err != nil {
13976				return err
13977			}
13978
13979		default:
13980			_, _ = key, value
13981
13982		}
13983	}
13984	*v = sv
13985	return nil
13986}
13987
13988type awsRestjson1_deserializeOpListUserGroups struct {
13989}
13990
13991func (*awsRestjson1_deserializeOpListUserGroups) ID() string {
13992	return "OperationDeserializer"
13993}
13994
13995func (m *awsRestjson1_deserializeOpListUserGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
13996	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
13997) {
13998	out, metadata, err = next.HandleDeserialize(ctx, in)
13999	if err != nil {
14000		return out, metadata, err
14001	}
14002
14003	response, ok := out.RawResponse.(*smithyhttp.Response)
14004	if !ok {
14005		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14006	}
14007
14008	if response.StatusCode < 200 || response.StatusCode >= 300 {
14009		return out, metadata, awsRestjson1_deserializeOpErrorListUserGroups(response, &metadata)
14010	}
14011	output := &ListUserGroupsOutput{}
14012	out.Result = output
14013
14014	err = awsRestjson1_deserializeOpHttpBindingsListUserGroupsOutput(output, response)
14015	if err != nil {
14016		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
14017	}
14018
14019	var buff [1024]byte
14020	ringBuffer := smithyio.NewRingBuffer(buff[:])
14021
14022	body := io.TeeReader(response.Body, ringBuffer)
14023
14024	decoder := json.NewDecoder(body)
14025	decoder.UseNumber()
14026	var shape interface{}
14027	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14028		var snapshot bytes.Buffer
14029		io.Copy(&snapshot, ringBuffer)
14030		err = &smithy.DeserializationError{
14031			Err:      fmt.Errorf("failed to decode response body, %w", err),
14032			Snapshot: snapshot.Bytes(),
14033		}
14034		return out, metadata, err
14035	}
14036
14037	err = awsRestjson1_deserializeOpDocumentListUserGroupsOutput(&output, shape)
14038	if err != nil {
14039		var snapshot bytes.Buffer
14040		io.Copy(&snapshot, ringBuffer)
14041		return out, metadata, &smithy.DeserializationError{
14042			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14043			Snapshot: snapshot.Bytes(),
14044		}
14045	}
14046
14047	return out, metadata, err
14048}
14049
14050func awsRestjson1_deserializeOpErrorListUserGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14051	var errorBuffer bytes.Buffer
14052	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14053		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14054	}
14055	errorBody := bytes.NewReader(errorBuffer.Bytes())
14056
14057	errorCode := "UnknownError"
14058	errorMessage := errorCode
14059
14060	code := response.Header.Get("X-Amzn-ErrorType")
14061	if len(code) != 0 {
14062		errorCode = restjson.SanitizeErrorCode(code)
14063	}
14064
14065	var buff [1024]byte
14066	ringBuffer := smithyio.NewRingBuffer(buff[:])
14067
14068	body := io.TeeReader(errorBody, ringBuffer)
14069	decoder := json.NewDecoder(body)
14070	decoder.UseNumber()
14071	code, message, err := restjson.GetErrorInfo(decoder)
14072	if err != nil {
14073		var snapshot bytes.Buffer
14074		io.Copy(&snapshot, ringBuffer)
14075		err = &smithy.DeserializationError{
14076			Err:      fmt.Errorf("failed to decode response body, %w", err),
14077			Snapshot: snapshot.Bytes(),
14078		}
14079		return err
14080	}
14081
14082	errorBody.Seek(0, io.SeekStart)
14083	if len(code) != 0 {
14084		errorCode = restjson.SanitizeErrorCode(code)
14085	}
14086	if len(message) != 0 {
14087		errorMessage = message
14088	}
14089
14090	switch {
14091	case strings.EqualFold("AccessDeniedException", errorCode):
14092		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
14093
14094	case strings.EqualFold("InternalFailureException", errorCode):
14095		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14096
14097	case strings.EqualFold("InvalidParameterValueException", errorCode):
14098		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
14099
14100	case strings.EqualFold("PreconditionNotMetException", errorCode):
14101		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
14102
14103	case strings.EqualFold("ResourceNotFoundException", errorCode):
14104		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14105
14106	case strings.EqualFold("ResourceUnavailableException", errorCode):
14107		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
14108
14109	case strings.EqualFold("ThrottlingException", errorCode):
14110		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14111
14112	default:
14113		genericError := &smithy.GenericAPIError{
14114			Code:    errorCode,
14115			Message: errorMessage,
14116		}
14117		return genericError
14118
14119	}
14120}
14121
14122func awsRestjson1_deserializeOpHttpBindingsListUserGroupsOutput(v *ListUserGroupsOutput, response *smithyhttp.Response) error {
14123	if v == nil {
14124		return fmt.Errorf("unsupported deserialization for nil %T", v)
14125	}
14126
14127	v.Status = int32(response.StatusCode)
14128
14129	return nil
14130}
14131func awsRestjson1_deserializeOpDocumentListUserGroupsOutput(v **ListUserGroupsOutput, value interface{}) error {
14132	if v == nil {
14133		return fmt.Errorf("unexpected nil of type %T", v)
14134	}
14135	if value == nil {
14136		return nil
14137	}
14138
14139	shape, ok := value.(map[string]interface{})
14140	if !ok {
14141		return fmt.Errorf("unexpected JSON type %v", value)
14142	}
14143
14144	var sv *ListUserGroupsOutput
14145	if *v == nil {
14146		sv = &ListUserGroupsOutput{}
14147	} else {
14148		sv = *v
14149	}
14150
14151	for key, value := range shape {
14152		switch key {
14153		case "GroupList":
14154			if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, value); err != nil {
14155				return err
14156			}
14157
14158		case "NextToken":
14159			if value != nil {
14160				jtv, ok := value.(string)
14161				if !ok {
14162					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14163				}
14164				sv.NextToken = ptr.String(jtv)
14165			}
14166
14167		case "RequestId":
14168			if value != nil {
14169				jtv, ok := value.(string)
14170				if !ok {
14171					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14172				}
14173				sv.RequestId = ptr.String(jtv)
14174			}
14175
14176		default:
14177			_, _ = key, value
14178
14179		}
14180	}
14181	*v = sv
14182	return nil
14183}
14184
14185type awsRestjson1_deserializeOpListUsers struct {
14186}
14187
14188func (*awsRestjson1_deserializeOpListUsers) ID() string {
14189	return "OperationDeserializer"
14190}
14191
14192func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14193	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14194) {
14195	out, metadata, err = next.HandleDeserialize(ctx, in)
14196	if err != nil {
14197		return out, metadata, err
14198	}
14199
14200	response, ok := out.RawResponse.(*smithyhttp.Response)
14201	if !ok {
14202		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14203	}
14204
14205	if response.StatusCode < 200 || response.StatusCode >= 300 {
14206		return out, metadata, awsRestjson1_deserializeOpErrorListUsers(response, &metadata)
14207	}
14208	output := &ListUsersOutput{}
14209	out.Result = output
14210
14211	err = awsRestjson1_deserializeOpHttpBindingsListUsersOutput(output, response)
14212	if err != nil {
14213		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
14214	}
14215
14216	var buff [1024]byte
14217	ringBuffer := smithyio.NewRingBuffer(buff[:])
14218
14219	body := io.TeeReader(response.Body, ringBuffer)
14220
14221	decoder := json.NewDecoder(body)
14222	decoder.UseNumber()
14223	var shape interface{}
14224	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14225		var snapshot bytes.Buffer
14226		io.Copy(&snapshot, ringBuffer)
14227		err = &smithy.DeserializationError{
14228			Err:      fmt.Errorf("failed to decode response body, %w", err),
14229			Snapshot: snapshot.Bytes(),
14230		}
14231		return out, metadata, err
14232	}
14233
14234	err = awsRestjson1_deserializeOpDocumentListUsersOutput(&output, shape)
14235	if err != nil {
14236		var snapshot bytes.Buffer
14237		io.Copy(&snapshot, ringBuffer)
14238		return out, metadata, &smithy.DeserializationError{
14239			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14240			Snapshot: snapshot.Bytes(),
14241		}
14242	}
14243
14244	return out, metadata, err
14245}
14246
14247func awsRestjson1_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14248	var errorBuffer bytes.Buffer
14249	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14250		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14251	}
14252	errorBody := bytes.NewReader(errorBuffer.Bytes())
14253
14254	errorCode := "UnknownError"
14255	errorMessage := errorCode
14256
14257	code := response.Header.Get("X-Amzn-ErrorType")
14258	if len(code) != 0 {
14259		errorCode = restjson.SanitizeErrorCode(code)
14260	}
14261
14262	var buff [1024]byte
14263	ringBuffer := smithyio.NewRingBuffer(buff[:])
14264
14265	body := io.TeeReader(errorBody, ringBuffer)
14266	decoder := json.NewDecoder(body)
14267	decoder.UseNumber()
14268	code, message, err := restjson.GetErrorInfo(decoder)
14269	if err != nil {
14270		var snapshot bytes.Buffer
14271		io.Copy(&snapshot, ringBuffer)
14272		err = &smithy.DeserializationError{
14273			Err:      fmt.Errorf("failed to decode response body, %w", err),
14274			Snapshot: snapshot.Bytes(),
14275		}
14276		return err
14277	}
14278
14279	errorBody.Seek(0, io.SeekStart)
14280	if len(code) != 0 {
14281		errorCode = restjson.SanitizeErrorCode(code)
14282	}
14283	if len(message) != 0 {
14284		errorMessage = message
14285	}
14286
14287	switch {
14288	case strings.EqualFold("AccessDeniedException", errorCode):
14289		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
14290
14291	case strings.EqualFold("InternalFailureException", errorCode):
14292		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14293
14294	case strings.EqualFold("InvalidNextTokenException", errorCode):
14295		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
14296
14297	case strings.EqualFold("InvalidParameterValueException", errorCode):
14298		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
14299
14300	case strings.EqualFold("PreconditionNotMetException", errorCode):
14301		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
14302
14303	case strings.EqualFold("ResourceNotFoundException", errorCode):
14304		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14305
14306	case strings.EqualFold("ResourceUnavailableException", errorCode):
14307		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
14308
14309	case strings.EqualFold("ThrottlingException", errorCode):
14310		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14311
14312	default:
14313		genericError := &smithy.GenericAPIError{
14314			Code:    errorCode,
14315			Message: errorMessage,
14316		}
14317		return genericError
14318
14319	}
14320}
14321
14322func awsRestjson1_deserializeOpHttpBindingsListUsersOutput(v *ListUsersOutput, response *smithyhttp.Response) error {
14323	if v == nil {
14324		return fmt.Errorf("unsupported deserialization for nil %T", v)
14325	}
14326
14327	v.Status = int32(response.StatusCode)
14328
14329	return nil
14330}
14331func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error {
14332	if v == nil {
14333		return fmt.Errorf("unexpected nil of type %T", v)
14334	}
14335	if value == nil {
14336		return nil
14337	}
14338
14339	shape, ok := value.(map[string]interface{})
14340	if !ok {
14341		return fmt.Errorf("unexpected JSON type %v", value)
14342	}
14343
14344	var sv *ListUsersOutput
14345	if *v == nil {
14346		sv = &ListUsersOutput{}
14347	} else {
14348		sv = *v
14349	}
14350
14351	for key, value := range shape {
14352		switch key {
14353		case "NextToken":
14354			if value != nil {
14355				jtv, ok := value.(string)
14356				if !ok {
14357					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14358				}
14359				sv.NextToken = ptr.String(jtv)
14360			}
14361
14362		case "RequestId":
14363			if value != nil {
14364				jtv, ok := value.(string)
14365				if !ok {
14366					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14367				}
14368				sv.RequestId = ptr.String(jtv)
14369			}
14370
14371		case "UserList":
14372			if err := awsRestjson1_deserializeDocumentUserList(&sv.UserList, value); err != nil {
14373				return err
14374			}
14375
14376		default:
14377			_, _ = key, value
14378
14379		}
14380	}
14381	*v = sv
14382	return nil
14383}
14384
14385type awsRestjson1_deserializeOpRegisterUser struct {
14386}
14387
14388func (*awsRestjson1_deserializeOpRegisterUser) ID() string {
14389	return "OperationDeserializer"
14390}
14391
14392func (m *awsRestjson1_deserializeOpRegisterUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14393	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14394) {
14395	out, metadata, err = next.HandleDeserialize(ctx, in)
14396	if err != nil {
14397		return out, metadata, err
14398	}
14399
14400	response, ok := out.RawResponse.(*smithyhttp.Response)
14401	if !ok {
14402		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14403	}
14404
14405	if response.StatusCode < 200 || response.StatusCode >= 300 {
14406		return out, metadata, awsRestjson1_deserializeOpErrorRegisterUser(response, &metadata)
14407	}
14408	output := &RegisterUserOutput{}
14409	out.Result = output
14410
14411	err = awsRestjson1_deserializeOpHttpBindingsRegisterUserOutput(output, response)
14412	if err != nil {
14413		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
14414	}
14415
14416	var buff [1024]byte
14417	ringBuffer := smithyio.NewRingBuffer(buff[:])
14418
14419	body := io.TeeReader(response.Body, ringBuffer)
14420
14421	decoder := json.NewDecoder(body)
14422	decoder.UseNumber()
14423	var shape interface{}
14424	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14425		var snapshot bytes.Buffer
14426		io.Copy(&snapshot, ringBuffer)
14427		err = &smithy.DeserializationError{
14428			Err:      fmt.Errorf("failed to decode response body, %w", err),
14429			Snapshot: snapshot.Bytes(),
14430		}
14431		return out, metadata, err
14432	}
14433
14434	err = awsRestjson1_deserializeOpDocumentRegisterUserOutput(&output, shape)
14435	if err != nil {
14436		var snapshot bytes.Buffer
14437		io.Copy(&snapshot, ringBuffer)
14438		return out, metadata, &smithy.DeserializationError{
14439			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14440			Snapshot: snapshot.Bytes(),
14441		}
14442	}
14443
14444	return out, metadata, err
14445}
14446
14447func awsRestjson1_deserializeOpErrorRegisterUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14448	var errorBuffer bytes.Buffer
14449	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14450		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14451	}
14452	errorBody := bytes.NewReader(errorBuffer.Bytes())
14453
14454	errorCode := "UnknownError"
14455	errorMessage := errorCode
14456
14457	code := response.Header.Get("X-Amzn-ErrorType")
14458	if len(code) != 0 {
14459		errorCode = restjson.SanitizeErrorCode(code)
14460	}
14461
14462	var buff [1024]byte
14463	ringBuffer := smithyio.NewRingBuffer(buff[:])
14464
14465	body := io.TeeReader(errorBody, ringBuffer)
14466	decoder := json.NewDecoder(body)
14467	decoder.UseNumber()
14468	code, message, err := restjson.GetErrorInfo(decoder)
14469	if err != nil {
14470		var snapshot bytes.Buffer
14471		io.Copy(&snapshot, ringBuffer)
14472		err = &smithy.DeserializationError{
14473			Err:      fmt.Errorf("failed to decode response body, %w", err),
14474			Snapshot: snapshot.Bytes(),
14475		}
14476		return err
14477	}
14478
14479	errorBody.Seek(0, io.SeekStart)
14480	if len(code) != 0 {
14481		errorCode = restjson.SanitizeErrorCode(code)
14482	}
14483	if len(message) != 0 {
14484		errorMessage = message
14485	}
14486
14487	switch {
14488	case strings.EqualFold("AccessDeniedException", errorCode):
14489		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
14490
14491	case strings.EqualFold("InternalFailureException", errorCode):
14492		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14493
14494	case strings.EqualFold("InvalidParameterValueException", errorCode):
14495		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
14496
14497	case strings.EqualFold("LimitExceededException", errorCode):
14498		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
14499
14500	case strings.EqualFold("PreconditionNotMetException", errorCode):
14501		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
14502
14503	case strings.EqualFold("ResourceExistsException", errorCode):
14504		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
14505
14506	case strings.EqualFold("ResourceNotFoundException", errorCode):
14507		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14508
14509	case strings.EqualFold("ResourceUnavailableException", errorCode):
14510		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
14511
14512	case strings.EqualFold("ThrottlingException", errorCode):
14513		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14514
14515	default:
14516		genericError := &smithy.GenericAPIError{
14517			Code:    errorCode,
14518			Message: errorMessage,
14519		}
14520		return genericError
14521
14522	}
14523}
14524
14525func awsRestjson1_deserializeOpHttpBindingsRegisterUserOutput(v *RegisterUserOutput, response *smithyhttp.Response) error {
14526	if v == nil {
14527		return fmt.Errorf("unsupported deserialization for nil %T", v)
14528	}
14529
14530	v.Status = int32(response.StatusCode)
14531
14532	return nil
14533}
14534func awsRestjson1_deserializeOpDocumentRegisterUserOutput(v **RegisterUserOutput, value interface{}) error {
14535	if v == nil {
14536		return fmt.Errorf("unexpected nil of type %T", v)
14537	}
14538	if value == nil {
14539		return nil
14540	}
14541
14542	shape, ok := value.(map[string]interface{})
14543	if !ok {
14544		return fmt.Errorf("unexpected JSON type %v", value)
14545	}
14546
14547	var sv *RegisterUserOutput
14548	if *v == nil {
14549		sv = &RegisterUserOutput{}
14550	} else {
14551		sv = *v
14552	}
14553
14554	for key, value := range shape {
14555		switch key {
14556		case "RequestId":
14557			if value != nil {
14558				jtv, ok := value.(string)
14559				if !ok {
14560					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14561				}
14562				sv.RequestId = ptr.String(jtv)
14563			}
14564
14565		case "User":
14566			if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil {
14567				return err
14568			}
14569
14570		case "UserInvitationUrl":
14571			if value != nil {
14572				jtv, ok := value.(string)
14573				if !ok {
14574					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14575				}
14576				sv.UserInvitationUrl = ptr.String(jtv)
14577			}
14578
14579		default:
14580			_, _ = key, value
14581
14582		}
14583	}
14584	*v = sv
14585	return nil
14586}
14587
14588type awsRestjson1_deserializeOpRestoreAnalysis struct {
14589}
14590
14591func (*awsRestjson1_deserializeOpRestoreAnalysis) ID() string {
14592	return "OperationDeserializer"
14593}
14594
14595func (m *awsRestjson1_deserializeOpRestoreAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14596	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14597) {
14598	out, metadata, err = next.HandleDeserialize(ctx, in)
14599	if err != nil {
14600		return out, metadata, err
14601	}
14602
14603	response, ok := out.RawResponse.(*smithyhttp.Response)
14604	if !ok {
14605		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14606	}
14607
14608	if response.StatusCode < 200 || response.StatusCode >= 300 {
14609		return out, metadata, awsRestjson1_deserializeOpErrorRestoreAnalysis(response, &metadata)
14610	}
14611	output := &RestoreAnalysisOutput{}
14612	out.Result = output
14613
14614	err = awsRestjson1_deserializeOpHttpBindingsRestoreAnalysisOutput(output, response)
14615	if err != nil {
14616		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
14617	}
14618
14619	var buff [1024]byte
14620	ringBuffer := smithyio.NewRingBuffer(buff[:])
14621
14622	body := io.TeeReader(response.Body, ringBuffer)
14623
14624	decoder := json.NewDecoder(body)
14625	decoder.UseNumber()
14626	var shape interface{}
14627	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14628		var snapshot bytes.Buffer
14629		io.Copy(&snapshot, ringBuffer)
14630		err = &smithy.DeserializationError{
14631			Err:      fmt.Errorf("failed to decode response body, %w", err),
14632			Snapshot: snapshot.Bytes(),
14633		}
14634		return out, metadata, err
14635	}
14636
14637	err = awsRestjson1_deserializeOpDocumentRestoreAnalysisOutput(&output, shape)
14638	if err != nil {
14639		var snapshot bytes.Buffer
14640		io.Copy(&snapshot, ringBuffer)
14641		return out, metadata, &smithy.DeserializationError{
14642			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14643			Snapshot: snapshot.Bytes(),
14644		}
14645	}
14646
14647	return out, metadata, err
14648}
14649
14650func awsRestjson1_deserializeOpErrorRestoreAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14651	var errorBuffer bytes.Buffer
14652	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14653		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14654	}
14655	errorBody := bytes.NewReader(errorBuffer.Bytes())
14656
14657	errorCode := "UnknownError"
14658	errorMessage := errorCode
14659
14660	code := response.Header.Get("X-Amzn-ErrorType")
14661	if len(code) != 0 {
14662		errorCode = restjson.SanitizeErrorCode(code)
14663	}
14664
14665	var buff [1024]byte
14666	ringBuffer := smithyio.NewRingBuffer(buff[:])
14667
14668	body := io.TeeReader(errorBody, ringBuffer)
14669	decoder := json.NewDecoder(body)
14670	decoder.UseNumber()
14671	code, message, err := restjson.GetErrorInfo(decoder)
14672	if err != nil {
14673		var snapshot bytes.Buffer
14674		io.Copy(&snapshot, ringBuffer)
14675		err = &smithy.DeserializationError{
14676			Err:      fmt.Errorf("failed to decode response body, %w", err),
14677			Snapshot: snapshot.Bytes(),
14678		}
14679		return err
14680	}
14681
14682	errorBody.Seek(0, io.SeekStart)
14683	if len(code) != 0 {
14684		errorCode = restjson.SanitizeErrorCode(code)
14685	}
14686	if len(message) != 0 {
14687		errorMessage = message
14688	}
14689
14690	switch {
14691	case strings.EqualFold("ConflictException", errorCode):
14692		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
14693
14694	case strings.EqualFold("InternalFailureException", errorCode):
14695		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14696
14697	case strings.EqualFold("InvalidParameterValueException", errorCode):
14698		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
14699
14700	case strings.EqualFold("ResourceNotFoundException", errorCode):
14701		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14702
14703	case strings.EqualFold("ThrottlingException", errorCode):
14704		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14705
14706	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
14707		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
14708
14709	default:
14710		genericError := &smithy.GenericAPIError{
14711			Code:    errorCode,
14712			Message: errorMessage,
14713		}
14714		return genericError
14715
14716	}
14717}
14718
14719func awsRestjson1_deserializeOpHttpBindingsRestoreAnalysisOutput(v *RestoreAnalysisOutput, response *smithyhttp.Response) error {
14720	if v == nil {
14721		return fmt.Errorf("unsupported deserialization for nil %T", v)
14722	}
14723
14724	v.Status = int32(response.StatusCode)
14725
14726	return nil
14727}
14728func awsRestjson1_deserializeOpDocumentRestoreAnalysisOutput(v **RestoreAnalysisOutput, value interface{}) error {
14729	if v == nil {
14730		return fmt.Errorf("unexpected nil of type %T", v)
14731	}
14732	if value == nil {
14733		return nil
14734	}
14735
14736	shape, ok := value.(map[string]interface{})
14737	if !ok {
14738		return fmt.Errorf("unexpected JSON type %v", value)
14739	}
14740
14741	var sv *RestoreAnalysisOutput
14742	if *v == nil {
14743		sv = &RestoreAnalysisOutput{}
14744	} else {
14745		sv = *v
14746	}
14747
14748	for key, value := range shape {
14749		switch key {
14750		case "AnalysisId":
14751			if value != nil {
14752				jtv, ok := value.(string)
14753				if !ok {
14754					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
14755				}
14756				sv.AnalysisId = ptr.String(jtv)
14757			}
14758
14759		case "Arn":
14760			if value != nil {
14761				jtv, ok := value.(string)
14762				if !ok {
14763					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
14764				}
14765				sv.Arn = ptr.String(jtv)
14766			}
14767
14768		case "RequestId":
14769			if value != nil {
14770				jtv, ok := value.(string)
14771				if !ok {
14772					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14773				}
14774				sv.RequestId = ptr.String(jtv)
14775			}
14776
14777		default:
14778			_, _ = key, value
14779
14780		}
14781	}
14782	*v = sv
14783	return nil
14784}
14785
14786type awsRestjson1_deserializeOpSearchAnalyses struct {
14787}
14788
14789func (*awsRestjson1_deserializeOpSearchAnalyses) ID() string {
14790	return "OperationDeserializer"
14791}
14792
14793func (m *awsRestjson1_deserializeOpSearchAnalyses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14794	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14795) {
14796	out, metadata, err = next.HandleDeserialize(ctx, in)
14797	if err != nil {
14798		return out, metadata, err
14799	}
14800
14801	response, ok := out.RawResponse.(*smithyhttp.Response)
14802	if !ok {
14803		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14804	}
14805
14806	if response.StatusCode < 200 || response.StatusCode >= 300 {
14807		return out, metadata, awsRestjson1_deserializeOpErrorSearchAnalyses(response, &metadata)
14808	}
14809	output := &SearchAnalysesOutput{}
14810	out.Result = output
14811
14812	err = awsRestjson1_deserializeOpHttpBindingsSearchAnalysesOutput(output, response)
14813	if err != nil {
14814		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
14815	}
14816
14817	var buff [1024]byte
14818	ringBuffer := smithyio.NewRingBuffer(buff[:])
14819
14820	body := io.TeeReader(response.Body, ringBuffer)
14821
14822	decoder := json.NewDecoder(body)
14823	decoder.UseNumber()
14824	var shape interface{}
14825	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
14826		var snapshot bytes.Buffer
14827		io.Copy(&snapshot, ringBuffer)
14828		err = &smithy.DeserializationError{
14829			Err:      fmt.Errorf("failed to decode response body, %w", err),
14830			Snapshot: snapshot.Bytes(),
14831		}
14832		return out, metadata, err
14833	}
14834
14835	err = awsRestjson1_deserializeOpDocumentSearchAnalysesOutput(&output, shape)
14836	if err != nil {
14837		var snapshot bytes.Buffer
14838		io.Copy(&snapshot, ringBuffer)
14839		return out, metadata, &smithy.DeserializationError{
14840			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
14841			Snapshot: snapshot.Bytes(),
14842		}
14843	}
14844
14845	return out, metadata, err
14846}
14847
14848func awsRestjson1_deserializeOpErrorSearchAnalyses(response *smithyhttp.Response, metadata *middleware.Metadata) error {
14849	var errorBuffer bytes.Buffer
14850	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
14851		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
14852	}
14853	errorBody := bytes.NewReader(errorBuffer.Bytes())
14854
14855	errorCode := "UnknownError"
14856	errorMessage := errorCode
14857
14858	code := response.Header.Get("X-Amzn-ErrorType")
14859	if len(code) != 0 {
14860		errorCode = restjson.SanitizeErrorCode(code)
14861	}
14862
14863	var buff [1024]byte
14864	ringBuffer := smithyio.NewRingBuffer(buff[:])
14865
14866	body := io.TeeReader(errorBody, ringBuffer)
14867	decoder := json.NewDecoder(body)
14868	decoder.UseNumber()
14869	code, message, err := restjson.GetErrorInfo(decoder)
14870	if err != nil {
14871		var snapshot bytes.Buffer
14872		io.Copy(&snapshot, ringBuffer)
14873		err = &smithy.DeserializationError{
14874			Err:      fmt.Errorf("failed to decode response body, %w", err),
14875			Snapshot: snapshot.Bytes(),
14876		}
14877		return err
14878	}
14879
14880	errorBody.Seek(0, io.SeekStart)
14881	if len(code) != 0 {
14882		errorCode = restjson.SanitizeErrorCode(code)
14883	}
14884	if len(message) != 0 {
14885		errorMessage = message
14886	}
14887
14888	switch {
14889	case strings.EqualFold("InternalFailureException", errorCode):
14890		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
14891
14892	case strings.EqualFold("InvalidNextTokenException", errorCode):
14893		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
14894
14895	case strings.EqualFold("InvalidParameterValueException", errorCode):
14896		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
14897
14898	case strings.EqualFold("ResourceNotFoundException", errorCode):
14899		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
14900
14901	case strings.EqualFold("ThrottlingException", errorCode):
14902		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
14903
14904	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
14905		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
14906
14907	default:
14908		genericError := &smithy.GenericAPIError{
14909			Code:    errorCode,
14910			Message: errorMessage,
14911		}
14912		return genericError
14913
14914	}
14915}
14916
14917func awsRestjson1_deserializeOpHttpBindingsSearchAnalysesOutput(v *SearchAnalysesOutput, response *smithyhttp.Response) error {
14918	if v == nil {
14919		return fmt.Errorf("unsupported deserialization for nil %T", v)
14920	}
14921
14922	v.Status = int32(response.StatusCode)
14923
14924	return nil
14925}
14926func awsRestjson1_deserializeOpDocumentSearchAnalysesOutput(v **SearchAnalysesOutput, value interface{}) error {
14927	if v == nil {
14928		return fmt.Errorf("unexpected nil of type %T", v)
14929	}
14930	if value == nil {
14931		return nil
14932	}
14933
14934	shape, ok := value.(map[string]interface{})
14935	if !ok {
14936		return fmt.Errorf("unexpected JSON type %v", value)
14937	}
14938
14939	var sv *SearchAnalysesOutput
14940	if *v == nil {
14941		sv = &SearchAnalysesOutput{}
14942	} else {
14943		sv = *v
14944	}
14945
14946	for key, value := range shape {
14947		switch key {
14948		case "AnalysisSummaryList":
14949			if err := awsRestjson1_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, value); err != nil {
14950				return err
14951			}
14952
14953		case "NextToken":
14954			if value != nil {
14955				jtv, ok := value.(string)
14956				if !ok {
14957					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14958				}
14959				sv.NextToken = ptr.String(jtv)
14960			}
14961
14962		case "RequestId":
14963			if value != nil {
14964				jtv, ok := value.(string)
14965				if !ok {
14966					return fmt.Errorf("expected String to be of type string, got %T instead", value)
14967				}
14968				sv.RequestId = ptr.String(jtv)
14969			}
14970
14971		default:
14972			_, _ = key, value
14973
14974		}
14975	}
14976	*v = sv
14977	return nil
14978}
14979
14980type awsRestjson1_deserializeOpSearchDashboards struct {
14981}
14982
14983func (*awsRestjson1_deserializeOpSearchDashboards) ID() string {
14984	return "OperationDeserializer"
14985}
14986
14987func (m *awsRestjson1_deserializeOpSearchDashboards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
14988	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
14989) {
14990	out, metadata, err = next.HandleDeserialize(ctx, in)
14991	if err != nil {
14992		return out, metadata, err
14993	}
14994
14995	response, ok := out.RawResponse.(*smithyhttp.Response)
14996	if !ok {
14997		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
14998	}
14999
15000	if response.StatusCode < 200 || response.StatusCode >= 300 {
15001		return out, metadata, awsRestjson1_deserializeOpErrorSearchDashboards(response, &metadata)
15002	}
15003	output := &SearchDashboardsOutput{}
15004	out.Result = output
15005
15006	err = awsRestjson1_deserializeOpHttpBindingsSearchDashboardsOutput(output, response)
15007	if err != nil {
15008		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15009	}
15010
15011	var buff [1024]byte
15012	ringBuffer := smithyio.NewRingBuffer(buff[:])
15013
15014	body := io.TeeReader(response.Body, ringBuffer)
15015
15016	decoder := json.NewDecoder(body)
15017	decoder.UseNumber()
15018	var shape interface{}
15019	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15020		var snapshot bytes.Buffer
15021		io.Copy(&snapshot, ringBuffer)
15022		err = &smithy.DeserializationError{
15023			Err:      fmt.Errorf("failed to decode response body, %w", err),
15024			Snapshot: snapshot.Bytes(),
15025		}
15026		return out, metadata, err
15027	}
15028
15029	err = awsRestjson1_deserializeOpDocumentSearchDashboardsOutput(&output, shape)
15030	if err != nil {
15031		var snapshot bytes.Buffer
15032		io.Copy(&snapshot, ringBuffer)
15033		return out, metadata, &smithy.DeserializationError{
15034			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15035			Snapshot: snapshot.Bytes(),
15036		}
15037	}
15038
15039	return out, metadata, err
15040}
15041
15042func awsRestjson1_deserializeOpErrorSearchDashboards(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15043	var errorBuffer bytes.Buffer
15044	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15045		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15046	}
15047	errorBody := bytes.NewReader(errorBuffer.Bytes())
15048
15049	errorCode := "UnknownError"
15050	errorMessage := errorCode
15051
15052	code := response.Header.Get("X-Amzn-ErrorType")
15053	if len(code) != 0 {
15054		errorCode = restjson.SanitizeErrorCode(code)
15055	}
15056
15057	var buff [1024]byte
15058	ringBuffer := smithyio.NewRingBuffer(buff[:])
15059
15060	body := io.TeeReader(errorBody, ringBuffer)
15061	decoder := json.NewDecoder(body)
15062	decoder.UseNumber()
15063	code, message, err := restjson.GetErrorInfo(decoder)
15064	if err != nil {
15065		var snapshot bytes.Buffer
15066		io.Copy(&snapshot, ringBuffer)
15067		err = &smithy.DeserializationError{
15068			Err:      fmt.Errorf("failed to decode response body, %w", err),
15069			Snapshot: snapshot.Bytes(),
15070		}
15071		return err
15072	}
15073
15074	errorBody.Seek(0, io.SeekStart)
15075	if len(code) != 0 {
15076		errorCode = restjson.SanitizeErrorCode(code)
15077	}
15078	if len(message) != 0 {
15079		errorMessage = message
15080	}
15081
15082	switch {
15083	case strings.EqualFold("InternalFailureException", errorCode):
15084		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15085
15086	case strings.EqualFold("InvalidNextTokenException", errorCode):
15087		return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
15088
15089	case strings.EqualFold("InvalidParameterValueException", errorCode):
15090		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
15091
15092	case strings.EqualFold("ResourceNotFoundException", errorCode):
15093		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15094
15095	case strings.EqualFold("ThrottlingException", errorCode):
15096		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15097
15098	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
15099		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
15100
15101	default:
15102		genericError := &smithy.GenericAPIError{
15103			Code:    errorCode,
15104			Message: errorMessage,
15105		}
15106		return genericError
15107
15108	}
15109}
15110
15111func awsRestjson1_deserializeOpHttpBindingsSearchDashboardsOutput(v *SearchDashboardsOutput, response *smithyhttp.Response) error {
15112	if v == nil {
15113		return fmt.Errorf("unsupported deserialization for nil %T", v)
15114	}
15115
15116	v.Status = int32(response.StatusCode)
15117
15118	return nil
15119}
15120func awsRestjson1_deserializeOpDocumentSearchDashboardsOutput(v **SearchDashboardsOutput, value interface{}) error {
15121	if v == nil {
15122		return fmt.Errorf("unexpected nil of type %T", v)
15123	}
15124	if value == nil {
15125		return nil
15126	}
15127
15128	shape, ok := value.(map[string]interface{})
15129	if !ok {
15130		return fmt.Errorf("unexpected JSON type %v", value)
15131	}
15132
15133	var sv *SearchDashboardsOutput
15134	if *v == nil {
15135		sv = &SearchDashboardsOutput{}
15136	} else {
15137		sv = *v
15138	}
15139
15140	for key, value := range shape {
15141		switch key {
15142		case "DashboardSummaryList":
15143			if err := awsRestjson1_deserializeDocumentDashboardSummaryList(&sv.DashboardSummaryList, value); err != nil {
15144				return err
15145			}
15146
15147		case "NextToken":
15148			if value != nil {
15149				jtv, ok := value.(string)
15150				if !ok {
15151					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15152				}
15153				sv.NextToken = ptr.String(jtv)
15154			}
15155
15156		case "RequestId":
15157			if value != nil {
15158				jtv, ok := value.(string)
15159				if !ok {
15160					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15161				}
15162				sv.RequestId = ptr.String(jtv)
15163			}
15164
15165		default:
15166			_, _ = key, value
15167
15168		}
15169	}
15170	*v = sv
15171	return nil
15172}
15173
15174type awsRestjson1_deserializeOpTagResource struct {
15175}
15176
15177func (*awsRestjson1_deserializeOpTagResource) ID() string {
15178	return "OperationDeserializer"
15179}
15180
15181func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15182	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15183) {
15184	out, metadata, err = next.HandleDeserialize(ctx, in)
15185	if err != nil {
15186		return out, metadata, err
15187	}
15188
15189	response, ok := out.RawResponse.(*smithyhttp.Response)
15190	if !ok {
15191		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15192	}
15193
15194	if response.StatusCode < 200 || response.StatusCode >= 300 {
15195		return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
15196	}
15197	output := &TagResourceOutput{}
15198	out.Result = output
15199
15200	err = awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(output, response)
15201	if err != nil {
15202		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15203	}
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_deserializeOpDocumentTagResourceOutput(&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_deserializeOpErrorTagResource(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("AccessDeniedException", errorCode):
15278		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
15279
15280	case strings.EqualFold("InternalFailureException", errorCode):
15281		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15282
15283	case strings.EqualFold("InvalidParameterValueException", errorCode):
15284		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
15285
15286	case strings.EqualFold("LimitExceededException", errorCode):
15287		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
15288
15289	case strings.EqualFold("ResourceNotFoundException", errorCode):
15290		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15291
15292	case strings.EqualFold("ThrottlingException", errorCode):
15293		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15294
15295	default:
15296		genericError := &smithy.GenericAPIError{
15297			Code:    errorCode,
15298			Message: errorMessage,
15299		}
15300		return genericError
15301
15302	}
15303}
15304
15305func awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(v *TagResourceOutput, response *smithyhttp.Response) error {
15306	if v == nil {
15307		return fmt.Errorf("unsupported deserialization for nil %T", v)
15308	}
15309
15310	v.Status = int32(response.StatusCode)
15311
15312	return nil
15313}
15314func awsRestjson1_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
15315	if v == nil {
15316		return fmt.Errorf("unexpected nil of type %T", v)
15317	}
15318	if value == nil {
15319		return nil
15320	}
15321
15322	shape, ok := value.(map[string]interface{})
15323	if !ok {
15324		return fmt.Errorf("unexpected JSON type %v", value)
15325	}
15326
15327	var sv *TagResourceOutput
15328	if *v == nil {
15329		sv = &TagResourceOutput{}
15330	} else {
15331		sv = *v
15332	}
15333
15334	for key, value := range shape {
15335		switch key {
15336		case "RequestId":
15337			if value != nil {
15338				jtv, ok := value.(string)
15339				if !ok {
15340					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15341				}
15342				sv.RequestId = ptr.String(jtv)
15343			}
15344
15345		default:
15346			_, _ = key, value
15347
15348		}
15349	}
15350	*v = sv
15351	return nil
15352}
15353
15354type awsRestjson1_deserializeOpUntagResource struct {
15355}
15356
15357func (*awsRestjson1_deserializeOpUntagResource) ID() string {
15358	return "OperationDeserializer"
15359}
15360
15361func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15362	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15363) {
15364	out, metadata, err = next.HandleDeserialize(ctx, in)
15365	if err != nil {
15366		return out, metadata, err
15367	}
15368
15369	response, ok := out.RawResponse.(*smithyhttp.Response)
15370	if !ok {
15371		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15372	}
15373
15374	if response.StatusCode < 200 || response.StatusCode >= 300 {
15375		return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
15376	}
15377	output := &UntagResourceOutput{}
15378	out.Result = output
15379
15380	err = awsRestjson1_deserializeOpHttpBindingsUntagResourceOutput(output, response)
15381	if err != nil {
15382		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15383	}
15384
15385	var buff [1024]byte
15386	ringBuffer := smithyio.NewRingBuffer(buff[:])
15387
15388	body := io.TeeReader(response.Body, ringBuffer)
15389
15390	decoder := json.NewDecoder(body)
15391	decoder.UseNumber()
15392	var shape interface{}
15393	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15394		var snapshot bytes.Buffer
15395		io.Copy(&snapshot, ringBuffer)
15396		err = &smithy.DeserializationError{
15397			Err:      fmt.Errorf("failed to decode response body, %w", err),
15398			Snapshot: snapshot.Bytes(),
15399		}
15400		return out, metadata, err
15401	}
15402
15403	err = awsRestjson1_deserializeOpDocumentUntagResourceOutput(&output, shape)
15404	if err != nil {
15405		var snapshot bytes.Buffer
15406		io.Copy(&snapshot, ringBuffer)
15407		return out, metadata, &smithy.DeserializationError{
15408			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15409			Snapshot: snapshot.Bytes(),
15410		}
15411	}
15412
15413	return out, metadata, err
15414}
15415
15416func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15417	var errorBuffer bytes.Buffer
15418	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15419		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15420	}
15421	errorBody := bytes.NewReader(errorBuffer.Bytes())
15422
15423	errorCode := "UnknownError"
15424	errorMessage := errorCode
15425
15426	code := response.Header.Get("X-Amzn-ErrorType")
15427	if len(code) != 0 {
15428		errorCode = restjson.SanitizeErrorCode(code)
15429	}
15430
15431	var buff [1024]byte
15432	ringBuffer := smithyio.NewRingBuffer(buff[:])
15433
15434	body := io.TeeReader(errorBody, ringBuffer)
15435	decoder := json.NewDecoder(body)
15436	decoder.UseNumber()
15437	code, message, err := restjson.GetErrorInfo(decoder)
15438	if err != nil {
15439		var snapshot bytes.Buffer
15440		io.Copy(&snapshot, ringBuffer)
15441		err = &smithy.DeserializationError{
15442			Err:      fmt.Errorf("failed to decode response body, %w", err),
15443			Snapshot: snapshot.Bytes(),
15444		}
15445		return err
15446	}
15447
15448	errorBody.Seek(0, io.SeekStart)
15449	if len(code) != 0 {
15450		errorCode = restjson.SanitizeErrorCode(code)
15451	}
15452	if len(message) != 0 {
15453		errorMessage = message
15454	}
15455
15456	switch {
15457	case strings.EqualFold("AccessDeniedException", errorCode):
15458		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
15459
15460	case strings.EqualFold("InternalFailureException", errorCode):
15461		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15462
15463	case strings.EqualFold("InvalidParameterValueException", errorCode):
15464		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
15465
15466	case strings.EqualFold("ResourceNotFoundException", errorCode):
15467		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15468
15469	case strings.EqualFold("ThrottlingException", errorCode):
15470		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15471
15472	default:
15473		genericError := &smithy.GenericAPIError{
15474			Code:    errorCode,
15475			Message: errorMessage,
15476		}
15477		return genericError
15478
15479	}
15480}
15481
15482func awsRestjson1_deserializeOpHttpBindingsUntagResourceOutput(v *UntagResourceOutput, response *smithyhttp.Response) error {
15483	if v == nil {
15484		return fmt.Errorf("unsupported deserialization for nil %T", v)
15485	}
15486
15487	v.Status = int32(response.StatusCode)
15488
15489	return nil
15490}
15491func awsRestjson1_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
15492	if v == nil {
15493		return fmt.Errorf("unexpected nil of type %T", v)
15494	}
15495	if value == nil {
15496		return nil
15497	}
15498
15499	shape, ok := value.(map[string]interface{})
15500	if !ok {
15501		return fmt.Errorf("unexpected JSON type %v", value)
15502	}
15503
15504	var sv *UntagResourceOutput
15505	if *v == nil {
15506		sv = &UntagResourceOutput{}
15507	} else {
15508		sv = *v
15509	}
15510
15511	for key, value := range shape {
15512		switch key {
15513		case "RequestId":
15514			if value != nil {
15515				jtv, ok := value.(string)
15516				if !ok {
15517					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15518				}
15519				sv.RequestId = ptr.String(jtv)
15520			}
15521
15522		default:
15523			_, _ = key, value
15524
15525		}
15526	}
15527	*v = sv
15528	return nil
15529}
15530
15531type awsRestjson1_deserializeOpUpdateAccountCustomization struct {
15532}
15533
15534func (*awsRestjson1_deserializeOpUpdateAccountCustomization) ID() string {
15535	return "OperationDeserializer"
15536}
15537
15538func (m *awsRestjson1_deserializeOpUpdateAccountCustomization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15539	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15540) {
15541	out, metadata, err = next.HandleDeserialize(ctx, in)
15542	if err != nil {
15543		return out, metadata, err
15544	}
15545
15546	response, ok := out.RawResponse.(*smithyhttp.Response)
15547	if !ok {
15548		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15549	}
15550
15551	if response.StatusCode < 200 || response.StatusCode >= 300 {
15552		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccountCustomization(response, &metadata)
15553	}
15554	output := &UpdateAccountCustomizationOutput{}
15555	out.Result = output
15556
15557	err = awsRestjson1_deserializeOpHttpBindingsUpdateAccountCustomizationOutput(output, response)
15558	if err != nil {
15559		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15560	}
15561
15562	var buff [1024]byte
15563	ringBuffer := smithyio.NewRingBuffer(buff[:])
15564
15565	body := io.TeeReader(response.Body, ringBuffer)
15566
15567	decoder := json.NewDecoder(body)
15568	decoder.UseNumber()
15569	var shape interface{}
15570	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15571		var snapshot bytes.Buffer
15572		io.Copy(&snapshot, ringBuffer)
15573		err = &smithy.DeserializationError{
15574			Err:      fmt.Errorf("failed to decode response body, %w", err),
15575			Snapshot: snapshot.Bytes(),
15576		}
15577		return out, metadata, err
15578	}
15579
15580	err = awsRestjson1_deserializeOpDocumentUpdateAccountCustomizationOutput(&output, shape)
15581	if err != nil {
15582		var snapshot bytes.Buffer
15583		io.Copy(&snapshot, ringBuffer)
15584		return out, metadata, &smithy.DeserializationError{
15585			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15586			Snapshot: snapshot.Bytes(),
15587		}
15588	}
15589
15590	return out, metadata, err
15591}
15592
15593func awsRestjson1_deserializeOpErrorUpdateAccountCustomization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15594	var errorBuffer bytes.Buffer
15595	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15596		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15597	}
15598	errorBody := bytes.NewReader(errorBuffer.Bytes())
15599
15600	errorCode := "UnknownError"
15601	errorMessage := errorCode
15602
15603	code := response.Header.Get("X-Amzn-ErrorType")
15604	if len(code) != 0 {
15605		errorCode = restjson.SanitizeErrorCode(code)
15606	}
15607
15608	var buff [1024]byte
15609	ringBuffer := smithyio.NewRingBuffer(buff[:])
15610
15611	body := io.TeeReader(errorBody, ringBuffer)
15612	decoder := json.NewDecoder(body)
15613	decoder.UseNumber()
15614	code, message, err := restjson.GetErrorInfo(decoder)
15615	if err != nil {
15616		var snapshot bytes.Buffer
15617		io.Copy(&snapshot, ringBuffer)
15618		err = &smithy.DeserializationError{
15619			Err:      fmt.Errorf("failed to decode response body, %w", err),
15620			Snapshot: snapshot.Bytes(),
15621		}
15622		return err
15623	}
15624
15625	errorBody.Seek(0, io.SeekStart)
15626	if len(code) != 0 {
15627		errorCode = restjson.SanitizeErrorCode(code)
15628	}
15629	if len(message) != 0 {
15630		errorMessage = message
15631	}
15632
15633	switch {
15634	case strings.EqualFold("AccessDeniedException", errorCode):
15635		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
15636
15637	case strings.EqualFold("InternalFailureException", errorCode):
15638		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15639
15640	case strings.EqualFold("InvalidParameterValueException", errorCode):
15641		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
15642
15643	case strings.EqualFold("ResourceNotFoundException", errorCode):
15644		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15645
15646	case strings.EqualFold("ResourceUnavailableException", errorCode):
15647		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
15648
15649	case strings.EqualFold("ThrottlingException", errorCode):
15650		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15651
15652	default:
15653		genericError := &smithy.GenericAPIError{
15654			Code:    errorCode,
15655			Message: errorMessage,
15656		}
15657		return genericError
15658
15659	}
15660}
15661
15662func awsRestjson1_deserializeOpHttpBindingsUpdateAccountCustomizationOutput(v *UpdateAccountCustomizationOutput, response *smithyhttp.Response) error {
15663	if v == nil {
15664		return fmt.Errorf("unsupported deserialization for nil %T", v)
15665	}
15666
15667	v.Status = int32(response.StatusCode)
15668
15669	return nil
15670}
15671func awsRestjson1_deserializeOpDocumentUpdateAccountCustomizationOutput(v **UpdateAccountCustomizationOutput, value interface{}) error {
15672	if v == nil {
15673		return fmt.Errorf("unexpected nil of type %T", v)
15674	}
15675	if value == nil {
15676		return nil
15677	}
15678
15679	shape, ok := value.(map[string]interface{})
15680	if !ok {
15681		return fmt.Errorf("unexpected JSON type %v", value)
15682	}
15683
15684	var sv *UpdateAccountCustomizationOutput
15685	if *v == nil {
15686		sv = &UpdateAccountCustomizationOutput{}
15687	} else {
15688		sv = *v
15689	}
15690
15691	for key, value := range shape {
15692		switch key {
15693		case "AccountCustomization":
15694			if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil {
15695				return err
15696			}
15697
15698		case "Arn":
15699			if value != nil {
15700				jtv, ok := value.(string)
15701				if !ok {
15702					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
15703				}
15704				sv.Arn = ptr.String(jtv)
15705			}
15706
15707		case "AwsAccountId":
15708			if value != nil {
15709				jtv, ok := value.(string)
15710				if !ok {
15711					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
15712				}
15713				sv.AwsAccountId = ptr.String(jtv)
15714			}
15715
15716		case "Namespace":
15717			if value != nil {
15718				jtv, ok := value.(string)
15719				if !ok {
15720					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
15721				}
15722				sv.Namespace = ptr.String(jtv)
15723			}
15724
15725		case "RequestId":
15726			if value != nil {
15727				jtv, ok := value.(string)
15728				if !ok {
15729					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15730				}
15731				sv.RequestId = ptr.String(jtv)
15732			}
15733
15734		default:
15735			_, _ = key, value
15736
15737		}
15738	}
15739	*v = sv
15740	return nil
15741}
15742
15743type awsRestjson1_deserializeOpUpdateAccountSettings struct {
15744}
15745
15746func (*awsRestjson1_deserializeOpUpdateAccountSettings) ID() string {
15747	return "OperationDeserializer"
15748}
15749
15750func (m *awsRestjson1_deserializeOpUpdateAccountSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15751	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15752) {
15753	out, metadata, err = next.HandleDeserialize(ctx, in)
15754	if err != nil {
15755		return out, metadata, err
15756	}
15757
15758	response, ok := out.RawResponse.(*smithyhttp.Response)
15759	if !ok {
15760		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15761	}
15762
15763	if response.StatusCode < 200 || response.StatusCode >= 300 {
15764		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccountSettings(response, &metadata)
15765	}
15766	output := &UpdateAccountSettingsOutput{}
15767	out.Result = output
15768
15769	err = awsRestjson1_deserializeOpHttpBindingsUpdateAccountSettingsOutput(output, response)
15770	if err != nil {
15771		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15772	}
15773
15774	var buff [1024]byte
15775	ringBuffer := smithyio.NewRingBuffer(buff[:])
15776
15777	body := io.TeeReader(response.Body, ringBuffer)
15778
15779	decoder := json.NewDecoder(body)
15780	decoder.UseNumber()
15781	var shape interface{}
15782	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15783		var snapshot bytes.Buffer
15784		io.Copy(&snapshot, ringBuffer)
15785		err = &smithy.DeserializationError{
15786			Err:      fmt.Errorf("failed to decode response body, %w", err),
15787			Snapshot: snapshot.Bytes(),
15788		}
15789		return out, metadata, err
15790	}
15791
15792	err = awsRestjson1_deserializeOpDocumentUpdateAccountSettingsOutput(&output, shape)
15793	if err != nil {
15794		var snapshot bytes.Buffer
15795		io.Copy(&snapshot, ringBuffer)
15796		return out, metadata, &smithy.DeserializationError{
15797			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15798			Snapshot: snapshot.Bytes(),
15799		}
15800	}
15801
15802	return out, metadata, err
15803}
15804
15805func awsRestjson1_deserializeOpErrorUpdateAccountSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15806	var errorBuffer bytes.Buffer
15807	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15808		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15809	}
15810	errorBody := bytes.NewReader(errorBuffer.Bytes())
15811
15812	errorCode := "UnknownError"
15813	errorMessage := errorCode
15814
15815	code := response.Header.Get("X-Amzn-ErrorType")
15816	if len(code) != 0 {
15817		errorCode = restjson.SanitizeErrorCode(code)
15818	}
15819
15820	var buff [1024]byte
15821	ringBuffer := smithyio.NewRingBuffer(buff[:])
15822
15823	body := io.TeeReader(errorBody, ringBuffer)
15824	decoder := json.NewDecoder(body)
15825	decoder.UseNumber()
15826	code, message, err := restjson.GetErrorInfo(decoder)
15827	if err != nil {
15828		var snapshot bytes.Buffer
15829		io.Copy(&snapshot, ringBuffer)
15830		err = &smithy.DeserializationError{
15831			Err:      fmt.Errorf("failed to decode response body, %w", err),
15832			Snapshot: snapshot.Bytes(),
15833		}
15834		return err
15835	}
15836
15837	errorBody.Seek(0, io.SeekStart)
15838	if len(code) != 0 {
15839		errorCode = restjson.SanitizeErrorCode(code)
15840	}
15841	if len(message) != 0 {
15842		errorMessage = message
15843	}
15844
15845	switch {
15846	case strings.EqualFold("AccessDeniedException", errorCode):
15847		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
15848
15849	case strings.EqualFold("InternalFailureException", errorCode):
15850		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
15851
15852	case strings.EqualFold("InvalidParameterValueException", errorCode):
15853		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
15854
15855	case strings.EqualFold("ResourceNotFoundException", errorCode):
15856		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
15857
15858	case strings.EqualFold("ResourceUnavailableException", errorCode):
15859		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
15860
15861	case strings.EqualFold("ThrottlingException", errorCode):
15862		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
15863
15864	default:
15865		genericError := &smithy.GenericAPIError{
15866			Code:    errorCode,
15867			Message: errorMessage,
15868		}
15869		return genericError
15870
15871	}
15872}
15873
15874func awsRestjson1_deserializeOpHttpBindingsUpdateAccountSettingsOutput(v *UpdateAccountSettingsOutput, response *smithyhttp.Response) error {
15875	if v == nil {
15876		return fmt.Errorf("unsupported deserialization for nil %T", v)
15877	}
15878
15879	v.Status = int32(response.StatusCode)
15880
15881	return nil
15882}
15883func awsRestjson1_deserializeOpDocumentUpdateAccountSettingsOutput(v **UpdateAccountSettingsOutput, value interface{}) error {
15884	if v == nil {
15885		return fmt.Errorf("unexpected nil of type %T", v)
15886	}
15887	if value == nil {
15888		return nil
15889	}
15890
15891	shape, ok := value.(map[string]interface{})
15892	if !ok {
15893		return fmt.Errorf("unexpected JSON type %v", value)
15894	}
15895
15896	var sv *UpdateAccountSettingsOutput
15897	if *v == nil {
15898		sv = &UpdateAccountSettingsOutput{}
15899	} else {
15900		sv = *v
15901	}
15902
15903	for key, value := range shape {
15904		switch key {
15905		case "RequestId":
15906			if value != nil {
15907				jtv, ok := value.(string)
15908				if !ok {
15909					return fmt.Errorf("expected String to be of type string, got %T instead", value)
15910				}
15911				sv.RequestId = ptr.String(jtv)
15912			}
15913
15914		default:
15915			_, _ = key, value
15916
15917		}
15918	}
15919	*v = sv
15920	return nil
15921}
15922
15923type awsRestjson1_deserializeOpUpdateAnalysis struct {
15924}
15925
15926func (*awsRestjson1_deserializeOpUpdateAnalysis) ID() string {
15927	return "OperationDeserializer"
15928}
15929
15930func (m *awsRestjson1_deserializeOpUpdateAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
15931	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
15932) {
15933	out, metadata, err = next.HandleDeserialize(ctx, in)
15934	if err != nil {
15935		return out, metadata, err
15936	}
15937
15938	response, ok := out.RawResponse.(*smithyhttp.Response)
15939	if !ok {
15940		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
15941	}
15942
15943	if response.StatusCode < 200 || response.StatusCode >= 300 {
15944		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAnalysis(response, &metadata)
15945	}
15946	output := &UpdateAnalysisOutput{}
15947	out.Result = output
15948
15949	err = awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisOutput(output, response)
15950	if err != nil {
15951		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
15952	}
15953
15954	var buff [1024]byte
15955	ringBuffer := smithyio.NewRingBuffer(buff[:])
15956
15957	body := io.TeeReader(response.Body, ringBuffer)
15958
15959	decoder := json.NewDecoder(body)
15960	decoder.UseNumber()
15961	var shape interface{}
15962	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
15963		var snapshot bytes.Buffer
15964		io.Copy(&snapshot, ringBuffer)
15965		err = &smithy.DeserializationError{
15966			Err:      fmt.Errorf("failed to decode response body, %w", err),
15967			Snapshot: snapshot.Bytes(),
15968		}
15969		return out, metadata, err
15970	}
15971
15972	err = awsRestjson1_deserializeOpDocumentUpdateAnalysisOutput(&output, shape)
15973	if err != nil {
15974		var snapshot bytes.Buffer
15975		io.Copy(&snapshot, ringBuffer)
15976		return out, metadata, &smithy.DeserializationError{
15977			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
15978			Snapshot: snapshot.Bytes(),
15979		}
15980	}
15981
15982	return out, metadata, err
15983}
15984
15985func awsRestjson1_deserializeOpErrorUpdateAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error {
15986	var errorBuffer bytes.Buffer
15987	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
15988		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
15989	}
15990	errorBody := bytes.NewReader(errorBuffer.Bytes())
15991
15992	errorCode := "UnknownError"
15993	errorMessage := errorCode
15994
15995	code := response.Header.Get("X-Amzn-ErrorType")
15996	if len(code) != 0 {
15997		errorCode = restjson.SanitizeErrorCode(code)
15998	}
15999
16000	var buff [1024]byte
16001	ringBuffer := smithyio.NewRingBuffer(buff[:])
16002
16003	body := io.TeeReader(errorBody, ringBuffer)
16004	decoder := json.NewDecoder(body)
16005	decoder.UseNumber()
16006	code, message, err := restjson.GetErrorInfo(decoder)
16007	if err != nil {
16008		var snapshot bytes.Buffer
16009		io.Copy(&snapshot, ringBuffer)
16010		err = &smithy.DeserializationError{
16011			Err:      fmt.Errorf("failed to decode response body, %w", err),
16012			Snapshot: snapshot.Bytes(),
16013		}
16014		return err
16015	}
16016
16017	errorBody.Seek(0, io.SeekStart)
16018	if len(code) != 0 {
16019		errorCode = restjson.SanitizeErrorCode(code)
16020	}
16021	if len(message) != 0 {
16022		errorMessage = message
16023	}
16024
16025	switch {
16026	case strings.EqualFold("ConflictException", errorCode):
16027		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
16028
16029	case strings.EqualFold("InternalFailureException", errorCode):
16030		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16031
16032	case strings.EqualFold("InvalidParameterValueException", errorCode):
16033		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
16034
16035	case strings.EqualFold("ResourceExistsException", errorCode):
16036		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
16037
16038	case strings.EqualFold("ResourceNotFoundException", errorCode):
16039		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16040
16041	case strings.EqualFold("ThrottlingException", errorCode):
16042		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16043
16044	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
16045		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
16046
16047	default:
16048		genericError := &smithy.GenericAPIError{
16049			Code:    errorCode,
16050			Message: errorMessage,
16051		}
16052		return genericError
16053
16054	}
16055}
16056
16057func awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisOutput(v *UpdateAnalysisOutput, response *smithyhttp.Response) error {
16058	if v == nil {
16059		return fmt.Errorf("unsupported deserialization for nil %T", v)
16060	}
16061
16062	v.Status = int32(response.StatusCode)
16063
16064	return nil
16065}
16066func awsRestjson1_deserializeOpDocumentUpdateAnalysisOutput(v **UpdateAnalysisOutput, value interface{}) error {
16067	if v == nil {
16068		return fmt.Errorf("unexpected nil of type %T", v)
16069	}
16070	if value == nil {
16071		return nil
16072	}
16073
16074	shape, ok := value.(map[string]interface{})
16075	if !ok {
16076		return fmt.Errorf("unexpected JSON type %v", value)
16077	}
16078
16079	var sv *UpdateAnalysisOutput
16080	if *v == nil {
16081		sv = &UpdateAnalysisOutput{}
16082	} else {
16083		sv = *v
16084	}
16085
16086	for key, value := range shape {
16087		switch key {
16088		case "AnalysisId":
16089			if value != nil {
16090				jtv, ok := value.(string)
16091				if !ok {
16092					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
16093				}
16094				sv.AnalysisId = ptr.String(jtv)
16095			}
16096
16097		case "Arn":
16098			if value != nil {
16099				jtv, ok := value.(string)
16100				if !ok {
16101					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16102				}
16103				sv.Arn = ptr.String(jtv)
16104			}
16105
16106		case "RequestId":
16107			if value != nil {
16108				jtv, ok := value.(string)
16109				if !ok {
16110					return fmt.Errorf("expected String to be of type string, got %T instead", value)
16111				}
16112				sv.RequestId = ptr.String(jtv)
16113			}
16114
16115		case "UpdateStatus":
16116			if value != nil {
16117				jtv, ok := value.(string)
16118				if !ok {
16119					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
16120				}
16121				sv.UpdateStatus = types.ResourceStatus(jtv)
16122			}
16123
16124		default:
16125			_, _ = key, value
16126
16127		}
16128	}
16129	*v = sv
16130	return nil
16131}
16132
16133type awsRestjson1_deserializeOpUpdateAnalysisPermissions struct {
16134}
16135
16136func (*awsRestjson1_deserializeOpUpdateAnalysisPermissions) ID() string {
16137	return "OperationDeserializer"
16138}
16139
16140func (m *awsRestjson1_deserializeOpUpdateAnalysisPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16141	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16142) {
16143	out, metadata, err = next.HandleDeserialize(ctx, in)
16144	if err != nil {
16145		return out, metadata, err
16146	}
16147
16148	response, ok := out.RawResponse.(*smithyhttp.Response)
16149	if !ok {
16150		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16151	}
16152
16153	if response.StatusCode < 200 || response.StatusCode >= 300 {
16154		return out, metadata, awsRestjson1_deserializeOpErrorUpdateAnalysisPermissions(response, &metadata)
16155	}
16156	output := &UpdateAnalysisPermissionsOutput{}
16157	out.Result = output
16158
16159	err = awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisPermissionsOutput(output, response)
16160	if err != nil {
16161		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
16162	}
16163
16164	var buff [1024]byte
16165	ringBuffer := smithyio.NewRingBuffer(buff[:])
16166
16167	body := io.TeeReader(response.Body, ringBuffer)
16168
16169	decoder := json.NewDecoder(body)
16170	decoder.UseNumber()
16171	var shape interface{}
16172	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16173		var snapshot bytes.Buffer
16174		io.Copy(&snapshot, ringBuffer)
16175		err = &smithy.DeserializationError{
16176			Err:      fmt.Errorf("failed to decode response body, %w", err),
16177			Snapshot: snapshot.Bytes(),
16178		}
16179		return out, metadata, err
16180	}
16181
16182	err = awsRestjson1_deserializeOpDocumentUpdateAnalysisPermissionsOutput(&output, shape)
16183	if err != nil {
16184		var snapshot bytes.Buffer
16185		io.Copy(&snapshot, ringBuffer)
16186		return out, metadata, &smithy.DeserializationError{
16187			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16188			Snapshot: snapshot.Bytes(),
16189		}
16190	}
16191
16192	return out, metadata, err
16193}
16194
16195func awsRestjson1_deserializeOpErrorUpdateAnalysisPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16196	var errorBuffer bytes.Buffer
16197	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16198		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16199	}
16200	errorBody := bytes.NewReader(errorBuffer.Bytes())
16201
16202	errorCode := "UnknownError"
16203	errorMessage := errorCode
16204
16205	code := response.Header.Get("X-Amzn-ErrorType")
16206	if len(code) != 0 {
16207		errorCode = restjson.SanitizeErrorCode(code)
16208	}
16209
16210	var buff [1024]byte
16211	ringBuffer := smithyio.NewRingBuffer(buff[:])
16212
16213	body := io.TeeReader(errorBody, ringBuffer)
16214	decoder := json.NewDecoder(body)
16215	decoder.UseNumber()
16216	code, message, err := restjson.GetErrorInfo(decoder)
16217	if err != nil {
16218		var snapshot bytes.Buffer
16219		io.Copy(&snapshot, ringBuffer)
16220		err = &smithy.DeserializationError{
16221			Err:      fmt.Errorf("failed to decode response body, %w", err),
16222			Snapshot: snapshot.Bytes(),
16223		}
16224		return err
16225	}
16226
16227	errorBody.Seek(0, io.SeekStart)
16228	if len(code) != 0 {
16229		errorCode = restjson.SanitizeErrorCode(code)
16230	}
16231	if len(message) != 0 {
16232		errorMessage = message
16233	}
16234
16235	switch {
16236	case strings.EqualFold("ConflictException", errorCode):
16237		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
16238
16239	case strings.EqualFold("InternalFailureException", errorCode):
16240		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16241
16242	case strings.EqualFold("InvalidParameterValueException", errorCode):
16243		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
16244
16245	case strings.EqualFold("ResourceNotFoundException", errorCode):
16246		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16247
16248	case strings.EqualFold("ThrottlingException", errorCode):
16249		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16250
16251	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
16252		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
16253
16254	default:
16255		genericError := &smithy.GenericAPIError{
16256			Code:    errorCode,
16257			Message: errorMessage,
16258		}
16259		return genericError
16260
16261	}
16262}
16263
16264func awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisPermissionsOutput(v *UpdateAnalysisPermissionsOutput, response *smithyhttp.Response) error {
16265	if v == nil {
16266		return fmt.Errorf("unsupported deserialization for nil %T", v)
16267	}
16268
16269	v.Status = int32(response.StatusCode)
16270
16271	return nil
16272}
16273func awsRestjson1_deserializeOpDocumentUpdateAnalysisPermissionsOutput(v **UpdateAnalysisPermissionsOutput, value interface{}) error {
16274	if v == nil {
16275		return fmt.Errorf("unexpected nil of type %T", v)
16276	}
16277	if value == nil {
16278		return nil
16279	}
16280
16281	shape, ok := value.(map[string]interface{})
16282	if !ok {
16283		return fmt.Errorf("unexpected JSON type %v", value)
16284	}
16285
16286	var sv *UpdateAnalysisPermissionsOutput
16287	if *v == nil {
16288		sv = &UpdateAnalysisPermissionsOutput{}
16289	} else {
16290		sv = *v
16291	}
16292
16293	for key, value := range shape {
16294		switch key {
16295		case "AnalysisArn":
16296			if value != nil {
16297				jtv, ok := value.(string)
16298				if !ok {
16299					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16300				}
16301				sv.AnalysisArn = ptr.String(jtv)
16302			}
16303
16304		case "AnalysisId":
16305			if value != nil {
16306				jtv, ok := value.(string)
16307				if !ok {
16308					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
16309				}
16310				sv.AnalysisId = ptr.String(jtv)
16311			}
16312
16313		case "Permissions":
16314			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
16315				return err
16316			}
16317
16318		case "RequestId":
16319			if value != nil {
16320				jtv, ok := value.(string)
16321				if !ok {
16322					return fmt.Errorf("expected String to be of type string, got %T instead", value)
16323				}
16324				sv.RequestId = ptr.String(jtv)
16325			}
16326
16327		default:
16328			_, _ = key, value
16329
16330		}
16331	}
16332	*v = sv
16333	return nil
16334}
16335
16336type awsRestjson1_deserializeOpUpdateDashboard struct {
16337}
16338
16339func (*awsRestjson1_deserializeOpUpdateDashboard) ID() string {
16340	return "OperationDeserializer"
16341}
16342
16343func (m *awsRestjson1_deserializeOpUpdateDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16344	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16345) {
16346	out, metadata, err = next.HandleDeserialize(ctx, in)
16347	if err != nil {
16348		return out, metadata, err
16349	}
16350
16351	response, ok := out.RawResponse.(*smithyhttp.Response)
16352	if !ok {
16353		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16354	}
16355
16356	if response.StatusCode < 200 || response.StatusCode >= 300 {
16357		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDashboard(response, &metadata)
16358	}
16359	output := &UpdateDashboardOutput{}
16360	out.Result = output
16361
16362	var buff [1024]byte
16363	ringBuffer := smithyio.NewRingBuffer(buff[:])
16364
16365	body := io.TeeReader(response.Body, ringBuffer)
16366
16367	decoder := json.NewDecoder(body)
16368	decoder.UseNumber()
16369	var shape interface{}
16370	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16371		var snapshot bytes.Buffer
16372		io.Copy(&snapshot, ringBuffer)
16373		err = &smithy.DeserializationError{
16374			Err:      fmt.Errorf("failed to decode response body, %w", err),
16375			Snapshot: snapshot.Bytes(),
16376		}
16377		return out, metadata, err
16378	}
16379
16380	err = awsRestjson1_deserializeOpDocumentUpdateDashboardOutput(&output, shape)
16381	if err != nil {
16382		var snapshot bytes.Buffer
16383		io.Copy(&snapshot, ringBuffer)
16384		return out, metadata, &smithy.DeserializationError{
16385			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16386			Snapshot: snapshot.Bytes(),
16387		}
16388	}
16389
16390	return out, metadata, err
16391}
16392
16393func awsRestjson1_deserializeOpErrorUpdateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16394	var errorBuffer bytes.Buffer
16395	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16396		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16397	}
16398	errorBody := bytes.NewReader(errorBuffer.Bytes())
16399
16400	errorCode := "UnknownError"
16401	errorMessage := errorCode
16402
16403	code := response.Header.Get("X-Amzn-ErrorType")
16404	if len(code) != 0 {
16405		errorCode = restjson.SanitizeErrorCode(code)
16406	}
16407
16408	var buff [1024]byte
16409	ringBuffer := smithyio.NewRingBuffer(buff[:])
16410
16411	body := io.TeeReader(errorBody, ringBuffer)
16412	decoder := json.NewDecoder(body)
16413	decoder.UseNumber()
16414	code, message, err := restjson.GetErrorInfo(decoder)
16415	if err != nil {
16416		var snapshot bytes.Buffer
16417		io.Copy(&snapshot, ringBuffer)
16418		err = &smithy.DeserializationError{
16419			Err:      fmt.Errorf("failed to decode response body, %w", err),
16420			Snapshot: snapshot.Bytes(),
16421		}
16422		return err
16423	}
16424
16425	errorBody.Seek(0, io.SeekStart)
16426	if len(code) != 0 {
16427		errorCode = restjson.SanitizeErrorCode(code)
16428	}
16429	if len(message) != 0 {
16430		errorMessage = message
16431	}
16432
16433	switch {
16434	case strings.EqualFold("ConflictException", errorCode):
16435		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
16436
16437	case strings.EqualFold("InternalFailureException", errorCode):
16438		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16439
16440	case strings.EqualFold("InvalidParameterValueException", errorCode):
16441		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
16442
16443	case strings.EqualFold("LimitExceededException", errorCode):
16444		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
16445
16446	case strings.EqualFold("ResourceNotFoundException", errorCode):
16447		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16448
16449	case strings.EqualFold("ThrottlingException", errorCode):
16450		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16451
16452	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
16453		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
16454
16455	default:
16456		genericError := &smithy.GenericAPIError{
16457			Code:    errorCode,
16458			Message: errorMessage,
16459		}
16460		return genericError
16461
16462	}
16463}
16464
16465func awsRestjson1_deserializeOpDocumentUpdateDashboardOutput(v **UpdateDashboardOutput, value interface{}) error {
16466	if v == nil {
16467		return fmt.Errorf("unexpected nil of type %T", v)
16468	}
16469	if value == nil {
16470		return nil
16471	}
16472
16473	shape, ok := value.(map[string]interface{})
16474	if !ok {
16475		return fmt.Errorf("unexpected JSON type %v", value)
16476	}
16477
16478	var sv *UpdateDashboardOutput
16479	if *v == nil {
16480		sv = &UpdateDashboardOutput{}
16481	} else {
16482		sv = *v
16483	}
16484
16485	for key, value := range shape {
16486		switch key {
16487		case "Arn":
16488			if value != nil {
16489				jtv, ok := value.(string)
16490				if !ok {
16491					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16492				}
16493				sv.Arn = ptr.String(jtv)
16494			}
16495
16496		case "CreationStatus":
16497			if value != nil {
16498				jtv, ok := value.(string)
16499				if !ok {
16500					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
16501				}
16502				sv.CreationStatus = types.ResourceStatus(jtv)
16503			}
16504
16505		case "DashboardId":
16506			if value != nil {
16507				jtv, ok := value.(string)
16508				if !ok {
16509					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
16510				}
16511				sv.DashboardId = ptr.String(jtv)
16512			}
16513
16514		case "RequestId":
16515			if value != nil {
16516				jtv, ok := value.(string)
16517				if !ok {
16518					return fmt.Errorf("expected String to be of type string, got %T instead", value)
16519				}
16520				sv.RequestId = ptr.String(jtv)
16521			}
16522
16523		case "Status":
16524			if value != nil {
16525				jtv, ok := value.(json.Number)
16526				if !ok {
16527					return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value)
16528				}
16529				i64, err := jtv.Int64()
16530				if err != nil {
16531					return err
16532				}
16533				sv.Status = int32(i64)
16534			}
16535
16536		case "VersionArn":
16537			if value != nil {
16538				jtv, ok := value.(string)
16539				if !ok {
16540					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16541				}
16542				sv.VersionArn = ptr.String(jtv)
16543			}
16544
16545		default:
16546			_, _ = key, value
16547
16548		}
16549	}
16550	*v = sv
16551	return nil
16552}
16553
16554type awsRestjson1_deserializeOpUpdateDashboardPermissions struct {
16555}
16556
16557func (*awsRestjson1_deserializeOpUpdateDashboardPermissions) ID() string {
16558	return "OperationDeserializer"
16559}
16560
16561func (m *awsRestjson1_deserializeOpUpdateDashboardPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16562	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16563) {
16564	out, metadata, err = next.HandleDeserialize(ctx, in)
16565	if err != nil {
16566		return out, metadata, err
16567	}
16568
16569	response, ok := out.RawResponse.(*smithyhttp.Response)
16570	if !ok {
16571		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16572	}
16573
16574	if response.StatusCode < 200 || response.StatusCode >= 300 {
16575		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDashboardPermissions(response, &metadata)
16576	}
16577	output := &UpdateDashboardPermissionsOutput{}
16578	out.Result = output
16579
16580	err = awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPermissionsOutput(output, response)
16581	if err != nil {
16582		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
16583	}
16584
16585	var buff [1024]byte
16586	ringBuffer := smithyio.NewRingBuffer(buff[:])
16587
16588	body := io.TeeReader(response.Body, ringBuffer)
16589
16590	decoder := json.NewDecoder(body)
16591	decoder.UseNumber()
16592	var shape interface{}
16593	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16594		var snapshot bytes.Buffer
16595		io.Copy(&snapshot, ringBuffer)
16596		err = &smithy.DeserializationError{
16597			Err:      fmt.Errorf("failed to decode response body, %w", err),
16598			Snapshot: snapshot.Bytes(),
16599		}
16600		return out, metadata, err
16601	}
16602
16603	err = awsRestjson1_deserializeOpDocumentUpdateDashboardPermissionsOutput(&output, shape)
16604	if err != nil {
16605		var snapshot bytes.Buffer
16606		io.Copy(&snapshot, ringBuffer)
16607		return out, metadata, &smithy.DeserializationError{
16608			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16609			Snapshot: snapshot.Bytes(),
16610		}
16611	}
16612
16613	return out, metadata, err
16614}
16615
16616func awsRestjson1_deserializeOpErrorUpdateDashboardPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16617	var errorBuffer bytes.Buffer
16618	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16619		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16620	}
16621	errorBody := bytes.NewReader(errorBuffer.Bytes())
16622
16623	errorCode := "UnknownError"
16624	errorMessage := errorCode
16625
16626	code := response.Header.Get("X-Amzn-ErrorType")
16627	if len(code) != 0 {
16628		errorCode = restjson.SanitizeErrorCode(code)
16629	}
16630
16631	var buff [1024]byte
16632	ringBuffer := smithyio.NewRingBuffer(buff[:])
16633
16634	body := io.TeeReader(errorBody, ringBuffer)
16635	decoder := json.NewDecoder(body)
16636	decoder.UseNumber()
16637	code, message, err := restjson.GetErrorInfo(decoder)
16638	if err != nil {
16639		var snapshot bytes.Buffer
16640		io.Copy(&snapshot, ringBuffer)
16641		err = &smithy.DeserializationError{
16642			Err:      fmt.Errorf("failed to decode response body, %w", err),
16643			Snapshot: snapshot.Bytes(),
16644		}
16645		return err
16646	}
16647
16648	errorBody.Seek(0, io.SeekStart)
16649	if len(code) != 0 {
16650		errorCode = restjson.SanitizeErrorCode(code)
16651	}
16652	if len(message) != 0 {
16653		errorMessage = message
16654	}
16655
16656	switch {
16657	case strings.EqualFold("ConflictException", errorCode):
16658		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
16659
16660	case strings.EqualFold("InternalFailureException", errorCode):
16661		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16662
16663	case strings.EqualFold("InvalidParameterValueException", errorCode):
16664		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
16665
16666	case strings.EqualFold("ResourceNotFoundException", errorCode):
16667		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16668
16669	case strings.EqualFold("ThrottlingException", errorCode):
16670		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16671
16672	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
16673		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
16674
16675	default:
16676		genericError := &smithy.GenericAPIError{
16677			Code:    errorCode,
16678			Message: errorMessage,
16679		}
16680		return genericError
16681
16682	}
16683}
16684
16685func awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPermissionsOutput(v *UpdateDashboardPermissionsOutput, response *smithyhttp.Response) error {
16686	if v == nil {
16687		return fmt.Errorf("unsupported deserialization for nil %T", v)
16688	}
16689
16690	v.Status = int32(response.StatusCode)
16691
16692	return nil
16693}
16694func awsRestjson1_deserializeOpDocumentUpdateDashboardPermissionsOutput(v **UpdateDashboardPermissionsOutput, value interface{}) error {
16695	if v == nil {
16696		return fmt.Errorf("unexpected nil of type %T", v)
16697	}
16698	if value == nil {
16699		return nil
16700	}
16701
16702	shape, ok := value.(map[string]interface{})
16703	if !ok {
16704		return fmt.Errorf("unexpected JSON type %v", value)
16705	}
16706
16707	var sv *UpdateDashboardPermissionsOutput
16708	if *v == nil {
16709		sv = &UpdateDashboardPermissionsOutput{}
16710	} else {
16711		sv = *v
16712	}
16713
16714	for key, value := range shape {
16715		switch key {
16716		case "DashboardArn":
16717			if value != nil {
16718				jtv, ok := value.(string)
16719				if !ok {
16720					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16721				}
16722				sv.DashboardArn = ptr.String(jtv)
16723			}
16724
16725		case "DashboardId":
16726			if value != nil {
16727				jtv, ok := value.(string)
16728				if !ok {
16729					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
16730				}
16731				sv.DashboardId = ptr.String(jtv)
16732			}
16733
16734		case "Permissions":
16735			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
16736				return err
16737			}
16738
16739		case "RequestId":
16740			if value != nil {
16741				jtv, ok := value.(string)
16742				if !ok {
16743					return fmt.Errorf("expected String to be of type string, got %T instead", value)
16744				}
16745				sv.RequestId = ptr.String(jtv)
16746			}
16747
16748		default:
16749			_, _ = key, value
16750
16751		}
16752	}
16753	*v = sv
16754	return nil
16755}
16756
16757type awsRestjson1_deserializeOpUpdateDashboardPublishedVersion struct {
16758}
16759
16760func (*awsRestjson1_deserializeOpUpdateDashboardPublishedVersion) ID() string {
16761	return "OperationDeserializer"
16762}
16763
16764func (m *awsRestjson1_deserializeOpUpdateDashboardPublishedVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16765	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16766) {
16767	out, metadata, err = next.HandleDeserialize(ctx, in)
16768	if err != nil {
16769		return out, metadata, err
16770	}
16771
16772	response, ok := out.RawResponse.(*smithyhttp.Response)
16773	if !ok {
16774		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16775	}
16776
16777	if response.StatusCode < 200 || response.StatusCode >= 300 {
16778		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDashboardPublishedVersion(response, &metadata)
16779	}
16780	output := &UpdateDashboardPublishedVersionOutput{}
16781	out.Result = output
16782
16783	err = awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPublishedVersionOutput(output, response)
16784	if err != nil {
16785		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
16786	}
16787
16788	var buff [1024]byte
16789	ringBuffer := smithyio.NewRingBuffer(buff[:])
16790
16791	body := io.TeeReader(response.Body, ringBuffer)
16792
16793	decoder := json.NewDecoder(body)
16794	decoder.UseNumber()
16795	var shape interface{}
16796	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16797		var snapshot bytes.Buffer
16798		io.Copy(&snapshot, ringBuffer)
16799		err = &smithy.DeserializationError{
16800			Err:      fmt.Errorf("failed to decode response body, %w", err),
16801			Snapshot: snapshot.Bytes(),
16802		}
16803		return out, metadata, err
16804	}
16805
16806	err = awsRestjson1_deserializeOpDocumentUpdateDashboardPublishedVersionOutput(&output, shape)
16807	if err != nil {
16808		var snapshot bytes.Buffer
16809		io.Copy(&snapshot, ringBuffer)
16810		return out, metadata, &smithy.DeserializationError{
16811			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
16812			Snapshot: snapshot.Bytes(),
16813		}
16814	}
16815
16816	return out, metadata, err
16817}
16818
16819func awsRestjson1_deserializeOpErrorUpdateDashboardPublishedVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
16820	var errorBuffer bytes.Buffer
16821	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
16822		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
16823	}
16824	errorBody := bytes.NewReader(errorBuffer.Bytes())
16825
16826	errorCode := "UnknownError"
16827	errorMessage := errorCode
16828
16829	code := response.Header.Get("X-Amzn-ErrorType")
16830	if len(code) != 0 {
16831		errorCode = restjson.SanitizeErrorCode(code)
16832	}
16833
16834	var buff [1024]byte
16835	ringBuffer := smithyio.NewRingBuffer(buff[:])
16836
16837	body := io.TeeReader(errorBody, ringBuffer)
16838	decoder := json.NewDecoder(body)
16839	decoder.UseNumber()
16840	code, message, err := restjson.GetErrorInfo(decoder)
16841	if err != nil {
16842		var snapshot bytes.Buffer
16843		io.Copy(&snapshot, ringBuffer)
16844		err = &smithy.DeserializationError{
16845			Err:      fmt.Errorf("failed to decode response body, %w", err),
16846			Snapshot: snapshot.Bytes(),
16847		}
16848		return err
16849	}
16850
16851	errorBody.Seek(0, io.SeekStart)
16852	if len(code) != 0 {
16853		errorCode = restjson.SanitizeErrorCode(code)
16854	}
16855	if len(message) != 0 {
16856		errorMessage = message
16857	}
16858
16859	switch {
16860	case strings.EqualFold("ConflictException", errorCode):
16861		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
16862
16863	case strings.EqualFold("InternalFailureException", errorCode):
16864		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
16865
16866	case strings.EqualFold("InvalidParameterValueException", errorCode):
16867		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
16868
16869	case strings.EqualFold("ResourceNotFoundException", errorCode):
16870		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
16871
16872	case strings.EqualFold("ThrottlingException", errorCode):
16873		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
16874
16875	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
16876		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
16877
16878	default:
16879		genericError := &smithy.GenericAPIError{
16880			Code:    errorCode,
16881			Message: errorMessage,
16882		}
16883		return genericError
16884
16885	}
16886}
16887
16888func awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPublishedVersionOutput(v *UpdateDashboardPublishedVersionOutput, response *smithyhttp.Response) error {
16889	if v == nil {
16890		return fmt.Errorf("unsupported deserialization for nil %T", v)
16891	}
16892
16893	v.Status = int32(response.StatusCode)
16894
16895	return nil
16896}
16897func awsRestjson1_deserializeOpDocumentUpdateDashboardPublishedVersionOutput(v **UpdateDashboardPublishedVersionOutput, value interface{}) error {
16898	if v == nil {
16899		return fmt.Errorf("unexpected nil of type %T", v)
16900	}
16901	if value == nil {
16902		return nil
16903	}
16904
16905	shape, ok := value.(map[string]interface{})
16906	if !ok {
16907		return fmt.Errorf("unexpected JSON type %v", value)
16908	}
16909
16910	var sv *UpdateDashboardPublishedVersionOutput
16911	if *v == nil {
16912		sv = &UpdateDashboardPublishedVersionOutput{}
16913	} else {
16914		sv = *v
16915	}
16916
16917	for key, value := range shape {
16918		switch key {
16919		case "DashboardArn":
16920			if value != nil {
16921				jtv, ok := value.(string)
16922				if !ok {
16923					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
16924				}
16925				sv.DashboardArn = ptr.String(jtv)
16926			}
16927
16928		case "DashboardId":
16929			if value != nil {
16930				jtv, ok := value.(string)
16931				if !ok {
16932					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
16933				}
16934				sv.DashboardId = ptr.String(jtv)
16935			}
16936
16937		case "RequestId":
16938			if value != nil {
16939				jtv, ok := value.(string)
16940				if !ok {
16941					return fmt.Errorf("expected String to be of type string, got %T instead", value)
16942				}
16943				sv.RequestId = ptr.String(jtv)
16944			}
16945
16946		default:
16947			_, _ = key, value
16948
16949		}
16950	}
16951	*v = sv
16952	return nil
16953}
16954
16955type awsRestjson1_deserializeOpUpdateDataSet struct {
16956}
16957
16958func (*awsRestjson1_deserializeOpUpdateDataSet) ID() string {
16959	return "OperationDeserializer"
16960}
16961
16962func (m *awsRestjson1_deserializeOpUpdateDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
16963	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
16964) {
16965	out, metadata, err = next.HandleDeserialize(ctx, in)
16966	if err != nil {
16967		return out, metadata, err
16968	}
16969
16970	response, ok := out.RawResponse.(*smithyhttp.Response)
16971	if !ok {
16972		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
16973	}
16974
16975	if response.StatusCode < 200 || response.StatusCode >= 300 {
16976		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSet(response, &metadata)
16977	}
16978	output := &UpdateDataSetOutput{}
16979	out.Result = output
16980
16981	err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSetOutput(output, response)
16982	if err != nil {
16983		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
16984	}
16985
16986	var buff [1024]byte
16987	ringBuffer := smithyio.NewRingBuffer(buff[:])
16988
16989	body := io.TeeReader(response.Body, ringBuffer)
16990
16991	decoder := json.NewDecoder(body)
16992	decoder.UseNumber()
16993	var shape interface{}
16994	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
16995		var snapshot bytes.Buffer
16996		io.Copy(&snapshot, ringBuffer)
16997		err = &smithy.DeserializationError{
16998			Err:      fmt.Errorf("failed to decode response body, %w", err),
16999			Snapshot: snapshot.Bytes(),
17000		}
17001		return out, metadata, err
17002	}
17003
17004	err = awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(&output, shape)
17005	if err != nil {
17006		var snapshot bytes.Buffer
17007		io.Copy(&snapshot, ringBuffer)
17008		return out, metadata, &smithy.DeserializationError{
17009			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17010			Snapshot: snapshot.Bytes(),
17011		}
17012	}
17013
17014	return out, metadata, err
17015}
17016
17017func awsRestjson1_deserializeOpErrorUpdateDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17018	var errorBuffer bytes.Buffer
17019	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17020		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17021	}
17022	errorBody := bytes.NewReader(errorBuffer.Bytes())
17023
17024	errorCode := "UnknownError"
17025	errorMessage := errorCode
17026
17027	code := response.Header.Get("X-Amzn-ErrorType")
17028	if len(code) != 0 {
17029		errorCode = restjson.SanitizeErrorCode(code)
17030	}
17031
17032	var buff [1024]byte
17033	ringBuffer := smithyio.NewRingBuffer(buff[:])
17034
17035	body := io.TeeReader(errorBody, ringBuffer)
17036	decoder := json.NewDecoder(body)
17037	decoder.UseNumber()
17038	code, message, err := restjson.GetErrorInfo(decoder)
17039	if err != nil {
17040		var snapshot bytes.Buffer
17041		io.Copy(&snapshot, ringBuffer)
17042		err = &smithy.DeserializationError{
17043			Err:      fmt.Errorf("failed to decode response body, %w", err),
17044			Snapshot: snapshot.Bytes(),
17045		}
17046		return err
17047	}
17048
17049	errorBody.Seek(0, io.SeekStart)
17050	if len(code) != 0 {
17051		errorCode = restjson.SanitizeErrorCode(code)
17052	}
17053	if len(message) != 0 {
17054		errorMessage = message
17055	}
17056
17057	switch {
17058	case strings.EqualFold("AccessDeniedException", errorCode):
17059		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
17060
17061	case strings.EqualFold("ConflictException", errorCode):
17062		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
17063
17064	case strings.EqualFold("InternalFailureException", errorCode):
17065		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17066
17067	case strings.EqualFold("InvalidParameterValueException", errorCode):
17068		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
17069
17070	case strings.EqualFold("LimitExceededException", errorCode):
17071		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
17072
17073	case strings.EqualFold("ResourceNotFoundException", errorCode):
17074		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17075
17076	case strings.EqualFold("ThrottlingException", errorCode):
17077		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17078
17079	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
17080		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
17081
17082	default:
17083		genericError := &smithy.GenericAPIError{
17084			Code:    errorCode,
17085			Message: errorMessage,
17086		}
17087		return genericError
17088
17089	}
17090}
17091
17092func awsRestjson1_deserializeOpHttpBindingsUpdateDataSetOutput(v *UpdateDataSetOutput, response *smithyhttp.Response) error {
17093	if v == nil {
17094		return fmt.Errorf("unsupported deserialization for nil %T", v)
17095	}
17096
17097	v.Status = int32(response.StatusCode)
17098
17099	return nil
17100}
17101func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutput, value interface{}) error {
17102	if v == nil {
17103		return fmt.Errorf("unexpected nil of type %T", v)
17104	}
17105	if value == nil {
17106		return nil
17107	}
17108
17109	shape, ok := value.(map[string]interface{})
17110	if !ok {
17111		return fmt.Errorf("unexpected JSON type %v", value)
17112	}
17113
17114	var sv *UpdateDataSetOutput
17115	if *v == nil {
17116		sv = &UpdateDataSetOutput{}
17117	} else {
17118		sv = *v
17119	}
17120
17121	for key, value := range shape {
17122		switch key {
17123		case "Arn":
17124			if value != nil {
17125				jtv, ok := value.(string)
17126				if !ok {
17127					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
17128				}
17129				sv.Arn = ptr.String(jtv)
17130			}
17131
17132		case "DataSetId":
17133			if value != nil {
17134				jtv, ok := value.(string)
17135				if !ok {
17136					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
17137				}
17138				sv.DataSetId = ptr.String(jtv)
17139			}
17140
17141		case "IngestionArn":
17142			if value != nil {
17143				jtv, ok := value.(string)
17144				if !ok {
17145					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
17146				}
17147				sv.IngestionArn = ptr.String(jtv)
17148			}
17149
17150		case "IngestionId":
17151			if value != nil {
17152				jtv, ok := value.(string)
17153				if !ok {
17154					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
17155				}
17156				sv.IngestionId = ptr.String(jtv)
17157			}
17158
17159		case "RequestId":
17160			if value != nil {
17161				jtv, ok := value.(string)
17162				if !ok {
17163					return fmt.Errorf("expected String to be of type string, got %T instead", value)
17164				}
17165				sv.RequestId = ptr.String(jtv)
17166			}
17167
17168		default:
17169			_, _ = key, value
17170
17171		}
17172	}
17173	*v = sv
17174	return nil
17175}
17176
17177type awsRestjson1_deserializeOpUpdateDataSetPermissions struct {
17178}
17179
17180func (*awsRestjson1_deserializeOpUpdateDataSetPermissions) ID() string {
17181	return "OperationDeserializer"
17182}
17183
17184func (m *awsRestjson1_deserializeOpUpdateDataSetPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17185	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17186) {
17187	out, metadata, err = next.HandleDeserialize(ctx, in)
17188	if err != nil {
17189		return out, metadata, err
17190	}
17191
17192	response, ok := out.RawResponse.(*smithyhttp.Response)
17193	if !ok {
17194		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17195	}
17196
17197	if response.StatusCode < 200 || response.StatusCode >= 300 {
17198		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSetPermissions(response, &metadata)
17199	}
17200	output := &UpdateDataSetPermissionsOutput{}
17201	out.Result = output
17202
17203	err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSetPermissionsOutput(output, response)
17204	if err != nil {
17205		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
17206	}
17207
17208	var buff [1024]byte
17209	ringBuffer := smithyio.NewRingBuffer(buff[:])
17210
17211	body := io.TeeReader(response.Body, ringBuffer)
17212
17213	decoder := json.NewDecoder(body)
17214	decoder.UseNumber()
17215	var shape interface{}
17216	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17217		var snapshot bytes.Buffer
17218		io.Copy(&snapshot, ringBuffer)
17219		err = &smithy.DeserializationError{
17220			Err:      fmt.Errorf("failed to decode response body, %w", err),
17221			Snapshot: snapshot.Bytes(),
17222		}
17223		return out, metadata, err
17224	}
17225
17226	err = awsRestjson1_deserializeOpDocumentUpdateDataSetPermissionsOutput(&output, shape)
17227	if err != nil {
17228		var snapshot bytes.Buffer
17229		io.Copy(&snapshot, ringBuffer)
17230		return out, metadata, &smithy.DeserializationError{
17231			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17232			Snapshot: snapshot.Bytes(),
17233		}
17234	}
17235
17236	return out, metadata, err
17237}
17238
17239func awsRestjson1_deserializeOpErrorUpdateDataSetPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17240	var errorBuffer bytes.Buffer
17241	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17242		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17243	}
17244	errorBody := bytes.NewReader(errorBuffer.Bytes())
17245
17246	errorCode := "UnknownError"
17247	errorMessage := errorCode
17248
17249	code := response.Header.Get("X-Amzn-ErrorType")
17250	if len(code) != 0 {
17251		errorCode = restjson.SanitizeErrorCode(code)
17252	}
17253
17254	var buff [1024]byte
17255	ringBuffer := smithyio.NewRingBuffer(buff[:])
17256
17257	body := io.TeeReader(errorBody, ringBuffer)
17258	decoder := json.NewDecoder(body)
17259	decoder.UseNumber()
17260	code, message, err := restjson.GetErrorInfo(decoder)
17261	if err != nil {
17262		var snapshot bytes.Buffer
17263		io.Copy(&snapshot, ringBuffer)
17264		err = &smithy.DeserializationError{
17265			Err:      fmt.Errorf("failed to decode response body, %w", err),
17266			Snapshot: snapshot.Bytes(),
17267		}
17268		return err
17269	}
17270
17271	errorBody.Seek(0, io.SeekStart)
17272	if len(code) != 0 {
17273		errorCode = restjson.SanitizeErrorCode(code)
17274	}
17275	if len(message) != 0 {
17276		errorMessage = message
17277	}
17278
17279	switch {
17280	case strings.EqualFold("AccessDeniedException", errorCode):
17281		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
17282
17283	case strings.EqualFold("ConflictException", errorCode):
17284		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
17285
17286	case strings.EqualFold("InternalFailureException", errorCode):
17287		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17288
17289	case strings.EqualFold("InvalidParameterValueException", errorCode):
17290		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
17291
17292	case strings.EqualFold("ResourceNotFoundException", errorCode):
17293		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17294
17295	case strings.EqualFold("ThrottlingException", errorCode):
17296		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17297
17298	default:
17299		genericError := &smithy.GenericAPIError{
17300			Code:    errorCode,
17301			Message: errorMessage,
17302		}
17303		return genericError
17304
17305	}
17306}
17307
17308func awsRestjson1_deserializeOpHttpBindingsUpdateDataSetPermissionsOutput(v *UpdateDataSetPermissionsOutput, response *smithyhttp.Response) error {
17309	if v == nil {
17310		return fmt.Errorf("unsupported deserialization for nil %T", v)
17311	}
17312
17313	v.Status = int32(response.StatusCode)
17314
17315	return nil
17316}
17317func awsRestjson1_deserializeOpDocumentUpdateDataSetPermissionsOutput(v **UpdateDataSetPermissionsOutput, value interface{}) error {
17318	if v == nil {
17319		return fmt.Errorf("unexpected nil of type %T", v)
17320	}
17321	if value == nil {
17322		return nil
17323	}
17324
17325	shape, ok := value.(map[string]interface{})
17326	if !ok {
17327		return fmt.Errorf("unexpected JSON type %v", value)
17328	}
17329
17330	var sv *UpdateDataSetPermissionsOutput
17331	if *v == nil {
17332		sv = &UpdateDataSetPermissionsOutput{}
17333	} else {
17334		sv = *v
17335	}
17336
17337	for key, value := range shape {
17338		switch key {
17339		case "DataSetArn":
17340			if value != nil {
17341				jtv, ok := value.(string)
17342				if !ok {
17343					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
17344				}
17345				sv.DataSetArn = ptr.String(jtv)
17346			}
17347
17348		case "DataSetId":
17349			if value != nil {
17350				jtv, ok := value.(string)
17351				if !ok {
17352					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
17353				}
17354				sv.DataSetId = ptr.String(jtv)
17355			}
17356
17357		case "RequestId":
17358			if value != nil {
17359				jtv, ok := value.(string)
17360				if !ok {
17361					return fmt.Errorf("expected String to be of type string, got %T instead", value)
17362				}
17363				sv.RequestId = ptr.String(jtv)
17364			}
17365
17366		default:
17367			_, _ = key, value
17368
17369		}
17370	}
17371	*v = sv
17372	return nil
17373}
17374
17375type awsRestjson1_deserializeOpUpdateDataSource struct {
17376}
17377
17378func (*awsRestjson1_deserializeOpUpdateDataSource) ID() string {
17379	return "OperationDeserializer"
17380}
17381
17382func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17383	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17384) {
17385	out, metadata, err = next.HandleDeserialize(ctx, in)
17386	if err != nil {
17387		return out, metadata, err
17388	}
17389
17390	response, ok := out.RawResponse.(*smithyhttp.Response)
17391	if !ok {
17392		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17393	}
17394
17395	if response.StatusCode < 200 || response.StatusCode >= 300 {
17396		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSource(response, &metadata)
17397	}
17398	output := &UpdateDataSourceOutput{}
17399	out.Result = output
17400
17401	err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSourceOutput(output, response)
17402	if err != nil {
17403		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
17404	}
17405
17406	var buff [1024]byte
17407	ringBuffer := smithyio.NewRingBuffer(buff[:])
17408
17409	body := io.TeeReader(response.Body, ringBuffer)
17410
17411	decoder := json.NewDecoder(body)
17412	decoder.UseNumber()
17413	var shape interface{}
17414	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17415		var snapshot bytes.Buffer
17416		io.Copy(&snapshot, ringBuffer)
17417		err = &smithy.DeserializationError{
17418			Err:      fmt.Errorf("failed to decode response body, %w", err),
17419			Snapshot: snapshot.Bytes(),
17420		}
17421		return out, metadata, err
17422	}
17423
17424	err = awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(&output, shape)
17425	if err != nil {
17426		var snapshot bytes.Buffer
17427		io.Copy(&snapshot, ringBuffer)
17428		return out, metadata, &smithy.DeserializationError{
17429			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17430			Snapshot: snapshot.Bytes(),
17431		}
17432	}
17433
17434	return out, metadata, err
17435}
17436
17437func awsRestjson1_deserializeOpErrorUpdateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17438	var errorBuffer bytes.Buffer
17439	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17440		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17441	}
17442	errorBody := bytes.NewReader(errorBuffer.Bytes())
17443
17444	errorCode := "UnknownError"
17445	errorMessage := errorCode
17446
17447	code := response.Header.Get("X-Amzn-ErrorType")
17448	if len(code) != 0 {
17449		errorCode = restjson.SanitizeErrorCode(code)
17450	}
17451
17452	var buff [1024]byte
17453	ringBuffer := smithyio.NewRingBuffer(buff[:])
17454
17455	body := io.TeeReader(errorBody, ringBuffer)
17456	decoder := json.NewDecoder(body)
17457	decoder.UseNumber()
17458	code, message, err := restjson.GetErrorInfo(decoder)
17459	if err != nil {
17460		var snapshot bytes.Buffer
17461		io.Copy(&snapshot, ringBuffer)
17462		err = &smithy.DeserializationError{
17463			Err:      fmt.Errorf("failed to decode response body, %w", err),
17464			Snapshot: snapshot.Bytes(),
17465		}
17466		return err
17467	}
17468
17469	errorBody.Seek(0, io.SeekStart)
17470	if len(code) != 0 {
17471		errorCode = restjson.SanitizeErrorCode(code)
17472	}
17473	if len(message) != 0 {
17474		errorMessage = message
17475	}
17476
17477	switch {
17478	case strings.EqualFold("AccessDeniedException", errorCode):
17479		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
17480
17481	case strings.EqualFold("ConflictException", errorCode):
17482		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
17483
17484	case strings.EqualFold("InternalFailureException", errorCode):
17485		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17486
17487	case strings.EqualFold("InvalidParameterValueException", errorCode):
17488		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
17489
17490	case strings.EqualFold("ResourceNotFoundException", errorCode):
17491		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17492
17493	case strings.EqualFold("ThrottlingException", errorCode):
17494		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17495
17496	default:
17497		genericError := &smithy.GenericAPIError{
17498			Code:    errorCode,
17499			Message: errorMessage,
17500		}
17501		return genericError
17502
17503	}
17504}
17505
17506func awsRestjson1_deserializeOpHttpBindingsUpdateDataSourceOutput(v *UpdateDataSourceOutput, response *smithyhttp.Response) error {
17507	if v == nil {
17508		return fmt.Errorf("unsupported deserialization for nil %T", v)
17509	}
17510
17511	v.Status = int32(response.StatusCode)
17512
17513	return nil
17514}
17515func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSourceOutput, value interface{}) error {
17516	if v == nil {
17517		return fmt.Errorf("unexpected nil of type %T", v)
17518	}
17519	if value == nil {
17520		return nil
17521	}
17522
17523	shape, ok := value.(map[string]interface{})
17524	if !ok {
17525		return fmt.Errorf("unexpected JSON type %v", value)
17526	}
17527
17528	var sv *UpdateDataSourceOutput
17529	if *v == nil {
17530		sv = &UpdateDataSourceOutput{}
17531	} else {
17532		sv = *v
17533	}
17534
17535	for key, value := range shape {
17536		switch key {
17537		case "Arn":
17538			if value != nil {
17539				jtv, ok := value.(string)
17540				if !ok {
17541					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
17542				}
17543				sv.Arn = ptr.String(jtv)
17544			}
17545
17546		case "DataSourceId":
17547			if value != nil {
17548				jtv, ok := value.(string)
17549				if !ok {
17550					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
17551				}
17552				sv.DataSourceId = ptr.String(jtv)
17553			}
17554
17555		case "RequestId":
17556			if value != nil {
17557				jtv, ok := value.(string)
17558				if !ok {
17559					return fmt.Errorf("expected String to be of type string, got %T instead", value)
17560				}
17561				sv.RequestId = ptr.String(jtv)
17562			}
17563
17564		case "UpdateStatus":
17565			if value != nil {
17566				jtv, ok := value.(string)
17567				if !ok {
17568					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
17569				}
17570				sv.UpdateStatus = types.ResourceStatus(jtv)
17571			}
17572
17573		default:
17574			_, _ = key, value
17575
17576		}
17577	}
17578	*v = sv
17579	return nil
17580}
17581
17582type awsRestjson1_deserializeOpUpdateDataSourcePermissions struct {
17583}
17584
17585func (*awsRestjson1_deserializeOpUpdateDataSourcePermissions) ID() string {
17586	return "OperationDeserializer"
17587}
17588
17589func (m *awsRestjson1_deserializeOpUpdateDataSourcePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17590	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17591) {
17592	out, metadata, err = next.HandleDeserialize(ctx, in)
17593	if err != nil {
17594		return out, metadata, err
17595	}
17596
17597	response, ok := out.RawResponse.(*smithyhttp.Response)
17598	if !ok {
17599		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17600	}
17601
17602	if response.StatusCode < 200 || response.StatusCode >= 300 {
17603		return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSourcePermissions(response, &metadata)
17604	}
17605	output := &UpdateDataSourcePermissionsOutput{}
17606	out.Result = output
17607
17608	err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSourcePermissionsOutput(output, response)
17609	if err != nil {
17610		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
17611	}
17612
17613	var buff [1024]byte
17614	ringBuffer := smithyio.NewRingBuffer(buff[:])
17615
17616	body := io.TeeReader(response.Body, ringBuffer)
17617
17618	decoder := json.NewDecoder(body)
17619	decoder.UseNumber()
17620	var shape interface{}
17621	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17622		var snapshot bytes.Buffer
17623		io.Copy(&snapshot, ringBuffer)
17624		err = &smithy.DeserializationError{
17625			Err:      fmt.Errorf("failed to decode response body, %w", err),
17626			Snapshot: snapshot.Bytes(),
17627		}
17628		return out, metadata, err
17629	}
17630
17631	err = awsRestjson1_deserializeOpDocumentUpdateDataSourcePermissionsOutput(&output, shape)
17632	if err != nil {
17633		var snapshot bytes.Buffer
17634		io.Copy(&snapshot, ringBuffer)
17635		return out, metadata, &smithy.DeserializationError{
17636			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17637			Snapshot: snapshot.Bytes(),
17638		}
17639	}
17640
17641	return out, metadata, err
17642}
17643
17644func awsRestjson1_deserializeOpErrorUpdateDataSourcePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17645	var errorBuffer bytes.Buffer
17646	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17647		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17648	}
17649	errorBody := bytes.NewReader(errorBuffer.Bytes())
17650
17651	errorCode := "UnknownError"
17652	errorMessage := errorCode
17653
17654	code := response.Header.Get("X-Amzn-ErrorType")
17655	if len(code) != 0 {
17656		errorCode = restjson.SanitizeErrorCode(code)
17657	}
17658
17659	var buff [1024]byte
17660	ringBuffer := smithyio.NewRingBuffer(buff[:])
17661
17662	body := io.TeeReader(errorBody, ringBuffer)
17663	decoder := json.NewDecoder(body)
17664	decoder.UseNumber()
17665	code, message, err := restjson.GetErrorInfo(decoder)
17666	if err != nil {
17667		var snapshot bytes.Buffer
17668		io.Copy(&snapshot, ringBuffer)
17669		err = &smithy.DeserializationError{
17670			Err:      fmt.Errorf("failed to decode response body, %w", err),
17671			Snapshot: snapshot.Bytes(),
17672		}
17673		return err
17674	}
17675
17676	errorBody.Seek(0, io.SeekStart)
17677	if len(code) != 0 {
17678		errorCode = restjson.SanitizeErrorCode(code)
17679	}
17680	if len(message) != 0 {
17681		errorMessage = message
17682	}
17683
17684	switch {
17685	case strings.EqualFold("AccessDeniedException", errorCode):
17686		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
17687
17688	case strings.EqualFold("ConflictException", errorCode):
17689		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
17690
17691	case strings.EqualFold("InternalFailureException", errorCode):
17692		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17693
17694	case strings.EqualFold("InvalidParameterValueException", errorCode):
17695		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
17696
17697	case strings.EqualFold("ResourceNotFoundException", errorCode):
17698		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17699
17700	case strings.EqualFold("ThrottlingException", errorCode):
17701		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17702
17703	default:
17704		genericError := &smithy.GenericAPIError{
17705			Code:    errorCode,
17706			Message: errorMessage,
17707		}
17708		return genericError
17709
17710	}
17711}
17712
17713func awsRestjson1_deserializeOpHttpBindingsUpdateDataSourcePermissionsOutput(v *UpdateDataSourcePermissionsOutput, response *smithyhttp.Response) error {
17714	if v == nil {
17715		return fmt.Errorf("unsupported deserialization for nil %T", v)
17716	}
17717
17718	v.Status = int32(response.StatusCode)
17719
17720	return nil
17721}
17722func awsRestjson1_deserializeOpDocumentUpdateDataSourcePermissionsOutput(v **UpdateDataSourcePermissionsOutput, value interface{}) error {
17723	if v == nil {
17724		return fmt.Errorf("unexpected nil of type %T", v)
17725	}
17726	if value == nil {
17727		return nil
17728	}
17729
17730	shape, ok := value.(map[string]interface{})
17731	if !ok {
17732		return fmt.Errorf("unexpected JSON type %v", value)
17733	}
17734
17735	var sv *UpdateDataSourcePermissionsOutput
17736	if *v == nil {
17737		sv = &UpdateDataSourcePermissionsOutput{}
17738	} else {
17739		sv = *v
17740	}
17741
17742	for key, value := range shape {
17743		switch key {
17744		case "DataSourceArn":
17745			if value != nil {
17746				jtv, ok := value.(string)
17747				if !ok {
17748					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
17749				}
17750				sv.DataSourceArn = ptr.String(jtv)
17751			}
17752
17753		case "DataSourceId":
17754			if value != nil {
17755				jtv, ok := value.(string)
17756				if !ok {
17757					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
17758				}
17759				sv.DataSourceId = ptr.String(jtv)
17760			}
17761
17762		case "RequestId":
17763			if value != nil {
17764				jtv, ok := value.(string)
17765				if !ok {
17766					return fmt.Errorf("expected String to be of type string, got %T instead", value)
17767				}
17768				sv.RequestId = ptr.String(jtv)
17769			}
17770
17771		default:
17772			_, _ = key, value
17773
17774		}
17775	}
17776	*v = sv
17777	return nil
17778}
17779
17780type awsRestjson1_deserializeOpUpdateGroup struct {
17781}
17782
17783func (*awsRestjson1_deserializeOpUpdateGroup) ID() string {
17784	return "OperationDeserializer"
17785}
17786
17787func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17788	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17789) {
17790	out, metadata, err = next.HandleDeserialize(ctx, in)
17791	if err != nil {
17792		return out, metadata, err
17793	}
17794
17795	response, ok := out.RawResponse.(*smithyhttp.Response)
17796	if !ok {
17797		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17798	}
17799
17800	if response.StatusCode < 200 || response.StatusCode >= 300 {
17801		return out, metadata, awsRestjson1_deserializeOpErrorUpdateGroup(response, &metadata)
17802	}
17803	output := &UpdateGroupOutput{}
17804	out.Result = output
17805
17806	err = awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(output, response)
17807	if err != nil {
17808		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
17809	}
17810
17811	var buff [1024]byte
17812	ringBuffer := smithyio.NewRingBuffer(buff[:])
17813
17814	body := io.TeeReader(response.Body, ringBuffer)
17815
17816	decoder := json.NewDecoder(body)
17817	decoder.UseNumber()
17818	var shape interface{}
17819	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
17820		var snapshot bytes.Buffer
17821		io.Copy(&snapshot, ringBuffer)
17822		err = &smithy.DeserializationError{
17823			Err:      fmt.Errorf("failed to decode response body, %w", err),
17824			Snapshot: snapshot.Bytes(),
17825		}
17826		return out, metadata, err
17827	}
17828
17829	err = awsRestjson1_deserializeOpDocumentUpdateGroupOutput(&output, shape)
17830	if err != nil {
17831		var snapshot bytes.Buffer
17832		io.Copy(&snapshot, ringBuffer)
17833		return out, metadata, &smithy.DeserializationError{
17834			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
17835			Snapshot: snapshot.Bytes(),
17836		}
17837	}
17838
17839	return out, metadata, err
17840}
17841
17842func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
17843	var errorBuffer bytes.Buffer
17844	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
17845		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
17846	}
17847	errorBody := bytes.NewReader(errorBuffer.Bytes())
17848
17849	errorCode := "UnknownError"
17850	errorMessage := errorCode
17851
17852	code := response.Header.Get("X-Amzn-ErrorType")
17853	if len(code) != 0 {
17854		errorCode = restjson.SanitizeErrorCode(code)
17855	}
17856
17857	var buff [1024]byte
17858	ringBuffer := smithyio.NewRingBuffer(buff[:])
17859
17860	body := io.TeeReader(errorBody, ringBuffer)
17861	decoder := json.NewDecoder(body)
17862	decoder.UseNumber()
17863	code, message, err := restjson.GetErrorInfo(decoder)
17864	if err != nil {
17865		var snapshot bytes.Buffer
17866		io.Copy(&snapshot, ringBuffer)
17867		err = &smithy.DeserializationError{
17868			Err:      fmt.Errorf("failed to decode response body, %w", err),
17869			Snapshot: snapshot.Bytes(),
17870		}
17871		return err
17872	}
17873
17874	errorBody.Seek(0, io.SeekStart)
17875	if len(code) != 0 {
17876		errorCode = restjson.SanitizeErrorCode(code)
17877	}
17878	if len(message) != 0 {
17879		errorMessage = message
17880	}
17881
17882	switch {
17883	case strings.EqualFold("AccessDeniedException", errorCode):
17884		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
17885
17886	case strings.EqualFold("InternalFailureException", errorCode):
17887		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
17888
17889	case strings.EqualFold("InvalidParameterValueException", errorCode):
17890		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
17891
17892	case strings.EqualFold("PreconditionNotMetException", errorCode):
17893		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
17894
17895	case strings.EqualFold("ResourceNotFoundException", errorCode):
17896		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
17897
17898	case strings.EqualFold("ResourceUnavailableException", errorCode):
17899		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
17900
17901	case strings.EqualFold("ThrottlingException", errorCode):
17902		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
17903
17904	default:
17905		genericError := &smithy.GenericAPIError{
17906			Code:    errorCode,
17907			Message: errorMessage,
17908		}
17909		return genericError
17910
17911	}
17912}
17913
17914func awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(v *UpdateGroupOutput, response *smithyhttp.Response) error {
17915	if v == nil {
17916		return fmt.Errorf("unsupported deserialization for nil %T", v)
17917	}
17918
17919	v.Status = int32(response.StatusCode)
17920
17921	return nil
17922}
17923func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error {
17924	if v == nil {
17925		return fmt.Errorf("unexpected nil of type %T", v)
17926	}
17927	if value == nil {
17928		return nil
17929	}
17930
17931	shape, ok := value.(map[string]interface{})
17932	if !ok {
17933		return fmt.Errorf("unexpected JSON type %v", value)
17934	}
17935
17936	var sv *UpdateGroupOutput
17937	if *v == nil {
17938		sv = &UpdateGroupOutput{}
17939	} else {
17940		sv = *v
17941	}
17942
17943	for key, value := range shape {
17944		switch key {
17945		case "Group":
17946			if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil {
17947				return err
17948			}
17949
17950		case "RequestId":
17951			if value != nil {
17952				jtv, ok := value.(string)
17953				if !ok {
17954					return fmt.Errorf("expected String to be of type string, got %T instead", value)
17955				}
17956				sv.RequestId = ptr.String(jtv)
17957			}
17958
17959		default:
17960			_, _ = key, value
17961
17962		}
17963	}
17964	*v = sv
17965	return nil
17966}
17967
17968type awsRestjson1_deserializeOpUpdateIAMPolicyAssignment struct {
17969}
17970
17971func (*awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) ID() string {
17972	return "OperationDeserializer"
17973}
17974
17975func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
17976	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
17977) {
17978	out, metadata, err = next.HandleDeserialize(ctx, in)
17979	if err != nil {
17980		return out, metadata, err
17981	}
17982
17983	response, ok := out.RawResponse.(*smithyhttp.Response)
17984	if !ok {
17985		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
17986	}
17987
17988	if response.StatusCode < 200 || response.StatusCode >= 300 {
17989		return out, metadata, awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response, &metadata)
17990	}
17991	output := &UpdateIAMPolicyAssignmentOutput{}
17992	out.Result = output
17993
17994	err = awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(output, response)
17995	if err != nil {
17996		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
17997	}
17998
17999	var buff [1024]byte
18000	ringBuffer := smithyio.NewRingBuffer(buff[:])
18001
18002	body := io.TeeReader(response.Body, ringBuffer)
18003
18004	decoder := json.NewDecoder(body)
18005	decoder.UseNumber()
18006	var shape interface{}
18007	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18008		var snapshot bytes.Buffer
18009		io.Copy(&snapshot, ringBuffer)
18010		err = &smithy.DeserializationError{
18011			Err:      fmt.Errorf("failed to decode response body, %w", err),
18012			Snapshot: snapshot.Bytes(),
18013		}
18014		return out, metadata, err
18015	}
18016
18017	err = awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(&output, shape)
18018	if err != nil {
18019		var snapshot bytes.Buffer
18020		io.Copy(&snapshot, ringBuffer)
18021		return out, metadata, &smithy.DeserializationError{
18022			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18023			Snapshot: snapshot.Bytes(),
18024		}
18025	}
18026
18027	return out, metadata, err
18028}
18029
18030func awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18031	var errorBuffer bytes.Buffer
18032	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18033		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18034	}
18035	errorBody := bytes.NewReader(errorBuffer.Bytes())
18036
18037	errorCode := "UnknownError"
18038	errorMessage := errorCode
18039
18040	code := response.Header.Get("X-Amzn-ErrorType")
18041	if len(code) != 0 {
18042		errorCode = restjson.SanitizeErrorCode(code)
18043	}
18044
18045	var buff [1024]byte
18046	ringBuffer := smithyio.NewRingBuffer(buff[:])
18047
18048	body := io.TeeReader(errorBody, ringBuffer)
18049	decoder := json.NewDecoder(body)
18050	decoder.UseNumber()
18051	code, message, err := restjson.GetErrorInfo(decoder)
18052	if err != nil {
18053		var snapshot bytes.Buffer
18054		io.Copy(&snapshot, ringBuffer)
18055		err = &smithy.DeserializationError{
18056			Err:      fmt.Errorf("failed to decode response body, %w", err),
18057			Snapshot: snapshot.Bytes(),
18058		}
18059		return err
18060	}
18061
18062	errorBody.Seek(0, io.SeekStart)
18063	if len(code) != 0 {
18064		errorCode = restjson.SanitizeErrorCode(code)
18065	}
18066	if len(message) != 0 {
18067		errorMessage = message
18068	}
18069
18070	switch {
18071	case strings.EqualFold("AccessDeniedException", errorCode):
18072		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
18073
18074	case strings.EqualFold("ConcurrentUpdatingException", errorCode):
18075		return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody)
18076
18077	case strings.EqualFold("InternalFailureException", errorCode):
18078		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18079
18080	case strings.EqualFold("InvalidParameterValueException", errorCode):
18081		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
18082
18083	case strings.EqualFold("ResourceExistsException", errorCode):
18084		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
18085
18086	case strings.EqualFold("ResourceNotFoundException", errorCode):
18087		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18088
18089	case strings.EqualFold("ThrottlingException", errorCode):
18090		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18091
18092	default:
18093		genericError := &smithy.GenericAPIError{
18094			Code:    errorCode,
18095			Message: errorMessage,
18096		}
18097		return genericError
18098
18099	}
18100}
18101
18102func awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(v *UpdateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error {
18103	if v == nil {
18104		return fmt.Errorf("unsupported deserialization for nil %T", v)
18105	}
18106
18107	v.Status = int32(response.StatusCode)
18108
18109	return nil
18110}
18111func awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(v **UpdateIAMPolicyAssignmentOutput, value interface{}) error {
18112	if v == nil {
18113		return fmt.Errorf("unexpected nil of type %T", v)
18114	}
18115	if value == nil {
18116		return nil
18117	}
18118
18119	shape, ok := value.(map[string]interface{})
18120	if !ok {
18121		return fmt.Errorf("unexpected JSON type %v", value)
18122	}
18123
18124	var sv *UpdateIAMPolicyAssignmentOutput
18125	if *v == nil {
18126		sv = &UpdateIAMPolicyAssignmentOutput{}
18127	} else {
18128		sv = *v
18129	}
18130
18131	for key, value := range shape {
18132		switch key {
18133		case "AssignmentId":
18134			if value != nil {
18135				jtv, ok := value.(string)
18136				if !ok {
18137					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18138				}
18139				sv.AssignmentId = ptr.String(jtv)
18140			}
18141
18142		case "AssignmentName":
18143			if value != nil {
18144				jtv, ok := value.(string)
18145				if !ok {
18146					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
18147				}
18148				sv.AssignmentName = ptr.String(jtv)
18149			}
18150
18151		case "AssignmentStatus":
18152			if value != nil {
18153				jtv, ok := value.(string)
18154				if !ok {
18155					return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value)
18156				}
18157				sv.AssignmentStatus = types.AssignmentStatus(jtv)
18158			}
18159
18160		case "Identities":
18161			if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil {
18162				return err
18163			}
18164
18165		case "PolicyArn":
18166			if value != nil {
18167				jtv, ok := value.(string)
18168				if !ok {
18169					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
18170				}
18171				sv.PolicyArn = ptr.String(jtv)
18172			}
18173
18174		case "RequestId":
18175			if value != nil {
18176				jtv, ok := value.(string)
18177				if !ok {
18178					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18179				}
18180				sv.RequestId = ptr.String(jtv)
18181			}
18182
18183		default:
18184			_, _ = key, value
18185
18186		}
18187	}
18188	*v = sv
18189	return nil
18190}
18191
18192type awsRestjson1_deserializeOpUpdateTemplate struct {
18193}
18194
18195func (*awsRestjson1_deserializeOpUpdateTemplate) ID() string {
18196	return "OperationDeserializer"
18197}
18198
18199func (m *awsRestjson1_deserializeOpUpdateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18200	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18201) {
18202	out, metadata, err = next.HandleDeserialize(ctx, in)
18203	if err != nil {
18204		return out, metadata, err
18205	}
18206
18207	response, ok := out.RawResponse.(*smithyhttp.Response)
18208	if !ok {
18209		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18210	}
18211
18212	if response.StatusCode < 200 || response.StatusCode >= 300 {
18213		return out, metadata, awsRestjson1_deserializeOpErrorUpdateTemplate(response, &metadata)
18214	}
18215	output := &UpdateTemplateOutput{}
18216	out.Result = output
18217
18218	err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplateOutput(output, response)
18219	if err != nil {
18220		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
18221	}
18222
18223	var buff [1024]byte
18224	ringBuffer := smithyio.NewRingBuffer(buff[:])
18225
18226	body := io.TeeReader(response.Body, ringBuffer)
18227
18228	decoder := json.NewDecoder(body)
18229	decoder.UseNumber()
18230	var shape interface{}
18231	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18232		var snapshot bytes.Buffer
18233		io.Copy(&snapshot, ringBuffer)
18234		err = &smithy.DeserializationError{
18235			Err:      fmt.Errorf("failed to decode response body, %w", err),
18236			Snapshot: snapshot.Bytes(),
18237		}
18238		return out, metadata, err
18239	}
18240
18241	err = awsRestjson1_deserializeOpDocumentUpdateTemplateOutput(&output, shape)
18242	if err != nil {
18243		var snapshot bytes.Buffer
18244		io.Copy(&snapshot, ringBuffer)
18245		return out, metadata, &smithy.DeserializationError{
18246			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18247			Snapshot: snapshot.Bytes(),
18248		}
18249	}
18250
18251	return out, metadata, err
18252}
18253
18254func awsRestjson1_deserializeOpErrorUpdateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18255	var errorBuffer bytes.Buffer
18256	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18257		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18258	}
18259	errorBody := bytes.NewReader(errorBuffer.Bytes())
18260
18261	errorCode := "UnknownError"
18262	errorMessage := errorCode
18263
18264	code := response.Header.Get("X-Amzn-ErrorType")
18265	if len(code) != 0 {
18266		errorCode = restjson.SanitizeErrorCode(code)
18267	}
18268
18269	var buff [1024]byte
18270	ringBuffer := smithyio.NewRingBuffer(buff[:])
18271
18272	body := io.TeeReader(errorBody, ringBuffer)
18273	decoder := json.NewDecoder(body)
18274	decoder.UseNumber()
18275	code, message, err := restjson.GetErrorInfo(decoder)
18276	if err != nil {
18277		var snapshot bytes.Buffer
18278		io.Copy(&snapshot, ringBuffer)
18279		err = &smithy.DeserializationError{
18280			Err:      fmt.Errorf("failed to decode response body, %w", err),
18281			Snapshot: snapshot.Bytes(),
18282		}
18283		return err
18284	}
18285
18286	errorBody.Seek(0, io.SeekStart)
18287	if len(code) != 0 {
18288		errorCode = restjson.SanitizeErrorCode(code)
18289	}
18290	if len(message) != 0 {
18291		errorMessage = message
18292	}
18293
18294	switch {
18295	case strings.EqualFold("ConflictException", errorCode):
18296		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
18297
18298	case strings.EqualFold("InternalFailureException", errorCode):
18299		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18300
18301	case strings.EqualFold("InvalidParameterValueException", errorCode):
18302		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
18303
18304	case strings.EqualFold("LimitExceededException", errorCode):
18305		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
18306
18307	case strings.EqualFold("ResourceExistsException", errorCode):
18308		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
18309
18310	case strings.EqualFold("ResourceNotFoundException", errorCode):
18311		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18312
18313	case strings.EqualFold("ThrottlingException", errorCode):
18314		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18315
18316	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
18317		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
18318
18319	default:
18320		genericError := &smithy.GenericAPIError{
18321			Code:    errorCode,
18322			Message: errorMessage,
18323		}
18324		return genericError
18325
18326	}
18327}
18328
18329func awsRestjson1_deserializeOpHttpBindingsUpdateTemplateOutput(v *UpdateTemplateOutput, response *smithyhttp.Response) error {
18330	if v == nil {
18331		return fmt.Errorf("unsupported deserialization for nil %T", v)
18332	}
18333
18334	v.Status = int32(response.StatusCode)
18335
18336	return nil
18337}
18338func awsRestjson1_deserializeOpDocumentUpdateTemplateOutput(v **UpdateTemplateOutput, value interface{}) error {
18339	if v == nil {
18340		return fmt.Errorf("unexpected nil of type %T", v)
18341	}
18342	if value == nil {
18343		return nil
18344	}
18345
18346	shape, ok := value.(map[string]interface{})
18347	if !ok {
18348		return fmt.Errorf("unexpected JSON type %v", value)
18349	}
18350
18351	var sv *UpdateTemplateOutput
18352	if *v == nil {
18353		sv = &UpdateTemplateOutput{}
18354	} else {
18355		sv = *v
18356	}
18357
18358	for key, value := range shape {
18359		switch key {
18360		case "Arn":
18361			if value != nil {
18362				jtv, ok := value.(string)
18363				if !ok {
18364					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
18365				}
18366				sv.Arn = ptr.String(jtv)
18367			}
18368
18369		case "CreationStatus":
18370			if value != nil {
18371				jtv, ok := value.(string)
18372				if !ok {
18373					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
18374				}
18375				sv.CreationStatus = types.ResourceStatus(jtv)
18376			}
18377
18378		case "RequestId":
18379			if value != nil {
18380				jtv, ok := value.(string)
18381				if !ok {
18382					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18383				}
18384				sv.RequestId = ptr.String(jtv)
18385			}
18386
18387		case "TemplateId":
18388			if value != nil {
18389				jtv, ok := value.(string)
18390				if !ok {
18391					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
18392				}
18393				sv.TemplateId = ptr.String(jtv)
18394			}
18395
18396		case "VersionArn":
18397			if value != nil {
18398				jtv, ok := value.(string)
18399				if !ok {
18400					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
18401				}
18402				sv.VersionArn = ptr.String(jtv)
18403			}
18404
18405		default:
18406			_, _ = key, value
18407
18408		}
18409	}
18410	*v = sv
18411	return nil
18412}
18413
18414type awsRestjson1_deserializeOpUpdateTemplateAlias struct {
18415}
18416
18417func (*awsRestjson1_deserializeOpUpdateTemplateAlias) ID() string {
18418	return "OperationDeserializer"
18419}
18420
18421func (m *awsRestjson1_deserializeOpUpdateTemplateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18422	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18423) {
18424	out, metadata, err = next.HandleDeserialize(ctx, in)
18425	if err != nil {
18426		return out, metadata, err
18427	}
18428
18429	response, ok := out.RawResponse.(*smithyhttp.Response)
18430	if !ok {
18431		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18432	}
18433
18434	if response.StatusCode < 200 || response.StatusCode >= 300 {
18435		return out, metadata, awsRestjson1_deserializeOpErrorUpdateTemplateAlias(response, &metadata)
18436	}
18437	output := &UpdateTemplateAliasOutput{}
18438	out.Result = output
18439
18440	err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplateAliasOutput(output, response)
18441	if err != nil {
18442		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
18443	}
18444
18445	var buff [1024]byte
18446	ringBuffer := smithyio.NewRingBuffer(buff[:])
18447
18448	body := io.TeeReader(response.Body, ringBuffer)
18449
18450	decoder := json.NewDecoder(body)
18451	decoder.UseNumber()
18452	var shape interface{}
18453	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18454		var snapshot bytes.Buffer
18455		io.Copy(&snapshot, ringBuffer)
18456		err = &smithy.DeserializationError{
18457			Err:      fmt.Errorf("failed to decode response body, %w", err),
18458			Snapshot: snapshot.Bytes(),
18459		}
18460		return out, metadata, err
18461	}
18462
18463	err = awsRestjson1_deserializeOpDocumentUpdateTemplateAliasOutput(&output, shape)
18464	if err != nil {
18465		var snapshot bytes.Buffer
18466		io.Copy(&snapshot, ringBuffer)
18467		return out, metadata, &smithy.DeserializationError{
18468			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18469			Snapshot: snapshot.Bytes(),
18470		}
18471	}
18472
18473	return out, metadata, err
18474}
18475
18476func awsRestjson1_deserializeOpErrorUpdateTemplateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18477	var errorBuffer bytes.Buffer
18478	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18479		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18480	}
18481	errorBody := bytes.NewReader(errorBuffer.Bytes())
18482
18483	errorCode := "UnknownError"
18484	errorMessage := errorCode
18485
18486	code := response.Header.Get("X-Amzn-ErrorType")
18487	if len(code) != 0 {
18488		errorCode = restjson.SanitizeErrorCode(code)
18489	}
18490
18491	var buff [1024]byte
18492	ringBuffer := smithyio.NewRingBuffer(buff[:])
18493
18494	body := io.TeeReader(errorBody, ringBuffer)
18495	decoder := json.NewDecoder(body)
18496	decoder.UseNumber()
18497	code, message, err := restjson.GetErrorInfo(decoder)
18498	if err != nil {
18499		var snapshot bytes.Buffer
18500		io.Copy(&snapshot, ringBuffer)
18501		err = &smithy.DeserializationError{
18502			Err:      fmt.Errorf("failed to decode response body, %w", err),
18503			Snapshot: snapshot.Bytes(),
18504		}
18505		return err
18506	}
18507
18508	errorBody.Seek(0, io.SeekStart)
18509	if len(code) != 0 {
18510		errorCode = restjson.SanitizeErrorCode(code)
18511	}
18512	if len(message) != 0 {
18513		errorMessage = message
18514	}
18515
18516	switch {
18517	case strings.EqualFold("ConflictException", errorCode):
18518		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
18519
18520	case strings.EqualFold("InternalFailureException", errorCode):
18521		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18522
18523	case strings.EqualFold("ResourceNotFoundException", errorCode):
18524		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18525
18526	case strings.EqualFold("ThrottlingException", errorCode):
18527		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18528
18529	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
18530		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
18531
18532	default:
18533		genericError := &smithy.GenericAPIError{
18534			Code:    errorCode,
18535			Message: errorMessage,
18536		}
18537		return genericError
18538
18539	}
18540}
18541
18542func awsRestjson1_deserializeOpHttpBindingsUpdateTemplateAliasOutput(v *UpdateTemplateAliasOutput, response *smithyhttp.Response) error {
18543	if v == nil {
18544		return fmt.Errorf("unsupported deserialization for nil %T", v)
18545	}
18546
18547	v.Status = int32(response.StatusCode)
18548
18549	return nil
18550}
18551func awsRestjson1_deserializeOpDocumentUpdateTemplateAliasOutput(v **UpdateTemplateAliasOutput, value interface{}) error {
18552	if v == nil {
18553		return fmt.Errorf("unexpected nil of type %T", v)
18554	}
18555	if value == nil {
18556		return nil
18557	}
18558
18559	shape, ok := value.(map[string]interface{})
18560	if !ok {
18561		return fmt.Errorf("unexpected JSON type %v", value)
18562	}
18563
18564	var sv *UpdateTemplateAliasOutput
18565	if *v == nil {
18566		sv = &UpdateTemplateAliasOutput{}
18567	} else {
18568		sv = *v
18569	}
18570
18571	for key, value := range shape {
18572		switch key {
18573		case "RequestId":
18574			if value != nil {
18575				jtv, ok := value.(string)
18576				if !ok {
18577					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18578				}
18579				sv.RequestId = ptr.String(jtv)
18580			}
18581
18582		case "TemplateAlias":
18583			if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil {
18584				return err
18585			}
18586
18587		default:
18588			_, _ = key, value
18589
18590		}
18591	}
18592	*v = sv
18593	return nil
18594}
18595
18596type awsRestjson1_deserializeOpUpdateTemplatePermissions struct {
18597}
18598
18599func (*awsRestjson1_deserializeOpUpdateTemplatePermissions) ID() string {
18600	return "OperationDeserializer"
18601}
18602
18603func (m *awsRestjson1_deserializeOpUpdateTemplatePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18604	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18605) {
18606	out, metadata, err = next.HandleDeserialize(ctx, in)
18607	if err != nil {
18608		return out, metadata, err
18609	}
18610
18611	response, ok := out.RawResponse.(*smithyhttp.Response)
18612	if !ok {
18613		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18614	}
18615
18616	if response.StatusCode < 200 || response.StatusCode >= 300 {
18617		return out, metadata, awsRestjson1_deserializeOpErrorUpdateTemplatePermissions(response, &metadata)
18618	}
18619	output := &UpdateTemplatePermissionsOutput{}
18620	out.Result = output
18621
18622	err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplatePermissionsOutput(output, response)
18623	if err != nil {
18624		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
18625	}
18626
18627	var buff [1024]byte
18628	ringBuffer := smithyio.NewRingBuffer(buff[:])
18629
18630	body := io.TeeReader(response.Body, ringBuffer)
18631
18632	decoder := json.NewDecoder(body)
18633	decoder.UseNumber()
18634	var shape interface{}
18635	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18636		var snapshot bytes.Buffer
18637		io.Copy(&snapshot, ringBuffer)
18638		err = &smithy.DeserializationError{
18639			Err:      fmt.Errorf("failed to decode response body, %w", err),
18640			Snapshot: snapshot.Bytes(),
18641		}
18642		return out, metadata, err
18643	}
18644
18645	err = awsRestjson1_deserializeOpDocumentUpdateTemplatePermissionsOutput(&output, shape)
18646	if err != nil {
18647		var snapshot bytes.Buffer
18648		io.Copy(&snapshot, ringBuffer)
18649		return out, metadata, &smithy.DeserializationError{
18650			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18651			Snapshot: snapshot.Bytes(),
18652		}
18653	}
18654
18655	return out, metadata, err
18656}
18657
18658func awsRestjson1_deserializeOpErrorUpdateTemplatePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18659	var errorBuffer bytes.Buffer
18660	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18661		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18662	}
18663	errorBody := bytes.NewReader(errorBuffer.Bytes())
18664
18665	errorCode := "UnknownError"
18666	errorMessage := errorCode
18667
18668	code := response.Header.Get("X-Amzn-ErrorType")
18669	if len(code) != 0 {
18670		errorCode = restjson.SanitizeErrorCode(code)
18671	}
18672
18673	var buff [1024]byte
18674	ringBuffer := smithyio.NewRingBuffer(buff[:])
18675
18676	body := io.TeeReader(errorBody, ringBuffer)
18677	decoder := json.NewDecoder(body)
18678	decoder.UseNumber()
18679	code, message, err := restjson.GetErrorInfo(decoder)
18680	if err != nil {
18681		var snapshot bytes.Buffer
18682		io.Copy(&snapshot, ringBuffer)
18683		err = &smithy.DeserializationError{
18684			Err:      fmt.Errorf("failed to decode response body, %w", err),
18685			Snapshot: snapshot.Bytes(),
18686		}
18687		return err
18688	}
18689
18690	errorBody.Seek(0, io.SeekStart)
18691	if len(code) != 0 {
18692		errorCode = restjson.SanitizeErrorCode(code)
18693	}
18694	if len(message) != 0 {
18695		errorMessage = message
18696	}
18697
18698	switch {
18699	case strings.EqualFold("ConflictException", errorCode):
18700		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
18701
18702	case strings.EqualFold("InternalFailureException", errorCode):
18703		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18704
18705	case strings.EqualFold("InvalidParameterValueException", errorCode):
18706		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
18707
18708	case strings.EqualFold("ResourceNotFoundException", errorCode):
18709		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18710
18711	case strings.EqualFold("ThrottlingException", errorCode):
18712		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18713
18714	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
18715		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
18716
18717	default:
18718		genericError := &smithy.GenericAPIError{
18719			Code:    errorCode,
18720			Message: errorMessage,
18721		}
18722		return genericError
18723
18724	}
18725}
18726
18727func awsRestjson1_deserializeOpHttpBindingsUpdateTemplatePermissionsOutput(v *UpdateTemplatePermissionsOutput, response *smithyhttp.Response) error {
18728	if v == nil {
18729		return fmt.Errorf("unsupported deserialization for nil %T", v)
18730	}
18731
18732	v.Status = int32(response.StatusCode)
18733
18734	return nil
18735}
18736func awsRestjson1_deserializeOpDocumentUpdateTemplatePermissionsOutput(v **UpdateTemplatePermissionsOutput, value interface{}) error {
18737	if v == nil {
18738		return fmt.Errorf("unexpected nil of type %T", v)
18739	}
18740	if value == nil {
18741		return nil
18742	}
18743
18744	shape, ok := value.(map[string]interface{})
18745	if !ok {
18746		return fmt.Errorf("unexpected JSON type %v", value)
18747	}
18748
18749	var sv *UpdateTemplatePermissionsOutput
18750	if *v == nil {
18751		sv = &UpdateTemplatePermissionsOutput{}
18752	} else {
18753		sv = *v
18754	}
18755
18756	for key, value := range shape {
18757		switch key {
18758		case "Permissions":
18759			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
18760				return err
18761			}
18762
18763		case "RequestId":
18764			if value != nil {
18765				jtv, ok := value.(string)
18766				if !ok {
18767					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18768				}
18769				sv.RequestId = ptr.String(jtv)
18770			}
18771
18772		case "TemplateArn":
18773			if value != nil {
18774				jtv, ok := value.(string)
18775				if !ok {
18776					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
18777				}
18778				sv.TemplateArn = ptr.String(jtv)
18779			}
18780
18781		case "TemplateId":
18782			if value != nil {
18783				jtv, ok := value.(string)
18784				if !ok {
18785					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
18786				}
18787				sv.TemplateId = ptr.String(jtv)
18788			}
18789
18790		default:
18791			_, _ = key, value
18792
18793		}
18794	}
18795	*v = sv
18796	return nil
18797}
18798
18799type awsRestjson1_deserializeOpUpdateTheme struct {
18800}
18801
18802func (*awsRestjson1_deserializeOpUpdateTheme) ID() string {
18803	return "OperationDeserializer"
18804}
18805
18806func (m *awsRestjson1_deserializeOpUpdateTheme) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
18807	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
18808) {
18809	out, metadata, err = next.HandleDeserialize(ctx, in)
18810	if err != nil {
18811		return out, metadata, err
18812	}
18813
18814	response, ok := out.RawResponse.(*smithyhttp.Response)
18815	if !ok {
18816		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
18817	}
18818
18819	if response.StatusCode < 200 || response.StatusCode >= 300 {
18820		return out, metadata, awsRestjson1_deserializeOpErrorUpdateTheme(response, &metadata)
18821	}
18822	output := &UpdateThemeOutput{}
18823	out.Result = output
18824
18825	err = awsRestjson1_deserializeOpHttpBindingsUpdateThemeOutput(output, response)
18826	if err != nil {
18827		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
18828	}
18829
18830	var buff [1024]byte
18831	ringBuffer := smithyio.NewRingBuffer(buff[:])
18832
18833	body := io.TeeReader(response.Body, ringBuffer)
18834
18835	decoder := json.NewDecoder(body)
18836	decoder.UseNumber()
18837	var shape interface{}
18838	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
18839		var snapshot bytes.Buffer
18840		io.Copy(&snapshot, ringBuffer)
18841		err = &smithy.DeserializationError{
18842			Err:      fmt.Errorf("failed to decode response body, %w", err),
18843			Snapshot: snapshot.Bytes(),
18844		}
18845		return out, metadata, err
18846	}
18847
18848	err = awsRestjson1_deserializeOpDocumentUpdateThemeOutput(&output, shape)
18849	if err != nil {
18850		var snapshot bytes.Buffer
18851		io.Copy(&snapshot, ringBuffer)
18852		return out, metadata, &smithy.DeserializationError{
18853			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
18854			Snapshot: snapshot.Bytes(),
18855		}
18856	}
18857
18858	return out, metadata, err
18859}
18860
18861func awsRestjson1_deserializeOpErrorUpdateTheme(response *smithyhttp.Response, metadata *middleware.Metadata) error {
18862	var errorBuffer bytes.Buffer
18863	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
18864		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
18865	}
18866	errorBody := bytes.NewReader(errorBuffer.Bytes())
18867
18868	errorCode := "UnknownError"
18869	errorMessage := errorCode
18870
18871	code := response.Header.Get("X-Amzn-ErrorType")
18872	if len(code) != 0 {
18873		errorCode = restjson.SanitizeErrorCode(code)
18874	}
18875
18876	var buff [1024]byte
18877	ringBuffer := smithyio.NewRingBuffer(buff[:])
18878
18879	body := io.TeeReader(errorBody, ringBuffer)
18880	decoder := json.NewDecoder(body)
18881	decoder.UseNumber()
18882	code, message, err := restjson.GetErrorInfo(decoder)
18883	if err != nil {
18884		var snapshot bytes.Buffer
18885		io.Copy(&snapshot, ringBuffer)
18886		err = &smithy.DeserializationError{
18887			Err:      fmt.Errorf("failed to decode response body, %w", err),
18888			Snapshot: snapshot.Bytes(),
18889		}
18890		return err
18891	}
18892
18893	errorBody.Seek(0, io.SeekStart)
18894	if len(code) != 0 {
18895		errorCode = restjson.SanitizeErrorCode(code)
18896	}
18897	if len(message) != 0 {
18898		errorMessage = message
18899	}
18900
18901	switch {
18902	case strings.EqualFold("AccessDeniedException", errorCode):
18903		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
18904
18905	case strings.EqualFold("InternalFailureException", errorCode):
18906		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
18907
18908	case strings.EqualFold("InvalidParameterValueException", errorCode):
18909		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
18910
18911	case strings.EqualFold("LimitExceededException", errorCode):
18912		return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
18913
18914	case strings.EqualFold("ResourceExistsException", errorCode):
18915		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
18916
18917	case strings.EqualFold("ResourceNotFoundException", errorCode):
18918		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
18919
18920	case strings.EqualFold("ThrottlingException", errorCode):
18921		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
18922
18923	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
18924		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
18925
18926	default:
18927		genericError := &smithy.GenericAPIError{
18928			Code:    errorCode,
18929			Message: errorMessage,
18930		}
18931		return genericError
18932
18933	}
18934}
18935
18936func awsRestjson1_deserializeOpHttpBindingsUpdateThemeOutput(v *UpdateThemeOutput, response *smithyhttp.Response) error {
18937	if v == nil {
18938		return fmt.Errorf("unsupported deserialization for nil %T", v)
18939	}
18940
18941	v.Status = int32(response.StatusCode)
18942
18943	return nil
18944}
18945func awsRestjson1_deserializeOpDocumentUpdateThemeOutput(v **UpdateThemeOutput, value interface{}) error {
18946	if v == nil {
18947		return fmt.Errorf("unexpected nil of type %T", v)
18948	}
18949	if value == nil {
18950		return nil
18951	}
18952
18953	shape, ok := value.(map[string]interface{})
18954	if !ok {
18955		return fmt.Errorf("unexpected JSON type %v", value)
18956	}
18957
18958	var sv *UpdateThemeOutput
18959	if *v == nil {
18960		sv = &UpdateThemeOutput{}
18961	} else {
18962		sv = *v
18963	}
18964
18965	for key, value := range shape {
18966		switch key {
18967		case "Arn":
18968			if value != nil {
18969				jtv, ok := value.(string)
18970				if !ok {
18971					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
18972				}
18973				sv.Arn = ptr.String(jtv)
18974			}
18975
18976		case "CreationStatus":
18977			if value != nil {
18978				jtv, ok := value.(string)
18979				if !ok {
18980					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
18981				}
18982				sv.CreationStatus = types.ResourceStatus(jtv)
18983			}
18984
18985		case "RequestId":
18986			if value != nil {
18987				jtv, ok := value.(string)
18988				if !ok {
18989					return fmt.Errorf("expected String to be of type string, got %T instead", value)
18990				}
18991				sv.RequestId = ptr.String(jtv)
18992			}
18993
18994		case "ThemeId":
18995			if value != nil {
18996				jtv, ok := value.(string)
18997				if !ok {
18998					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
18999				}
19000				sv.ThemeId = ptr.String(jtv)
19001			}
19002
19003		case "VersionArn":
19004			if value != nil {
19005				jtv, ok := value.(string)
19006				if !ok {
19007					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
19008				}
19009				sv.VersionArn = ptr.String(jtv)
19010			}
19011
19012		default:
19013			_, _ = key, value
19014
19015		}
19016	}
19017	*v = sv
19018	return nil
19019}
19020
19021type awsRestjson1_deserializeOpUpdateThemeAlias struct {
19022}
19023
19024func (*awsRestjson1_deserializeOpUpdateThemeAlias) ID() string {
19025	return "OperationDeserializer"
19026}
19027
19028func (m *awsRestjson1_deserializeOpUpdateThemeAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19029	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19030) {
19031	out, metadata, err = next.HandleDeserialize(ctx, in)
19032	if err != nil {
19033		return out, metadata, err
19034	}
19035
19036	response, ok := out.RawResponse.(*smithyhttp.Response)
19037	if !ok {
19038		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19039	}
19040
19041	if response.StatusCode < 200 || response.StatusCode >= 300 {
19042		return out, metadata, awsRestjson1_deserializeOpErrorUpdateThemeAlias(response, &metadata)
19043	}
19044	output := &UpdateThemeAliasOutput{}
19045	out.Result = output
19046
19047	err = awsRestjson1_deserializeOpHttpBindingsUpdateThemeAliasOutput(output, response)
19048	if err != nil {
19049		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
19050	}
19051
19052	var buff [1024]byte
19053	ringBuffer := smithyio.NewRingBuffer(buff[:])
19054
19055	body := io.TeeReader(response.Body, ringBuffer)
19056
19057	decoder := json.NewDecoder(body)
19058	decoder.UseNumber()
19059	var shape interface{}
19060	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19061		var snapshot bytes.Buffer
19062		io.Copy(&snapshot, ringBuffer)
19063		err = &smithy.DeserializationError{
19064			Err:      fmt.Errorf("failed to decode response body, %w", err),
19065			Snapshot: snapshot.Bytes(),
19066		}
19067		return out, metadata, err
19068	}
19069
19070	err = awsRestjson1_deserializeOpDocumentUpdateThemeAliasOutput(&output, shape)
19071	if err != nil {
19072		var snapshot bytes.Buffer
19073		io.Copy(&snapshot, ringBuffer)
19074		return out, metadata, &smithy.DeserializationError{
19075			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19076			Snapshot: snapshot.Bytes(),
19077		}
19078	}
19079
19080	return out, metadata, err
19081}
19082
19083func awsRestjson1_deserializeOpErrorUpdateThemeAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19084	var errorBuffer bytes.Buffer
19085	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19086		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19087	}
19088	errorBody := bytes.NewReader(errorBuffer.Bytes())
19089
19090	errorCode := "UnknownError"
19091	errorMessage := errorCode
19092
19093	code := response.Header.Get("X-Amzn-ErrorType")
19094	if len(code) != 0 {
19095		errorCode = restjson.SanitizeErrorCode(code)
19096	}
19097
19098	var buff [1024]byte
19099	ringBuffer := smithyio.NewRingBuffer(buff[:])
19100
19101	body := io.TeeReader(errorBody, ringBuffer)
19102	decoder := json.NewDecoder(body)
19103	decoder.UseNumber()
19104	code, message, err := restjson.GetErrorInfo(decoder)
19105	if err != nil {
19106		var snapshot bytes.Buffer
19107		io.Copy(&snapshot, ringBuffer)
19108		err = &smithy.DeserializationError{
19109			Err:      fmt.Errorf("failed to decode response body, %w", err),
19110			Snapshot: snapshot.Bytes(),
19111		}
19112		return err
19113	}
19114
19115	errorBody.Seek(0, io.SeekStart)
19116	if len(code) != 0 {
19117		errorCode = restjson.SanitizeErrorCode(code)
19118	}
19119	if len(message) != 0 {
19120		errorMessage = message
19121	}
19122
19123	switch {
19124	case strings.EqualFold("ConflictException", errorCode):
19125		return awsRestjson1_deserializeErrorConflictException(response, errorBody)
19126
19127	case strings.EqualFold("InternalFailureException", errorCode):
19128		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19129
19130	case strings.EqualFold("InvalidParameterValueException", errorCode):
19131		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
19132
19133	case strings.EqualFold("ResourceExistsException", errorCode):
19134		return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody)
19135
19136	case strings.EqualFold("ResourceNotFoundException", errorCode):
19137		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
19138
19139	case strings.EqualFold("ThrottlingException", errorCode):
19140		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19141
19142	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
19143		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
19144
19145	default:
19146		genericError := &smithy.GenericAPIError{
19147			Code:    errorCode,
19148			Message: errorMessage,
19149		}
19150		return genericError
19151
19152	}
19153}
19154
19155func awsRestjson1_deserializeOpHttpBindingsUpdateThemeAliasOutput(v *UpdateThemeAliasOutput, response *smithyhttp.Response) error {
19156	if v == nil {
19157		return fmt.Errorf("unsupported deserialization for nil %T", v)
19158	}
19159
19160	v.Status = int32(response.StatusCode)
19161
19162	return nil
19163}
19164func awsRestjson1_deserializeOpDocumentUpdateThemeAliasOutput(v **UpdateThemeAliasOutput, value interface{}) error {
19165	if v == nil {
19166		return fmt.Errorf("unexpected nil of type %T", v)
19167	}
19168	if value == nil {
19169		return nil
19170	}
19171
19172	shape, ok := value.(map[string]interface{})
19173	if !ok {
19174		return fmt.Errorf("unexpected JSON type %v", value)
19175	}
19176
19177	var sv *UpdateThemeAliasOutput
19178	if *v == nil {
19179		sv = &UpdateThemeAliasOutput{}
19180	} else {
19181		sv = *v
19182	}
19183
19184	for key, value := range shape {
19185		switch key {
19186		case "RequestId":
19187			if value != nil {
19188				jtv, ok := value.(string)
19189				if !ok {
19190					return fmt.Errorf("expected String to be of type string, got %T instead", value)
19191				}
19192				sv.RequestId = ptr.String(jtv)
19193			}
19194
19195		case "ThemeAlias":
19196			if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil {
19197				return err
19198			}
19199
19200		default:
19201			_, _ = key, value
19202
19203		}
19204	}
19205	*v = sv
19206	return nil
19207}
19208
19209type awsRestjson1_deserializeOpUpdateThemePermissions struct {
19210}
19211
19212func (*awsRestjson1_deserializeOpUpdateThemePermissions) ID() string {
19213	return "OperationDeserializer"
19214}
19215
19216func (m *awsRestjson1_deserializeOpUpdateThemePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19217	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19218) {
19219	out, metadata, err = next.HandleDeserialize(ctx, in)
19220	if err != nil {
19221		return out, metadata, err
19222	}
19223
19224	response, ok := out.RawResponse.(*smithyhttp.Response)
19225	if !ok {
19226		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19227	}
19228
19229	if response.StatusCode < 200 || response.StatusCode >= 300 {
19230		return out, metadata, awsRestjson1_deserializeOpErrorUpdateThemePermissions(response, &metadata)
19231	}
19232	output := &UpdateThemePermissionsOutput{}
19233	out.Result = output
19234
19235	err = awsRestjson1_deserializeOpHttpBindingsUpdateThemePermissionsOutput(output, response)
19236	if err != nil {
19237		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
19238	}
19239
19240	var buff [1024]byte
19241	ringBuffer := smithyio.NewRingBuffer(buff[:])
19242
19243	body := io.TeeReader(response.Body, ringBuffer)
19244
19245	decoder := json.NewDecoder(body)
19246	decoder.UseNumber()
19247	var shape interface{}
19248	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19249		var snapshot bytes.Buffer
19250		io.Copy(&snapshot, ringBuffer)
19251		err = &smithy.DeserializationError{
19252			Err:      fmt.Errorf("failed to decode response body, %w", err),
19253			Snapshot: snapshot.Bytes(),
19254		}
19255		return out, metadata, err
19256	}
19257
19258	err = awsRestjson1_deserializeOpDocumentUpdateThemePermissionsOutput(&output, shape)
19259	if err != nil {
19260		var snapshot bytes.Buffer
19261		io.Copy(&snapshot, ringBuffer)
19262		return out, metadata, &smithy.DeserializationError{
19263			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19264			Snapshot: snapshot.Bytes(),
19265		}
19266	}
19267
19268	return out, metadata, err
19269}
19270
19271func awsRestjson1_deserializeOpErrorUpdateThemePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19272	var errorBuffer bytes.Buffer
19273	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19274		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19275	}
19276	errorBody := bytes.NewReader(errorBuffer.Bytes())
19277
19278	errorCode := "UnknownError"
19279	errorMessage := errorCode
19280
19281	code := response.Header.Get("X-Amzn-ErrorType")
19282	if len(code) != 0 {
19283		errorCode = restjson.SanitizeErrorCode(code)
19284	}
19285
19286	var buff [1024]byte
19287	ringBuffer := smithyio.NewRingBuffer(buff[:])
19288
19289	body := io.TeeReader(errorBody, ringBuffer)
19290	decoder := json.NewDecoder(body)
19291	decoder.UseNumber()
19292	code, message, err := restjson.GetErrorInfo(decoder)
19293	if err != nil {
19294		var snapshot bytes.Buffer
19295		io.Copy(&snapshot, ringBuffer)
19296		err = &smithy.DeserializationError{
19297			Err:      fmt.Errorf("failed to decode response body, %w", err),
19298			Snapshot: snapshot.Bytes(),
19299		}
19300		return err
19301	}
19302
19303	errorBody.Seek(0, io.SeekStart)
19304	if len(code) != 0 {
19305		errorCode = restjson.SanitizeErrorCode(code)
19306	}
19307	if len(message) != 0 {
19308		errorMessage = message
19309	}
19310
19311	switch {
19312	case strings.EqualFold("AccessDeniedException", errorCode):
19313		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
19314
19315	case strings.EqualFold("InternalFailureException", errorCode):
19316		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19317
19318	case strings.EqualFold("InvalidParameterValueException", errorCode):
19319		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
19320
19321	case strings.EqualFold("ResourceNotFoundException", errorCode):
19322		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
19323
19324	case strings.EqualFold("ThrottlingException", errorCode):
19325		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19326
19327	case strings.EqualFold("UnsupportedUserEditionException", errorCode):
19328		return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody)
19329
19330	default:
19331		genericError := &smithy.GenericAPIError{
19332			Code:    errorCode,
19333			Message: errorMessage,
19334		}
19335		return genericError
19336
19337	}
19338}
19339
19340func awsRestjson1_deserializeOpHttpBindingsUpdateThemePermissionsOutput(v *UpdateThemePermissionsOutput, response *smithyhttp.Response) error {
19341	if v == nil {
19342		return fmt.Errorf("unsupported deserialization for nil %T", v)
19343	}
19344
19345	v.Status = int32(response.StatusCode)
19346
19347	return nil
19348}
19349func awsRestjson1_deserializeOpDocumentUpdateThemePermissionsOutput(v **UpdateThemePermissionsOutput, value interface{}) error {
19350	if v == nil {
19351		return fmt.Errorf("unexpected nil of type %T", v)
19352	}
19353	if value == nil {
19354		return nil
19355	}
19356
19357	shape, ok := value.(map[string]interface{})
19358	if !ok {
19359		return fmt.Errorf("unexpected JSON type %v", value)
19360	}
19361
19362	var sv *UpdateThemePermissionsOutput
19363	if *v == nil {
19364		sv = &UpdateThemePermissionsOutput{}
19365	} else {
19366		sv = *v
19367	}
19368
19369	for key, value := range shape {
19370		switch key {
19371		case "Permissions":
19372			if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil {
19373				return err
19374			}
19375
19376		case "RequestId":
19377			if value != nil {
19378				jtv, ok := value.(string)
19379				if !ok {
19380					return fmt.Errorf("expected String to be of type string, got %T instead", value)
19381				}
19382				sv.RequestId = ptr.String(jtv)
19383			}
19384
19385		case "ThemeArn":
19386			if value != nil {
19387				jtv, ok := value.(string)
19388				if !ok {
19389					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
19390				}
19391				sv.ThemeArn = ptr.String(jtv)
19392			}
19393
19394		case "ThemeId":
19395			if value != nil {
19396				jtv, ok := value.(string)
19397				if !ok {
19398					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
19399				}
19400				sv.ThemeId = ptr.String(jtv)
19401			}
19402
19403		default:
19404			_, _ = key, value
19405
19406		}
19407	}
19408	*v = sv
19409	return nil
19410}
19411
19412type awsRestjson1_deserializeOpUpdateUser struct {
19413}
19414
19415func (*awsRestjson1_deserializeOpUpdateUser) ID() string {
19416	return "OperationDeserializer"
19417}
19418
19419func (m *awsRestjson1_deserializeOpUpdateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
19420	out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
19421) {
19422	out, metadata, err = next.HandleDeserialize(ctx, in)
19423	if err != nil {
19424		return out, metadata, err
19425	}
19426
19427	response, ok := out.RawResponse.(*smithyhttp.Response)
19428	if !ok {
19429		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
19430	}
19431
19432	if response.StatusCode < 200 || response.StatusCode >= 300 {
19433		return out, metadata, awsRestjson1_deserializeOpErrorUpdateUser(response, &metadata)
19434	}
19435	output := &UpdateUserOutput{}
19436	out.Result = output
19437
19438	err = awsRestjson1_deserializeOpHttpBindingsUpdateUserOutput(output, response)
19439	if err != nil {
19440		return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
19441	}
19442
19443	var buff [1024]byte
19444	ringBuffer := smithyio.NewRingBuffer(buff[:])
19445
19446	body := io.TeeReader(response.Body, ringBuffer)
19447
19448	decoder := json.NewDecoder(body)
19449	decoder.UseNumber()
19450	var shape interface{}
19451	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19452		var snapshot bytes.Buffer
19453		io.Copy(&snapshot, ringBuffer)
19454		err = &smithy.DeserializationError{
19455			Err:      fmt.Errorf("failed to decode response body, %w", err),
19456			Snapshot: snapshot.Bytes(),
19457		}
19458		return out, metadata, err
19459	}
19460
19461	err = awsRestjson1_deserializeOpDocumentUpdateUserOutput(&output, shape)
19462	if err != nil {
19463		var snapshot bytes.Buffer
19464		io.Copy(&snapshot, ringBuffer)
19465		return out, metadata, &smithy.DeserializationError{
19466			Err:      fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
19467			Snapshot: snapshot.Bytes(),
19468		}
19469	}
19470
19471	return out, metadata, err
19472}
19473
19474func awsRestjson1_deserializeOpErrorUpdateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
19475	var errorBuffer bytes.Buffer
19476	if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
19477		return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
19478	}
19479	errorBody := bytes.NewReader(errorBuffer.Bytes())
19480
19481	errorCode := "UnknownError"
19482	errorMessage := errorCode
19483
19484	code := response.Header.Get("X-Amzn-ErrorType")
19485	if len(code) != 0 {
19486		errorCode = restjson.SanitizeErrorCode(code)
19487	}
19488
19489	var buff [1024]byte
19490	ringBuffer := smithyio.NewRingBuffer(buff[:])
19491
19492	body := io.TeeReader(errorBody, ringBuffer)
19493	decoder := json.NewDecoder(body)
19494	decoder.UseNumber()
19495	code, message, err := restjson.GetErrorInfo(decoder)
19496	if err != nil {
19497		var snapshot bytes.Buffer
19498		io.Copy(&snapshot, ringBuffer)
19499		err = &smithy.DeserializationError{
19500			Err:      fmt.Errorf("failed to decode response body, %w", err),
19501			Snapshot: snapshot.Bytes(),
19502		}
19503		return err
19504	}
19505
19506	errorBody.Seek(0, io.SeekStart)
19507	if len(code) != 0 {
19508		errorCode = restjson.SanitizeErrorCode(code)
19509	}
19510	if len(message) != 0 {
19511		errorMessage = message
19512	}
19513
19514	switch {
19515	case strings.EqualFold("AccessDeniedException", errorCode):
19516		return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
19517
19518	case strings.EqualFold("InternalFailureException", errorCode):
19519		return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
19520
19521	case strings.EqualFold("InvalidParameterValueException", errorCode):
19522		return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody)
19523
19524	case strings.EqualFold("PreconditionNotMetException", errorCode):
19525		return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody)
19526
19527	case strings.EqualFold("ResourceNotFoundException", errorCode):
19528		return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
19529
19530	case strings.EqualFold("ResourceUnavailableException", errorCode):
19531		return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody)
19532
19533	case strings.EqualFold("ThrottlingException", errorCode):
19534		return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
19535
19536	default:
19537		genericError := &smithy.GenericAPIError{
19538			Code:    errorCode,
19539			Message: errorMessage,
19540		}
19541		return genericError
19542
19543	}
19544}
19545
19546func awsRestjson1_deserializeOpHttpBindingsUpdateUserOutput(v *UpdateUserOutput, response *smithyhttp.Response) error {
19547	if v == nil {
19548		return fmt.Errorf("unsupported deserialization for nil %T", v)
19549	}
19550
19551	v.Status = int32(response.StatusCode)
19552
19553	return nil
19554}
19555func awsRestjson1_deserializeOpDocumentUpdateUserOutput(v **UpdateUserOutput, value interface{}) error {
19556	if v == nil {
19557		return fmt.Errorf("unexpected nil of type %T", v)
19558	}
19559	if value == nil {
19560		return nil
19561	}
19562
19563	shape, ok := value.(map[string]interface{})
19564	if !ok {
19565		return fmt.Errorf("unexpected JSON type %v", value)
19566	}
19567
19568	var sv *UpdateUserOutput
19569	if *v == nil {
19570		sv = &UpdateUserOutput{}
19571	} else {
19572		sv = *v
19573	}
19574
19575	for key, value := range shape {
19576		switch key {
19577		case "RequestId":
19578			if value != nil {
19579				jtv, ok := value.(string)
19580				if !ok {
19581					return fmt.Errorf("expected String to be of type string, got %T instead", value)
19582				}
19583				sv.RequestId = ptr.String(jtv)
19584			}
19585
19586		case "User":
19587			if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil {
19588				return err
19589			}
19590
19591		default:
19592			_, _ = key, value
19593
19594		}
19595	}
19596	*v = sv
19597	return nil
19598}
19599
19600func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19601	output := &types.AccessDeniedException{}
19602	var buff [1024]byte
19603	ringBuffer := smithyio.NewRingBuffer(buff[:])
19604
19605	body := io.TeeReader(errorBody, ringBuffer)
19606	decoder := json.NewDecoder(body)
19607	decoder.UseNumber()
19608	var shape interface{}
19609	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19610		var snapshot bytes.Buffer
19611		io.Copy(&snapshot, ringBuffer)
19612		err = &smithy.DeserializationError{
19613			Err:      fmt.Errorf("failed to decode response body, %w", err),
19614			Snapshot: snapshot.Bytes(),
19615		}
19616		return err
19617	}
19618
19619	err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
19620
19621	if err != nil {
19622		var snapshot bytes.Buffer
19623		io.Copy(&snapshot, ringBuffer)
19624		err = &smithy.DeserializationError{
19625			Err:      fmt.Errorf("failed to decode response body, %w", err),
19626			Snapshot: snapshot.Bytes(),
19627		}
19628		return err
19629	}
19630
19631	errorBody.Seek(0, io.SeekStart)
19632
19633	return output
19634}
19635
19636func awsRestjson1_deserializeErrorConcurrentUpdatingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19637	output := &types.ConcurrentUpdatingException{}
19638	var buff [1024]byte
19639	ringBuffer := smithyio.NewRingBuffer(buff[:])
19640
19641	body := io.TeeReader(errorBody, ringBuffer)
19642	decoder := json.NewDecoder(body)
19643	decoder.UseNumber()
19644	var shape interface{}
19645	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19646		var snapshot bytes.Buffer
19647		io.Copy(&snapshot, ringBuffer)
19648		err = &smithy.DeserializationError{
19649			Err:      fmt.Errorf("failed to decode response body, %w", err),
19650			Snapshot: snapshot.Bytes(),
19651		}
19652		return err
19653	}
19654
19655	err := awsRestjson1_deserializeDocumentConcurrentUpdatingException(&output, shape)
19656
19657	if err != nil {
19658		var snapshot bytes.Buffer
19659		io.Copy(&snapshot, ringBuffer)
19660		err = &smithy.DeserializationError{
19661			Err:      fmt.Errorf("failed to decode response body, %w", err),
19662			Snapshot: snapshot.Bytes(),
19663		}
19664		return err
19665	}
19666
19667	errorBody.Seek(0, io.SeekStart)
19668
19669	return output
19670}
19671
19672func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19673	output := &types.ConflictException{}
19674	var buff [1024]byte
19675	ringBuffer := smithyio.NewRingBuffer(buff[:])
19676
19677	body := io.TeeReader(errorBody, ringBuffer)
19678	decoder := json.NewDecoder(body)
19679	decoder.UseNumber()
19680	var shape interface{}
19681	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19682		var snapshot bytes.Buffer
19683		io.Copy(&snapshot, ringBuffer)
19684		err = &smithy.DeserializationError{
19685			Err:      fmt.Errorf("failed to decode response body, %w", err),
19686			Snapshot: snapshot.Bytes(),
19687		}
19688		return err
19689	}
19690
19691	err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
19692
19693	if err != nil {
19694		var snapshot bytes.Buffer
19695		io.Copy(&snapshot, ringBuffer)
19696		err = &smithy.DeserializationError{
19697			Err:      fmt.Errorf("failed to decode response body, %w", err),
19698			Snapshot: snapshot.Bytes(),
19699		}
19700		return err
19701	}
19702
19703	errorBody.Seek(0, io.SeekStart)
19704
19705	return output
19706}
19707
19708func awsRestjson1_deserializeErrorDomainNotWhitelistedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19709	output := &types.DomainNotWhitelistedException{}
19710	var buff [1024]byte
19711	ringBuffer := smithyio.NewRingBuffer(buff[:])
19712
19713	body := io.TeeReader(errorBody, ringBuffer)
19714	decoder := json.NewDecoder(body)
19715	decoder.UseNumber()
19716	var shape interface{}
19717	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19718		var snapshot bytes.Buffer
19719		io.Copy(&snapshot, ringBuffer)
19720		err = &smithy.DeserializationError{
19721			Err:      fmt.Errorf("failed to decode response body, %w", err),
19722			Snapshot: snapshot.Bytes(),
19723		}
19724		return err
19725	}
19726
19727	err := awsRestjson1_deserializeDocumentDomainNotWhitelistedException(&output, shape)
19728
19729	if err != nil {
19730		var snapshot bytes.Buffer
19731		io.Copy(&snapshot, ringBuffer)
19732		err = &smithy.DeserializationError{
19733			Err:      fmt.Errorf("failed to decode response body, %w", err),
19734			Snapshot: snapshot.Bytes(),
19735		}
19736		return err
19737	}
19738
19739	errorBody.Seek(0, io.SeekStart)
19740
19741	return output
19742}
19743
19744func awsRestjson1_deserializeErrorIdentityTypeNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19745	output := &types.IdentityTypeNotSupportedException{}
19746	var buff [1024]byte
19747	ringBuffer := smithyio.NewRingBuffer(buff[:])
19748
19749	body := io.TeeReader(errorBody, ringBuffer)
19750	decoder := json.NewDecoder(body)
19751	decoder.UseNumber()
19752	var shape interface{}
19753	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19754		var snapshot bytes.Buffer
19755		io.Copy(&snapshot, ringBuffer)
19756		err = &smithy.DeserializationError{
19757			Err:      fmt.Errorf("failed to decode response body, %w", err),
19758			Snapshot: snapshot.Bytes(),
19759		}
19760		return err
19761	}
19762
19763	err := awsRestjson1_deserializeDocumentIdentityTypeNotSupportedException(&output, shape)
19764
19765	if err != nil {
19766		var snapshot bytes.Buffer
19767		io.Copy(&snapshot, ringBuffer)
19768		err = &smithy.DeserializationError{
19769			Err:      fmt.Errorf("failed to decode response body, %w", err),
19770			Snapshot: snapshot.Bytes(),
19771		}
19772		return err
19773	}
19774
19775	errorBody.Seek(0, io.SeekStart)
19776
19777	return output
19778}
19779
19780func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19781	output := &types.InternalFailureException{}
19782	var buff [1024]byte
19783	ringBuffer := smithyio.NewRingBuffer(buff[:])
19784
19785	body := io.TeeReader(errorBody, ringBuffer)
19786	decoder := json.NewDecoder(body)
19787	decoder.UseNumber()
19788	var shape interface{}
19789	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19790		var snapshot bytes.Buffer
19791		io.Copy(&snapshot, ringBuffer)
19792		err = &smithy.DeserializationError{
19793			Err:      fmt.Errorf("failed to decode response body, %w", err),
19794			Snapshot: snapshot.Bytes(),
19795		}
19796		return err
19797	}
19798
19799	err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape)
19800
19801	if err != nil {
19802		var snapshot bytes.Buffer
19803		io.Copy(&snapshot, ringBuffer)
19804		err = &smithy.DeserializationError{
19805			Err:      fmt.Errorf("failed to decode response body, %w", err),
19806			Snapshot: snapshot.Bytes(),
19807		}
19808		return err
19809	}
19810
19811	errorBody.Seek(0, io.SeekStart)
19812
19813	return output
19814}
19815
19816func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19817	output := &types.InvalidNextTokenException{}
19818	var buff [1024]byte
19819	ringBuffer := smithyio.NewRingBuffer(buff[:])
19820
19821	body := io.TeeReader(errorBody, ringBuffer)
19822	decoder := json.NewDecoder(body)
19823	decoder.UseNumber()
19824	var shape interface{}
19825	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19826		var snapshot bytes.Buffer
19827		io.Copy(&snapshot, ringBuffer)
19828		err = &smithy.DeserializationError{
19829			Err:      fmt.Errorf("failed to decode response body, %w", err),
19830			Snapshot: snapshot.Bytes(),
19831		}
19832		return err
19833	}
19834
19835	err := awsRestjson1_deserializeDocumentInvalidNextTokenException(&output, shape)
19836
19837	if err != nil {
19838		var snapshot bytes.Buffer
19839		io.Copy(&snapshot, ringBuffer)
19840		err = &smithy.DeserializationError{
19841			Err:      fmt.Errorf("failed to decode response body, %w", err),
19842			Snapshot: snapshot.Bytes(),
19843		}
19844		return err
19845	}
19846
19847	errorBody.Seek(0, io.SeekStart)
19848
19849	return output
19850}
19851
19852func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19853	output := &types.InvalidParameterValueException{}
19854	var buff [1024]byte
19855	ringBuffer := smithyio.NewRingBuffer(buff[:])
19856
19857	body := io.TeeReader(errorBody, ringBuffer)
19858	decoder := json.NewDecoder(body)
19859	decoder.UseNumber()
19860	var shape interface{}
19861	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19862		var snapshot bytes.Buffer
19863		io.Copy(&snapshot, ringBuffer)
19864		err = &smithy.DeserializationError{
19865			Err:      fmt.Errorf("failed to decode response body, %w", err),
19866			Snapshot: snapshot.Bytes(),
19867		}
19868		return err
19869	}
19870
19871	err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape)
19872
19873	if err != nil {
19874		var snapshot bytes.Buffer
19875		io.Copy(&snapshot, ringBuffer)
19876		err = &smithy.DeserializationError{
19877			Err:      fmt.Errorf("failed to decode response body, %w", err),
19878			Snapshot: snapshot.Bytes(),
19879		}
19880		return err
19881	}
19882
19883	errorBody.Seek(0, io.SeekStart)
19884
19885	return output
19886}
19887
19888func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19889	output := &types.LimitExceededException{}
19890	var buff [1024]byte
19891	ringBuffer := smithyio.NewRingBuffer(buff[:])
19892
19893	body := io.TeeReader(errorBody, ringBuffer)
19894	decoder := json.NewDecoder(body)
19895	decoder.UseNumber()
19896	var shape interface{}
19897	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19898		var snapshot bytes.Buffer
19899		io.Copy(&snapshot, ringBuffer)
19900		err = &smithy.DeserializationError{
19901			Err:      fmt.Errorf("failed to decode response body, %w", err),
19902			Snapshot: snapshot.Bytes(),
19903		}
19904		return err
19905	}
19906
19907	err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape)
19908
19909	if err != nil {
19910		var snapshot bytes.Buffer
19911		io.Copy(&snapshot, ringBuffer)
19912		err = &smithy.DeserializationError{
19913			Err:      fmt.Errorf("failed to decode response body, %w", err),
19914			Snapshot: snapshot.Bytes(),
19915		}
19916		return err
19917	}
19918
19919	errorBody.Seek(0, io.SeekStart)
19920
19921	return output
19922}
19923
19924func awsRestjson1_deserializeErrorPreconditionNotMetException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19925	output := &types.PreconditionNotMetException{}
19926	var buff [1024]byte
19927	ringBuffer := smithyio.NewRingBuffer(buff[:])
19928
19929	body := io.TeeReader(errorBody, ringBuffer)
19930	decoder := json.NewDecoder(body)
19931	decoder.UseNumber()
19932	var shape interface{}
19933	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19934		var snapshot bytes.Buffer
19935		io.Copy(&snapshot, ringBuffer)
19936		err = &smithy.DeserializationError{
19937			Err:      fmt.Errorf("failed to decode response body, %w", err),
19938			Snapshot: snapshot.Bytes(),
19939		}
19940		return err
19941	}
19942
19943	err := awsRestjson1_deserializeDocumentPreconditionNotMetException(&output, shape)
19944
19945	if err != nil {
19946		var snapshot bytes.Buffer
19947		io.Copy(&snapshot, ringBuffer)
19948		err = &smithy.DeserializationError{
19949			Err:      fmt.Errorf("failed to decode response body, %w", err),
19950			Snapshot: snapshot.Bytes(),
19951		}
19952		return err
19953	}
19954
19955	errorBody.Seek(0, io.SeekStart)
19956
19957	return output
19958}
19959
19960func awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19961	output := &types.QuickSightUserNotFoundException{}
19962	var buff [1024]byte
19963	ringBuffer := smithyio.NewRingBuffer(buff[:])
19964
19965	body := io.TeeReader(errorBody, ringBuffer)
19966	decoder := json.NewDecoder(body)
19967	decoder.UseNumber()
19968	var shape interface{}
19969	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
19970		var snapshot bytes.Buffer
19971		io.Copy(&snapshot, ringBuffer)
19972		err = &smithy.DeserializationError{
19973			Err:      fmt.Errorf("failed to decode response body, %w", err),
19974			Snapshot: snapshot.Bytes(),
19975		}
19976		return err
19977	}
19978
19979	err := awsRestjson1_deserializeDocumentQuickSightUserNotFoundException(&output, shape)
19980
19981	if err != nil {
19982		var snapshot bytes.Buffer
19983		io.Copy(&snapshot, ringBuffer)
19984		err = &smithy.DeserializationError{
19985			Err:      fmt.Errorf("failed to decode response body, %w", err),
19986			Snapshot: snapshot.Bytes(),
19987		}
19988		return err
19989	}
19990
19991	errorBody.Seek(0, io.SeekStart)
19992
19993	return output
19994}
19995
19996func awsRestjson1_deserializeErrorResourceExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
19997	output := &types.ResourceExistsException{}
19998	var buff [1024]byte
19999	ringBuffer := smithyio.NewRingBuffer(buff[:])
20000
20001	body := io.TeeReader(errorBody, ringBuffer)
20002	decoder := json.NewDecoder(body)
20003	decoder.UseNumber()
20004	var shape interface{}
20005	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20006		var snapshot bytes.Buffer
20007		io.Copy(&snapshot, ringBuffer)
20008		err = &smithy.DeserializationError{
20009			Err:      fmt.Errorf("failed to decode response body, %w", err),
20010			Snapshot: snapshot.Bytes(),
20011		}
20012		return err
20013	}
20014
20015	err := awsRestjson1_deserializeDocumentResourceExistsException(&output, shape)
20016
20017	if err != nil {
20018		var snapshot bytes.Buffer
20019		io.Copy(&snapshot, ringBuffer)
20020		err = &smithy.DeserializationError{
20021			Err:      fmt.Errorf("failed to decode response body, %w", err),
20022			Snapshot: snapshot.Bytes(),
20023		}
20024		return err
20025	}
20026
20027	errorBody.Seek(0, io.SeekStart)
20028
20029	return output
20030}
20031
20032func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20033	output := &types.ResourceNotFoundException{}
20034	var buff [1024]byte
20035	ringBuffer := smithyio.NewRingBuffer(buff[:])
20036
20037	body := io.TeeReader(errorBody, ringBuffer)
20038	decoder := json.NewDecoder(body)
20039	decoder.UseNumber()
20040	var shape interface{}
20041	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20042		var snapshot bytes.Buffer
20043		io.Copy(&snapshot, ringBuffer)
20044		err = &smithy.DeserializationError{
20045			Err:      fmt.Errorf("failed to decode response body, %w", err),
20046			Snapshot: snapshot.Bytes(),
20047		}
20048		return err
20049	}
20050
20051	err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
20052
20053	if err != nil {
20054		var snapshot bytes.Buffer
20055		io.Copy(&snapshot, ringBuffer)
20056		err = &smithy.DeserializationError{
20057			Err:      fmt.Errorf("failed to decode response body, %w", err),
20058			Snapshot: snapshot.Bytes(),
20059		}
20060		return err
20061	}
20062
20063	errorBody.Seek(0, io.SeekStart)
20064
20065	return output
20066}
20067
20068func awsRestjson1_deserializeErrorResourceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20069	output := &types.ResourceUnavailableException{}
20070	var buff [1024]byte
20071	ringBuffer := smithyio.NewRingBuffer(buff[:])
20072
20073	body := io.TeeReader(errorBody, ringBuffer)
20074	decoder := json.NewDecoder(body)
20075	decoder.UseNumber()
20076	var shape interface{}
20077	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20078		var snapshot bytes.Buffer
20079		io.Copy(&snapshot, ringBuffer)
20080		err = &smithy.DeserializationError{
20081			Err:      fmt.Errorf("failed to decode response body, %w", err),
20082			Snapshot: snapshot.Bytes(),
20083		}
20084		return err
20085	}
20086
20087	err := awsRestjson1_deserializeDocumentResourceUnavailableException(&output, shape)
20088
20089	if err != nil {
20090		var snapshot bytes.Buffer
20091		io.Copy(&snapshot, ringBuffer)
20092		err = &smithy.DeserializationError{
20093			Err:      fmt.Errorf("failed to decode response body, %w", err),
20094			Snapshot: snapshot.Bytes(),
20095		}
20096		return err
20097	}
20098
20099	errorBody.Seek(0, io.SeekStart)
20100
20101	return output
20102}
20103
20104func awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20105	output := &types.SessionLifetimeInMinutesInvalidException{}
20106	var buff [1024]byte
20107	ringBuffer := smithyio.NewRingBuffer(buff[:])
20108
20109	body := io.TeeReader(errorBody, ringBuffer)
20110	decoder := json.NewDecoder(body)
20111	decoder.UseNumber()
20112	var shape interface{}
20113	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20114		var snapshot bytes.Buffer
20115		io.Copy(&snapshot, ringBuffer)
20116		err = &smithy.DeserializationError{
20117			Err:      fmt.Errorf("failed to decode response body, %w", err),
20118			Snapshot: snapshot.Bytes(),
20119		}
20120		return err
20121	}
20122
20123	err := awsRestjson1_deserializeDocumentSessionLifetimeInMinutesInvalidException(&output, shape)
20124
20125	if err != nil {
20126		var snapshot bytes.Buffer
20127		io.Copy(&snapshot, ringBuffer)
20128		err = &smithy.DeserializationError{
20129			Err:      fmt.Errorf("failed to decode response body, %w", err),
20130			Snapshot: snapshot.Bytes(),
20131		}
20132		return err
20133	}
20134
20135	errorBody.Seek(0, io.SeekStart)
20136
20137	return output
20138}
20139
20140func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20141	output := &types.ThrottlingException{}
20142	var buff [1024]byte
20143	ringBuffer := smithyio.NewRingBuffer(buff[:])
20144
20145	body := io.TeeReader(errorBody, ringBuffer)
20146	decoder := json.NewDecoder(body)
20147	decoder.UseNumber()
20148	var shape interface{}
20149	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20150		var snapshot bytes.Buffer
20151		io.Copy(&snapshot, ringBuffer)
20152		err = &smithy.DeserializationError{
20153			Err:      fmt.Errorf("failed to decode response body, %w", err),
20154			Snapshot: snapshot.Bytes(),
20155		}
20156		return err
20157	}
20158
20159	err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
20160
20161	if err != nil {
20162		var snapshot bytes.Buffer
20163		io.Copy(&snapshot, ringBuffer)
20164		err = &smithy.DeserializationError{
20165			Err:      fmt.Errorf("failed to decode response body, %w", err),
20166			Snapshot: snapshot.Bytes(),
20167		}
20168		return err
20169	}
20170
20171	errorBody.Seek(0, io.SeekStart)
20172
20173	return output
20174}
20175
20176func awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20177	output := &types.UnsupportedPricingPlanException{}
20178	var buff [1024]byte
20179	ringBuffer := smithyio.NewRingBuffer(buff[:])
20180
20181	body := io.TeeReader(errorBody, ringBuffer)
20182	decoder := json.NewDecoder(body)
20183	decoder.UseNumber()
20184	var shape interface{}
20185	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20186		var snapshot bytes.Buffer
20187		io.Copy(&snapshot, ringBuffer)
20188		err = &smithy.DeserializationError{
20189			Err:      fmt.Errorf("failed to decode response body, %w", err),
20190			Snapshot: snapshot.Bytes(),
20191		}
20192		return err
20193	}
20194
20195	err := awsRestjson1_deserializeDocumentUnsupportedPricingPlanException(&output, shape)
20196
20197	if err != nil {
20198		var snapshot bytes.Buffer
20199		io.Copy(&snapshot, ringBuffer)
20200		err = &smithy.DeserializationError{
20201			Err:      fmt.Errorf("failed to decode response body, %w", err),
20202			Snapshot: snapshot.Bytes(),
20203		}
20204		return err
20205	}
20206
20207	errorBody.Seek(0, io.SeekStart)
20208
20209	return output
20210}
20211
20212func awsRestjson1_deserializeErrorUnsupportedUserEditionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
20213	output := &types.UnsupportedUserEditionException{}
20214	var buff [1024]byte
20215	ringBuffer := smithyio.NewRingBuffer(buff[:])
20216
20217	body := io.TeeReader(errorBody, ringBuffer)
20218	decoder := json.NewDecoder(body)
20219	decoder.UseNumber()
20220	var shape interface{}
20221	if err := decoder.Decode(&shape); err != nil && err != io.EOF {
20222		var snapshot bytes.Buffer
20223		io.Copy(&snapshot, ringBuffer)
20224		err = &smithy.DeserializationError{
20225			Err:      fmt.Errorf("failed to decode response body, %w", err),
20226			Snapshot: snapshot.Bytes(),
20227		}
20228		return err
20229	}
20230
20231	err := awsRestjson1_deserializeDocumentUnsupportedUserEditionException(&output, shape)
20232
20233	if err != nil {
20234		var snapshot bytes.Buffer
20235		io.Copy(&snapshot, ringBuffer)
20236		err = &smithy.DeserializationError{
20237			Err:      fmt.Errorf("failed to decode response body, %w", err),
20238			Snapshot: snapshot.Bytes(),
20239		}
20240		return err
20241	}
20242
20243	errorBody.Seek(0, io.SeekStart)
20244
20245	return output
20246}
20247
20248func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
20249	if v == nil {
20250		return fmt.Errorf("unexpected nil of type %T", v)
20251	}
20252	if value == nil {
20253		return nil
20254	}
20255
20256	shape, ok := value.(map[string]interface{})
20257	if !ok {
20258		return fmt.Errorf("unexpected JSON type %v", value)
20259	}
20260
20261	var sv *types.AccessDeniedException
20262	if *v == nil {
20263		sv = &types.AccessDeniedException{}
20264	} else {
20265		sv = *v
20266	}
20267
20268	for key, value := range shape {
20269		switch key {
20270		case "Message":
20271			if value != nil {
20272				jtv, ok := value.(string)
20273				if !ok {
20274					return fmt.Errorf("expected String to be of type string, got %T instead", value)
20275				}
20276				sv.Message = ptr.String(jtv)
20277			}
20278
20279		case "RequestId":
20280			if value != nil {
20281				jtv, ok := value.(string)
20282				if !ok {
20283					return fmt.Errorf("expected String to be of type string, got %T instead", value)
20284				}
20285				sv.RequestId = ptr.String(jtv)
20286			}
20287
20288		default:
20289			_, _ = key, value
20290
20291		}
20292	}
20293	*v = sv
20294	return nil
20295}
20296
20297func awsRestjson1_deserializeDocumentAccountCustomization(v **types.AccountCustomization, value interface{}) error {
20298	if v == nil {
20299		return fmt.Errorf("unexpected nil of type %T", v)
20300	}
20301	if value == nil {
20302		return nil
20303	}
20304
20305	shape, ok := value.(map[string]interface{})
20306	if !ok {
20307		return fmt.Errorf("unexpected JSON type %v", value)
20308	}
20309
20310	var sv *types.AccountCustomization
20311	if *v == nil {
20312		sv = &types.AccountCustomization{}
20313	} else {
20314		sv = *v
20315	}
20316
20317	for key, value := range shape {
20318		switch key {
20319		case "DefaultTheme":
20320			if value != nil {
20321				jtv, ok := value.(string)
20322				if !ok {
20323					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
20324				}
20325				sv.DefaultTheme = ptr.String(jtv)
20326			}
20327
20328		default:
20329			_, _ = key, value
20330
20331		}
20332	}
20333	*v = sv
20334	return nil
20335}
20336
20337func awsRestjson1_deserializeDocumentAccountSettings(v **types.AccountSettings, value interface{}) error {
20338	if v == nil {
20339		return fmt.Errorf("unexpected nil of type %T", v)
20340	}
20341	if value == nil {
20342		return nil
20343	}
20344
20345	shape, ok := value.(map[string]interface{})
20346	if !ok {
20347		return fmt.Errorf("unexpected JSON type %v", value)
20348	}
20349
20350	var sv *types.AccountSettings
20351	if *v == nil {
20352		sv = &types.AccountSettings{}
20353	} else {
20354		sv = *v
20355	}
20356
20357	for key, value := range shape {
20358		switch key {
20359		case "AccountName":
20360			if value != nil {
20361				jtv, ok := value.(string)
20362				if !ok {
20363					return fmt.Errorf("expected String to be of type string, got %T instead", value)
20364				}
20365				sv.AccountName = ptr.String(jtv)
20366			}
20367
20368		case "DefaultNamespace":
20369			if value != nil {
20370				jtv, ok := value.(string)
20371				if !ok {
20372					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
20373				}
20374				sv.DefaultNamespace = ptr.String(jtv)
20375			}
20376
20377		case "Edition":
20378			if value != nil {
20379				jtv, ok := value.(string)
20380				if !ok {
20381					return fmt.Errorf("expected Edition to be of type string, got %T instead", value)
20382				}
20383				sv.Edition = types.Edition(jtv)
20384			}
20385
20386		case "NotificationEmail":
20387			if value != nil {
20388				jtv, ok := value.(string)
20389				if !ok {
20390					return fmt.Errorf("expected String to be of type string, got %T instead", value)
20391				}
20392				sv.NotificationEmail = ptr.String(jtv)
20393			}
20394
20395		default:
20396			_, _ = key, value
20397
20398		}
20399	}
20400	*v = sv
20401	return nil
20402}
20403
20404func awsRestjson1_deserializeDocumentActionList(v *[]string, value interface{}) error {
20405	if v == nil {
20406		return fmt.Errorf("unexpected nil of type %T", v)
20407	}
20408	if value == nil {
20409		return nil
20410	}
20411
20412	shape, ok := value.([]interface{})
20413	if !ok {
20414		return fmt.Errorf("unexpected JSON type %v", value)
20415	}
20416
20417	var cv []string
20418	if *v == nil {
20419		cv = []string{}
20420	} else {
20421		cv = *v
20422	}
20423
20424	for _, value := range shape {
20425		var col string
20426		if value != nil {
20427			jtv, ok := value.(string)
20428			if !ok {
20429				return fmt.Errorf("expected String to be of type string, got %T instead", value)
20430			}
20431			col = jtv
20432		}
20433		cv = append(cv, col)
20434
20435	}
20436	*v = cv
20437	return nil
20438}
20439
20440func awsRestjson1_deserializeDocumentActiveIAMPolicyAssignment(v **types.ActiveIAMPolicyAssignment, value interface{}) error {
20441	if v == nil {
20442		return fmt.Errorf("unexpected nil of type %T", v)
20443	}
20444	if value == nil {
20445		return nil
20446	}
20447
20448	shape, ok := value.(map[string]interface{})
20449	if !ok {
20450		return fmt.Errorf("unexpected JSON type %v", value)
20451	}
20452
20453	var sv *types.ActiveIAMPolicyAssignment
20454	if *v == nil {
20455		sv = &types.ActiveIAMPolicyAssignment{}
20456	} else {
20457		sv = *v
20458	}
20459
20460	for key, value := range shape {
20461		switch key {
20462		case "AssignmentName":
20463			if value != nil {
20464				jtv, ok := value.(string)
20465				if !ok {
20466					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
20467				}
20468				sv.AssignmentName = ptr.String(jtv)
20469			}
20470
20471		case "PolicyArn":
20472			if value != nil {
20473				jtv, ok := value.(string)
20474				if !ok {
20475					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
20476				}
20477				sv.PolicyArn = ptr.String(jtv)
20478			}
20479
20480		default:
20481			_, _ = key, value
20482
20483		}
20484	}
20485	*v = sv
20486	return nil
20487}
20488
20489func awsRestjson1_deserializeDocumentActiveIAMPolicyAssignmentList(v *[]types.ActiveIAMPolicyAssignment, value interface{}) error {
20490	if v == nil {
20491		return fmt.Errorf("unexpected nil of type %T", v)
20492	}
20493	if value == nil {
20494		return nil
20495	}
20496
20497	shape, ok := value.([]interface{})
20498	if !ok {
20499		return fmt.Errorf("unexpected JSON type %v", value)
20500	}
20501
20502	var cv []types.ActiveIAMPolicyAssignment
20503	if *v == nil {
20504		cv = []types.ActiveIAMPolicyAssignment{}
20505	} else {
20506		cv = *v
20507	}
20508
20509	for _, value := range shape {
20510		var col types.ActiveIAMPolicyAssignment
20511		destAddr := &col
20512		if err := awsRestjson1_deserializeDocumentActiveIAMPolicyAssignment(&destAddr, value); err != nil {
20513			return err
20514		}
20515		col = *destAddr
20516		cv = append(cv, col)
20517
20518	}
20519	*v = cv
20520	return nil
20521}
20522
20523func awsRestjson1_deserializeDocumentAmazonElasticsearchParameters(v **types.AmazonElasticsearchParameters, value interface{}) error {
20524	if v == nil {
20525		return fmt.Errorf("unexpected nil of type %T", v)
20526	}
20527	if value == nil {
20528		return nil
20529	}
20530
20531	shape, ok := value.(map[string]interface{})
20532	if !ok {
20533		return fmt.Errorf("unexpected JSON type %v", value)
20534	}
20535
20536	var sv *types.AmazonElasticsearchParameters
20537	if *v == nil {
20538		sv = &types.AmazonElasticsearchParameters{}
20539	} else {
20540		sv = *v
20541	}
20542
20543	for key, value := range shape {
20544		switch key {
20545		case "Domain":
20546			if value != nil {
20547				jtv, ok := value.(string)
20548				if !ok {
20549					return fmt.Errorf("expected Domain to be of type string, got %T instead", value)
20550				}
20551				sv.Domain = ptr.String(jtv)
20552			}
20553
20554		default:
20555			_, _ = key, value
20556
20557		}
20558	}
20559	*v = sv
20560	return nil
20561}
20562
20563func awsRestjson1_deserializeDocumentAnalysis(v **types.Analysis, value interface{}) error {
20564	if v == nil {
20565		return fmt.Errorf("unexpected nil of type %T", v)
20566	}
20567	if value == nil {
20568		return nil
20569	}
20570
20571	shape, ok := value.(map[string]interface{})
20572	if !ok {
20573		return fmt.Errorf("unexpected JSON type %v", value)
20574	}
20575
20576	var sv *types.Analysis
20577	if *v == nil {
20578		sv = &types.Analysis{}
20579	} else {
20580		sv = *v
20581	}
20582
20583	for key, value := range shape {
20584		switch key {
20585		case "AnalysisId":
20586			if value != nil {
20587				jtv, ok := value.(string)
20588				if !ok {
20589					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
20590				}
20591				sv.AnalysisId = ptr.String(jtv)
20592			}
20593
20594		case "Arn":
20595			if value != nil {
20596				jtv, ok := value.(string)
20597				if !ok {
20598					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
20599				}
20600				sv.Arn = ptr.String(jtv)
20601			}
20602
20603		case "CreatedTime":
20604			if value != nil {
20605				jtv, ok := value.(json.Number)
20606				if !ok {
20607					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
20608				}
20609				f64, err := jtv.Float64()
20610				if err != nil {
20611					return err
20612				}
20613				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
20614			}
20615
20616		case "DataSetArns":
20617			if err := awsRestjson1_deserializeDocumentDataSetArnsList(&sv.DataSetArns, value); err != nil {
20618				return err
20619			}
20620
20621		case "Errors":
20622			if err := awsRestjson1_deserializeDocumentAnalysisErrorList(&sv.Errors, value); err != nil {
20623				return err
20624			}
20625
20626		case "LastUpdatedTime":
20627			if value != nil {
20628				jtv, ok := value.(json.Number)
20629				if !ok {
20630					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
20631				}
20632				f64, err := jtv.Float64()
20633				if err != nil {
20634					return err
20635				}
20636				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
20637			}
20638
20639		case "Name":
20640			if value != nil {
20641				jtv, ok := value.(string)
20642				if !ok {
20643					return fmt.Errorf("expected AnalysisName to be of type string, got %T instead", value)
20644				}
20645				sv.Name = ptr.String(jtv)
20646			}
20647
20648		case "Sheets":
20649			if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil {
20650				return err
20651			}
20652
20653		case "Status":
20654			if value != nil {
20655				jtv, ok := value.(string)
20656				if !ok {
20657					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
20658				}
20659				sv.Status = types.ResourceStatus(jtv)
20660			}
20661
20662		case "ThemeArn":
20663			if value != nil {
20664				jtv, ok := value.(string)
20665				if !ok {
20666					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
20667				}
20668				sv.ThemeArn = ptr.String(jtv)
20669			}
20670
20671		default:
20672			_, _ = key, value
20673
20674		}
20675	}
20676	*v = sv
20677	return nil
20678}
20679
20680func awsRestjson1_deserializeDocumentAnalysisError(v **types.AnalysisError, value interface{}) error {
20681	if v == nil {
20682		return fmt.Errorf("unexpected nil of type %T", v)
20683	}
20684	if value == nil {
20685		return nil
20686	}
20687
20688	shape, ok := value.(map[string]interface{})
20689	if !ok {
20690		return fmt.Errorf("unexpected JSON type %v", value)
20691	}
20692
20693	var sv *types.AnalysisError
20694	if *v == nil {
20695		sv = &types.AnalysisError{}
20696	} else {
20697		sv = *v
20698	}
20699
20700	for key, value := range shape {
20701		switch key {
20702		case "Message":
20703			if value != nil {
20704				jtv, ok := value.(string)
20705				if !ok {
20706					return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
20707				}
20708				sv.Message = ptr.String(jtv)
20709			}
20710
20711		case "Type":
20712			if value != nil {
20713				jtv, ok := value.(string)
20714				if !ok {
20715					return fmt.Errorf("expected AnalysisErrorType to be of type string, got %T instead", value)
20716				}
20717				sv.Type = types.AnalysisErrorType(jtv)
20718			}
20719
20720		default:
20721			_, _ = key, value
20722
20723		}
20724	}
20725	*v = sv
20726	return nil
20727}
20728
20729func awsRestjson1_deserializeDocumentAnalysisErrorList(v *[]types.AnalysisError, value interface{}) error {
20730	if v == nil {
20731		return fmt.Errorf("unexpected nil of type %T", v)
20732	}
20733	if value == nil {
20734		return nil
20735	}
20736
20737	shape, ok := value.([]interface{})
20738	if !ok {
20739		return fmt.Errorf("unexpected JSON type %v", value)
20740	}
20741
20742	var cv []types.AnalysisError
20743	if *v == nil {
20744		cv = []types.AnalysisError{}
20745	} else {
20746		cv = *v
20747	}
20748
20749	for _, value := range shape {
20750		var col types.AnalysisError
20751		destAddr := &col
20752		if err := awsRestjson1_deserializeDocumentAnalysisError(&destAddr, value); err != nil {
20753			return err
20754		}
20755		col = *destAddr
20756		cv = append(cv, col)
20757
20758	}
20759	*v = cv
20760	return nil
20761}
20762
20763func awsRestjson1_deserializeDocumentAnalysisSummary(v **types.AnalysisSummary, value interface{}) error {
20764	if v == nil {
20765		return fmt.Errorf("unexpected nil of type %T", v)
20766	}
20767	if value == nil {
20768		return nil
20769	}
20770
20771	shape, ok := value.(map[string]interface{})
20772	if !ok {
20773		return fmt.Errorf("unexpected JSON type %v", value)
20774	}
20775
20776	var sv *types.AnalysisSummary
20777	if *v == nil {
20778		sv = &types.AnalysisSummary{}
20779	} else {
20780		sv = *v
20781	}
20782
20783	for key, value := range shape {
20784		switch key {
20785		case "AnalysisId":
20786			if value != nil {
20787				jtv, ok := value.(string)
20788				if !ok {
20789					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
20790				}
20791				sv.AnalysisId = ptr.String(jtv)
20792			}
20793
20794		case "Arn":
20795			if value != nil {
20796				jtv, ok := value.(string)
20797				if !ok {
20798					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
20799				}
20800				sv.Arn = ptr.String(jtv)
20801			}
20802
20803		case "CreatedTime":
20804			if value != nil {
20805				jtv, ok := value.(json.Number)
20806				if !ok {
20807					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
20808				}
20809				f64, err := jtv.Float64()
20810				if err != nil {
20811					return err
20812				}
20813				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
20814			}
20815
20816		case "LastUpdatedTime":
20817			if value != nil {
20818				jtv, ok := value.(json.Number)
20819				if !ok {
20820					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
20821				}
20822				f64, err := jtv.Float64()
20823				if err != nil {
20824					return err
20825				}
20826				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
20827			}
20828
20829		case "Name":
20830			if value != nil {
20831				jtv, ok := value.(string)
20832				if !ok {
20833					return fmt.Errorf("expected AnalysisName to be of type string, got %T instead", value)
20834				}
20835				sv.Name = ptr.String(jtv)
20836			}
20837
20838		case "Status":
20839			if value != nil {
20840				jtv, ok := value.(string)
20841				if !ok {
20842					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
20843				}
20844				sv.Status = types.ResourceStatus(jtv)
20845			}
20846
20847		default:
20848			_, _ = key, value
20849
20850		}
20851	}
20852	*v = sv
20853	return nil
20854}
20855
20856func awsRestjson1_deserializeDocumentAnalysisSummaryList(v *[]types.AnalysisSummary, value interface{}) error {
20857	if v == nil {
20858		return fmt.Errorf("unexpected nil of type %T", v)
20859	}
20860	if value == nil {
20861		return nil
20862	}
20863
20864	shape, ok := value.([]interface{})
20865	if !ok {
20866		return fmt.Errorf("unexpected JSON type %v", value)
20867	}
20868
20869	var cv []types.AnalysisSummary
20870	if *v == nil {
20871		cv = []types.AnalysisSummary{}
20872	} else {
20873		cv = *v
20874	}
20875
20876	for _, value := range shape {
20877		var col types.AnalysisSummary
20878		destAddr := &col
20879		if err := awsRestjson1_deserializeDocumentAnalysisSummary(&destAddr, value); err != nil {
20880			return err
20881		}
20882		col = *destAddr
20883		cv = append(cv, col)
20884
20885	}
20886	*v = cv
20887	return nil
20888}
20889
20890func awsRestjson1_deserializeDocumentAthenaParameters(v **types.AthenaParameters, value interface{}) error {
20891	if v == nil {
20892		return fmt.Errorf("unexpected nil of type %T", v)
20893	}
20894	if value == nil {
20895		return nil
20896	}
20897
20898	shape, ok := value.(map[string]interface{})
20899	if !ok {
20900		return fmt.Errorf("unexpected JSON type %v", value)
20901	}
20902
20903	var sv *types.AthenaParameters
20904	if *v == nil {
20905		sv = &types.AthenaParameters{}
20906	} else {
20907		sv = *v
20908	}
20909
20910	for key, value := range shape {
20911		switch key {
20912		case "WorkGroup":
20913			if value != nil {
20914				jtv, ok := value.(string)
20915				if !ok {
20916					return fmt.Errorf("expected WorkGroup to be of type string, got %T instead", value)
20917				}
20918				sv.WorkGroup = ptr.String(jtv)
20919			}
20920
20921		default:
20922			_, _ = key, value
20923
20924		}
20925	}
20926	*v = sv
20927	return nil
20928}
20929
20930func awsRestjson1_deserializeDocumentAuroraParameters(v **types.AuroraParameters, value interface{}) error {
20931	if v == nil {
20932		return fmt.Errorf("unexpected nil of type %T", v)
20933	}
20934	if value == nil {
20935		return nil
20936	}
20937
20938	shape, ok := value.(map[string]interface{})
20939	if !ok {
20940		return fmt.Errorf("unexpected JSON type %v", value)
20941	}
20942
20943	var sv *types.AuroraParameters
20944	if *v == nil {
20945		sv = &types.AuroraParameters{}
20946	} else {
20947		sv = *v
20948	}
20949
20950	for key, value := range shape {
20951		switch key {
20952		case "Database":
20953			if value != nil {
20954				jtv, ok := value.(string)
20955				if !ok {
20956					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
20957				}
20958				sv.Database = ptr.String(jtv)
20959			}
20960
20961		case "Host":
20962			if value != nil {
20963				jtv, ok := value.(string)
20964				if !ok {
20965					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
20966				}
20967				sv.Host = ptr.String(jtv)
20968			}
20969
20970		case "Port":
20971			if value != nil {
20972				jtv, ok := value.(json.Number)
20973				if !ok {
20974					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
20975				}
20976				i64, err := jtv.Int64()
20977				if err != nil {
20978					return err
20979				}
20980				sv.Port = int32(i64)
20981			}
20982
20983		default:
20984			_, _ = key, value
20985
20986		}
20987	}
20988	*v = sv
20989	return nil
20990}
20991
20992func awsRestjson1_deserializeDocumentAuroraPostgreSqlParameters(v **types.AuroraPostgreSqlParameters, value interface{}) error {
20993	if v == nil {
20994		return fmt.Errorf("unexpected nil of type %T", v)
20995	}
20996	if value == nil {
20997		return nil
20998	}
20999
21000	shape, ok := value.(map[string]interface{})
21001	if !ok {
21002		return fmt.Errorf("unexpected JSON type %v", value)
21003	}
21004
21005	var sv *types.AuroraPostgreSqlParameters
21006	if *v == nil {
21007		sv = &types.AuroraPostgreSqlParameters{}
21008	} else {
21009		sv = *v
21010	}
21011
21012	for key, value := range shape {
21013		switch key {
21014		case "Database":
21015			if value != nil {
21016				jtv, ok := value.(string)
21017				if !ok {
21018					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
21019				}
21020				sv.Database = ptr.String(jtv)
21021			}
21022
21023		case "Host":
21024			if value != nil {
21025				jtv, ok := value.(string)
21026				if !ok {
21027					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
21028				}
21029				sv.Host = ptr.String(jtv)
21030			}
21031
21032		case "Port":
21033			if value != nil {
21034				jtv, ok := value.(json.Number)
21035				if !ok {
21036					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
21037				}
21038				i64, err := jtv.Int64()
21039				if err != nil {
21040					return err
21041				}
21042				sv.Port = int32(i64)
21043			}
21044
21045		default:
21046			_, _ = key, value
21047
21048		}
21049	}
21050	*v = sv
21051	return nil
21052}
21053
21054func awsRestjson1_deserializeDocumentAwsIotAnalyticsParameters(v **types.AwsIotAnalyticsParameters, value interface{}) error {
21055	if v == nil {
21056		return fmt.Errorf("unexpected nil of type %T", v)
21057	}
21058	if value == nil {
21059		return nil
21060	}
21061
21062	shape, ok := value.(map[string]interface{})
21063	if !ok {
21064		return fmt.Errorf("unexpected JSON type %v", value)
21065	}
21066
21067	var sv *types.AwsIotAnalyticsParameters
21068	if *v == nil {
21069		sv = &types.AwsIotAnalyticsParameters{}
21070	} else {
21071		sv = *v
21072	}
21073
21074	for key, value := range shape {
21075		switch key {
21076		case "DataSetName":
21077			if value != nil {
21078				jtv, ok := value.(string)
21079				if !ok {
21080					return fmt.Errorf("expected DataSetName to be of type string, got %T instead", value)
21081				}
21082				sv.DataSetName = ptr.String(jtv)
21083			}
21084
21085		default:
21086			_, _ = key, value
21087
21088		}
21089	}
21090	*v = sv
21091	return nil
21092}
21093
21094func awsRestjson1_deserializeDocumentBorderStyle(v **types.BorderStyle, value interface{}) error {
21095	if v == nil {
21096		return fmt.Errorf("unexpected nil of type %T", v)
21097	}
21098	if value == nil {
21099		return nil
21100	}
21101
21102	shape, ok := value.(map[string]interface{})
21103	if !ok {
21104		return fmt.Errorf("unexpected JSON type %v", value)
21105	}
21106
21107	var sv *types.BorderStyle
21108	if *v == nil {
21109		sv = &types.BorderStyle{}
21110	} else {
21111		sv = *v
21112	}
21113
21114	for key, value := range shape {
21115		switch key {
21116		case "Show":
21117			if value != nil {
21118				jtv, ok := value.(bool)
21119				if !ok {
21120					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
21121				}
21122				sv.Show = jtv
21123			}
21124
21125		default:
21126			_, _ = key, value
21127
21128		}
21129	}
21130	*v = sv
21131	return nil
21132}
21133
21134func awsRestjson1_deserializeDocumentCalculatedColumn(v **types.CalculatedColumn, value interface{}) error {
21135	if v == nil {
21136		return fmt.Errorf("unexpected nil of type %T", v)
21137	}
21138	if value == nil {
21139		return nil
21140	}
21141
21142	shape, ok := value.(map[string]interface{})
21143	if !ok {
21144		return fmt.Errorf("unexpected JSON type %v", value)
21145	}
21146
21147	var sv *types.CalculatedColumn
21148	if *v == nil {
21149		sv = &types.CalculatedColumn{}
21150	} else {
21151		sv = *v
21152	}
21153
21154	for key, value := range shape {
21155		switch key {
21156		case "ColumnId":
21157			if value != nil {
21158				jtv, ok := value.(string)
21159				if !ok {
21160					return fmt.Errorf("expected ColumnId to be of type string, got %T instead", value)
21161				}
21162				sv.ColumnId = ptr.String(jtv)
21163			}
21164
21165		case "ColumnName":
21166			if value != nil {
21167				jtv, ok := value.(string)
21168				if !ok {
21169					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
21170				}
21171				sv.ColumnName = ptr.String(jtv)
21172			}
21173
21174		case "Expression":
21175			if value != nil {
21176				jtv, ok := value.(string)
21177				if !ok {
21178					return fmt.Errorf("expected Expression to be of type string, got %T instead", value)
21179				}
21180				sv.Expression = ptr.String(jtv)
21181			}
21182
21183		default:
21184			_, _ = key, value
21185
21186		}
21187	}
21188	*v = sv
21189	return nil
21190}
21191
21192func awsRestjson1_deserializeDocumentCalculatedColumnList(v *[]types.CalculatedColumn, value interface{}) error {
21193	if v == nil {
21194		return fmt.Errorf("unexpected nil of type %T", v)
21195	}
21196	if value == nil {
21197		return nil
21198	}
21199
21200	shape, ok := value.([]interface{})
21201	if !ok {
21202		return fmt.Errorf("unexpected JSON type %v", value)
21203	}
21204
21205	var cv []types.CalculatedColumn
21206	if *v == nil {
21207		cv = []types.CalculatedColumn{}
21208	} else {
21209		cv = *v
21210	}
21211
21212	for _, value := range shape {
21213		var col types.CalculatedColumn
21214		destAddr := &col
21215		if err := awsRestjson1_deserializeDocumentCalculatedColumn(&destAddr, value); err != nil {
21216			return err
21217		}
21218		col = *destAddr
21219		cv = append(cv, col)
21220
21221	}
21222	*v = cv
21223	return nil
21224}
21225
21226func awsRestjson1_deserializeDocumentCastColumnTypeOperation(v **types.CastColumnTypeOperation, value interface{}) error {
21227	if v == nil {
21228		return fmt.Errorf("unexpected nil of type %T", v)
21229	}
21230	if value == nil {
21231		return nil
21232	}
21233
21234	shape, ok := value.(map[string]interface{})
21235	if !ok {
21236		return fmt.Errorf("unexpected JSON type %v", value)
21237	}
21238
21239	var sv *types.CastColumnTypeOperation
21240	if *v == nil {
21241		sv = &types.CastColumnTypeOperation{}
21242	} else {
21243		sv = *v
21244	}
21245
21246	for key, value := range shape {
21247		switch key {
21248		case "ColumnName":
21249			if value != nil {
21250				jtv, ok := value.(string)
21251				if !ok {
21252					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
21253				}
21254				sv.ColumnName = ptr.String(jtv)
21255			}
21256
21257		case "Format":
21258			if value != nil {
21259				jtv, ok := value.(string)
21260				if !ok {
21261					return fmt.Errorf("expected TypeCastFormat to be of type string, got %T instead", value)
21262				}
21263				sv.Format = ptr.String(jtv)
21264			}
21265
21266		case "NewColumnType":
21267			if value != nil {
21268				jtv, ok := value.(string)
21269				if !ok {
21270					return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value)
21271				}
21272				sv.NewColumnType = types.ColumnDataType(jtv)
21273			}
21274
21275		default:
21276			_, _ = key, value
21277
21278		}
21279	}
21280	*v = sv
21281	return nil
21282}
21283
21284func awsRestjson1_deserializeDocumentColorList(v *[]string, value interface{}) error {
21285	if v == nil {
21286		return fmt.Errorf("unexpected nil of type %T", v)
21287	}
21288	if value == nil {
21289		return nil
21290	}
21291
21292	shape, ok := value.([]interface{})
21293	if !ok {
21294		return fmt.Errorf("unexpected JSON type %v", value)
21295	}
21296
21297	var cv []string
21298	if *v == nil {
21299		cv = []string{}
21300	} else {
21301		cv = *v
21302	}
21303
21304	for _, value := range shape {
21305		var col string
21306		if value != nil {
21307			jtv, ok := value.(string)
21308			if !ok {
21309				return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
21310			}
21311			col = jtv
21312		}
21313		cv = append(cv, col)
21314
21315	}
21316	*v = cv
21317	return nil
21318}
21319
21320func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescription, value interface{}) error {
21321	if v == nil {
21322		return fmt.Errorf("unexpected nil of type %T", v)
21323	}
21324	if value == nil {
21325		return nil
21326	}
21327
21328	shape, ok := value.(map[string]interface{})
21329	if !ok {
21330		return fmt.Errorf("unexpected JSON type %v", value)
21331	}
21332
21333	var sv *types.ColumnDescription
21334	if *v == nil {
21335		sv = &types.ColumnDescription{}
21336	} else {
21337		sv = *v
21338	}
21339
21340	for key, value := range shape {
21341		switch key {
21342		case "Text":
21343			if value != nil {
21344				jtv, ok := value.(string)
21345				if !ok {
21346					return fmt.Errorf("expected ColumnDescriptiveText to be of type string, got %T instead", value)
21347				}
21348				sv.Text = ptr.String(jtv)
21349			}
21350
21351		default:
21352			_, _ = key, value
21353
21354		}
21355	}
21356	*v = sv
21357	return nil
21358}
21359
21360func awsRestjson1_deserializeDocumentColumnGroup(v **types.ColumnGroup, value interface{}) error {
21361	if v == nil {
21362		return fmt.Errorf("unexpected nil of type %T", v)
21363	}
21364	if value == nil {
21365		return nil
21366	}
21367
21368	shape, ok := value.(map[string]interface{})
21369	if !ok {
21370		return fmt.Errorf("unexpected JSON type %v", value)
21371	}
21372
21373	var sv *types.ColumnGroup
21374	if *v == nil {
21375		sv = &types.ColumnGroup{}
21376	} else {
21377		sv = *v
21378	}
21379
21380	for key, value := range shape {
21381		switch key {
21382		case "GeoSpatialColumnGroup":
21383			if err := awsRestjson1_deserializeDocumentGeoSpatialColumnGroup(&sv.GeoSpatialColumnGroup, value); err != nil {
21384				return err
21385			}
21386
21387		default:
21388			_, _ = key, value
21389
21390		}
21391	}
21392	*v = sv
21393	return nil
21394}
21395
21396func awsRestjson1_deserializeDocumentColumnGroupColumnSchema(v **types.ColumnGroupColumnSchema, value interface{}) error {
21397	if v == nil {
21398		return fmt.Errorf("unexpected nil of type %T", v)
21399	}
21400	if value == nil {
21401		return nil
21402	}
21403
21404	shape, ok := value.(map[string]interface{})
21405	if !ok {
21406		return fmt.Errorf("unexpected JSON type %v", value)
21407	}
21408
21409	var sv *types.ColumnGroupColumnSchema
21410	if *v == nil {
21411		sv = &types.ColumnGroupColumnSchema{}
21412	} else {
21413		sv = *v
21414	}
21415
21416	for key, value := range shape {
21417		switch key {
21418		case "Name":
21419			if value != nil {
21420				jtv, ok := value.(string)
21421				if !ok {
21422					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21423				}
21424				sv.Name = ptr.String(jtv)
21425			}
21426
21427		default:
21428			_, _ = key, value
21429
21430		}
21431	}
21432	*v = sv
21433	return nil
21434}
21435
21436func awsRestjson1_deserializeDocumentColumnGroupColumnSchemaList(v *[]types.ColumnGroupColumnSchema, value interface{}) error {
21437	if v == nil {
21438		return fmt.Errorf("unexpected nil of type %T", v)
21439	}
21440	if value == nil {
21441		return nil
21442	}
21443
21444	shape, ok := value.([]interface{})
21445	if !ok {
21446		return fmt.Errorf("unexpected JSON type %v", value)
21447	}
21448
21449	var cv []types.ColumnGroupColumnSchema
21450	if *v == nil {
21451		cv = []types.ColumnGroupColumnSchema{}
21452	} else {
21453		cv = *v
21454	}
21455
21456	for _, value := range shape {
21457		var col types.ColumnGroupColumnSchema
21458		destAddr := &col
21459		if err := awsRestjson1_deserializeDocumentColumnGroupColumnSchema(&destAddr, value); err != nil {
21460			return err
21461		}
21462		col = *destAddr
21463		cv = append(cv, col)
21464
21465	}
21466	*v = cv
21467	return nil
21468}
21469
21470func awsRestjson1_deserializeDocumentColumnGroupList(v *[]types.ColumnGroup, value interface{}) error {
21471	if v == nil {
21472		return fmt.Errorf("unexpected nil of type %T", v)
21473	}
21474	if value == nil {
21475		return nil
21476	}
21477
21478	shape, ok := value.([]interface{})
21479	if !ok {
21480		return fmt.Errorf("unexpected JSON type %v", value)
21481	}
21482
21483	var cv []types.ColumnGroup
21484	if *v == nil {
21485		cv = []types.ColumnGroup{}
21486	} else {
21487		cv = *v
21488	}
21489
21490	for _, value := range shape {
21491		var col types.ColumnGroup
21492		destAddr := &col
21493		if err := awsRestjson1_deserializeDocumentColumnGroup(&destAddr, value); err != nil {
21494			return err
21495		}
21496		col = *destAddr
21497		cv = append(cv, col)
21498
21499	}
21500	*v = cv
21501	return nil
21502}
21503
21504func awsRestjson1_deserializeDocumentColumnGroupSchema(v **types.ColumnGroupSchema, value interface{}) error {
21505	if v == nil {
21506		return fmt.Errorf("unexpected nil of type %T", v)
21507	}
21508	if value == nil {
21509		return nil
21510	}
21511
21512	shape, ok := value.(map[string]interface{})
21513	if !ok {
21514		return fmt.Errorf("unexpected JSON type %v", value)
21515	}
21516
21517	var sv *types.ColumnGroupSchema
21518	if *v == nil {
21519		sv = &types.ColumnGroupSchema{}
21520	} else {
21521		sv = *v
21522	}
21523
21524	for key, value := range shape {
21525		switch key {
21526		case "ColumnGroupColumnSchemaList":
21527			if err := awsRestjson1_deserializeDocumentColumnGroupColumnSchemaList(&sv.ColumnGroupColumnSchemaList, value); err != nil {
21528				return err
21529			}
21530
21531		case "Name":
21532			if value != nil {
21533				jtv, ok := value.(string)
21534				if !ok {
21535					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21536				}
21537				sv.Name = ptr.String(jtv)
21538			}
21539
21540		default:
21541			_, _ = key, value
21542
21543		}
21544	}
21545	*v = sv
21546	return nil
21547}
21548
21549func awsRestjson1_deserializeDocumentColumnGroupSchemaList(v *[]types.ColumnGroupSchema, value interface{}) error {
21550	if v == nil {
21551		return fmt.Errorf("unexpected nil of type %T", v)
21552	}
21553	if value == nil {
21554		return nil
21555	}
21556
21557	shape, ok := value.([]interface{})
21558	if !ok {
21559		return fmt.Errorf("unexpected JSON type %v", value)
21560	}
21561
21562	var cv []types.ColumnGroupSchema
21563	if *v == nil {
21564		cv = []types.ColumnGroupSchema{}
21565	} else {
21566		cv = *v
21567	}
21568
21569	for _, value := range shape {
21570		var col types.ColumnGroupSchema
21571		destAddr := &col
21572		if err := awsRestjson1_deserializeDocumentColumnGroupSchema(&destAddr, value); err != nil {
21573			return err
21574		}
21575		col = *destAddr
21576		cv = append(cv, col)
21577
21578	}
21579	*v = cv
21580	return nil
21581}
21582
21583func awsRestjson1_deserializeDocumentColumnLevelPermissionRule(v **types.ColumnLevelPermissionRule, value interface{}) error {
21584	if v == nil {
21585		return fmt.Errorf("unexpected nil of type %T", v)
21586	}
21587	if value == nil {
21588		return nil
21589	}
21590
21591	shape, ok := value.(map[string]interface{})
21592	if !ok {
21593		return fmt.Errorf("unexpected JSON type %v", value)
21594	}
21595
21596	var sv *types.ColumnLevelPermissionRule
21597	if *v == nil {
21598		sv = &types.ColumnLevelPermissionRule{}
21599	} else {
21600		sv = *v
21601	}
21602
21603	for key, value := range shape {
21604		switch key {
21605		case "ColumnNames":
21606			if err := awsRestjson1_deserializeDocumentColumnNameList(&sv.ColumnNames, value); err != nil {
21607				return err
21608			}
21609
21610		case "Principals":
21611			if err := awsRestjson1_deserializeDocumentPrincipalList(&sv.Principals, value); err != nil {
21612				return err
21613			}
21614
21615		default:
21616			_, _ = key, value
21617
21618		}
21619	}
21620	*v = sv
21621	return nil
21622}
21623
21624func awsRestjson1_deserializeDocumentColumnLevelPermissionRuleList(v *[]types.ColumnLevelPermissionRule, value interface{}) error {
21625	if v == nil {
21626		return fmt.Errorf("unexpected nil of type %T", v)
21627	}
21628	if value == nil {
21629		return nil
21630	}
21631
21632	shape, ok := value.([]interface{})
21633	if !ok {
21634		return fmt.Errorf("unexpected JSON type %v", value)
21635	}
21636
21637	var cv []types.ColumnLevelPermissionRule
21638	if *v == nil {
21639		cv = []types.ColumnLevelPermissionRule{}
21640	} else {
21641		cv = *v
21642	}
21643
21644	for _, value := range shape {
21645		var col types.ColumnLevelPermissionRule
21646		destAddr := &col
21647		if err := awsRestjson1_deserializeDocumentColumnLevelPermissionRule(&destAddr, value); err != nil {
21648			return err
21649		}
21650		col = *destAddr
21651		cv = append(cv, col)
21652
21653	}
21654	*v = cv
21655	return nil
21656}
21657
21658func awsRestjson1_deserializeDocumentColumnList(v *[]string, value interface{}) error {
21659	if v == nil {
21660		return fmt.Errorf("unexpected nil of type %T", v)
21661	}
21662	if value == nil {
21663		return nil
21664	}
21665
21666	shape, ok := value.([]interface{})
21667	if !ok {
21668		return fmt.Errorf("unexpected JSON type %v", value)
21669	}
21670
21671	var cv []string
21672	if *v == nil {
21673		cv = []string{}
21674	} else {
21675		cv = *v
21676	}
21677
21678	for _, value := range shape {
21679		var col string
21680		if value != nil {
21681			jtv, ok := value.(string)
21682			if !ok {
21683				return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
21684			}
21685			col = jtv
21686		}
21687		cv = append(cv, col)
21688
21689	}
21690	*v = cv
21691	return nil
21692}
21693
21694func awsRestjson1_deserializeDocumentColumnNameList(v *[]string, value interface{}) error {
21695	if v == nil {
21696		return fmt.Errorf("unexpected nil of type %T", v)
21697	}
21698	if value == nil {
21699		return nil
21700	}
21701
21702	shape, ok := value.([]interface{})
21703	if !ok {
21704		return fmt.Errorf("unexpected JSON type %v", value)
21705	}
21706
21707	var cv []string
21708	if *v == nil {
21709		cv = []string{}
21710	} else {
21711		cv = *v
21712	}
21713
21714	for _, value := range shape {
21715		var col string
21716		if value != nil {
21717			jtv, ok := value.(string)
21718			if !ok {
21719				return fmt.Errorf("expected String to be of type string, got %T instead", value)
21720			}
21721			col = jtv
21722		}
21723		cv = append(cv, col)
21724
21725	}
21726	*v = cv
21727	return nil
21728}
21729
21730func awsRestjson1_deserializeDocumentColumnSchema(v **types.ColumnSchema, value interface{}) error {
21731	if v == nil {
21732		return fmt.Errorf("unexpected nil of type %T", v)
21733	}
21734	if value == nil {
21735		return nil
21736	}
21737
21738	shape, ok := value.(map[string]interface{})
21739	if !ok {
21740		return fmt.Errorf("unexpected JSON type %v", value)
21741	}
21742
21743	var sv *types.ColumnSchema
21744	if *v == nil {
21745		sv = &types.ColumnSchema{}
21746	} else {
21747		sv = *v
21748	}
21749
21750	for key, value := range shape {
21751		switch key {
21752		case "DataType":
21753			if value != nil {
21754				jtv, ok := value.(string)
21755				if !ok {
21756					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21757				}
21758				sv.DataType = ptr.String(jtv)
21759			}
21760
21761		case "GeographicRole":
21762			if value != nil {
21763				jtv, ok := value.(string)
21764				if !ok {
21765					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21766				}
21767				sv.GeographicRole = ptr.String(jtv)
21768			}
21769
21770		case "Name":
21771			if value != nil {
21772				jtv, ok := value.(string)
21773				if !ok {
21774					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21775				}
21776				sv.Name = ptr.String(jtv)
21777			}
21778
21779		default:
21780			_, _ = key, value
21781
21782		}
21783	}
21784	*v = sv
21785	return nil
21786}
21787
21788func awsRestjson1_deserializeDocumentColumnSchemaList(v *[]types.ColumnSchema, value interface{}) error {
21789	if v == nil {
21790		return fmt.Errorf("unexpected nil of type %T", v)
21791	}
21792	if value == nil {
21793		return nil
21794	}
21795
21796	shape, ok := value.([]interface{})
21797	if !ok {
21798		return fmt.Errorf("unexpected JSON type %v", value)
21799	}
21800
21801	var cv []types.ColumnSchema
21802	if *v == nil {
21803		cv = []types.ColumnSchema{}
21804	} else {
21805		cv = *v
21806	}
21807
21808	for _, value := range shape {
21809		var col types.ColumnSchema
21810		destAddr := &col
21811		if err := awsRestjson1_deserializeDocumentColumnSchema(&destAddr, value); err != nil {
21812			return err
21813		}
21814		col = *destAddr
21815		cv = append(cv, col)
21816
21817	}
21818	*v = cv
21819	return nil
21820}
21821
21822func awsRestjson1_deserializeDocumentColumnTag(v **types.ColumnTag, value interface{}) error {
21823	if v == nil {
21824		return fmt.Errorf("unexpected nil of type %T", v)
21825	}
21826	if value == nil {
21827		return nil
21828	}
21829
21830	shape, ok := value.(map[string]interface{})
21831	if !ok {
21832		return fmt.Errorf("unexpected JSON type %v", value)
21833	}
21834
21835	var sv *types.ColumnTag
21836	if *v == nil {
21837		sv = &types.ColumnTag{}
21838	} else {
21839		sv = *v
21840	}
21841
21842	for key, value := range shape {
21843		switch key {
21844		case "ColumnDescription":
21845			if err := awsRestjson1_deserializeDocumentColumnDescription(&sv.ColumnDescription, value); err != nil {
21846				return err
21847			}
21848
21849		case "ColumnGeographicRole":
21850			if value != nil {
21851				jtv, ok := value.(string)
21852				if !ok {
21853					return fmt.Errorf("expected GeoSpatialDataRole to be of type string, got %T instead", value)
21854				}
21855				sv.ColumnGeographicRole = types.GeoSpatialDataRole(jtv)
21856			}
21857
21858		default:
21859			_, _ = key, value
21860
21861		}
21862	}
21863	*v = sv
21864	return nil
21865}
21866
21867func awsRestjson1_deserializeDocumentColumnTagList(v *[]types.ColumnTag, value interface{}) error {
21868	if v == nil {
21869		return fmt.Errorf("unexpected nil of type %T", v)
21870	}
21871	if value == nil {
21872		return nil
21873	}
21874
21875	shape, ok := value.([]interface{})
21876	if !ok {
21877		return fmt.Errorf("unexpected JSON type %v", value)
21878	}
21879
21880	var cv []types.ColumnTag
21881	if *v == nil {
21882		cv = []types.ColumnTag{}
21883	} else {
21884		cv = *v
21885	}
21886
21887	for _, value := range shape {
21888		var col types.ColumnTag
21889		destAddr := &col
21890		if err := awsRestjson1_deserializeDocumentColumnTag(&destAddr, value); err != nil {
21891			return err
21892		}
21893		col = *destAddr
21894		cv = append(cv, col)
21895
21896	}
21897	*v = cv
21898	return nil
21899}
21900
21901func awsRestjson1_deserializeDocumentConcurrentUpdatingException(v **types.ConcurrentUpdatingException, value interface{}) error {
21902	if v == nil {
21903		return fmt.Errorf("unexpected nil of type %T", v)
21904	}
21905	if value == nil {
21906		return nil
21907	}
21908
21909	shape, ok := value.(map[string]interface{})
21910	if !ok {
21911		return fmt.Errorf("unexpected JSON type %v", value)
21912	}
21913
21914	var sv *types.ConcurrentUpdatingException
21915	if *v == nil {
21916		sv = &types.ConcurrentUpdatingException{}
21917	} else {
21918		sv = *v
21919	}
21920
21921	for key, value := range shape {
21922		switch key {
21923		case "Message":
21924			if value != nil {
21925				jtv, ok := value.(string)
21926				if !ok {
21927					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21928				}
21929				sv.Message = ptr.String(jtv)
21930			}
21931
21932		case "RequestId":
21933			if value != nil {
21934				jtv, ok := value.(string)
21935				if !ok {
21936					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21937				}
21938				sv.RequestId = ptr.String(jtv)
21939			}
21940
21941		default:
21942			_, _ = key, value
21943
21944		}
21945	}
21946	*v = sv
21947	return nil
21948}
21949
21950func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
21951	if v == nil {
21952		return fmt.Errorf("unexpected nil of type %T", v)
21953	}
21954	if value == nil {
21955		return nil
21956	}
21957
21958	shape, ok := value.(map[string]interface{})
21959	if !ok {
21960		return fmt.Errorf("unexpected JSON type %v", value)
21961	}
21962
21963	var sv *types.ConflictException
21964	if *v == nil {
21965		sv = &types.ConflictException{}
21966	} else {
21967		sv = *v
21968	}
21969
21970	for key, value := range shape {
21971		switch key {
21972		case "Message":
21973			if value != nil {
21974				jtv, ok := value.(string)
21975				if !ok {
21976					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21977				}
21978				sv.Message = ptr.String(jtv)
21979			}
21980
21981		case "RequestId":
21982			if value != nil {
21983				jtv, ok := value.(string)
21984				if !ok {
21985					return fmt.Errorf("expected String to be of type string, got %T instead", value)
21986				}
21987				sv.RequestId = ptr.String(jtv)
21988			}
21989
21990		default:
21991			_, _ = key, value
21992
21993		}
21994	}
21995	*v = sv
21996	return nil
21997}
21998
21999func awsRestjson1_deserializeDocumentCreateColumnsOperation(v **types.CreateColumnsOperation, value interface{}) error {
22000	if v == nil {
22001		return fmt.Errorf("unexpected nil of type %T", v)
22002	}
22003	if value == nil {
22004		return nil
22005	}
22006
22007	shape, ok := value.(map[string]interface{})
22008	if !ok {
22009		return fmt.Errorf("unexpected JSON type %v", value)
22010	}
22011
22012	var sv *types.CreateColumnsOperation
22013	if *v == nil {
22014		sv = &types.CreateColumnsOperation{}
22015	} else {
22016		sv = *v
22017	}
22018
22019	for key, value := range shape {
22020		switch key {
22021		case "Columns":
22022			if err := awsRestjson1_deserializeDocumentCalculatedColumnList(&sv.Columns, value); err != nil {
22023				return err
22024			}
22025
22026		default:
22027			_, _ = key, value
22028
22029		}
22030	}
22031	*v = sv
22032	return nil
22033}
22034
22035func awsRestjson1_deserializeDocumentCustomSql(v **types.CustomSql, value interface{}) error {
22036	if v == nil {
22037		return fmt.Errorf("unexpected nil of type %T", v)
22038	}
22039	if value == nil {
22040		return nil
22041	}
22042
22043	shape, ok := value.(map[string]interface{})
22044	if !ok {
22045		return fmt.Errorf("unexpected JSON type %v", value)
22046	}
22047
22048	var sv *types.CustomSql
22049	if *v == nil {
22050		sv = &types.CustomSql{}
22051	} else {
22052		sv = *v
22053	}
22054
22055	for key, value := range shape {
22056		switch key {
22057		case "Columns":
22058			if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.Columns, value); err != nil {
22059				return err
22060			}
22061
22062		case "DataSourceArn":
22063			if value != nil {
22064				jtv, ok := value.(string)
22065				if !ok {
22066					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22067				}
22068				sv.DataSourceArn = ptr.String(jtv)
22069			}
22070
22071		case "Name":
22072			if value != nil {
22073				jtv, ok := value.(string)
22074				if !ok {
22075					return fmt.Errorf("expected CustomSqlName to be of type string, got %T instead", value)
22076				}
22077				sv.Name = ptr.String(jtv)
22078			}
22079
22080		case "SqlQuery":
22081			if value != nil {
22082				jtv, ok := value.(string)
22083				if !ok {
22084					return fmt.Errorf("expected SqlQuery to be of type string, got %T instead", value)
22085				}
22086				sv.SqlQuery = ptr.String(jtv)
22087			}
22088
22089		default:
22090			_, _ = key, value
22091
22092		}
22093	}
22094	*v = sv
22095	return nil
22096}
22097
22098func awsRestjson1_deserializeDocumentDashboard(v **types.Dashboard, value interface{}) error {
22099	if v == nil {
22100		return fmt.Errorf("unexpected nil of type %T", v)
22101	}
22102	if value == nil {
22103		return nil
22104	}
22105
22106	shape, ok := value.(map[string]interface{})
22107	if !ok {
22108		return fmt.Errorf("unexpected JSON type %v", value)
22109	}
22110
22111	var sv *types.Dashboard
22112	if *v == nil {
22113		sv = &types.Dashboard{}
22114	} else {
22115		sv = *v
22116	}
22117
22118	for key, value := range shape {
22119		switch key {
22120		case "Arn":
22121			if value != nil {
22122				jtv, ok := value.(string)
22123				if !ok {
22124					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22125				}
22126				sv.Arn = ptr.String(jtv)
22127			}
22128
22129		case "CreatedTime":
22130			if value != nil {
22131				jtv, ok := value.(json.Number)
22132				if !ok {
22133					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22134				}
22135				f64, err := jtv.Float64()
22136				if err != nil {
22137					return err
22138				}
22139				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22140			}
22141
22142		case "DashboardId":
22143			if value != nil {
22144				jtv, ok := value.(string)
22145				if !ok {
22146					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
22147				}
22148				sv.DashboardId = ptr.String(jtv)
22149			}
22150
22151		case "LastPublishedTime":
22152			if value != nil {
22153				jtv, ok := value.(json.Number)
22154				if !ok {
22155					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22156				}
22157				f64, err := jtv.Float64()
22158				if err != nil {
22159					return err
22160				}
22161				sv.LastPublishedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22162			}
22163
22164		case "LastUpdatedTime":
22165			if value != nil {
22166				jtv, ok := value.(json.Number)
22167				if !ok {
22168					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22169				}
22170				f64, err := jtv.Float64()
22171				if err != nil {
22172					return err
22173				}
22174				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22175			}
22176
22177		case "Name":
22178			if value != nil {
22179				jtv, ok := value.(string)
22180				if !ok {
22181					return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value)
22182				}
22183				sv.Name = ptr.String(jtv)
22184			}
22185
22186		case "Version":
22187			if err := awsRestjson1_deserializeDocumentDashboardVersion(&sv.Version, value); err != nil {
22188				return err
22189			}
22190
22191		default:
22192			_, _ = key, value
22193
22194		}
22195	}
22196	*v = sv
22197	return nil
22198}
22199
22200func awsRestjson1_deserializeDocumentDashboardError(v **types.DashboardError, value interface{}) error {
22201	if v == nil {
22202		return fmt.Errorf("unexpected nil of type %T", v)
22203	}
22204	if value == nil {
22205		return nil
22206	}
22207
22208	shape, ok := value.(map[string]interface{})
22209	if !ok {
22210		return fmt.Errorf("unexpected JSON type %v", value)
22211	}
22212
22213	var sv *types.DashboardError
22214	if *v == nil {
22215		sv = &types.DashboardError{}
22216	} else {
22217		sv = *v
22218	}
22219
22220	for key, value := range shape {
22221		switch key {
22222		case "Message":
22223			if value != nil {
22224				jtv, ok := value.(string)
22225				if !ok {
22226					return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
22227				}
22228				sv.Message = ptr.String(jtv)
22229			}
22230
22231		case "Type":
22232			if value != nil {
22233				jtv, ok := value.(string)
22234				if !ok {
22235					return fmt.Errorf("expected DashboardErrorType to be of type string, got %T instead", value)
22236				}
22237				sv.Type = types.DashboardErrorType(jtv)
22238			}
22239
22240		default:
22241			_, _ = key, value
22242
22243		}
22244	}
22245	*v = sv
22246	return nil
22247}
22248
22249func awsRestjson1_deserializeDocumentDashboardErrorList(v *[]types.DashboardError, value interface{}) error {
22250	if v == nil {
22251		return fmt.Errorf("unexpected nil of type %T", v)
22252	}
22253	if value == nil {
22254		return nil
22255	}
22256
22257	shape, ok := value.([]interface{})
22258	if !ok {
22259		return fmt.Errorf("unexpected JSON type %v", value)
22260	}
22261
22262	var cv []types.DashboardError
22263	if *v == nil {
22264		cv = []types.DashboardError{}
22265	} else {
22266		cv = *v
22267	}
22268
22269	for _, value := range shape {
22270		var col types.DashboardError
22271		destAddr := &col
22272		if err := awsRestjson1_deserializeDocumentDashboardError(&destAddr, value); err != nil {
22273			return err
22274		}
22275		col = *destAddr
22276		cv = append(cv, col)
22277
22278	}
22279	*v = cv
22280	return nil
22281}
22282
22283func awsRestjson1_deserializeDocumentDashboardSummary(v **types.DashboardSummary, value interface{}) error {
22284	if v == nil {
22285		return fmt.Errorf("unexpected nil of type %T", v)
22286	}
22287	if value == nil {
22288		return nil
22289	}
22290
22291	shape, ok := value.(map[string]interface{})
22292	if !ok {
22293		return fmt.Errorf("unexpected JSON type %v", value)
22294	}
22295
22296	var sv *types.DashboardSummary
22297	if *v == nil {
22298		sv = &types.DashboardSummary{}
22299	} else {
22300		sv = *v
22301	}
22302
22303	for key, value := range shape {
22304		switch key {
22305		case "Arn":
22306			if value != nil {
22307				jtv, ok := value.(string)
22308				if !ok {
22309					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22310				}
22311				sv.Arn = ptr.String(jtv)
22312			}
22313
22314		case "CreatedTime":
22315			if value != nil {
22316				jtv, ok := value.(json.Number)
22317				if !ok {
22318					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22319				}
22320				f64, err := jtv.Float64()
22321				if err != nil {
22322					return err
22323				}
22324				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22325			}
22326
22327		case "DashboardId":
22328			if value != nil {
22329				jtv, ok := value.(string)
22330				if !ok {
22331					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
22332				}
22333				sv.DashboardId = ptr.String(jtv)
22334			}
22335
22336		case "LastPublishedTime":
22337			if value != nil {
22338				jtv, ok := value.(json.Number)
22339				if !ok {
22340					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22341				}
22342				f64, err := jtv.Float64()
22343				if err != nil {
22344					return err
22345				}
22346				sv.LastPublishedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22347			}
22348
22349		case "LastUpdatedTime":
22350			if value != nil {
22351				jtv, ok := value.(json.Number)
22352				if !ok {
22353					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22354				}
22355				f64, err := jtv.Float64()
22356				if err != nil {
22357					return err
22358				}
22359				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22360			}
22361
22362		case "Name":
22363			if value != nil {
22364				jtv, ok := value.(string)
22365				if !ok {
22366					return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value)
22367				}
22368				sv.Name = ptr.String(jtv)
22369			}
22370
22371		case "PublishedVersionNumber":
22372			if value != nil {
22373				jtv, ok := value.(json.Number)
22374				if !ok {
22375					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
22376				}
22377				i64, err := jtv.Int64()
22378				if err != nil {
22379					return err
22380				}
22381				sv.PublishedVersionNumber = ptr.Int64(i64)
22382			}
22383
22384		default:
22385			_, _ = key, value
22386
22387		}
22388	}
22389	*v = sv
22390	return nil
22391}
22392
22393func awsRestjson1_deserializeDocumentDashboardSummaryList(v *[]types.DashboardSummary, value interface{}) error {
22394	if v == nil {
22395		return fmt.Errorf("unexpected nil of type %T", v)
22396	}
22397	if value == nil {
22398		return nil
22399	}
22400
22401	shape, ok := value.([]interface{})
22402	if !ok {
22403		return fmt.Errorf("unexpected JSON type %v", value)
22404	}
22405
22406	var cv []types.DashboardSummary
22407	if *v == nil {
22408		cv = []types.DashboardSummary{}
22409	} else {
22410		cv = *v
22411	}
22412
22413	for _, value := range shape {
22414		var col types.DashboardSummary
22415		destAddr := &col
22416		if err := awsRestjson1_deserializeDocumentDashboardSummary(&destAddr, value); err != nil {
22417			return err
22418		}
22419		col = *destAddr
22420		cv = append(cv, col)
22421
22422	}
22423	*v = cv
22424	return nil
22425}
22426
22427func awsRestjson1_deserializeDocumentDashboardVersion(v **types.DashboardVersion, value interface{}) error {
22428	if v == nil {
22429		return fmt.Errorf("unexpected nil of type %T", v)
22430	}
22431	if value == nil {
22432		return nil
22433	}
22434
22435	shape, ok := value.(map[string]interface{})
22436	if !ok {
22437		return fmt.Errorf("unexpected JSON type %v", value)
22438	}
22439
22440	var sv *types.DashboardVersion
22441	if *v == nil {
22442		sv = &types.DashboardVersion{}
22443	} else {
22444		sv = *v
22445	}
22446
22447	for key, value := range shape {
22448		switch key {
22449		case "Arn":
22450			if value != nil {
22451				jtv, ok := value.(string)
22452				if !ok {
22453					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22454				}
22455				sv.Arn = ptr.String(jtv)
22456			}
22457
22458		case "CreatedTime":
22459			if value != nil {
22460				jtv, ok := value.(json.Number)
22461				if !ok {
22462					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22463				}
22464				f64, err := jtv.Float64()
22465				if err != nil {
22466					return err
22467				}
22468				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22469			}
22470
22471		case "DataSetArns":
22472			if err := awsRestjson1_deserializeDocumentDataSetArnsList(&sv.DataSetArns, value); err != nil {
22473				return err
22474			}
22475
22476		case "Description":
22477			if value != nil {
22478				jtv, ok := value.(string)
22479				if !ok {
22480					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
22481				}
22482				sv.Description = ptr.String(jtv)
22483			}
22484
22485		case "Errors":
22486			if err := awsRestjson1_deserializeDocumentDashboardErrorList(&sv.Errors, value); err != nil {
22487				return err
22488			}
22489
22490		case "Sheets":
22491			if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil {
22492				return err
22493			}
22494
22495		case "SourceEntityArn":
22496			if value != nil {
22497				jtv, ok := value.(string)
22498				if !ok {
22499					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22500				}
22501				sv.SourceEntityArn = ptr.String(jtv)
22502			}
22503
22504		case "Status":
22505			if value != nil {
22506				jtv, ok := value.(string)
22507				if !ok {
22508					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
22509				}
22510				sv.Status = types.ResourceStatus(jtv)
22511			}
22512
22513		case "ThemeArn":
22514			if value != nil {
22515				jtv, ok := value.(string)
22516				if !ok {
22517					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22518				}
22519				sv.ThemeArn = ptr.String(jtv)
22520			}
22521
22522		case "VersionNumber":
22523			if value != nil {
22524				jtv, ok := value.(json.Number)
22525				if !ok {
22526					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
22527				}
22528				i64, err := jtv.Int64()
22529				if err != nil {
22530					return err
22531				}
22532				sv.VersionNumber = ptr.Int64(i64)
22533			}
22534
22535		default:
22536			_, _ = key, value
22537
22538		}
22539	}
22540	*v = sv
22541	return nil
22542}
22543
22544func awsRestjson1_deserializeDocumentDashboardVersionSummary(v **types.DashboardVersionSummary, value interface{}) error {
22545	if v == nil {
22546		return fmt.Errorf("unexpected nil of type %T", v)
22547	}
22548	if value == nil {
22549		return nil
22550	}
22551
22552	shape, ok := value.(map[string]interface{})
22553	if !ok {
22554		return fmt.Errorf("unexpected JSON type %v", value)
22555	}
22556
22557	var sv *types.DashboardVersionSummary
22558	if *v == nil {
22559		sv = &types.DashboardVersionSummary{}
22560	} else {
22561		sv = *v
22562	}
22563
22564	for key, value := range shape {
22565		switch key {
22566		case "Arn":
22567			if value != nil {
22568				jtv, ok := value.(string)
22569				if !ok {
22570					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22571				}
22572				sv.Arn = ptr.String(jtv)
22573			}
22574
22575		case "CreatedTime":
22576			if value != nil {
22577				jtv, ok := value.(json.Number)
22578				if !ok {
22579					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22580				}
22581				f64, err := jtv.Float64()
22582				if err != nil {
22583					return err
22584				}
22585				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22586			}
22587
22588		case "Description":
22589			if value != nil {
22590				jtv, ok := value.(string)
22591				if !ok {
22592					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
22593				}
22594				sv.Description = ptr.String(jtv)
22595			}
22596
22597		case "SourceEntityArn":
22598			if value != nil {
22599				jtv, ok := value.(string)
22600				if !ok {
22601					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22602				}
22603				sv.SourceEntityArn = ptr.String(jtv)
22604			}
22605
22606		case "Status":
22607			if value != nil {
22608				jtv, ok := value.(string)
22609				if !ok {
22610					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
22611				}
22612				sv.Status = types.ResourceStatus(jtv)
22613			}
22614
22615		case "VersionNumber":
22616			if value != nil {
22617				jtv, ok := value.(json.Number)
22618				if !ok {
22619					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
22620				}
22621				i64, err := jtv.Int64()
22622				if err != nil {
22623					return err
22624				}
22625				sv.VersionNumber = ptr.Int64(i64)
22626			}
22627
22628		default:
22629			_, _ = key, value
22630
22631		}
22632	}
22633	*v = sv
22634	return nil
22635}
22636
22637func awsRestjson1_deserializeDocumentDashboardVersionSummaryList(v *[]types.DashboardVersionSummary, value interface{}) error {
22638	if v == nil {
22639		return fmt.Errorf("unexpected nil of type %T", v)
22640	}
22641	if value == nil {
22642		return nil
22643	}
22644
22645	shape, ok := value.([]interface{})
22646	if !ok {
22647		return fmt.Errorf("unexpected JSON type %v", value)
22648	}
22649
22650	var cv []types.DashboardVersionSummary
22651	if *v == nil {
22652		cv = []types.DashboardVersionSummary{}
22653	} else {
22654		cv = *v
22655	}
22656
22657	for _, value := range shape {
22658		var col types.DashboardVersionSummary
22659		destAddr := &col
22660		if err := awsRestjson1_deserializeDocumentDashboardVersionSummary(&destAddr, value); err != nil {
22661			return err
22662		}
22663		col = *destAddr
22664		cv = append(cv, col)
22665
22666	}
22667	*v = cv
22668	return nil
22669}
22670
22671func awsRestjson1_deserializeDocumentDataColorPalette(v **types.DataColorPalette, value interface{}) error {
22672	if v == nil {
22673		return fmt.Errorf("unexpected nil of type %T", v)
22674	}
22675	if value == nil {
22676		return nil
22677	}
22678
22679	shape, ok := value.(map[string]interface{})
22680	if !ok {
22681		return fmt.Errorf("unexpected JSON type %v", value)
22682	}
22683
22684	var sv *types.DataColorPalette
22685	if *v == nil {
22686		sv = &types.DataColorPalette{}
22687	} else {
22688		sv = *v
22689	}
22690
22691	for key, value := range shape {
22692		switch key {
22693		case "Colors":
22694			if err := awsRestjson1_deserializeDocumentColorList(&sv.Colors, value); err != nil {
22695				return err
22696			}
22697
22698		case "EmptyFillColor":
22699			if value != nil {
22700				jtv, ok := value.(string)
22701				if !ok {
22702					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
22703				}
22704				sv.EmptyFillColor = ptr.String(jtv)
22705			}
22706
22707		case "MinMaxGradient":
22708			if err := awsRestjson1_deserializeDocumentColorList(&sv.MinMaxGradient, value); err != nil {
22709				return err
22710			}
22711
22712		default:
22713			_, _ = key, value
22714
22715		}
22716	}
22717	*v = sv
22718	return nil
22719}
22720
22721func awsRestjson1_deserializeDocumentDataSet(v **types.DataSet, value interface{}) error {
22722	if v == nil {
22723		return fmt.Errorf("unexpected nil of type %T", v)
22724	}
22725	if value == nil {
22726		return nil
22727	}
22728
22729	shape, ok := value.(map[string]interface{})
22730	if !ok {
22731		return fmt.Errorf("unexpected JSON type %v", value)
22732	}
22733
22734	var sv *types.DataSet
22735	if *v == nil {
22736		sv = &types.DataSet{}
22737	} else {
22738		sv = *v
22739	}
22740
22741	for key, value := range shape {
22742		switch key {
22743		case "Arn":
22744			if value != nil {
22745				jtv, ok := value.(string)
22746				if !ok {
22747					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22748				}
22749				sv.Arn = ptr.String(jtv)
22750			}
22751
22752		case "ColumnGroups":
22753			if err := awsRestjson1_deserializeDocumentColumnGroupList(&sv.ColumnGroups, value); err != nil {
22754				return err
22755			}
22756
22757		case "ColumnLevelPermissionRules":
22758			if err := awsRestjson1_deserializeDocumentColumnLevelPermissionRuleList(&sv.ColumnLevelPermissionRules, value); err != nil {
22759				return err
22760			}
22761
22762		case "ConsumedSpiceCapacityInBytes":
22763			if value != nil {
22764				jtv, ok := value.(json.Number)
22765				if !ok {
22766					return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
22767				}
22768				i64, err := jtv.Int64()
22769				if err != nil {
22770					return err
22771				}
22772				sv.ConsumedSpiceCapacityInBytes = i64
22773			}
22774
22775		case "CreatedTime":
22776			if value != nil {
22777				jtv, ok := value.(json.Number)
22778				if !ok {
22779					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22780				}
22781				f64, err := jtv.Float64()
22782				if err != nil {
22783					return err
22784				}
22785				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22786			}
22787
22788		case "DataSetId":
22789			if value != nil {
22790				jtv, ok := value.(string)
22791				if !ok {
22792					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
22793				}
22794				sv.DataSetId = ptr.String(jtv)
22795			}
22796
22797		case "FieldFolders":
22798			if err := awsRestjson1_deserializeDocumentFieldFolderMap(&sv.FieldFolders, value); err != nil {
22799				return err
22800			}
22801
22802		case "ImportMode":
22803			if value != nil {
22804				jtv, ok := value.(string)
22805				if !ok {
22806					return fmt.Errorf("expected DataSetImportMode to be of type string, got %T instead", value)
22807				}
22808				sv.ImportMode = types.DataSetImportMode(jtv)
22809			}
22810
22811		case "LastUpdatedTime":
22812			if value != nil {
22813				jtv, ok := value.(json.Number)
22814				if !ok {
22815					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
22816				}
22817				f64, err := jtv.Float64()
22818				if err != nil {
22819					return err
22820				}
22821				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
22822			}
22823
22824		case "LogicalTableMap":
22825			if err := awsRestjson1_deserializeDocumentLogicalTableMap(&sv.LogicalTableMap, value); err != nil {
22826				return err
22827			}
22828
22829		case "Name":
22830			if value != nil {
22831				jtv, ok := value.(string)
22832				if !ok {
22833					return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
22834				}
22835				sv.Name = ptr.String(jtv)
22836			}
22837
22838		case "OutputColumns":
22839			if err := awsRestjson1_deserializeDocumentOutputColumnList(&sv.OutputColumns, value); err != nil {
22840				return err
22841			}
22842
22843		case "PhysicalTableMap":
22844			if err := awsRestjson1_deserializeDocumentPhysicalTableMap(&sv.PhysicalTableMap, value); err != nil {
22845				return err
22846			}
22847
22848		case "RowLevelPermissionDataSet":
22849			if err := awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(&sv.RowLevelPermissionDataSet, value); err != nil {
22850				return err
22851			}
22852
22853		default:
22854			_, _ = key, value
22855
22856		}
22857	}
22858	*v = sv
22859	return nil
22860}
22861
22862func awsRestjson1_deserializeDocumentDataSetArnsList(v *[]string, value interface{}) error {
22863	if v == nil {
22864		return fmt.Errorf("unexpected nil of type %T", v)
22865	}
22866	if value == nil {
22867		return nil
22868	}
22869
22870	shape, ok := value.([]interface{})
22871	if !ok {
22872		return fmt.Errorf("unexpected JSON type %v", value)
22873	}
22874
22875	var cv []string
22876	if *v == nil {
22877		cv = []string{}
22878	} else {
22879		cv = *v
22880	}
22881
22882	for _, value := range shape {
22883		var col string
22884		if value != nil {
22885			jtv, ok := value.(string)
22886			if !ok {
22887				return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
22888			}
22889			col = jtv
22890		}
22891		cv = append(cv, col)
22892
22893	}
22894	*v = cv
22895	return nil
22896}
22897
22898func awsRestjson1_deserializeDocumentDataSetConfiguration(v **types.DataSetConfiguration, 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 *types.DataSetConfiguration
22912	if *v == nil {
22913		sv = &types.DataSetConfiguration{}
22914	} else {
22915		sv = *v
22916	}
22917
22918	for key, value := range shape {
22919		switch key {
22920		case "ColumnGroupSchemaList":
22921			if err := awsRestjson1_deserializeDocumentColumnGroupSchemaList(&sv.ColumnGroupSchemaList, value); err != nil {
22922				return err
22923			}
22924
22925		case "DataSetSchema":
22926			if err := awsRestjson1_deserializeDocumentDataSetSchema(&sv.DataSetSchema, value); err != nil {
22927				return err
22928			}
22929
22930		case "Placeholder":
22931			if value != nil {
22932				jtv, ok := value.(string)
22933				if !ok {
22934					return fmt.Errorf("expected String to be of type string, got %T instead", value)
22935				}
22936				sv.Placeholder = ptr.String(jtv)
22937			}
22938
22939		default:
22940			_, _ = key, value
22941
22942		}
22943	}
22944	*v = sv
22945	return nil
22946}
22947
22948func awsRestjson1_deserializeDocumentDataSetConfigurationList(v *[]types.DataSetConfiguration, value interface{}) error {
22949	if v == nil {
22950		return fmt.Errorf("unexpected nil of type %T", v)
22951	}
22952	if value == nil {
22953		return nil
22954	}
22955
22956	shape, ok := value.([]interface{})
22957	if !ok {
22958		return fmt.Errorf("unexpected JSON type %v", value)
22959	}
22960
22961	var cv []types.DataSetConfiguration
22962	if *v == nil {
22963		cv = []types.DataSetConfiguration{}
22964	} else {
22965		cv = *v
22966	}
22967
22968	for _, value := range shape {
22969		var col types.DataSetConfiguration
22970		destAddr := &col
22971		if err := awsRestjson1_deserializeDocumentDataSetConfiguration(&destAddr, value); err != nil {
22972			return err
22973		}
22974		col = *destAddr
22975		cv = append(cv, col)
22976
22977	}
22978	*v = cv
22979	return nil
22980}
22981
22982func awsRestjson1_deserializeDocumentDataSetSchema(v **types.DataSetSchema, value interface{}) error {
22983	if v == nil {
22984		return fmt.Errorf("unexpected nil of type %T", v)
22985	}
22986	if value == nil {
22987		return nil
22988	}
22989
22990	shape, ok := value.(map[string]interface{})
22991	if !ok {
22992		return fmt.Errorf("unexpected JSON type %v", value)
22993	}
22994
22995	var sv *types.DataSetSchema
22996	if *v == nil {
22997		sv = &types.DataSetSchema{}
22998	} else {
22999		sv = *v
23000	}
23001
23002	for key, value := range shape {
23003		switch key {
23004		case "ColumnSchemaList":
23005			if err := awsRestjson1_deserializeDocumentColumnSchemaList(&sv.ColumnSchemaList, value); err != nil {
23006				return err
23007			}
23008
23009		default:
23010			_, _ = key, value
23011
23012		}
23013	}
23014	*v = sv
23015	return nil
23016}
23017
23018func awsRestjson1_deserializeDocumentDataSetSummary(v **types.DataSetSummary, value interface{}) error {
23019	if v == nil {
23020		return fmt.Errorf("unexpected nil of type %T", v)
23021	}
23022	if value == nil {
23023		return nil
23024	}
23025
23026	shape, ok := value.(map[string]interface{})
23027	if !ok {
23028		return fmt.Errorf("unexpected JSON type %v", value)
23029	}
23030
23031	var sv *types.DataSetSummary
23032	if *v == nil {
23033		sv = &types.DataSetSummary{}
23034	} else {
23035		sv = *v
23036	}
23037
23038	for key, value := range shape {
23039		switch key {
23040		case "Arn":
23041			if value != nil {
23042				jtv, ok := value.(string)
23043				if !ok {
23044					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
23045				}
23046				sv.Arn = ptr.String(jtv)
23047			}
23048
23049		case "ColumnLevelPermissionRulesApplied":
23050			if value != nil {
23051				jtv, ok := value.(bool)
23052				if !ok {
23053					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
23054				}
23055				sv.ColumnLevelPermissionRulesApplied = jtv
23056			}
23057
23058		case "CreatedTime":
23059			if value != nil {
23060				jtv, ok := value.(json.Number)
23061				if !ok {
23062					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
23063				}
23064				f64, err := jtv.Float64()
23065				if err != nil {
23066					return err
23067				}
23068				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
23069			}
23070
23071		case "DataSetId":
23072			if value != nil {
23073				jtv, ok := value.(string)
23074				if !ok {
23075					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
23076				}
23077				sv.DataSetId = ptr.String(jtv)
23078			}
23079
23080		case "ImportMode":
23081			if value != nil {
23082				jtv, ok := value.(string)
23083				if !ok {
23084					return fmt.Errorf("expected DataSetImportMode to be of type string, got %T instead", value)
23085				}
23086				sv.ImportMode = types.DataSetImportMode(jtv)
23087			}
23088
23089		case "LastUpdatedTime":
23090			if value != nil {
23091				jtv, ok := value.(json.Number)
23092				if !ok {
23093					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
23094				}
23095				f64, err := jtv.Float64()
23096				if err != nil {
23097					return err
23098				}
23099				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
23100			}
23101
23102		case "Name":
23103			if value != nil {
23104				jtv, ok := value.(string)
23105				if !ok {
23106					return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
23107				}
23108				sv.Name = ptr.String(jtv)
23109			}
23110
23111		case "RowLevelPermissionDataSet":
23112			if err := awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(&sv.RowLevelPermissionDataSet, value); err != nil {
23113				return err
23114			}
23115
23116		default:
23117			_, _ = key, value
23118
23119		}
23120	}
23121	*v = sv
23122	return nil
23123}
23124
23125func awsRestjson1_deserializeDocumentDataSetSummaryList(v *[]types.DataSetSummary, value interface{}) error {
23126	if v == nil {
23127		return fmt.Errorf("unexpected nil of type %T", v)
23128	}
23129	if value == nil {
23130		return nil
23131	}
23132
23133	shape, ok := value.([]interface{})
23134	if !ok {
23135		return fmt.Errorf("unexpected JSON type %v", value)
23136	}
23137
23138	var cv []types.DataSetSummary
23139	if *v == nil {
23140		cv = []types.DataSetSummary{}
23141	} else {
23142		cv = *v
23143	}
23144
23145	for _, value := range shape {
23146		var col types.DataSetSummary
23147		destAddr := &col
23148		if err := awsRestjson1_deserializeDocumentDataSetSummary(&destAddr, value); err != nil {
23149			return err
23150		}
23151		col = *destAddr
23152		cv = append(cv, col)
23153
23154	}
23155	*v = cv
23156	return nil
23157}
23158
23159func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error {
23160	if v == nil {
23161		return fmt.Errorf("unexpected nil of type %T", v)
23162	}
23163	if value == nil {
23164		return nil
23165	}
23166
23167	shape, ok := value.(map[string]interface{})
23168	if !ok {
23169		return fmt.Errorf("unexpected JSON type %v", value)
23170	}
23171
23172	var sv *types.DataSource
23173	if *v == nil {
23174		sv = &types.DataSource{}
23175	} else {
23176		sv = *v
23177	}
23178
23179	for key, value := range shape {
23180		switch key {
23181		case "AlternateDataSourceParameters":
23182			if err := awsRestjson1_deserializeDocumentDataSourceParametersList(&sv.AlternateDataSourceParameters, value); err != nil {
23183				return err
23184			}
23185
23186		case "Arn":
23187			if value != nil {
23188				jtv, ok := value.(string)
23189				if !ok {
23190					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
23191				}
23192				sv.Arn = ptr.String(jtv)
23193			}
23194
23195		case "CreatedTime":
23196			if value != nil {
23197				jtv, ok := value.(json.Number)
23198				if !ok {
23199					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
23200				}
23201				f64, err := jtv.Float64()
23202				if err != nil {
23203					return err
23204				}
23205				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
23206			}
23207
23208		case "DataSourceId":
23209			if value != nil {
23210				jtv, ok := value.(string)
23211				if !ok {
23212					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
23213				}
23214				sv.DataSourceId = ptr.String(jtv)
23215			}
23216
23217		case "DataSourceParameters":
23218			if err := awsRestjson1_deserializeDocumentDataSourceParameters(&sv.DataSourceParameters, value); err != nil {
23219				return err
23220			}
23221
23222		case "ErrorInfo":
23223			if err := awsRestjson1_deserializeDocumentDataSourceErrorInfo(&sv.ErrorInfo, value); err != nil {
23224				return err
23225			}
23226
23227		case "LastUpdatedTime":
23228			if value != nil {
23229				jtv, ok := value.(json.Number)
23230				if !ok {
23231					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
23232				}
23233				f64, err := jtv.Float64()
23234				if err != nil {
23235					return err
23236				}
23237				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
23238			}
23239
23240		case "Name":
23241			if value != nil {
23242				jtv, ok := value.(string)
23243				if !ok {
23244					return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
23245				}
23246				sv.Name = ptr.String(jtv)
23247			}
23248
23249		case "SslProperties":
23250			if err := awsRestjson1_deserializeDocumentSslProperties(&sv.SslProperties, value); err != nil {
23251				return err
23252			}
23253
23254		case "Status":
23255			if value != nil {
23256				jtv, ok := value.(string)
23257				if !ok {
23258					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
23259				}
23260				sv.Status = types.ResourceStatus(jtv)
23261			}
23262
23263		case "Type":
23264			if value != nil {
23265				jtv, ok := value.(string)
23266				if !ok {
23267					return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value)
23268				}
23269				sv.Type = types.DataSourceType(jtv)
23270			}
23271
23272		case "VpcConnectionProperties":
23273			if err := awsRestjson1_deserializeDocumentVpcConnectionProperties(&sv.VpcConnectionProperties, value); err != nil {
23274				return err
23275			}
23276
23277		default:
23278			_, _ = key, value
23279
23280		}
23281	}
23282	*v = sv
23283	return nil
23284}
23285
23286func awsRestjson1_deserializeDocumentDataSourceErrorInfo(v **types.DataSourceErrorInfo, value interface{}) error {
23287	if v == nil {
23288		return fmt.Errorf("unexpected nil of type %T", v)
23289	}
23290	if value == nil {
23291		return nil
23292	}
23293
23294	shape, ok := value.(map[string]interface{})
23295	if !ok {
23296		return fmt.Errorf("unexpected JSON type %v", value)
23297	}
23298
23299	var sv *types.DataSourceErrorInfo
23300	if *v == nil {
23301		sv = &types.DataSourceErrorInfo{}
23302	} else {
23303		sv = *v
23304	}
23305
23306	for key, value := range shape {
23307		switch key {
23308		case "Message":
23309			if value != nil {
23310				jtv, ok := value.(string)
23311				if !ok {
23312					return fmt.Errorf("expected String to be of type string, got %T instead", value)
23313				}
23314				sv.Message = ptr.String(jtv)
23315			}
23316
23317		case "Type":
23318			if value != nil {
23319				jtv, ok := value.(string)
23320				if !ok {
23321					return fmt.Errorf("expected DataSourceErrorInfoType to be of type string, got %T instead", value)
23322				}
23323				sv.Type = types.DataSourceErrorInfoType(jtv)
23324			}
23325
23326		default:
23327			_, _ = key, value
23328
23329		}
23330	}
23331	*v = sv
23332	return nil
23333}
23334
23335func awsRestjson1_deserializeDocumentDataSourceList(v *[]types.DataSource, value interface{}) error {
23336	if v == nil {
23337		return fmt.Errorf("unexpected nil of type %T", v)
23338	}
23339	if value == nil {
23340		return nil
23341	}
23342
23343	shape, ok := value.([]interface{})
23344	if !ok {
23345		return fmt.Errorf("unexpected JSON type %v", value)
23346	}
23347
23348	var cv []types.DataSource
23349	if *v == nil {
23350		cv = []types.DataSource{}
23351	} else {
23352		cv = *v
23353	}
23354
23355	for _, value := range shape {
23356		var col types.DataSource
23357		destAddr := &col
23358		if err := awsRestjson1_deserializeDocumentDataSource(&destAddr, value); err != nil {
23359			return err
23360		}
23361		col = *destAddr
23362		cv = append(cv, col)
23363
23364	}
23365	*v = cv
23366	return nil
23367}
23368
23369func awsRestjson1_deserializeDocumentDataSourceParameters(v *types.DataSourceParameters, value interface{}) error {
23370	if v == nil {
23371		return fmt.Errorf("unexpected nil of type %T", v)
23372	}
23373	if value == nil {
23374		return nil
23375	}
23376
23377	shape, ok := value.(map[string]interface{})
23378	if !ok {
23379		return fmt.Errorf("unexpected JSON type %v", value)
23380	}
23381
23382	var uv types.DataSourceParameters
23383loop:
23384	for key, value := range shape {
23385		if value == nil {
23386			continue
23387		}
23388		switch key {
23389		case "AmazonElasticsearchParameters":
23390			var mv types.AmazonElasticsearchParameters
23391			destAddr := &mv
23392			if err := awsRestjson1_deserializeDocumentAmazonElasticsearchParameters(&destAddr, value); err != nil {
23393				return err
23394			}
23395			mv = *destAddr
23396			uv = &types.DataSourceParametersMemberAmazonElasticsearchParameters{Value: mv}
23397			break loop
23398
23399		case "AthenaParameters":
23400			var mv types.AthenaParameters
23401			destAddr := &mv
23402			if err := awsRestjson1_deserializeDocumentAthenaParameters(&destAddr, value); err != nil {
23403				return err
23404			}
23405			mv = *destAddr
23406			uv = &types.DataSourceParametersMemberAthenaParameters{Value: mv}
23407			break loop
23408
23409		case "AuroraParameters":
23410			var mv types.AuroraParameters
23411			destAddr := &mv
23412			if err := awsRestjson1_deserializeDocumentAuroraParameters(&destAddr, value); err != nil {
23413				return err
23414			}
23415			mv = *destAddr
23416			uv = &types.DataSourceParametersMemberAuroraParameters{Value: mv}
23417			break loop
23418
23419		case "AuroraPostgreSqlParameters":
23420			var mv types.AuroraPostgreSqlParameters
23421			destAddr := &mv
23422			if err := awsRestjson1_deserializeDocumentAuroraPostgreSqlParameters(&destAddr, value); err != nil {
23423				return err
23424			}
23425			mv = *destAddr
23426			uv = &types.DataSourceParametersMemberAuroraPostgreSqlParameters{Value: mv}
23427			break loop
23428
23429		case "AwsIotAnalyticsParameters":
23430			var mv types.AwsIotAnalyticsParameters
23431			destAddr := &mv
23432			if err := awsRestjson1_deserializeDocumentAwsIotAnalyticsParameters(&destAddr, value); err != nil {
23433				return err
23434			}
23435			mv = *destAddr
23436			uv = &types.DataSourceParametersMemberAwsIotAnalyticsParameters{Value: mv}
23437			break loop
23438
23439		case "JiraParameters":
23440			var mv types.JiraParameters
23441			destAddr := &mv
23442			if err := awsRestjson1_deserializeDocumentJiraParameters(&destAddr, value); err != nil {
23443				return err
23444			}
23445			mv = *destAddr
23446			uv = &types.DataSourceParametersMemberJiraParameters{Value: mv}
23447			break loop
23448
23449		case "MariaDbParameters":
23450			var mv types.MariaDbParameters
23451			destAddr := &mv
23452			if err := awsRestjson1_deserializeDocumentMariaDbParameters(&destAddr, value); err != nil {
23453				return err
23454			}
23455			mv = *destAddr
23456			uv = &types.DataSourceParametersMemberMariaDbParameters{Value: mv}
23457			break loop
23458
23459		case "MySqlParameters":
23460			var mv types.MySqlParameters
23461			destAddr := &mv
23462			if err := awsRestjson1_deserializeDocumentMySqlParameters(&destAddr, value); err != nil {
23463				return err
23464			}
23465			mv = *destAddr
23466			uv = &types.DataSourceParametersMemberMySqlParameters{Value: mv}
23467			break loop
23468
23469		case "OracleParameters":
23470			var mv types.OracleParameters
23471			destAddr := &mv
23472			if err := awsRestjson1_deserializeDocumentOracleParameters(&destAddr, value); err != nil {
23473				return err
23474			}
23475			mv = *destAddr
23476			uv = &types.DataSourceParametersMemberOracleParameters{Value: mv}
23477			break loop
23478
23479		case "PostgreSqlParameters":
23480			var mv types.PostgreSqlParameters
23481			destAddr := &mv
23482			if err := awsRestjson1_deserializeDocumentPostgreSqlParameters(&destAddr, value); err != nil {
23483				return err
23484			}
23485			mv = *destAddr
23486			uv = &types.DataSourceParametersMemberPostgreSqlParameters{Value: mv}
23487			break loop
23488
23489		case "PrestoParameters":
23490			var mv types.PrestoParameters
23491			destAddr := &mv
23492			if err := awsRestjson1_deserializeDocumentPrestoParameters(&destAddr, value); err != nil {
23493				return err
23494			}
23495			mv = *destAddr
23496			uv = &types.DataSourceParametersMemberPrestoParameters{Value: mv}
23497			break loop
23498
23499		case "RdsParameters":
23500			var mv types.RdsParameters
23501			destAddr := &mv
23502			if err := awsRestjson1_deserializeDocumentRdsParameters(&destAddr, value); err != nil {
23503				return err
23504			}
23505			mv = *destAddr
23506			uv = &types.DataSourceParametersMemberRdsParameters{Value: mv}
23507			break loop
23508
23509		case "RedshiftParameters":
23510			var mv types.RedshiftParameters
23511			destAddr := &mv
23512			if err := awsRestjson1_deserializeDocumentRedshiftParameters(&destAddr, value); err != nil {
23513				return err
23514			}
23515			mv = *destAddr
23516			uv = &types.DataSourceParametersMemberRedshiftParameters{Value: mv}
23517			break loop
23518
23519		case "S3Parameters":
23520			var mv types.S3Parameters
23521			destAddr := &mv
23522			if err := awsRestjson1_deserializeDocumentS3Parameters(&destAddr, value); err != nil {
23523				return err
23524			}
23525			mv = *destAddr
23526			uv = &types.DataSourceParametersMemberS3Parameters{Value: mv}
23527			break loop
23528
23529		case "ServiceNowParameters":
23530			var mv types.ServiceNowParameters
23531			destAddr := &mv
23532			if err := awsRestjson1_deserializeDocumentServiceNowParameters(&destAddr, value); err != nil {
23533				return err
23534			}
23535			mv = *destAddr
23536			uv = &types.DataSourceParametersMemberServiceNowParameters{Value: mv}
23537			break loop
23538
23539		case "SnowflakeParameters":
23540			var mv types.SnowflakeParameters
23541			destAddr := &mv
23542			if err := awsRestjson1_deserializeDocumentSnowflakeParameters(&destAddr, value); err != nil {
23543				return err
23544			}
23545			mv = *destAddr
23546			uv = &types.DataSourceParametersMemberSnowflakeParameters{Value: mv}
23547			break loop
23548
23549		case "SparkParameters":
23550			var mv types.SparkParameters
23551			destAddr := &mv
23552			if err := awsRestjson1_deserializeDocumentSparkParameters(&destAddr, value); err != nil {
23553				return err
23554			}
23555			mv = *destAddr
23556			uv = &types.DataSourceParametersMemberSparkParameters{Value: mv}
23557			break loop
23558
23559		case "SqlServerParameters":
23560			var mv types.SqlServerParameters
23561			destAddr := &mv
23562			if err := awsRestjson1_deserializeDocumentSqlServerParameters(&destAddr, value); err != nil {
23563				return err
23564			}
23565			mv = *destAddr
23566			uv = &types.DataSourceParametersMemberSqlServerParameters{Value: mv}
23567			break loop
23568
23569		case "TeradataParameters":
23570			var mv types.TeradataParameters
23571			destAddr := &mv
23572			if err := awsRestjson1_deserializeDocumentTeradataParameters(&destAddr, value); err != nil {
23573				return err
23574			}
23575			mv = *destAddr
23576			uv = &types.DataSourceParametersMemberTeradataParameters{Value: mv}
23577			break loop
23578
23579		case "TwitterParameters":
23580			var mv types.TwitterParameters
23581			destAddr := &mv
23582			if err := awsRestjson1_deserializeDocumentTwitterParameters(&destAddr, value); err != nil {
23583				return err
23584			}
23585			mv = *destAddr
23586			uv = &types.DataSourceParametersMemberTwitterParameters{Value: mv}
23587			break loop
23588
23589		default:
23590			uv = &types.UnknownUnionMember{Tag: key}
23591			break loop
23592
23593		}
23594	}
23595	*v = uv
23596	return nil
23597}
23598
23599func awsRestjson1_deserializeDocumentDataSourceParametersList(v *[]types.DataSourceParameters, value interface{}) error {
23600	if v == nil {
23601		return fmt.Errorf("unexpected nil of type %T", v)
23602	}
23603	if value == nil {
23604		return nil
23605	}
23606
23607	shape, ok := value.([]interface{})
23608	if !ok {
23609		return fmt.Errorf("unexpected JSON type %v", value)
23610	}
23611
23612	var cv []types.DataSourceParameters
23613	if *v == nil {
23614		cv = []types.DataSourceParameters{}
23615	} else {
23616		cv = *v
23617	}
23618
23619	for _, value := range shape {
23620		var col types.DataSourceParameters
23621		if err := awsRestjson1_deserializeDocumentDataSourceParameters(&col, value); err != nil {
23622			return err
23623		}
23624		cv = append(cv, col)
23625
23626	}
23627	*v = cv
23628	return nil
23629}
23630
23631func awsRestjson1_deserializeDocumentDomainNotWhitelistedException(v **types.DomainNotWhitelistedException, value interface{}) error {
23632	if v == nil {
23633		return fmt.Errorf("unexpected nil of type %T", v)
23634	}
23635	if value == nil {
23636		return nil
23637	}
23638
23639	shape, ok := value.(map[string]interface{})
23640	if !ok {
23641		return fmt.Errorf("unexpected JSON type %v", value)
23642	}
23643
23644	var sv *types.DomainNotWhitelistedException
23645	if *v == nil {
23646		sv = &types.DomainNotWhitelistedException{}
23647	} else {
23648		sv = *v
23649	}
23650
23651	for key, value := range shape {
23652		switch key {
23653		case "Message":
23654			if value != nil {
23655				jtv, ok := value.(string)
23656				if !ok {
23657					return fmt.Errorf("expected String to be of type string, got %T instead", value)
23658				}
23659				sv.Message = ptr.String(jtv)
23660			}
23661
23662		case "RequestId":
23663			if value != nil {
23664				jtv, ok := value.(string)
23665				if !ok {
23666					return fmt.Errorf("expected String to be of type string, got %T instead", value)
23667				}
23668				sv.RequestId = ptr.String(jtv)
23669			}
23670
23671		default:
23672			_, _ = key, value
23673
23674		}
23675	}
23676	*v = sv
23677	return nil
23678}
23679
23680func awsRestjson1_deserializeDocumentErrorInfo(v **types.ErrorInfo, value interface{}) error {
23681	if v == nil {
23682		return fmt.Errorf("unexpected nil of type %T", v)
23683	}
23684	if value == nil {
23685		return nil
23686	}
23687
23688	shape, ok := value.(map[string]interface{})
23689	if !ok {
23690		return fmt.Errorf("unexpected JSON type %v", value)
23691	}
23692
23693	var sv *types.ErrorInfo
23694	if *v == nil {
23695		sv = &types.ErrorInfo{}
23696	} else {
23697		sv = *v
23698	}
23699
23700	for key, value := range shape {
23701		switch key {
23702		case "Message":
23703			if value != nil {
23704				jtv, ok := value.(string)
23705				if !ok {
23706					return fmt.Errorf("expected String to be of type string, got %T instead", value)
23707				}
23708				sv.Message = ptr.String(jtv)
23709			}
23710
23711		case "Type":
23712			if value != nil {
23713				jtv, ok := value.(string)
23714				if !ok {
23715					return fmt.Errorf("expected IngestionErrorType to be of type string, got %T instead", value)
23716				}
23717				sv.Type = types.IngestionErrorType(jtv)
23718			}
23719
23720		default:
23721			_, _ = key, value
23722
23723		}
23724	}
23725	*v = sv
23726	return nil
23727}
23728
23729func awsRestjson1_deserializeDocumentFieldFolder(v **types.FieldFolder, value interface{}) error {
23730	if v == nil {
23731		return fmt.Errorf("unexpected nil of type %T", v)
23732	}
23733	if value == nil {
23734		return nil
23735	}
23736
23737	shape, ok := value.(map[string]interface{})
23738	if !ok {
23739		return fmt.Errorf("unexpected JSON type %v", value)
23740	}
23741
23742	var sv *types.FieldFolder
23743	if *v == nil {
23744		sv = &types.FieldFolder{}
23745	} else {
23746		sv = *v
23747	}
23748
23749	for key, value := range shape {
23750		switch key {
23751		case "columns":
23752			if err := awsRestjson1_deserializeDocumentFolderColumnList(&sv.Columns, value); err != nil {
23753				return err
23754			}
23755
23756		case "description":
23757			if value != nil {
23758				jtv, ok := value.(string)
23759				if !ok {
23760					return fmt.Errorf("expected FieldFolderDescription to be of type string, got %T instead", value)
23761				}
23762				sv.Description = ptr.String(jtv)
23763			}
23764
23765		default:
23766			_, _ = key, value
23767
23768		}
23769	}
23770	*v = sv
23771	return nil
23772}
23773
23774func awsRestjson1_deserializeDocumentFieldFolderMap(v *map[string]types.FieldFolder, value interface{}) error {
23775	if v == nil {
23776		return fmt.Errorf("unexpected nil of type %T", v)
23777	}
23778	if value == nil {
23779		return nil
23780	}
23781
23782	shape, ok := value.(map[string]interface{})
23783	if !ok {
23784		return fmt.Errorf("unexpected JSON type %v", value)
23785	}
23786
23787	var mv map[string]types.FieldFolder
23788	if *v == nil {
23789		mv = map[string]types.FieldFolder{}
23790	} else {
23791		mv = *v
23792	}
23793
23794	for key, value := range shape {
23795		var parsedVal types.FieldFolder
23796		mapVar := parsedVal
23797		destAddr := &mapVar
23798		if err := awsRestjson1_deserializeDocumentFieldFolder(&destAddr, value); err != nil {
23799			return err
23800		}
23801		parsedVal = *destAddr
23802		mv[key] = parsedVal
23803
23804	}
23805	*v = mv
23806	return nil
23807}
23808
23809func awsRestjson1_deserializeDocumentFilterOperation(v **types.FilterOperation, value interface{}) error {
23810	if v == nil {
23811		return fmt.Errorf("unexpected nil of type %T", v)
23812	}
23813	if value == nil {
23814		return nil
23815	}
23816
23817	shape, ok := value.(map[string]interface{})
23818	if !ok {
23819		return fmt.Errorf("unexpected JSON type %v", value)
23820	}
23821
23822	var sv *types.FilterOperation
23823	if *v == nil {
23824		sv = &types.FilterOperation{}
23825	} else {
23826		sv = *v
23827	}
23828
23829	for key, value := range shape {
23830		switch key {
23831		case "ConditionExpression":
23832			if value != nil {
23833				jtv, ok := value.(string)
23834				if !ok {
23835					return fmt.Errorf("expected Expression to be of type string, got %T instead", value)
23836				}
23837				sv.ConditionExpression = ptr.String(jtv)
23838			}
23839
23840		default:
23841			_, _ = key, value
23842
23843		}
23844	}
23845	*v = sv
23846	return nil
23847}
23848
23849func awsRestjson1_deserializeDocumentFolderColumnList(v *[]string, value interface{}) error {
23850	if v == nil {
23851		return fmt.Errorf("unexpected nil of type %T", v)
23852	}
23853	if value == nil {
23854		return nil
23855	}
23856
23857	shape, ok := value.([]interface{})
23858	if !ok {
23859		return fmt.Errorf("unexpected JSON type %v", value)
23860	}
23861
23862	var cv []string
23863	if *v == nil {
23864		cv = []string{}
23865	} else {
23866		cv = *v
23867	}
23868
23869	for _, value := range shape {
23870		var col string
23871		if value != nil {
23872			jtv, ok := value.(string)
23873			if !ok {
23874				return fmt.Errorf("expected String to be of type string, got %T instead", value)
23875			}
23876			col = jtv
23877		}
23878		cv = append(cv, col)
23879
23880	}
23881	*v = cv
23882	return nil
23883}
23884
23885func awsRestjson1_deserializeDocumentGeoSpatialColumnGroup(v **types.GeoSpatialColumnGroup, value interface{}) error {
23886	if v == nil {
23887		return fmt.Errorf("unexpected nil of type %T", v)
23888	}
23889	if value == nil {
23890		return nil
23891	}
23892
23893	shape, ok := value.(map[string]interface{})
23894	if !ok {
23895		return fmt.Errorf("unexpected JSON type %v", value)
23896	}
23897
23898	var sv *types.GeoSpatialColumnGroup
23899	if *v == nil {
23900		sv = &types.GeoSpatialColumnGroup{}
23901	} else {
23902		sv = *v
23903	}
23904
23905	for key, value := range shape {
23906		switch key {
23907		case "Columns":
23908			if err := awsRestjson1_deserializeDocumentColumnList(&sv.Columns, value); err != nil {
23909				return err
23910			}
23911
23912		case "CountryCode":
23913			if value != nil {
23914				jtv, ok := value.(string)
23915				if !ok {
23916					return fmt.Errorf("expected GeoSpatialCountryCode to be of type string, got %T instead", value)
23917				}
23918				sv.CountryCode = types.GeoSpatialCountryCode(jtv)
23919			}
23920
23921		case "Name":
23922			if value != nil {
23923				jtv, ok := value.(string)
23924				if !ok {
23925					return fmt.Errorf("expected ColumnGroupName to be of type string, got %T instead", value)
23926				}
23927				sv.Name = ptr.String(jtv)
23928			}
23929
23930		default:
23931			_, _ = key, value
23932
23933		}
23934	}
23935	*v = sv
23936	return nil
23937}
23938
23939func awsRestjson1_deserializeDocumentGroup(v **types.Group, value interface{}) error {
23940	if v == nil {
23941		return fmt.Errorf("unexpected nil of type %T", v)
23942	}
23943	if value == nil {
23944		return nil
23945	}
23946
23947	shape, ok := value.(map[string]interface{})
23948	if !ok {
23949		return fmt.Errorf("unexpected JSON type %v", value)
23950	}
23951
23952	var sv *types.Group
23953	if *v == nil {
23954		sv = &types.Group{}
23955	} else {
23956		sv = *v
23957	}
23958
23959	for key, value := range shape {
23960		switch key {
23961		case "Arn":
23962			if value != nil {
23963				jtv, ok := value.(string)
23964				if !ok {
23965					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
23966				}
23967				sv.Arn = ptr.String(jtv)
23968			}
23969
23970		case "Description":
23971			if value != nil {
23972				jtv, ok := value.(string)
23973				if !ok {
23974					return fmt.Errorf("expected GroupDescription to be of type string, got %T instead", value)
23975				}
23976				sv.Description = ptr.String(jtv)
23977			}
23978
23979		case "GroupName":
23980			if value != nil {
23981				jtv, ok := value.(string)
23982				if !ok {
23983					return fmt.Errorf("expected GroupName to be of type string, got %T instead", value)
23984				}
23985				sv.GroupName = ptr.String(jtv)
23986			}
23987
23988		case "PrincipalId":
23989			if value != nil {
23990				jtv, ok := value.(string)
23991				if !ok {
23992					return fmt.Errorf("expected String to be of type string, got %T instead", value)
23993				}
23994				sv.PrincipalId = ptr.String(jtv)
23995			}
23996
23997		default:
23998			_, _ = key, value
23999
24000		}
24001	}
24002	*v = sv
24003	return nil
24004}
24005
24006func awsRestjson1_deserializeDocumentGroupList(v *[]types.Group, value interface{}) error {
24007	if v == nil {
24008		return fmt.Errorf("unexpected nil of type %T", v)
24009	}
24010	if value == nil {
24011		return nil
24012	}
24013
24014	shape, ok := value.([]interface{})
24015	if !ok {
24016		return fmt.Errorf("unexpected JSON type %v", value)
24017	}
24018
24019	var cv []types.Group
24020	if *v == nil {
24021		cv = []types.Group{}
24022	} else {
24023		cv = *v
24024	}
24025
24026	for _, value := range shape {
24027		var col types.Group
24028		destAddr := &col
24029		if err := awsRestjson1_deserializeDocumentGroup(&destAddr, value); err != nil {
24030			return err
24031		}
24032		col = *destAddr
24033		cv = append(cv, col)
24034
24035	}
24036	*v = cv
24037	return nil
24038}
24039
24040func awsRestjson1_deserializeDocumentGroupMember(v **types.GroupMember, value interface{}) error {
24041	if v == nil {
24042		return fmt.Errorf("unexpected nil of type %T", v)
24043	}
24044	if value == nil {
24045		return nil
24046	}
24047
24048	shape, ok := value.(map[string]interface{})
24049	if !ok {
24050		return fmt.Errorf("unexpected JSON type %v", value)
24051	}
24052
24053	var sv *types.GroupMember
24054	if *v == nil {
24055		sv = &types.GroupMember{}
24056	} else {
24057		sv = *v
24058	}
24059
24060	for key, value := range shape {
24061		switch key {
24062		case "Arn":
24063			if value != nil {
24064				jtv, ok := value.(string)
24065				if !ok {
24066					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
24067				}
24068				sv.Arn = ptr.String(jtv)
24069			}
24070
24071		case "MemberName":
24072			if value != nil {
24073				jtv, ok := value.(string)
24074				if !ok {
24075					return fmt.Errorf("expected GroupMemberName to be of type string, got %T instead", value)
24076				}
24077				sv.MemberName = ptr.String(jtv)
24078			}
24079
24080		default:
24081			_, _ = key, value
24082
24083		}
24084	}
24085	*v = sv
24086	return nil
24087}
24088
24089func awsRestjson1_deserializeDocumentGroupMemberList(v *[]types.GroupMember, value interface{}) error {
24090	if v == nil {
24091		return fmt.Errorf("unexpected nil of type %T", v)
24092	}
24093	if value == nil {
24094		return nil
24095	}
24096
24097	shape, ok := value.([]interface{})
24098	if !ok {
24099		return fmt.Errorf("unexpected JSON type %v", value)
24100	}
24101
24102	var cv []types.GroupMember
24103	if *v == nil {
24104		cv = []types.GroupMember{}
24105	} else {
24106		cv = *v
24107	}
24108
24109	for _, value := range shape {
24110		var col types.GroupMember
24111		destAddr := &col
24112		if err := awsRestjson1_deserializeDocumentGroupMember(&destAddr, value); err != nil {
24113			return err
24114		}
24115		col = *destAddr
24116		cv = append(cv, col)
24117
24118	}
24119	*v = cv
24120	return nil
24121}
24122
24123func awsRestjson1_deserializeDocumentGutterStyle(v **types.GutterStyle, value interface{}) error {
24124	if v == nil {
24125		return fmt.Errorf("unexpected nil of type %T", v)
24126	}
24127	if value == nil {
24128		return nil
24129	}
24130
24131	shape, ok := value.(map[string]interface{})
24132	if !ok {
24133		return fmt.Errorf("unexpected JSON type %v", value)
24134	}
24135
24136	var sv *types.GutterStyle
24137	if *v == nil {
24138		sv = &types.GutterStyle{}
24139	} else {
24140		sv = *v
24141	}
24142
24143	for key, value := range shape {
24144		switch key {
24145		case "Show":
24146			if value != nil {
24147				jtv, ok := value.(bool)
24148				if !ok {
24149					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
24150				}
24151				sv.Show = jtv
24152			}
24153
24154		default:
24155			_, _ = key, value
24156
24157		}
24158	}
24159	*v = sv
24160	return nil
24161}
24162
24163func awsRestjson1_deserializeDocumentIAMPolicyAssignment(v **types.IAMPolicyAssignment, value interface{}) error {
24164	if v == nil {
24165		return fmt.Errorf("unexpected nil of type %T", v)
24166	}
24167	if value == nil {
24168		return nil
24169	}
24170
24171	shape, ok := value.(map[string]interface{})
24172	if !ok {
24173		return fmt.Errorf("unexpected JSON type %v", value)
24174	}
24175
24176	var sv *types.IAMPolicyAssignment
24177	if *v == nil {
24178		sv = &types.IAMPolicyAssignment{}
24179	} else {
24180		sv = *v
24181	}
24182
24183	for key, value := range shape {
24184		switch key {
24185		case "AssignmentId":
24186			if value != nil {
24187				jtv, ok := value.(string)
24188				if !ok {
24189					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24190				}
24191				sv.AssignmentId = ptr.String(jtv)
24192			}
24193
24194		case "AssignmentName":
24195			if value != nil {
24196				jtv, ok := value.(string)
24197				if !ok {
24198					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
24199				}
24200				sv.AssignmentName = ptr.String(jtv)
24201			}
24202
24203		case "AssignmentStatus":
24204			if value != nil {
24205				jtv, ok := value.(string)
24206				if !ok {
24207					return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value)
24208				}
24209				sv.AssignmentStatus = types.AssignmentStatus(jtv)
24210			}
24211
24212		case "AwsAccountId":
24213			if value != nil {
24214				jtv, ok := value.(string)
24215				if !ok {
24216					return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
24217				}
24218				sv.AwsAccountId = ptr.String(jtv)
24219			}
24220
24221		case "Identities":
24222			if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil {
24223				return err
24224			}
24225
24226		case "PolicyArn":
24227			if value != nil {
24228				jtv, ok := value.(string)
24229				if !ok {
24230					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
24231				}
24232				sv.PolicyArn = ptr.String(jtv)
24233			}
24234
24235		default:
24236			_, _ = key, value
24237
24238		}
24239	}
24240	*v = sv
24241	return nil
24242}
24243
24244func awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummary(v **types.IAMPolicyAssignmentSummary, value interface{}) error {
24245	if v == nil {
24246		return fmt.Errorf("unexpected nil of type %T", v)
24247	}
24248	if value == nil {
24249		return nil
24250	}
24251
24252	shape, ok := value.(map[string]interface{})
24253	if !ok {
24254		return fmt.Errorf("unexpected JSON type %v", value)
24255	}
24256
24257	var sv *types.IAMPolicyAssignmentSummary
24258	if *v == nil {
24259		sv = &types.IAMPolicyAssignmentSummary{}
24260	} else {
24261		sv = *v
24262	}
24263
24264	for key, value := range shape {
24265		switch key {
24266		case "AssignmentName":
24267			if value != nil {
24268				jtv, ok := value.(string)
24269				if !ok {
24270					return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value)
24271				}
24272				sv.AssignmentName = ptr.String(jtv)
24273			}
24274
24275		case "AssignmentStatus":
24276			if value != nil {
24277				jtv, ok := value.(string)
24278				if !ok {
24279					return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value)
24280				}
24281				sv.AssignmentStatus = types.AssignmentStatus(jtv)
24282			}
24283
24284		default:
24285			_, _ = key, value
24286
24287		}
24288	}
24289	*v = sv
24290	return nil
24291}
24292
24293func awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummaryList(v *[]types.IAMPolicyAssignmentSummary, value interface{}) error {
24294	if v == nil {
24295		return fmt.Errorf("unexpected nil of type %T", v)
24296	}
24297	if value == nil {
24298		return nil
24299	}
24300
24301	shape, ok := value.([]interface{})
24302	if !ok {
24303		return fmt.Errorf("unexpected JSON type %v", value)
24304	}
24305
24306	var cv []types.IAMPolicyAssignmentSummary
24307	if *v == nil {
24308		cv = []types.IAMPolicyAssignmentSummary{}
24309	} else {
24310		cv = *v
24311	}
24312
24313	for _, value := range shape {
24314		var col types.IAMPolicyAssignmentSummary
24315		destAddr := &col
24316		if err := awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummary(&destAddr, value); err != nil {
24317			return err
24318		}
24319		col = *destAddr
24320		cv = append(cv, col)
24321
24322	}
24323	*v = cv
24324	return nil
24325}
24326
24327func awsRestjson1_deserializeDocumentIdentityMap(v *map[string][]string, value interface{}) error {
24328	if v == nil {
24329		return fmt.Errorf("unexpected nil of type %T", v)
24330	}
24331	if value == nil {
24332		return nil
24333	}
24334
24335	shape, ok := value.(map[string]interface{})
24336	if !ok {
24337		return fmt.Errorf("unexpected JSON type %v", value)
24338	}
24339
24340	var mv map[string][]string
24341	if *v == nil {
24342		mv = map[string][]string{}
24343	} else {
24344		mv = *v
24345	}
24346
24347	for key, value := range shape {
24348		var parsedVal []string
24349		mapVar := parsedVal
24350		if err := awsRestjson1_deserializeDocumentIdentityNameList(&mapVar, value); err != nil {
24351			return err
24352		}
24353		parsedVal = mapVar
24354		mv[key] = parsedVal
24355
24356	}
24357	*v = mv
24358	return nil
24359}
24360
24361func awsRestjson1_deserializeDocumentIdentityNameList(v *[]string, value interface{}) error {
24362	if v == nil {
24363		return fmt.Errorf("unexpected nil of type %T", v)
24364	}
24365	if value == nil {
24366		return nil
24367	}
24368
24369	shape, ok := value.([]interface{})
24370	if !ok {
24371		return fmt.Errorf("unexpected JSON type %v", value)
24372	}
24373
24374	var cv []string
24375	if *v == nil {
24376		cv = []string{}
24377	} else {
24378		cv = *v
24379	}
24380
24381	for _, value := range shape {
24382		var col string
24383		if value != nil {
24384			jtv, ok := value.(string)
24385			if !ok {
24386				return fmt.Errorf("expected IdentityName to be of type string, got %T instead", value)
24387			}
24388			col = jtv
24389		}
24390		cv = append(cv, col)
24391
24392	}
24393	*v = cv
24394	return nil
24395}
24396
24397func awsRestjson1_deserializeDocumentIdentityTypeNotSupportedException(v **types.IdentityTypeNotSupportedException, value interface{}) error {
24398	if v == nil {
24399		return fmt.Errorf("unexpected nil of type %T", v)
24400	}
24401	if value == nil {
24402		return nil
24403	}
24404
24405	shape, ok := value.(map[string]interface{})
24406	if !ok {
24407		return fmt.Errorf("unexpected JSON type %v", value)
24408	}
24409
24410	var sv *types.IdentityTypeNotSupportedException
24411	if *v == nil {
24412		sv = &types.IdentityTypeNotSupportedException{}
24413	} else {
24414		sv = *v
24415	}
24416
24417	for key, value := range shape {
24418		switch key {
24419		case "Message":
24420			if value != nil {
24421				jtv, ok := value.(string)
24422				if !ok {
24423					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24424				}
24425				sv.Message = ptr.String(jtv)
24426			}
24427
24428		case "RequestId":
24429			if value != nil {
24430				jtv, ok := value.(string)
24431				if !ok {
24432					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24433				}
24434				sv.RequestId = ptr.String(jtv)
24435			}
24436
24437		default:
24438			_, _ = key, value
24439
24440		}
24441	}
24442	*v = sv
24443	return nil
24444}
24445
24446func awsRestjson1_deserializeDocumentIngestion(v **types.Ingestion, value interface{}) error {
24447	if v == nil {
24448		return fmt.Errorf("unexpected nil of type %T", v)
24449	}
24450	if value == nil {
24451		return nil
24452	}
24453
24454	shape, ok := value.(map[string]interface{})
24455	if !ok {
24456		return fmt.Errorf("unexpected JSON type %v", value)
24457	}
24458
24459	var sv *types.Ingestion
24460	if *v == nil {
24461		sv = &types.Ingestion{}
24462	} else {
24463		sv = *v
24464	}
24465
24466	for key, value := range shape {
24467		switch key {
24468		case "Arn":
24469			if value != nil {
24470				jtv, ok := value.(string)
24471				if !ok {
24472					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
24473				}
24474				sv.Arn = ptr.String(jtv)
24475			}
24476
24477		case "CreatedTime":
24478			if value != nil {
24479				jtv, ok := value.(json.Number)
24480				if !ok {
24481					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
24482				}
24483				f64, err := jtv.Float64()
24484				if err != nil {
24485					return err
24486				}
24487				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
24488			}
24489
24490		case "ErrorInfo":
24491			if err := awsRestjson1_deserializeDocumentErrorInfo(&sv.ErrorInfo, value); err != nil {
24492				return err
24493			}
24494
24495		case "IngestionId":
24496			if value != nil {
24497				jtv, ok := value.(string)
24498				if !ok {
24499					return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value)
24500				}
24501				sv.IngestionId = ptr.String(jtv)
24502			}
24503
24504		case "IngestionSizeInBytes":
24505			if value != nil {
24506				jtv, ok := value.(json.Number)
24507				if !ok {
24508					return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
24509				}
24510				i64, err := jtv.Int64()
24511				if err != nil {
24512					return err
24513				}
24514				sv.IngestionSizeInBytes = i64
24515			}
24516
24517		case "IngestionStatus":
24518			if value != nil {
24519				jtv, ok := value.(string)
24520				if !ok {
24521					return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value)
24522				}
24523				sv.IngestionStatus = types.IngestionStatus(jtv)
24524			}
24525
24526		case "IngestionTimeInSeconds":
24527			if value != nil {
24528				jtv, ok := value.(json.Number)
24529				if !ok {
24530					return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
24531				}
24532				i64, err := jtv.Int64()
24533				if err != nil {
24534					return err
24535				}
24536				sv.IngestionTimeInSeconds = i64
24537			}
24538
24539		case "QueueInfo":
24540			if err := awsRestjson1_deserializeDocumentQueueInfo(&sv.QueueInfo, value); err != nil {
24541				return err
24542			}
24543
24544		case "RequestSource":
24545			if value != nil {
24546				jtv, ok := value.(string)
24547				if !ok {
24548					return fmt.Errorf("expected IngestionRequestSource to be of type string, got %T instead", value)
24549				}
24550				sv.RequestSource = types.IngestionRequestSource(jtv)
24551			}
24552
24553		case "RequestType":
24554			if value != nil {
24555				jtv, ok := value.(string)
24556				if !ok {
24557					return fmt.Errorf("expected IngestionRequestType to be of type string, got %T instead", value)
24558				}
24559				sv.RequestType = types.IngestionRequestType(jtv)
24560			}
24561
24562		case "RowInfo":
24563			if err := awsRestjson1_deserializeDocumentRowInfo(&sv.RowInfo, value); err != nil {
24564				return err
24565			}
24566
24567		default:
24568			_, _ = key, value
24569
24570		}
24571	}
24572	*v = sv
24573	return nil
24574}
24575
24576func awsRestjson1_deserializeDocumentIngestions(v *[]types.Ingestion, value interface{}) error {
24577	if v == nil {
24578		return fmt.Errorf("unexpected nil of type %T", v)
24579	}
24580	if value == nil {
24581		return nil
24582	}
24583
24584	shape, ok := value.([]interface{})
24585	if !ok {
24586		return fmt.Errorf("unexpected JSON type %v", value)
24587	}
24588
24589	var cv []types.Ingestion
24590	if *v == nil {
24591		cv = []types.Ingestion{}
24592	} else {
24593		cv = *v
24594	}
24595
24596	for _, value := range shape {
24597		var col types.Ingestion
24598		destAddr := &col
24599		if err := awsRestjson1_deserializeDocumentIngestion(&destAddr, value); err != nil {
24600			return err
24601		}
24602		col = *destAddr
24603		cv = append(cv, col)
24604
24605	}
24606	*v = cv
24607	return nil
24608}
24609
24610func awsRestjson1_deserializeDocumentInputColumn(v **types.InputColumn, value interface{}) error {
24611	if v == nil {
24612		return fmt.Errorf("unexpected nil of type %T", v)
24613	}
24614	if value == nil {
24615		return nil
24616	}
24617
24618	shape, ok := value.(map[string]interface{})
24619	if !ok {
24620		return fmt.Errorf("unexpected JSON type %v", value)
24621	}
24622
24623	var sv *types.InputColumn
24624	if *v == nil {
24625		sv = &types.InputColumn{}
24626	} else {
24627		sv = *v
24628	}
24629
24630	for key, value := range shape {
24631		switch key {
24632		case "Name":
24633			if value != nil {
24634				jtv, ok := value.(string)
24635				if !ok {
24636					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
24637				}
24638				sv.Name = ptr.String(jtv)
24639			}
24640
24641		case "Type":
24642			if value != nil {
24643				jtv, ok := value.(string)
24644				if !ok {
24645					return fmt.Errorf("expected InputColumnDataType to be of type string, got %T instead", value)
24646				}
24647				sv.Type = types.InputColumnDataType(jtv)
24648			}
24649
24650		default:
24651			_, _ = key, value
24652
24653		}
24654	}
24655	*v = sv
24656	return nil
24657}
24658
24659func awsRestjson1_deserializeDocumentInputColumnList(v *[]types.InputColumn, value interface{}) error {
24660	if v == nil {
24661		return fmt.Errorf("unexpected nil of type %T", v)
24662	}
24663	if value == nil {
24664		return nil
24665	}
24666
24667	shape, ok := value.([]interface{})
24668	if !ok {
24669		return fmt.Errorf("unexpected JSON type %v", value)
24670	}
24671
24672	var cv []types.InputColumn
24673	if *v == nil {
24674		cv = []types.InputColumn{}
24675	} else {
24676		cv = *v
24677	}
24678
24679	for _, value := range shape {
24680		var col types.InputColumn
24681		destAddr := &col
24682		if err := awsRestjson1_deserializeDocumentInputColumn(&destAddr, value); err != nil {
24683			return err
24684		}
24685		col = *destAddr
24686		cv = append(cv, col)
24687
24688	}
24689	*v = cv
24690	return nil
24691}
24692
24693func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error {
24694	if v == nil {
24695		return fmt.Errorf("unexpected nil of type %T", v)
24696	}
24697	if value == nil {
24698		return nil
24699	}
24700
24701	shape, ok := value.(map[string]interface{})
24702	if !ok {
24703		return fmt.Errorf("unexpected JSON type %v", value)
24704	}
24705
24706	var sv *types.InternalFailureException
24707	if *v == nil {
24708		sv = &types.InternalFailureException{}
24709	} else {
24710		sv = *v
24711	}
24712
24713	for key, value := range shape {
24714		switch key {
24715		case "Message":
24716			if value != nil {
24717				jtv, ok := value.(string)
24718				if !ok {
24719					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24720				}
24721				sv.Message = ptr.String(jtv)
24722			}
24723
24724		case "RequestId":
24725			if value != nil {
24726				jtv, ok := value.(string)
24727				if !ok {
24728					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24729				}
24730				sv.RequestId = ptr.String(jtv)
24731			}
24732
24733		default:
24734			_, _ = key, value
24735
24736		}
24737	}
24738	*v = sv
24739	return nil
24740}
24741
24742func awsRestjson1_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error {
24743	if v == nil {
24744		return fmt.Errorf("unexpected nil of type %T", v)
24745	}
24746	if value == nil {
24747		return nil
24748	}
24749
24750	shape, ok := value.(map[string]interface{})
24751	if !ok {
24752		return fmt.Errorf("unexpected JSON type %v", value)
24753	}
24754
24755	var sv *types.InvalidNextTokenException
24756	if *v == nil {
24757		sv = &types.InvalidNextTokenException{}
24758	} else {
24759		sv = *v
24760	}
24761
24762	for key, value := range shape {
24763		switch key {
24764		case "Message":
24765			if value != nil {
24766				jtv, ok := value.(string)
24767				if !ok {
24768					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24769				}
24770				sv.Message = ptr.String(jtv)
24771			}
24772
24773		case "RequestId":
24774			if value != nil {
24775				jtv, ok := value.(string)
24776				if !ok {
24777					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24778				}
24779				sv.RequestId = ptr.String(jtv)
24780			}
24781
24782		default:
24783			_, _ = key, value
24784
24785		}
24786	}
24787	*v = sv
24788	return nil
24789}
24790
24791func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error {
24792	if v == nil {
24793		return fmt.Errorf("unexpected nil of type %T", v)
24794	}
24795	if value == nil {
24796		return nil
24797	}
24798
24799	shape, ok := value.(map[string]interface{})
24800	if !ok {
24801		return fmt.Errorf("unexpected JSON type %v", value)
24802	}
24803
24804	var sv *types.InvalidParameterValueException
24805	if *v == nil {
24806		sv = &types.InvalidParameterValueException{}
24807	} else {
24808		sv = *v
24809	}
24810
24811	for key, value := range shape {
24812		switch key {
24813		case "Message":
24814			if value != nil {
24815				jtv, ok := value.(string)
24816				if !ok {
24817					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24818				}
24819				sv.Message = ptr.String(jtv)
24820			}
24821
24822		case "RequestId":
24823			if value != nil {
24824				jtv, ok := value.(string)
24825				if !ok {
24826					return fmt.Errorf("expected String to be of type string, got %T instead", value)
24827				}
24828				sv.RequestId = ptr.String(jtv)
24829			}
24830
24831		default:
24832			_, _ = key, value
24833
24834		}
24835	}
24836	*v = sv
24837	return nil
24838}
24839
24840func awsRestjson1_deserializeDocumentJiraParameters(v **types.JiraParameters, value interface{}) error {
24841	if v == nil {
24842		return fmt.Errorf("unexpected nil of type %T", v)
24843	}
24844	if value == nil {
24845		return nil
24846	}
24847
24848	shape, ok := value.(map[string]interface{})
24849	if !ok {
24850		return fmt.Errorf("unexpected JSON type %v", value)
24851	}
24852
24853	var sv *types.JiraParameters
24854	if *v == nil {
24855		sv = &types.JiraParameters{}
24856	} else {
24857		sv = *v
24858	}
24859
24860	for key, value := range shape {
24861		switch key {
24862		case "SiteBaseUrl":
24863			if value != nil {
24864				jtv, ok := value.(string)
24865				if !ok {
24866					return fmt.Errorf("expected SiteBaseUrl to be of type string, got %T instead", value)
24867				}
24868				sv.SiteBaseUrl = ptr.String(jtv)
24869			}
24870
24871		default:
24872			_, _ = key, value
24873
24874		}
24875	}
24876	*v = sv
24877	return nil
24878}
24879
24880func awsRestjson1_deserializeDocumentJoinInstruction(v **types.JoinInstruction, value interface{}) error {
24881	if v == nil {
24882		return fmt.Errorf("unexpected nil of type %T", v)
24883	}
24884	if value == nil {
24885		return nil
24886	}
24887
24888	shape, ok := value.(map[string]interface{})
24889	if !ok {
24890		return fmt.Errorf("unexpected JSON type %v", value)
24891	}
24892
24893	var sv *types.JoinInstruction
24894	if *v == nil {
24895		sv = &types.JoinInstruction{}
24896	} else {
24897		sv = *v
24898	}
24899
24900	for key, value := range shape {
24901		switch key {
24902		case "LeftJoinKeyProperties":
24903			if err := awsRestjson1_deserializeDocumentJoinKeyProperties(&sv.LeftJoinKeyProperties, value); err != nil {
24904				return err
24905			}
24906
24907		case "LeftOperand":
24908			if value != nil {
24909				jtv, ok := value.(string)
24910				if !ok {
24911					return fmt.Errorf("expected LogicalTableId to be of type string, got %T instead", value)
24912				}
24913				sv.LeftOperand = ptr.String(jtv)
24914			}
24915
24916		case "OnClause":
24917			if value != nil {
24918				jtv, ok := value.(string)
24919				if !ok {
24920					return fmt.Errorf("expected OnClause to be of type string, got %T instead", value)
24921				}
24922				sv.OnClause = ptr.String(jtv)
24923			}
24924
24925		case "RightJoinKeyProperties":
24926			if err := awsRestjson1_deserializeDocumentJoinKeyProperties(&sv.RightJoinKeyProperties, value); err != nil {
24927				return err
24928			}
24929
24930		case "RightOperand":
24931			if value != nil {
24932				jtv, ok := value.(string)
24933				if !ok {
24934					return fmt.Errorf("expected LogicalTableId to be of type string, got %T instead", value)
24935				}
24936				sv.RightOperand = ptr.String(jtv)
24937			}
24938
24939		case "Type":
24940			if value != nil {
24941				jtv, ok := value.(string)
24942				if !ok {
24943					return fmt.Errorf("expected JoinType to be of type string, got %T instead", value)
24944				}
24945				sv.Type = types.JoinType(jtv)
24946			}
24947
24948		default:
24949			_, _ = key, value
24950
24951		}
24952	}
24953	*v = sv
24954	return nil
24955}
24956
24957func awsRestjson1_deserializeDocumentJoinKeyProperties(v **types.JoinKeyProperties, value interface{}) error {
24958	if v == nil {
24959		return fmt.Errorf("unexpected nil of type %T", v)
24960	}
24961	if value == nil {
24962		return nil
24963	}
24964
24965	shape, ok := value.(map[string]interface{})
24966	if !ok {
24967		return fmt.Errorf("unexpected JSON type %v", value)
24968	}
24969
24970	var sv *types.JoinKeyProperties
24971	if *v == nil {
24972		sv = &types.JoinKeyProperties{}
24973	} else {
24974		sv = *v
24975	}
24976
24977	for key, value := range shape {
24978		switch key {
24979		case "UniqueKey":
24980			if value != nil {
24981				jtv, ok := value.(bool)
24982				if !ok {
24983					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
24984				}
24985				sv.UniqueKey = jtv
24986			}
24987
24988		default:
24989			_, _ = key, value
24990
24991		}
24992	}
24993	*v = sv
24994	return nil
24995}
24996
24997func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
24998	if v == nil {
24999		return fmt.Errorf("unexpected nil of type %T", v)
25000	}
25001	if value == nil {
25002		return nil
25003	}
25004
25005	shape, ok := value.(map[string]interface{})
25006	if !ok {
25007		return fmt.Errorf("unexpected JSON type %v", value)
25008	}
25009
25010	var sv *types.LimitExceededException
25011	if *v == nil {
25012		sv = &types.LimitExceededException{}
25013	} else {
25014		sv = *v
25015	}
25016
25017	for key, value := range shape {
25018		switch key {
25019		case "Message":
25020			if value != nil {
25021				jtv, ok := value.(string)
25022				if !ok {
25023					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25024				}
25025				sv.Message = ptr.String(jtv)
25026			}
25027
25028		case "RequestId":
25029			if value != nil {
25030				jtv, ok := value.(string)
25031				if !ok {
25032					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25033				}
25034				sv.RequestId = ptr.String(jtv)
25035			}
25036
25037		case "ResourceType":
25038			if value != nil {
25039				jtv, ok := value.(string)
25040				if !ok {
25041					return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value)
25042				}
25043				sv.ResourceType = types.ExceptionResourceType(jtv)
25044			}
25045
25046		default:
25047			_, _ = key, value
25048
25049		}
25050	}
25051	*v = sv
25052	return nil
25053}
25054
25055func awsRestjson1_deserializeDocumentLogicalTable(v **types.LogicalTable, value interface{}) error {
25056	if v == nil {
25057		return fmt.Errorf("unexpected nil of type %T", v)
25058	}
25059	if value == nil {
25060		return nil
25061	}
25062
25063	shape, ok := value.(map[string]interface{})
25064	if !ok {
25065		return fmt.Errorf("unexpected JSON type %v", value)
25066	}
25067
25068	var sv *types.LogicalTable
25069	if *v == nil {
25070		sv = &types.LogicalTable{}
25071	} else {
25072		sv = *v
25073	}
25074
25075	for key, value := range shape {
25076		switch key {
25077		case "Alias":
25078			if value != nil {
25079				jtv, ok := value.(string)
25080				if !ok {
25081					return fmt.Errorf("expected LogicalTableAlias to be of type string, got %T instead", value)
25082				}
25083				sv.Alias = ptr.String(jtv)
25084			}
25085
25086		case "DataTransforms":
25087			if err := awsRestjson1_deserializeDocumentTransformOperationList(&sv.DataTransforms, value); err != nil {
25088				return err
25089			}
25090
25091		case "Source":
25092			if err := awsRestjson1_deserializeDocumentLogicalTableSource(&sv.Source, value); err != nil {
25093				return err
25094			}
25095
25096		default:
25097			_, _ = key, value
25098
25099		}
25100	}
25101	*v = sv
25102	return nil
25103}
25104
25105func awsRestjson1_deserializeDocumentLogicalTableMap(v *map[string]types.LogicalTable, value interface{}) error {
25106	if v == nil {
25107		return fmt.Errorf("unexpected nil of type %T", v)
25108	}
25109	if value == nil {
25110		return nil
25111	}
25112
25113	shape, ok := value.(map[string]interface{})
25114	if !ok {
25115		return fmt.Errorf("unexpected JSON type %v", value)
25116	}
25117
25118	var mv map[string]types.LogicalTable
25119	if *v == nil {
25120		mv = map[string]types.LogicalTable{}
25121	} else {
25122		mv = *v
25123	}
25124
25125	for key, value := range shape {
25126		var parsedVal types.LogicalTable
25127		mapVar := parsedVal
25128		destAddr := &mapVar
25129		if err := awsRestjson1_deserializeDocumentLogicalTable(&destAddr, value); err != nil {
25130			return err
25131		}
25132		parsedVal = *destAddr
25133		mv[key] = parsedVal
25134
25135	}
25136	*v = mv
25137	return nil
25138}
25139
25140func awsRestjson1_deserializeDocumentLogicalTableSource(v **types.LogicalTableSource, value interface{}) error {
25141	if v == nil {
25142		return fmt.Errorf("unexpected nil of type %T", v)
25143	}
25144	if value == nil {
25145		return nil
25146	}
25147
25148	shape, ok := value.(map[string]interface{})
25149	if !ok {
25150		return fmt.Errorf("unexpected JSON type %v", value)
25151	}
25152
25153	var sv *types.LogicalTableSource
25154	if *v == nil {
25155		sv = &types.LogicalTableSource{}
25156	} else {
25157		sv = *v
25158	}
25159
25160	for key, value := range shape {
25161		switch key {
25162		case "JoinInstruction":
25163			if err := awsRestjson1_deserializeDocumentJoinInstruction(&sv.JoinInstruction, value); err != nil {
25164				return err
25165			}
25166
25167		case "PhysicalTableId":
25168			if value != nil {
25169				jtv, ok := value.(string)
25170				if !ok {
25171					return fmt.Errorf("expected PhysicalTableId to be of type string, got %T instead", value)
25172				}
25173				sv.PhysicalTableId = ptr.String(jtv)
25174			}
25175
25176		default:
25177			_, _ = key, value
25178
25179		}
25180	}
25181	*v = sv
25182	return nil
25183}
25184
25185func awsRestjson1_deserializeDocumentManifestFileLocation(v **types.ManifestFileLocation, value interface{}) error {
25186	if v == nil {
25187		return fmt.Errorf("unexpected nil of type %T", v)
25188	}
25189	if value == nil {
25190		return nil
25191	}
25192
25193	shape, ok := value.(map[string]interface{})
25194	if !ok {
25195		return fmt.Errorf("unexpected JSON type %v", value)
25196	}
25197
25198	var sv *types.ManifestFileLocation
25199	if *v == nil {
25200		sv = &types.ManifestFileLocation{}
25201	} else {
25202		sv = *v
25203	}
25204
25205	for key, value := range shape {
25206		switch key {
25207		case "Bucket":
25208			if value != nil {
25209				jtv, ok := value.(string)
25210				if !ok {
25211					return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value)
25212				}
25213				sv.Bucket = ptr.String(jtv)
25214			}
25215
25216		case "Key":
25217			if value != nil {
25218				jtv, ok := value.(string)
25219				if !ok {
25220					return fmt.Errorf("expected S3Key to be of type string, got %T instead", value)
25221				}
25222				sv.Key = ptr.String(jtv)
25223			}
25224
25225		default:
25226			_, _ = key, value
25227
25228		}
25229	}
25230	*v = sv
25231	return nil
25232}
25233
25234func awsRestjson1_deserializeDocumentMarginStyle(v **types.MarginStyle, value interface{}) error {
25235	if v == nil {
25236		return fmt.Errorf("unexpected nil of type %T", v)
25237	}
25238	if value == nil {
25239		return nil
25240	}
25241
25242	shape, ok := value.(map[string]interface{})
25243	if !ok {
25244		return fmt.Errorf("unexpected JSON type %v", value)
25245	}
25246
25247	var sv *types.MarginStyle
25248	if *v == nil {
25249		sv = &types.MarginStyle{}
25250	} else {
25251		sv = *v
25252	}
25253
25254	for key, value := range shape {
25255		switch key {
25256		case "Show":
25257			if value != nil {
25258				jtv, ok := value.(bool)
25259				if !ok {
25260					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
25261				}
25262				sv.Show = jtv
25263			}
25264
25265		default:
25266			_, _ = key, value
25267
25268		}
25269	}
25270	*v = sv
25271	return nil
25272}
25273
25274func awsRestjson1_deserializeDocumentMariaDbParameters(v **types.MariaDbParameters, value interface{}) error {
25275	if v == nil {
25276		return fmt.Errorf("unexpected nil of type %T", v)
25277	}
25278	if value == nil {
25279		return nil
25280	}
25281
25282	shape, ok := value.(map[string]interface{})
25283	if !ok {
25284		return fmt.Errorf("unexpected JSON type %v", value)
25285	}
25286
25287	var sv *types.MariaDbParameters
25288	if *v == nil {
25289		sv = &types.MariaDbParameters{}
25290	} else {
25291		sv = *v
25292	}
25293
25294	for key, value := range shape {
25295		switch key {
25296		case "Database":
25297			if value != nil {
25298				jtv, ok := value.(string)
25299				if !ok {
25300					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
25301				}
25302				sv.Database = ptr.String(jtv)
25303			}
25304
25305		case "Host":
25306			if value != nil {
25307				jtv, ok := value.(string)
25308				if !ok {
25309					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
25310				}
25311				sv.Host = ptr.String(jtv)
25312			}
25313
25314		case "Port":
25315			if value != nil {
25316				jtv, ok := value.(json.Number)
25317				if !ok {
25318					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
25319				}
25320				i64, err := jtv.Int64()
25321				if err != nil {
25322					return err
25323				}
25324				sv.Port = int32(i64)
25325			}
25326
25327		default:
25328			_, _ = key, value
25329
25330		}
25331	}
25332	*v = sv
25333	return nil
25334}
25335
25336func awsRestjson1_deserializeDocumentMySqlParameters(v **types.MySqlParameters, value interface{}) error {
25337	if v == nil {
25338		return fmt.Errorf("unexpected nil of type %T", v)
25339	}
25340	if value == nil {
25341		return nil
25342	}
25343
25344	shape, ok := value.(map[string]interface{})
25345	if !ok {
25346		return fmt.Errorf("unexpected JSON type %v", value)
25347	}
25348
25349	var sv *types.MySqlParameters
25350	if *v == nil {
25351		sv = &types.MySqlParameters{}
25352	} else {
25353		sv = *v
25354	}
25355
25356	for key, value := range shape {
25357		switch key {
25358		case "Database":
25359			if value != nil {
25360				jtv, ok := value.(string)
25361				if !ok {
25362					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
25363				}
25364				sv.Database = ptr.String(jtv)
25365			}
25366
25367		case "Host":
25368			if value != nil {
25369				jtv, ok := value.(string)
25370				if !ok {
25371					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
25372				}
25373				sv.Host = ptr.String(jtv)
25374			}
25375
25376		case "Port":
25377			if value != nil {
25378				jtv, ok := value.(json.Number)
25379				if !ok {
25380					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
25381				}
25382				i64, err := jtv.Int64()
25383				if err != nil {
25384					return err
25385				}
25386				sv.Port = int32(i64)
25387			}
25388
25389		default:
25390			_, _ = key, value
25391
25392		}
25393	}
25394	*v = sv
25395	return nil
25396}
25397
25398func awsRestjson1_deserializeDocumentNamespaceError(v **types.NamespaceError, value interface{}) error {
25399	if v == nil {
25400		return fmt.Errorf("unexpected nil of type %T", v)
25401	}
25402	if value == nil {
25403		return nil
25404	}
25405
25406	shape, ok := value.(map[string]interface{})
25407	if !ok {
25408		return fmt.Errorf("unexpected JSON type %v", value)
25409	}
25410
25411	var sv *types.NamespaceError
25412	if *v == nil {
25413		sv = &types.NamespaceError{}
25414	} else {
25415		sv = *v
25416	}
25417
25418	for key, value := range shape {
25419		switch key {
25420		case "Message":
25421			if value != nil {
25422				jtv, ok := value.(string)
25423				if !ok {
25424					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25425				}
25426				sv.Message = ptr.String(jtv)
25427			}
25428
25429		case "Type":
25430			if value != nil {
25431				jtv, ok := value.(string)
25432				if !ok {
25433					return fmt.Errorf("expected NamespaceErrorType to be of type string, got %T instead", value)
25434				}
25435				sv.Type = types.NamespaceErrorType(jtv)
25436			}
25437
25438		default:
25439			_, _ = key, value
25440
25441		}
25442	}
25443	*v = sv
25444	return nil
25445}
25446
25447func awsRestjson1_deserializeDocumentNamespaceInfoV2(v **types.NamespaceInfoV2, value interface{}) error {
25448	if v == nil {
25449		return fmt.Errorf("unexpected nil of type %T", v)
25450	}
25451	if value == nil {
25452		return nil
25453	}
25454
25455	shape, ok := value.(map[string]interface{})
25456	if !ok {
25457		return fmt.Errorf("unexpected JSON type %v", value)
25458	}
25459
25460	var sv *types.NamespaceInfoV2
25461	if *v == nil {
25462		sv = &types.NamespaceInfoV2{}
25463	} else {
25464		sv = *v
25465	}
25466
25467	for key, value := range shape {
25468		switch key {
25469		case "Arn":
25470			if value != nil {
25471				jtv, ok := value.(string)
25472				if !ok {
25473					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
25474				}
25475				sv.Arn = ptr.String(jtv)
25476			}
25477
25478		case "CapacityRegion":
25479			if value != nil {
25480				jtv, ok := value.(string)
25481				if !ok {
25482					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25483				}
25484				sv.CapacityRegion = ptr.String(jtv)
25485			}
25486
25487		case "CreationStatus":
25488			if value != nil {
25489				jtv, ok := value.(string)
25490				if !ok {
25491					return fmt.Errorf("expected NamespaceStatus to be of type string, got %T instead", value)
25492				}
25493				sv.CreationStatus = types.NamespaceStatus(jtv)
25494			}
25495
25496		case "IdentityStore":
25497			if value != nil {
25498				jtv, ok := value.(string)
25499				if !ok {
25500					return fmt.Errorf("expected IdentityStore to be of type string, got %T instead", value)
25501				}
25502				sv.IdentityStore = types.IdentityStore(jtv)
25503			}
25504
25505		case "Name":
25506			if value != nil {
25507				jtv, ok := value.(string)
25508				if !ok {
25509					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
25510				}
25511				sv.Name = ptr.String(jtv)
25512			}
25513
25514		case "NamespaceError":
25515			if err := awsRestjson1_deserializeDocumentNamespaceError(&sv.NamespaceError, value); err != nil {
25516				return err
25517			}
25518
25519		default:
25520			_, _ = key, value
25521
25522		}
25523	}
25524	*v = sv
25525	return nil
25526}
25527
25528func awsRestjson1_deserializeDocumentNamespaces(v *[]types.NamespaceInfoV2, value interface{}) error {
25529	if v == nil {
25530		return fmt.Errorf("unexpected nil of type %T", v)
25531	}
25532	if value == nil {
25533		return nil
25534	}
25535
25536	shape, ok := value.([]interface{})
25537	if !ok {
25538		return fmt.Errorf("unexpected JSON type %v", value)
25539	}
25540
25541	var cv []types.NamespaceInfoV2
25542	if *v == nil {
25543		cv = []types.NamespaceInfoV2{}
25544	} else {
25545		cv = *v
25546	}
25547
25548	for _, value := range shape {
25549		var col types.NamespaceInfoV2
25550		destAddr := &col
25551		if err := awsRestjson1_deserializeDocumentNamespaceInfoV2(&destAddr, value); err != nil {
25552			return err
25553		}
25554		col = *destAddr
25555		cv = append(cv, col)
25556
25557	}
25558	*v = cv
25559	return nil
25560}
25561
25562func awsRestjson1_deserializeDocumentOracleParameters(v **types.OracleParameters, 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 *types.OracleParameters
25576	if *v == nil {
25577		sv = &types.OracleParameters{}
25578	} else {
25579		sv = *v
25580	}
25581
25582	for key, value := range shape {
25583		switch key {
25584		case "Database":
25585			if value != nil {
25586				jtv, ok := value.(string)
25587				if !ok {
25588					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
25589				}
25590				sv.Database = ptr.String(jtv)
25591			}
25592
25593		case "Host":
25594			if value != nil {
25595				jtv, ok := value.(string)
25596				if !ok {
25597					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
25598				}
25599				sv.Host = ptr.String(jtv)
25600			}
25601
25602		case "Port":
25603			if value != nil {
25604				jtv, ok := value.(json.Number)
25605				if !ok {
25606					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
25607				}
25608				i64, err := jtv.Int64()
25609				if err != nil {
25610					return err
25611				}
25612				sv.Port = int32(i64)
25613			}
25614
25615		default:
25616			_, _ = key, value
25617
25618		}
25619	}
25620	*v = sv
25621	return nil
25622}
25623
25624func awsRestjson1_deserializeDocumentOutputColumn(v **types.OutputColumn, value interface{}) error {
25625	if v == nil {
25626		return fmt.Errorf("unexpected nil of type %T", v)
25627	}
25628	if value == nil {
25629		return nil
25630	}
25631
25632	shape, ok := value.(map[string]interface{})
25633	if !ok {
25634		return fmt.Errorf("unexpected JSON type %v", value)
25635	}
25636
25637	var sv *types.OutputColumn
25638	if *v == nil {
25639		sv = &types.OutputColumn{}
25640	} else {
25641		sv = *v
25642	}
25643
25644	for key, value := range shape {
25645		switch key {
25646		case "Description":
25647			if value != nil {
25648				jtv, ok := value.(string)
25649				if !ok {
25650					return fmt.Errorf("expected ColumnDescriptiveText to be of type string, got %T instead", value)
25651				}
25652				sv.Description = ptr.String(jtv)
25653			}
25654
25655		case "Name":
25656			if value != nil {
25657				jtv, ok := value.(string)
25658				if !ok {
25659					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
25660				}
25661				sv.Name = ptr.String(jtv)
25662			}
25663
25664		case "Type":
25665			if value != nil {
25666				jtv, ok := value.(string)
25667				if !ok {
25668					return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value)
25669				}
25670				sv.Type = types.ColumnDataType(jtv)
25671			}
25672
25673		default:
25674			_, _ = key, value
25675
25676		}
25677	}
25678	*v = sv
25679	return nil
25680}
25681
25682func awsRestjson1_deserializeDocumentOutputColumnList(v *[]types.OutputColumn, value interface{}) error {
25683	if v == nil {
25684		return fmt.Errorf("unexpected nil of type %T", v)
25685	}
25686	if value == nil {
25687		return nil
25688	}
25689
25690	shape, ok := value.([]interface{})
25691	if !ok {
25692		return fmt.Errorf("unexpected JSON type %v", value)
25693	}
25694
25695	var cv []types.OutputColumn
25696	if *v == nil {
25697		cv = []types.OutputColumn{}
25698	} else {
25699		cv = *v
25700	}
25701
25702	for _, value := range shape {
25703		var col types.OutputColumn
25704		destAddr := &col
25705		if err := awsRestjson1_deserializeDocumentOutputColumn(&destAddr, value); err != nil {
25706			return err
25707		}
25708		col = *destAddr
25709		cv = append(cv, col)
25710
25711	}
25712	*v = cv
25713	return nil
25714}
25715
25716func awsRestjson1_deserializeDocumentPhysicalTable(v *types.PhysicalTable, value interface{}) error {
25717	if v == nil {
25718		return fmt.Errorf("unexpected nil of type %T", v)
25719	}
25720	if value == nil {
25721		return nil
25722	}
25723
25724	shape, ok := value.(map[string]interface{})
25725	if !ok {
25726		return fmt.Errorf("unexpected JSON type %v", value)
25727	}
25728
25729	var uv types.PhysicalTable
25730loop:
25731	for key, value := range shape {
25732		if value == nil {
25733			continue
25734		}
25735		switch key {
25736		case "CustomSql":
25737			var mv types.CustomSql
25738			destAddr := &mv
25739			if err := awsRestjson1_deserializeDocumentCustomSql(&destAddr, value); err != nil {
25740				return err
25741			}
25742			mv = *destAddr
25743			uv = &types.PhysicalTableMemberCustomSql{Value: mv}
25744			break loop
25745
25746		case "RelationalTable":
25747			var mv types.RelationalTable
25748			destAddr := &mv
25749			if err := awsRestjson1_deserializeDocumentRelationalTable(&destAddr, value); err != nil {
25750				return err
25751			}
25752			mv = *destAddr
25753			uv = &types.PhysicalTableMemberRelationalTable{Value: mv}
25754			break loop
25755
25756		case "S3Source":
25757			var mv types.S3Source
25758			destAddr := &mv
25759			if err := awsRestjson1_deserializeDocumentS3Source(&destAddr, value); err != nil {
25760				return err
25761			}
25762			mv = *destAddr
25763			uv = &types.PhysicalTableMemberS3Source{Value: mv}
25764			break loop
25765
25766		default:
25767			uv = &types.UnknownUnionMember{Tag: key}
25768			break loop
25769
25770		}
25771	}
25772	*v = uv
25773	return nil
25774}
25775
25776func awsRestjson1_deserializeDocumentPhysicalTableMap(v *map[string]types.PhysicalTable, value interface{}) error {
25777	if v == nil {
25778		return fmt.Errorf("unexpected nil of type %T", v)
25779	}
25780	if value == nil {
25781		return nil
25782	}
25783
25784	shape, ok := value.(map[string]interface{})
25785	if !ok {
25786		return fmt.Errorf("unexpected JSON type %v", value)
25787	}
25788
25789	var mv map[string]types.PhysicalTable
25790	if *v == nil {
25791		mv = map[string]types.PhysicalTable{}
25792	} else {
25793		mv = *v
25794	}
25795
25796	for key, value := range shape {
25797		var parsedVal types.PhysicalTable
25798		mapVar := parsedVal
25799		if err := awsRestjson1_deserializeDocumentPhysicalTable(&mapVar, value); err != nil {
25800			return err
25801		}
25802		parsedVal = mapVar
25803		mv[key] = parsedVal
25804
25805	}
25806	*v = mv
25807	return nil
25808}
25809
25810func awsRestjson1_deserializeDocumentPostgreSqlParameters(v **types.PostgreSqlParameters, value interface{}) error {
25811	if v == nil {
25812		return fmt.Errorf("unexpected nil of type %T", v)
25813	}
25814	if value == nil {
25815		return nil
25816	}
25817
25818	shape, ok := value.(map[string]interface{})
25819	if !ok {
25820		return fmt.Errorf("unexpected JSON type %v", value)
25821	}
25822
25823	var sv *types.PostgreSqlParameters
25824	if *v == nil {
25825		sv = &types.PostgreSqlParameters{}
25826	} else {
25827		sv = *v
25828	}
25829
25830	for key, value := range shape {
25831		switch key {
25832		case "Database":
25833			if value != nil {
25834				jtv, ok := value.(string)
25835				if !ok {
25836					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
25837				}
25838				sv.Database = ptr.String(jtv)
25839			}
25840
25841		case "Host":
25842			if value != nil {
25843				jtv, ok := value.(string)
25844				if !ok {
25845					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
25846				}
25847				sv.Host = ptr.String(jtv)
25848			}
25849
25850		case "Port":
25851			if value != nil {
25852				jtv, ok := value.(json.Number)
25853				if !ok {
25854					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
25855				}
25856				i64, err := jtv.Int64()
25857				if err != nil {
25858					return err
25859				}
25860				sv.Port = int32(i64)
25861			}
25862
25863		default:
25864			_, _ = key, value
25865
25866		}
25867	}
25868	*v = sv
25869	return nil
25870}
25871
25872func awsRestjson1_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error {
25873	if v == nil {
25874		return fmt.Errorf("unexpected nil of type %T", v)
25875	}
25876	if value == nil {
25877		return nil
25878	}
25879
25880	shape, ok := value.(map[string]interface{})
25881	if !ok {
25882		return fmt.Errorf("unexpected JSON type %v", value)
25883	}
25884
25885	var sv *types.PreconditionNotMetException
25886	if *v == nil {
25887		sv = &types.PreconditionNotMetException{}
25888	} else {
25889		sv = *v
25890	}
25891
25892	for key, value := range shape {
25893		switch key {
25894		case "Message":
25895			if value != nil {
25896				jtv, ok := value.(string)
25897				if !ok {
25898					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25899				}
25900				sv.Message = ptr.String(jtv)
25901			}
25902
25903		case "RequestId":
25904			if value != nil {
25905				jtv, ok := value.(string)
25906				if !ok {
25907					return fmt.Errorf("expected String to be of type string, got %T instead", value)
25908				}
25909				sv.RequestId = ptr.String(jtv)
25910			}
25911
25912		default:
25913			_, _ = key, value
25914
25915		}
25916	}
25917	*v = sv
25918	return nil
25919}
25920
25921func awsRestjson1_deserializeDocumentPrestoParameters(v **types.PrestoParameters, value interface{}) error {
25922	if v == nil {
25923		return fmt.Errorf("unexpected nil of type %T", v)
25924	}
25925	if value == nil {
25926		return nil
25927	}
25928
25929	shape, ok := value.(map[string]interface{})
25930	if !ok {
25931		return fmt.Errorf("unexpected JSON type %v", value)
25932	}
25933
25934	var sv *types.PrestoParameters
25935	if *v == nil {
25936		sv = &types.PrestoParameters{}
25937	} else {
25938		sv = *v
25939	}
25940
25941	for key, value := range shape {
25942		switch key {
25943		case "Catalog":
25944			if value != nil {
25945				jtv, ok := value.(string)
25946				if !ok {
25947					return fmt.Errorf("expected Catalog to be of type string, got %T instead", value)
25948				}
25949				sv.Catalog = ptr.String(jtv)
25950			}
25951
25952		case "Host":
25953			if value != nil {
25954				jtv, ok := value.(string)
25955				if !ok {
25956					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
25957				}
25958				sv.Host = ptr.String(jtv)
25959			}
25960
25961		case "Port":
25962			if value != nil {
25963				jtv, ok := value.(json.Number)
25964				if !ok {
25965					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
25966				}
25967				i64, err := jtv.Int64()
25968				if err != nil {
25969					return err
25970				}
25971				sv.Port = int32(i64)
25972			}
25973
25974		default:
25975			_, _ = key, value
25976
25977		}
25978	}
25979	*v = sv
25980	return nil
25981}
25982
25983func awsRestjson1_deserializeDocumentPrincipalList(v *[]string, value interface{}) error {
25984	if v == nil {
25985		return fmt.Errorf("unexpected nil of type %T", v)
25986	}
25987	if value == nil {
25988		return nil
25989	}
25990
25991	shape, ok := value.([]interface{})
25992	if !ok {
25993		return fmt.Errorf("unexpected JSON type %v", value)
25994	}
25995
25996	var cv []string
25997	if *v == nil {
25998		cv = []string{}
25999	} else {
26000		cv = *v
26001	}
26002
26003	for _, value := range shape {
26004		var col string
26005		if value != nil {
26006			jtv, ok := value.(string)
26007			if !ok {
26008				return fmt.Errorf("expected String to be of type string, got %T instead", value)
26009			}
26010			col = jtv
26011		}
26012		cv = append(cv, col)
26013
26014	}
26015	*v = cv
26016	return nil
26017}
26018
26019func awsRestjson1_deserializeDocumentProjectedColumnList(v *[]string, value interface{}) error {
26020	if v == nil {
26021		return fmt.Errorf("unexpected nil of type %T", v)
26022	}
26023	if value == nil {
26024		return nil
26025	}
26026
26027	shape, ok := value.([]interface{})
26028	if !ok {
26029		return fmt.Errorf("unexpected JSON type %v", value)
26030	}
26031
26032	var cv []string
26033	if *v == nil {
26034		cv = []string{}
26035	} else {
26036		cv = *v
26037	}
26038
26039	for _, value := range shape {
26040		var col string
26041		if value != nil {
26042			jtv, ok := value.(string)
26043			if !ok {
26044				return fmt.Errorf("expected String to be of type string, got %T instead", value)
26045			}
26046			col = jtv
26047		}
26048		cv = append(cv, col)
26049
26050	}
26051	*v = cv
26052	return nil
26053}
26054
26055func awsRestjson1_deserializeDocumentProjectOperation(v **types.ProjectOperation, value interface{}) error {
26056	if v == nil {
26057		return fmt.Errorf("unexpected nil of type %T", v)
26058	}
26059	if value == nil {
26060		return nil
26061	}
26062
26063	shape, ok := value.(map[string]interface{})
26064	if !ok {
26065		return fmt.Errorf("unexpected JSON type %v", value)
26066	}
26067
26068	var sv *types.ProjectOperation
26069	if *v == nil {
26070		sv = &types.ProjectOperation{}
26071	} else {
26072		sv = *v
26073	}
26074
26075	for key, value := range shape {
26076		switch key {
26077		case "ProjectedColumns":
26078			if err := awsRestjson1_deserializeDocumentProjectedColumnList(&sv.ProjectedColumns, value); err != nil {
26079				return err
26080			}
26081
26082		default:
26083			_, _ = key, value
26084
26085		}
26086	}
26087	*v = sv
26088	return nil
26089}
26090
26091func awsRestjson1_deserializeDocumentQueueInfo(v **types.QueueInfo, value interface{}) error {
26092	if v == nil {
26093		return fmt.Errorf("unexpected nil of type %T", v)
26094	}
26095	if value == nil {
26096		return nil
26097	}
26098
26099	shape, ok := value.(map[string]interface{})
26100	if !ok {
26101		return fmt.Errorf("unexpected JSON type %v", value)
26102	}
26103
26104	var sv *types.QueueInfo
26105	if *v == nil {
26106		sv = &types.QueueInfo{}
26107	} else {
26108		sv = *v
26109	}
26110
26111	for key, value := range shape {
26112		switch key {
26113		case "QueuedIngestion":
26114			if value != nil {
26115				jtv, ok := value.(string)
26116				if !ok {
26117					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26118				}
26119				sv.QueuedIngestion = ptr.String(jtv)
26120			}
26121
26122		case "WaitingOnIngestion":
26123			if value != nil {
26124				jtv, ok := value.(string)
26125				if !ok {
26126					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26127				}
26128				sv.WaitingOnIngestion = ptr.String(jtv)
26129			}
26130
26131		default:
26132			_, _ = key, value
26133
26134		}
26135	}
26136	*v = sv
26137	return nil
26138}
26139
26140func awsRestjson1_deserializeDocumentQuickSightUserNotFoundException(v **types.QuickSightUserNotFoundException, value interface{}) error {
26141	if v == nil {
26142		return fmt.Errorf("unexpected nil of type %T", v)
26143	}
26144	if value == nil {
26145		return nil
26146	}
26147
26148	shape, ok := value.(map[string]interface{})
26149	if !ok {
26150		return fmt.Errorf("unexpected JSON type %v", value)
26151	}
26152
26153	var sv *types.QuickSightUserNotFoundException
26154	if *v == nil {
26155		sv = &types.QuickSightUserNotFoundException{}
26156	} else {
26157		sv = *v
26158	}
26159
26160	for key, value := range shape {
26161		switch key {
26162		case "Message":
26163			if value != nil {
26164				jtv, ok := value.(string)
26165				if !ok {
26166					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26167				}
26168				sv.Message = ptr.String(jtv)
26169			}
26170
26171		case "RequestId":
26172			if value != nil {
26173				jtv, ok := value.(string)
26174				if !ok {
26175					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26176				}
26177				sv.RequestId = ptr.String(jtv)
26178			}
26179
26180		default:
26181			_, _ = key, value
26182
26183		}
26184	}
26185	*v = sv
26186	return nil
26187}
26188
26189func awsRestjson1_deserializeDocumentRdsParameters(v **types.RdsParameters, value interface{}) error {
26190	if v == nil {
26191		return fmt.Errorf("unexpected nil of type %T", v)
26192	}
26193	if value == nil {
26194		return nil
26195	}
26196
26197	shape, ok := value.(map[string]interface{})
26198	if !ok {
26199		return fmt.Errorf("unexpected JSON type %v", value)
26200	}
26201
26202	var sv *types.RdsParameters
26203	if *v == nil {
26204		sv = &types.RdsParameters{}
26205	} else {
26206		sv = *v
26207	}
26208
26209	for key, value := range shape {
26210		switch key {
26211		case "Database":
26212			if value != nil {
26213				jtv, ok := value.(string)
26214				if !ok {
26215					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
26216				}
26217				sv.Database = ptr.String(jtv)
26218			}
26219
26220		case "InstanceId":
26221			if value != nil {
26222				jtv, ok := value.(string)
26223				if !ok {
26224					return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value)
26225				}
26226				sv.InstanceId = ptr.String(jtv)
26227			}
26228
26229		default:
26230			_, _ = key, value
26231
26232		}
26233	}
26234	*v = sv
26235	return nil
26236}
26237
26238func awsRestjson1_deserializeDocumentRedshiftParameters(v **types.RedshiftParameters, value interface{}) error {
26239	if v == nil {
26240		return fmt.Errorf("unexpected nil of type %T", v)
26241	}
26242	if value == nil {
26243		return nil
26244	}
26245
26246	shape, ok := value.(map[string]interface{})
26247	if !ok {
26248		return fmt.Errorf("unexpected JSON type %v", value)
26249	}
26250
26251	var sv *types.RedshiftParameters
26252	if *v == nil {
26253		sv = &types.RedshiftParameters{}
26254	} else {
26255		sv = *v
26256	}
26257
26258	for key, value := range shape {
26259		switch key {
26260		case "ClusterId":
26261			if value != nil {
26262				jtv, ok := value.(string)
26263				if !ok {
26264					return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value)
26265				}
26266				sv.ClusterId = ptr.String(jtv)
26267			}
26268
26269		case "Database":
26270			if value != nil {
26271				jtv, ok := value.(string)
26272				if !ok {
26273					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
26274				}
26275				sv.Database = ptr.String(jtv)
26276			}
26277
26278		case "Host":
26279			if value != nil {
26280				jtv, ok := value.(string)
26281				if !ok {
26282					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
26283				}
26284				sv.Host = ptr.String(jtv)
26285			}
26286
26287		case "Port":
26288			if value != nil {
26289				jtv, ok := value.(json.Number)
26290				if !ok {
26291					return fmt.Errorf("expected OptionalPort to be json.Number, got %T instead", value)
26292				}
26293				i64, err := jtv.Int64()
26294				if err != nil {
26295					return err
26296				}
26297				sv.Port = int32(i64)
26298			}
26299
26300		default:
26301			_, _ = key, value
26302
26303		}
26304	}
26305	*v = sv
26306	return nil
26307}
26308
26309func awsRestjson1_deserializeDocumentRelationalTable(v **types.RelationalTable, value interface{}) error {
26310	if v == nil {
26311		return fmt.Errorf("unexpected nil of type %T", v)
26312	}
26313	if value == nil {
26314		return nil
26315	}
26316
26317	shape, ok := value.(map[string]interface{})
26318	if !ok {
26319		return fmt.Errorf("unexpected JSON type %v", value)
26320	}
26321
26322	var sv *types.RelationalTable
26323	if *v == nil {
26324		sv = &types.RelationalTable{}
26325	} else {
26326		sv = *v
26327	}
26328
26329	for key, value := range shape {
26330		switch key {
26331		case "Catalog":
26332			if value != nil {
26333				jtv, ok := value.(string)
26334				if !ok {
26335					return fmt.Errorf("expected RelationalTableCatalog to be of type string, got %T instead", value)
26336				}
26337				sv.Catalog = ptr.String(jtv)
26338			}
26339
26340		case "DataSourceArn":
26341			if value != nil {
26342				jtv, ok := value.(string)
26343				if !ok {
26344					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
26345				}
26346				sv.DataSourceArn = ptr.String(jtv)
26347			}
26348
26349		case "InputColumns":
26350			if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.InputColumns, value); err != nil {
26351				return err
26352			}
26353
26354		case "Name":
26355			if value != nil {
26356				jtv, ok := value.(string)
26357				if !ok {
26358					return fmt.Errorf("expected RelationalTableName to be of type string, got %T instead", value)
26359				}
26360				sv.Name = ptr.String(jtv)
26361			}
26362
26363		case "Schema":
26364			if value != nil {
26365				jtv, ok := value.(string)
26366				if !ok {
26367					return fmt.Errorf("expected RelationalTableSchema to be of type string, got %T instead", value)
26368				}
26369				sv.Schema = ptr.String(jtv)
26370			}
26371
26372		default:
26373			_, _ = key, value
26374
26375		}
26376	}
26377	*v = sv
26378	return nil
26379}
26380
26381func awsRestjson1_deserializeDocumentRenameColumnOperation(v **types.RenameColumnOperation, value interface{}) error {
26382	if v == nil {
26383		return fmt.Errorf("unexpected nil of type %T", v)
26384	}
26385	if value == nil {
26386		return nil
26387	}
26388
26389	shape, ok := value.(map[string]interface{})
26390	if !ok {
26391		return fmt.Errorf("unexpected JSON type %v", value)
26392	}
26393
26394	var sv *types.RenameColumnOperation
26395	if *v == nil {
26396		sv = &types.RenameColumnOperation{}
26397	} else {
26398		sv = *v
26399	}
26400
26401	for key, value := range shape {
26402		switch key {
26403		case "ColumnName":
26404			if value != nil {
26405				jtv, ok := value.(string)
26406				if !ok {
26407					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
26408				}
26409				sv.ColumnName = ptr.String(jtv)
26410			}
26411
26412		case "NewColumnName":
26413			if value != nil {
26414				jtv, ok := value.(string)
26415				if !ok {
26416					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
26417				}
26418				sv.NewColumnName = ptr.String(jtv)
26419			}
26420
26421		default:
26422			_, _ = key, value
26423
26424		}
26425	}
26426	*v = sv
26427	return nil
26428}
26429
26430func awsRestjson1_deserializeDocumentResourceExistsException(v **types.ResourceExistsException, value interface{}) error {
26431	if v == nil {
26432		return fmt.Errorf("unexpected nil of type %T", v)
26433	}
26434	if value == nil {
26435		return nil
26436	}
26437
26438	shape, ok := value.(map[string]interface{})
26439	if !ok {
26440		return fmt.Errorf("unexpected JSON type %v", value)
26441	}
26442
26443	var sv *types.ResourceExistsException
26444	if *v == nil {
26445		sv = &types.ResourceExistsException{}
26446	} else {
26447		sv = *v
26448	}
26449
26450	for key, value := range shape {
26451		switch key {
26452		case "Message":
26453			if value != nil {
26454				jtv, ok := value.(string)
26455				if !ok {
26456					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26457				}
26458				sv.Message = ptr.String(jtv)
26459			}
26460
26461		case "RequestId":
26462			if value != nil {
26463				jtv, ok := value.(string)
26464				if !ok {
26465					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26466				}
26467				sv.RequestId = ptr.String(jtv)
26468			}
26469
26470		case "ResourceType":
26471			if value != nil {
26472				jtv, ok := value.(string)
26473				if !ok {
26474					return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value)
26475				}
26476				sv.ResourceType = types.ExceptionResourceType(jtv)
26477			}
26478
26479		default:
26480			_, _ = key, value
26481
26482		}
26483	}
26484	*v = sv
26485	return nil
26486}
26487
26488func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
26489	if v == nil {
26490		return fmt.Errorf("unexpected nil of type %T", v)
26491	}
26492	if value == nil {
26493		return nil
26494	}
26495
26496	shape, ok := value.(map[string]interface{})
26497	if !ok {
26498		return fmt.Errorf("unexpected JSON type %v", value)
26499	}
26500
26501	var sv *types.ResourceNotFoundException
26502	if *v == nil {
26503		sv = &types.ResourceNotFoundException{}
26504	} else {
26505		sv = *v
26506	}
26507
26508	for key, value := range shape {
26509		switch key {
26510		case "Message":
26511			if value != nil {
26512				jtv, ok := value.(string)
26513				if !ok {
26514					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26515				}
26516				sv.Message = ptr.String(jtv)
26517			}
26518
26519		case "RequestId":
26520			if value != nil {
26521				jtv, ok := value.(string)
26522				if !ok {
26523					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26524				}
26525				sv.RequestId = ptr.String(jtv)
26526			}
26527
26528		case "ResourceType":
26529			if value != nil {
26530				jtv, ok := value.(string)
26531				if !ok {
26532					return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value)
26533				}
26534				sv.ResourceType = types.ExceptionResourceType(jtv)
26535			}
26536
26537		default:
26538			_, _ = key, value
26539
26540		}
26541	}
26542	*v = sv
26543	return nil
26544}
26545
26546func awsRestjson1_deserializeDocumentResourcePermission(v **types.ResourcePermission, value interface{}) error {
26547	if v == nil {
26548		return fmt.Errorf("unexpected nil of type %T", v)
26549	}
26550	if value == nil {
26551		return nil
26552	}
26553
26554	shape, ok := value.(map[string]interface{})
26555	if !ok {
26556		return fmt.Errorf("unexpected JSON type %v", value)
26557	}
26558
26559	var sv *types.ResourcePermission
26560	if *v == nil {
26561		sv = &types.ResourcePermission{}
26562	} else {
26563		sv = *v
26564	}
26565
26566	for key, value := range shape {
26567		switch key {
26568		case "Actions":
26569			if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil {
26570				return err
26571			}
26572
26573		case "Principal":
26574			if value != nil {
26575				jtv, ok := value.(string)
26576				if !ok {
26577					return fmt.Errorf("expected Principal to be of type string, got %T instead", value)
26578				}
26579				sv.Principal = ptr.String(jtv)
26580			}
26581
26582		default:
26583			_, _ = key, value
26584
26585		}
26586	}
26587	*v = sv
26588	return nil
26589}
26590
26591func awsRestjson1_deserializeDocumentResourcePermissionList(v *[]types.ResourcePermission, value interface{}) error {
26592	if v == nil {
26593		return fmt.Errorf("unexpected nil of type %T", v)
26594	}
26595	if value == nil {
26596		return nil
26597	}
26598
26599	shape, ok := value.([]interface{})
26600	if !ok {
26601		return fmt.Errorf("unexpected JSON type %v", value)
26602	}
26603
26604	var cv []types.ResourcePermission
26605	if *v == nil {
26606		cv = []types.ResourcePermission{}
26607	} else {
26608		cv = *v
26609	}
26610
26611	for _, value := range shape {
26612		var col types.ResourcePermission
26613		destAddr := &col
26614		if err := awsRestjson1_deserializeDocumentResourcePermission(&destAddr, value); err != nil {
26615			return err
26616		}
26617		col = *destAddr
26618		cv = append(cv, col)
26619
26620	}
26621	*v = cv
26622	return nil
26623}
26624
26625func awsRestjson1_deserializeDocumentResourceUnavailableException(v **types.ResourceUnavailableException, value interface{}) error {
26626	if v == nil {
26627		return fmt.Errorf("unexpected nil of type %T", v)
26628	}
26629	if value == nil {
26630		return nil
26631	}
26632
26633	shape, ok := value.(map[string]interface{})
26634	if !ok {
26635		return fmt.Errorf("unexpected JSON type %v", value)
26636	}
26637
26638	var sv *types.ResourceUnavailableException
26639	if *v == nil {
26640		sv = &types.ResourceUnavailableException{}
26641	} else {
26642		sv = *v
26643	}
26644
26645	for key, value := range shape {
26646		switch key {
26647		case "Message":
26648			if value != nil {
26649				jtv, ok := value.(string)
26650				if !ok {
26651					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26652				}
26653				sv.Message = ptr.String(jtv)
26654			}
26655
26656		case "RequestId":
26657			if value != nil {
26658				jtv, ok := value.(string)
26659				if !ok {
26660					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26661				}
26662				sv.RequestId = ptr.String(jtv)
26663			}
26664
26665		case "ResourceType":
26666			if value != nil {
26667				jtv, ok := value.(string)
26668				if !ok {
26669					return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value)
26670				}
26671				sv.ResourceType = types.ExceptionResourceType(jtv)
26672			}
26673
26674		default:
26675			_, _ = key, value
26676
26677		}
26678	}
26679	*v = sv
26680	return nil
26681}
26682
26683func awsRestjson1_deserializeDocumentRowInfo(v **types.RowInfo, value interface{}) error {
26684	if v == nil {
26685		return fmt.Errorf("unexpected nil of type %T", v)
26686	}
26687	if value == nil {
26688		return nil
26689	}
26690
26691	shape, ok := value.(map[string]interface{})
26692	if !ok {
26693		return fmt.Errorf("unexpected JSON type %v", value)
26694	}
26695
26696	var sv *types.RowInfo
26697	if *v == nil {
26698		sv = &types.RowInfo{}
26699	} else {
26700		sv = *v
26701	}
26702
26703	for key, value := range shape {
26704		switch key {
26705		case "RowsDropped":
26706			if value != nil {
26707				jtv, ok := value.(json.Number)
26708				if !ok {
26709					return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
26710				}
26711				i64, err := jtv.Int64()
26712				if err != nil {
26713					return err
26714				}
26715				sv.RowsDropped = i64
26716			}
26717
26718		case "RowsIngested":
26719			if value != nil {
26720				jtv, ok := value.(json.Number)
26721				if !ok {
26722					return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
26723				}
26724				i64, err := jtv.Int64()
26725				if err != nil {
26726					return err
26727				}
26728				sv.RowsIngested = i64
26729			}
26730
26731		default:
26732			_, _ = key, value
26733
26734		}
26735	}
26736	*v = sv
26737	return nil
26738}
26739
26740func awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(v **types.RowLevelPermissionDataSet, value interface{}) error {
26741	if v == nil {
26742		return fmt.Errorf("unexpected nil of type %T", v)
26743	}
26744	if value == nil {
26745		return nil
26746	}
26747
26748	shape, ok := value.(map[string]interface{})
26749	if !ok {
26750		return fmt.Errorf("unexpected JSON type %v", value)
26751	}
26752
26753	var sv *types.RowLevelPermissionDataSet
26754	if *v == nil {
26755		sv = &types.RowLevelPermissionDataSet{}
26756	} else {
26757		sv = *v
26758	}
26759
26760	for key, value := range shape {
26761		switch key {
26762		case "Arn":
26763			if value != nil {
26764				jtv, ok := value.(string)
26765				if !ok {
26766					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
26767				}
26768				sv.Arn = ptr.String(jtv)
26769			}
26770
26771		case "Namespace":
26772			if value != nil {
26773				jtv, ok := value.(string)
26774				if !ok {
26775					return fmt.Errorf("expected Namespace to be of type string, got %T instead", value)
26776				}
26777				sv.Namespace = ptr.String(jtv)
26778			}
26779
26780		case "PermissionPolicy":
26781			if value != nil {
26782				jtv, ok := value.(string)
26783				if !ok {
26784					return fmt.Errorf("expected RowLevelPermissionPolicy to be of type string, got %T instead", value)
26785				}
26786				sv.PermissionPolicy = types.RowLevelPermissionPolicy(jtv)
26787			}
26788
26789		default:
26790			_, _ = key, value
26791
26792		}
26793	}
26794	*v = sv
26795	return nil
26796}
26797
26798func awsRestjson1_deserializeDocumentS3Parameters(v **types.S3Parameters, value interface{}) error {
26799	if v == nil {
26800		return fmt.Errorf("unexpected nil of type %T", v)
26801	}
26802	if value == nil {
26803		return nil
26804	}
26805
26806	shape, ok := value.(map[string]interface{})
26807	if !ok {
26808		return fmt.Errorf("unexpected JSON type %v", value)
26809	}
26810
26811	var sv *types.S3Parameters
26812	if *v == nil {
26813		sv = &types.S3Parameters{}
26814	} else {
26815		sv = *v
26816	}
26817
26818	for key, value := range shape {
26819		switch key {
26820		case "ManifestFileLocation":
26821			if err := awsRestjson1_deserializeDocumentManifestFileLocation(&sv.ManifestFileLocation, value); err != nil {
26822				return err
26823			}
26824
26825		default:
26826			_, _ = key, value
26827
26828		}
26829	}
26830	*v = sv
26831	return nil
26832}
26833
26834func awsRestjson1_deserializeDocumentS3Source(v **types.S3Source, value interface{}) error {
26835	if v == nil {
26836		return fmt.Errorf("unexpected nil of type %T", v)
26837	}
26838	if value == nil {
26839		return nil
26840	}
26841
26842	shape, ok := value.(map[string]interface{})
26843	if !ok {
26844		return fmt.Errorf("unexpected JSON type %v", value)
26845	}
26846
26847	var sv *types.S3Source
26848	if *v == nil {
26849		sv = &types.S3Source{}
26850	} else {
26851		sv = *v
26852	}
26853
26854	for key, value := range shape {
26855		switch key {
26856		case "DataSourceArn":
26857			if value != nil {
26858				jtv, ok := value.(string)
26859				if !ok {
26860					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
26861				}
26862				sv.DataSourceArn = ptr.String(jtv)
26863			}
26864
26865		case "InputColumns":
26866			if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.InputColumns, value); err != nil {
26867				return err
26868			}
26869
26870		case "UploadSettings":
26871			if err := awsRestjson1_deserializeDocumentUploadSettings(&sv.UploadSettings, value); err != nil {
26872				return err
26873			}
26874
26875		default:
26876			_, _ = key, value
26877
26878		}
26879	}
26880	*v = sv
26881	return nil
26882}
26883
26884func awsRestjson1_deserializeDocumentServiceNowParameters(v **types.ServiceNowParameters, value interface{}) error {
26885	if v == nil {
26886		return fmt.Errorf("unexpected nil of type %T", v)
26887	}
26888	if value == nil {
26889		return nil
26890	}
26891
26892	shape, ok := value.(map[string]interface{})
26893	if !ok {
26894		return fmt.Errorf("unexpected JSON type %v", value)
26895	}
26896
26897	var sv *types.ServiceNowParameters
26898	if *v == nil {
26899		sv = &types.ServiceNowParameters{}
26900	} else {
26901		sv = *v
26902	}
26903
26904	for key, value := range shape {
26905		switch key {
26906		case "SiteBaseUrl":
26907			if value != nil {
26908				jtv, ok := value.(string)
26909				if !ok {
26910					return fmt.Errorf("expected SiteBaseUrl to be of type string, got %T instead", value)
26911				}
26912				sv.SiteBaseUrl = ptr.String(jtv)
26913			}
26914
26915		default:
26916			_, _ = key, value
26917
26918		}
26919	}
26920	*v = sv
26921	return nil
26922}
26923
26924func awsRestjson1_deserializeDocumentSessionLifetimeInMinutesInvalidException(v **types.SessionLifetimeInMinutesInvalidException, value interface{}) error {
26925	if v == nil {
26926		return fmt.Errorf("unexpected nil of type %T", v)
26927	}
26928	if value == nil {
26929		return nil
26930	}
26931
26932	shape, ok := value.(map[string]interface{})
26933	if !ok {
26934		return fmt.Errorf("unexpected JSON type %v", value)
26935	}
26936
26937	var sv *types.SessionLifetimeInMinutesInvalidException
26938	if *v == nil {
26939		sv = &types.SessionLifetimeInMinutesInvalidException{}
26940	} else {
26941		sv = *v
26942	}
26943
26944	for key, value := range shape {
26945		switch key {
26946		case "Message":
26947			if value != nil {
26948				jtv, ok := value.(string)
26949				if !ok {
26950					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26951				}
26952				sv.Message = ptr.String(jtv)
26953			}
26954
26955		case "RequestId":
26956			if value != nil {
26957				jtv, ok := value.(string)
26958				if !ok {
26959					return fmt.Errorf("expected String to be of type string, got %T instead", value)
26960				}
26961				sv.RequestId = ptr.String(jtv)
26962			}
26963
26964		default:
26965			_, _ = key, value
26966
26967		}
26968	}
26969	*v = sv
26970	return nil
26971}
26972
26973func awsRestjson1_deserializeDocumentSheet(v **types.Sheet, value interface{}) error {
26974	if v == nil {
26975		return fmt.Errorf("unexpected nil of type %T", v)
26976	}
26977	if value == nil {
26978		return nil
26979	}
26980
26981	shape, ok := value.(map[string]interface{})
26982	if !ok {
26983		return fmt.Errorf("unexpected JSON type %v", value)
26984	}
26985
26986	var sv *types.Sheet
26987	if *v == nil {
26988		sv = &types.Sheet{}
26989	} else {
26990		sv = *v
26991	}
26992
26993	for key, value := range shape {
26994		switch key {
26995		case "Name":
26996			if value != nil {
26997				jtv, ok := value.(string)
26998				if !ok {
26999					return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
27000				}
27001				sv.Name = ptr.String(jtv)
27002			}
27003
27004		case "SheetId":
27005			if value != nil {
27006				jtv, ok := value.(string)
27007				if !ok {
27008					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
27009				}
27010				sv.SheetId = ptr.String(jtv)
27011			}
27012
27013		default:
27014			_, _ = key, value
27015
27016		}
27017	}
27018	*v = sv
27019	return nil
27020}
27021
27022func awsRestjson1_deserializeDocumentSheetList(v *[]types.Sheet, value interface{}) error {
27023	if v == nil {
27024		return fmt.Errorf("unexpected nil of type %T", v)
27025	}
27026	if value == nil {
27027		return nil
27028	}
27029
27030	shape, ok := value.([]interface{})
27031	if !ok {
27032		return fmt.Errorf("unexpected JSON type %v", value)
27033	}
27034
27035	var cv []types.Sheet
27036	if *v == nil {
27037		cv = []types.Sheet{}
27038	} else {
27039		cv = *v
27040	}
27041
27042	for _, value := range shape {
27043		var col types.Sheet
27044		destAddr := &col
27045		if err := awsRestjson1_deserializeDocumentSheet(&destAddr, value); err != nil {
27046			return err
27047		}
27048		col = *destAddr
27049		cv = append(cv, col)
27050
27051	}
27052	*v = cv
27053	return nil
27054}
27055
27056func awsRestjson1_deserializeDocumentSheetStyle(v **types.SheetStyle, value interface{}) error {
27057	if v == nil {
27058		return fmt.Errorf("unexpected nil of type %T", v)
27059	}
27060	if value == nil {
27061		return nil
27062	}
27063
27064	shape, ok := value.(map[string]interface{})
27065	if !ok {
27066		return fmt.Errorf("unexpected JSON type %v", value)
27067	}
27068
27069	var sv *types.SheetStyle
27070	if *v == nil {
27071		sv = &types.SheetStyle{}
27072	} else {
27073		sv = *v
27074	}
27075
27076	for key, value := range shape {
27077		switch key {
27078		case "Tile":
27079			if err := awsRestjson1_deserializeDocumentTileStyle(&sv.Tile, value); err != nil {
27080				return err
27081			}
27082
27083		case "TileLayout":
27084			if err := awsRestjson1_deserializeDocumentTileLayoutStyle(&sv.TileLayout, value); err != nil {
27085				return err
27086			}
27087
27088		default:
27089			_, _ = key, value
27090
27091		}
27092	}
27093	*v = sv
27094	return nil
27095}
27096
27097func awsRestjson1_deserializeDocumentSnowflakeParameters(v **types.SnowflakeParameters, value interface{}) error {
27098	if v == nil {
27099		return fmt.Errorf("unexpected nil of type %T", v)
27100	}
27101	if value == nil {
27102		return nil
27103	}
27104
27105	shape, ok := value.(map[string]interface{})
27106	if !ok {
27107		return fmt.Errorf("unexpected JSON type %v", value)
27108	}
27109
27110	var sv *types.SnowflakeParameters
27111	if *v == nil {
27112		sv = &types.SnowflakeParameters{}
27113	} else {
27114		sv = *v
27115	}
27116
27117	for key, value := range shape {
27118		switch key {
27119		case "Database":
27120			if value != nil {
27121				jtv, ok := value.(string)
27122				if !ok {
27123					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
27124				}
27125				sv.Database = ptr.String(jtv)
27126			}
27127
27128		case "Host":
27129			if value != nil {
27130				jtv, ok := value.(string)
27131				if !ok {
27132					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
27133				}
27134				sv.Host = ptr.String(jtv)
27135			}
27136
27137		case "Warehouse":
27138			if value != nil {
27139				jtv, ok := value.(string)
27140				if !ok {
27141					return fmt.Errorf("expected Warehouse to be of type string, got %T instead", value)
27142				}
27143				sv.Warehouse = ptr.String(jtv)
27144			}
27145
27146		default:
27147			_, _ = key, value
27148
27149		}
27150	}
27151	*v = sv
27152	return nil
27153}
27154
27155func awsRestjson1_deserializeDocumentSparkParameters(v **types.SparkParameters, value interface{}) error {
27156	if v == nil {
27157		return fmt.Errorf("unexpected nil of type %T", v)
27158	}
27159	if value == nil {
27160		return nil
27161	}
27162
27163	shape, ok := value.(map[string]interface{})
27164	if !ok {
27165		return fmt.Errorf("unexpected JSON type %v", value)
27166	}
27167
27168	var sv *types.SparkParameters
27169	if *v == nil {
27170		sv = &types.SparkParameters{}
27171	} else {
27172		sv = *v
27173	}
27174
27175	for key, value := range shape {
27176		switch key {
27177		case "Host":
27178			if value != nil {
27179				jtv, ok := value.(string)
27180				if !ok {
27181					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
27182				}
27183				sv.Host = ptr.String(jtv)
27184			}
27185
27186		case "Port":
27187			if value != nil {
27188				jtv, ok := value.(json.Number)
27189				if !ok {
27190					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
27191				}
27192				i64, err := jtv.Int64()
27193				if err != nil {
27194					return err
27195				}
27196				sv.Port = int32(i64)
27197			}
27198
27199		default:
27200			_, _ = key, value
27201
27202		}
27203	}
27204	*v = sv
27205	return nil
27206}
27207
27208func awsRestjson1_deserializeDocumentSqlServerParameters(v **types.SqlServerParameters, value interface{}) error {
27209	if v == nil {
27210		return fmt.Errorf("unexpected nil of type %T", v)
27211	}
27212	if value == nil {
27213		return nil
27214	}
27215
27216	shape, ok := value.(map[string]interface{})
27217	if !ok {
27218		return fmt.Errorf("unexpected JSON type %v", value)
27219	}
27220
27221	var sv *types.SqlServerParameters
27222	if *v == nil {
27223		sv = &types.SqlServerParameters{}
27224	} else {
27225		sv = *v
27226	}
27227
27228	for key, value := range shape {
27229		switch key {
27230		case "Database":
27231			if value != nil {
27232				jtv, ok := value.(string)
27233				if !ok {
27234					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
27235				}
27236				sv.Database = ptr.String(jtv)
27237			}
27238
27239		case "Host":
27240			if value != nil {
27241				jtv, ok := value.(string)
27242				if !ok {
27243					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
27244				}
27245				sv.Host = ptr.String(jtv)
27246			}
27247
27248		case "Port":
27249			if value != nil {
27250				jtv, ok := value.(json.Number)
27251				if !ok {
27252					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
27253				}
27254				i64, err := jtv.Int64()
27255				if err != nil {
27256					return err
27257				}
27258				sv.Port = int32(i64)
27259			}
27260
27261		default:
27262			_, _ = key, value
27263
27264		}
27265	}
27266	*v = sv
27267	return nil
27268}
27269
27270func awsRestjson1_deserializeDocumentSslProperties(v **types.SslProperties, value interface{}) error {
27271	if v == nil {
27272		return fmt.Errorf("unexpected nil of type %T", v)
27273	}
27274	if value == nil {
27275		return nil
27276	}
27277
27278	shape, ok := value.(map[string]interface{})
27279	if !ok {
27280		return fmt.Errorf("unexpected JSON type %v", value)
27281	}
27282
27283	var sv *types.SslProperties
27284	if *v == nil {
27285		sv = &types.SslProperties{}
27286	} else {
27287		sv = *v
27288	}
27289
27290	for key, value := range shape {
27291		switch key {
27292		case "DisableSsl":
27293			if value != nil {
27294				jtv, ok := value.(bool)
27295				if !ok {
27296					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
27297				}
27298				sv.DisableSsl = jtv
27299			}
27300
27301		default:
27302			_, _ = key, value
27303
27304		}
27305	}
27306	*v = sv
27307	return nil
27308}
27309
27310func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error {
27311	if v == nil {
27312		return fmt.Errorf("unexpected nil of type %T", v)
27313	}
27314	if value == nil {
27315		return nil
27316	}
27317
27318	shape, ok := value.(map[string]interface{})
27319	if !ok {
27320		return fmt.Errorf("unexpected JSON type %v", value)
27321	}
27322
27323	var sv *types.Tag
27324	if *v == nil {
27325		sv = &types.Tag{}
27326	} else {
27327		sv = *v
27328	}
27329
27330	for key, value := range shape {
27331		switch key {
27332		case "Key":
27333			if value != nil {
27334				jtv, ok := value.(string)
27335				if !ok {
27336					return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
27337				}
27338				sv.Key = ptr.String(jtv)
27339			}
27340
27341		case "Value":
27342			if value != nil {
27343				jtv, ok := value.(string)
27344				if !ok {
27345					return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
27346				}
27347				sv.Value = ptr.String(jtv)
27348			}
27349
27350		default:
27351			_, _ = key, value
27352
27353		}
27354	}
27355	*v = sv
27356	return nil
27357}
27358
27359func awsRestjson1_deserializeDocumentTagColumnOperation(v **types.TagColumnOperation, value interface{}) error {
27360	if v == nil {
27361		return fmt.Errorf("unexpected nil of type %T", v)
27362	}
27363	if value == nil {
27364		return nil
27365	}
27366
27367	shape, ok := value.(map[string]interface{})
27368	if !ok {
27369		return fmt.Errorf("unexpected JSON type %v", value)
27370	}
27371
27372	var sv *types.TagColumnOperation
27373	if *v == nil {
27374		sv = &types.TagColumnOperation{}
27375	} else {
27376		sv = *v
27377	}
27378
27379	for key, value := range shape {
27380		switch key {
27381		case "ColumnName":
27382			if value != nil {
27383				jtv, ok := value.(string)
27384				if !ok {
27385					return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
27386				}
27387				sv.ColumnName = ptr.String(jtv)
27388			}
27389
27390		case "Tags":
27391			if err := awsRestjson1_deserializeDocumentColumnTagList(&sv.Tags, value); err != nil {
27392				return err
27393			}
27394
27395		default:
27396			_, _ = key, value
27397
27398		}
27399	}
27400	*v = sv
27401	return nil
27402}
27403
27404func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
27405	if v == nil {
27406		return fmt.Errorf("unexpected nil of type %T", v)
27407	}
27408	if value == nil {
27409		return nil
27410	}
27411
27412	shape, ok := value.([]interface{})
27413	if !ok {
27414		return fmt.Errorf("unexpected JSON type %v", value)
27415	}
27416
27417	var cv []types.Tag
27418	if *v == nil {
27419		cv = []types.Tag{}
27420	} else {
27421		cv = *v
27422	}
27423
27424	for _, value := range shape {
27425		var col types.Tag
27426		destAddr := &col
27427		if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil {
27428			return err
27429		}
27430		col = *destAddr
27431		cv = append(cv, col)
27432
27433	}
27434	*v = cv
27435	return nil
27436}
27437
27438func awsRestjson1_deserializeDocumentTemplate(v **types.Template, value interface{}) error {
27439	if v == nil {
27440		return fmt.Errorf("unexpected nil of type %T", v)
27441	}
27442	if value == nil {
27443		return nil
27444	}
27445
27446	shape, ok := value.(map[string]interface{})
27447	if !ok {
27448		return fmt.Errorf("unexpected JSON type %v", value)
27449	}
27450
27451	var sv *types.Template
27452	if *v == nil {
27453		sv = &types.Template{}
27454	} else {
27455		sv = *v
27456	}
27457
27458	for key, value := range shape {
27459		switch key {
27460		case "Arn":
27461			if value != nil {
27462				jtv, ok := value.(string)
27463				if !ok {
27464					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27465				}
27466				sv.Arn = ptr.String(jtv)
27467			}
27468
27469		case "CreatedTime":
27470			if value != nil {
27471				jtv, ok := value.(json.Number)
27472				if !ok {
27473					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27474				}
27475				f64, err := jtv.Float64()
27476				if err != nil {
27477					return err
27478				}
27479				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27480			}
27481
27482		case "LastUpdatedTime":
27483			if value != nil {
27484				jtv, ok := value.(json.Number)
27485				if !ok {
27486					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27487				}
27488				f64, err := jtv.Float64()
27489				if err != nil {
27490					return err
27491				}
27492				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27493			}
27494
27495		case "Name":
27496			if value != nil {
27497				jtv, ok := value.(string)
27498				if !ok {
27499					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
27500				}
27501				sv.Name = ptr.String(jtv)
27502			}
27503
27504		case "TemplateId":
27505			if value != nil {
27506				jtv, ok := value.(string)
27507				if !ok {
27508					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
27509				}
27510				sv.TemplateId = ptr.String(jtv)
27511			}
27512
27513		case "Version":
27514			if err := awsRestjson1_deserializeDocumentTemplateVersion(&sv.Version, value); err != nil {
27515				return err
27516			}
27517
27518		default:
27519			_, _ = key, value
27520
27521		}
27522	}
27523	*v = sv
27524	return nil
27525}
27526
27527func awsRestjson1_deserializeDocumentTemplateAlias(v **types.TemplateAlias, value interface{}) error {
27528	if v == nil {
27529		return fmt.Errorf("unexpected nil of type %T", v)
27530	}
27531	if value == nil {
27532		return nil
27533	}
27534
27535	shape, ok := value.(map[string]interface{})
27536	if !ok {
27537		return fmt.Errorf("unexpected JSON type %v", value)
27538	}
27539
27540	var sv *types.TemplateAlias
27541	if *v == nil {
27542		sv = &types.TemplateAlias{}
27543	} else {
27544		sv = *v
27545	}
27546
27547	for key, value := range shape {
27548		switch key {
27549		case "AliasName":
27550			if value != nil {
27551				jtv, ok := value.(string)
27552				if !ok {
27553					return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
27554				}
27555				sv.AliasName = ptr.String(jtv)
27556			}
27557
27558		case "Arn":
27559			if value != nil {
27560				jtv, ok := value.(string)
27561				if !ok {
27562					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27563				}
27564				sv.Arn = ptr.String(jtv)
27565			}
27566
27567		case "TemplateVersionNumber":
27568			if value != nil {
27569				jtv, ok := value.(json.Number)
27570				if !ok {
27571					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
27572				}
27573				i64, err := jtv.Int64()
27574				if err != nil {
27575					return err
27576				}
27577				sv.TemplateVersionNumber = ptr.Int64(i64)
27578			}
27579
27580		default:
27581			_, _ = key, value
27582
27583		}
27584	}
27585	*v = sv
27586	return nil
27587}
27588
27589func awsRestjson1_deserializeDocumentTemplateAliasList(v *[]types.TemplateAlias, value interface{}) error {
27590	if v == nil {
27591		return fmt.Errorf("unexpected nil of type %T", v)
27592	}
27593	if value == nil {
27594		return nil
27595	}
27596
27597	shape, ok := value.([]interface{})
27598	if !ok {
27599		return fmt.Errorf("unexpected JSON type %v", value)
27600	}
27601
27602	var cv []types.TemplateAlias
27603	if *v == nil {
27604		cv = []types.TemplateAlias{}
27605	} else {
27606		cv = *v
27607	}
27608
27609	for _, value := range shape {
27610		var col types.TemplateAlias
27611		destAddr := &col
27612		if err := awsRestjson1_deserializeDocumentTemplateAlias(&destAddr, value); err != nil {
27613			return err
27614		}
27615		col = *destAddr
27616		cv = append(cv, col)
27617
27618	}
27619	*v = cv
27620	return nil
27621}
27622
27623func awsRestjson1_deserializeDocumentTemplateError(v **types.TemplateError, value interface{}) error {
27624	if v == nil {
27625		return fmt.Errorf("unexpected nil of type %T", v)
27626	}
27627	if value == nil {
27628		return nil
27629	}
27630
27631	shape, ok := value.(map[string]interface{})
27632	if !ok {
27633		return fmt.Errorf("unexpected JSON type %v", value)
27634	}
27635
27636	var sv *types.TemplateError
27637	if *v == nil {
27638		sv = &types.TemplateError{}
27639	} else {
27640		sv = *v
27641	}
27642
27643	for key, value := range shape {
27644		switch key {
27645		case "Message":
27646			if value != nil {
27647				jtv, ok := value.(string)
27648				if !ok {
27649					return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
27650				}
27651				sv.Message = ptr.String(jtv)
27652			}
27653
27654		case "Type":
27655			if value != nil {
27656				jtv, ok := value.(string)
27657				if !ok {
27658					return fmt.Errorf("expected TemplateErrorType to be of type string, got %T instead", value)
27659				}
27660				sv.Type = types.TemplateErrorType(jtv)
27661			}
27662
27663		default:
27664			_, _ = key, value
27665
27666		}
27667	}
27668	*v = sv
27669	return nil
27670}
27671
27672func awsRestjson1_deserializeDocumentTemplateErrorList(v *[]types.TemplateError, value interface{}) error {
27673	if v == nil {
27674		return fmt.Errorf("unexpected nil of type %T", v)
27675	}
27676	if value == nil {
27677		return nil
27678	}
27679
27680	shape, ok := value.([]interface{})
27681	if !ok {
27682		return fmt.Errorf("unexpected JSON type %v", value)
27683	}
27684
27685	var cv []types.TemplateError
27686	if *v == nil {
27687		cv = []types.TemplateError{}
27688	} else {
27689		cv = *v
27690	}
27691
27692	for _, value := range shape {
27693		var col types.TemplateError
27694		destAddr := &col
27695		if err := awsRestjson1_deserializeDocumentTemplateError(&destAddr, value); err != nil {
27696			return err
27697		}
27698		col = *destAddr
27699		cv = append(cv, col)
27700
27701	}
27702	*v = cv
27703	return nil
27704}
27705
27706func awsRestjson1_deserializeDocumentTemplateSummary(v **types.TemplateSummary, value interface{}) error {
27707	if v == nil {
27708		return fmt.Errorf("unexpected nil of type %T", v)
27709	}
27710	if value == nil {
27711		return nil
27712	}
27713
27714	shape, ok := value.(map[string]interface{})
27715	if !ok {
27716		return fmt.Errorf("unexpected JSON type %v", value)
27717	}
27718
27719	var sv *types.TemplateSummary
27720	if *v == nil {
27721		sv = &types.TemplateSummary{}
27722	} else {
27723		sv = *v
27724	}
27725
27726	for key, value := range shape {
27727		switch key {
27728		case "Arn":
27729			if value != nil {
27730				jtv, ok := value.(string)
27731				if !ok {
27732					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27733				}
27734				sv.Arn = ptr.String(jtv)
27735			}
27736
27737		case "CreatedTime":
27738			if value != nil {
27739				jtv, ok := value.(json.Number)
27740				if !ok {
27741					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27742				}
27743				f64, err := jtv.Float64()
27744				if err != nil {
27745					return err
27746				}
27747				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27748			}
27749
27750		case "LastUpdatedTime":
27751			if value != nil {
27752				jtv, ok := value.(json.Number)
27753				if !ok {
27754					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27755				}
27756				f64, err := jtv.Float64()
27757				if err != nil {
27758					return err
27759				}
27760				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27761			}
27762
27763		case "LatestVersionNumber":
27764			if value != nil {
27765				jtv, ok := value.(json.Number)
27766				if !ok {
27767					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
27768				}
27769				i64, err := jtv.Int64()
27770				if err != nil {
27771					return err
27772				}
27773				sv.LatestVersionNumber = ptr.Int64(i64)
27774			}
27775
27776		case "Name":
27777			if value != nil {
27778				jtv, ok := value.(string)
27779				if !ok {
27780					return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value)
27781				}
27782				sv.Name = ptr.String(jtv)
27783			}
27784
27785		case "TemplateId":
27786			if value != nil {
27787				jtv, ok := value.(string)
27788				if !ok {
27789					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
27790				}
27791				sv.TemplateId = ptr.String(jtv)
27792			}
27793
27794		default:
27795			_, _ = key, value
27796
27797		}
27798	}
27799	*v = sv
27800	return nil
27801}
27802
27803func awsRestjson1_deserializeDocumentTemplateSummaryList(v *[]types.TemplateSummary, value interface{}) error {
27804	if v == nil {
27805		return fmt.Errorf("unexpected nil of type %T", v)
27806	}
27807	if value == nil {
27808		return nil
27809	}
27810
27811	shape, ok := value.([]interface{})
27812	if !ok {
27813		return fmt.Errorf("unexpected JSON type %v", value)
27814	}
27815
27816	var cv []types.TemplateSummary
27817	if *v == nil {
27818		cv = []types.TemplateSummary{}
27819	} else {
27820		cv = *v
27821	}
27822
27823	for _, value := range shape {
27824		var col types.TemplateSummary
27825		destAddr := &col
27826		if err := awsRestjson1_deserializeDocumentTemplateSummary(&destAddr, value); err != nil {
27827			return err
27828		}
27829		col = *destAddr
27830		cv = append(cv, col)
27831
27832	}
27833	*v = cv
27834	return nil
27835}
27836
27837func awsRestjson1_deserializeDocumentTemplateVersion(v **types.TemplateVersion, value interface{}) error {
27838	if v == nil {
27839		return fmt.Errorf("unexpected nil of type %T", v)
27840	}
27841	if value == nil {
27842		return nil
27843	}
27844
27845	shape, ok := value.(map[string]interface{})
27846	if !ok {
27847		return fmt.Errorf("unexpected JSON type %v", value)
27848	}
27849
27850	var sv *types.TemplateVersion
27851	if *v == nil {
27852		sv = &types.TemplateVersion{}
27853	} else {
27854		sv = *v
27855	}
27856
27857	for key, value := range shape {
27858		switch key {
27859		case "CreatedTime":
27860			if value != nil {
27861				jtv, ok := value.(json.Number)
27862				if !ok {
27863					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27864				}
27865				f64, err := jtv.Float64()
27866				if err != nil {
27867					return err
27868				}
27869				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27870			}
27871
27872		case "DataSetConfigurations":
27873			if err := awsRestjson1_deserializeDocumentDataSetConfigurationList(&sv.DataSetConfigurations, value); err != nil {
27874				return err
27875			}
27876
27877		case "Description":
27878			if value != nil {
27879				jtv, ok := value.(string)
27880				if !ok {
27881					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
27882				}
27883				sv.Description = ptr.String(jtv)
27884			}
27885
27886		case "Errors":
27887			if err := awsRestjson1_deserializeDocumentTemplateErrorList(&sv.Errors, value); err != nil {
27888				return err
27889			}
27890
27891		case "Sheets":
27892			if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil {
27893				return err
27894			}
27895
27896		case "SourceEntityArn":
27897			if value != nil {
27898				jtv, ok := value.(string)
27899				if !ok {
27900					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27901				}
27902				sv.SourceEntityArn = ptr.String(jtv)
27903			}
27904
27905		case "Status":
27906			if value != nil {
27907				jtv, ok := value.(string)
27908				if !ok {
27909					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
27910				}
27911				sv.Status = types.ResourceStatus(jtv)
27912			}
27913
27914		case "ThemeArn":
27915			if value != nil {
27916				jtv, ok := value.(string)
27917				if !ok {
27918					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27919				}
27920				sv.ThemeArn = ptr.String(jtv)
27921			}
27922
27923		case "VersionNumber":
27924			if value != nil {
27925				jtv, ok := value.(json.Number)
27926				if !ok {
27927					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
27928				}
27929				i64, err := jtv.Int64()
27930				if err != nil {
27931					return err
27932				}
27933				sv.VersionNumber = ptr.Int64(i64)
27934			}
27935
27936		default:
27937			_, _ = key, value
27938
27939		}
27940	}
27941	*v = sv
27942	return nil
27943}
27944
27945func awsRestjson1_deserializeDocumentTemplateVersionSummary(v **types.TemplateVersionSummary, value interface{}) error {
27946	if v == nil {
27947		return fmt.Errorf("unexpected nil of type %T", v)
27948	}
27949	if value == nil {
27950		return nil
27951	}
27952
27953	shape, ok := value.(map[string]interface{})
27954	if !ok {
27955		return fmt.Errorf("unexpected JSON type %v", value)
27956	}
27957
27958	var sv *types.TemplateVersionSummary
27959	if *v == nil {
27960		sv = &types.TemplateVersionSummary{}
27961	} else {
27962		sv = *v
27963	}
27964
27965	for key, value := range shape {
27966		switch key {
27967		case "Arn":
27968			if value != nil {
27969				jtv, ok := value.(string)
27970				if !ok {
27971					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
27972				}
27973				sv.Arn = ptr.String(jtv)
27974			}
27975
27976		case "CreatedTime":
27977			if value != nil {
27978				jtv, ok := value.(json.Number)
27979				if !ok {
27980					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
27981				}
27982				f64, err := jtv.Float64()
27983				if err != nil {
27984					return err
27985				}
27986				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
27987			}
27988
27989		case "Description":
27990			if value != nil {
27991				jtv, ok := value.(string)
27992				if !ok {
27993					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
27994				}
27995				sv.Description = ptr.String(jtv)
27996			}
27997
27998		case "Status":
27999			if value != nil {
28000				jtv, ok := value.(string)
28001				if !ok {
28002					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
28003				}
28004				sv.Status = types.ResourceStatus(jtv)
28005			}
28006
28007		case "VersionNumber":
28008			if value != nil {
28009				jtv, ok := value.(json.Number)
28010				if !ok {
28011					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
28012				}
28013				i64, err := jtv.Int64()
28014				if err != nil {
28015					return err
28016				}
28017				sv.VersionNumber = ptr.Int64(i64)
28018			}
28019
28020		default:
28021			_, _ = key, value
28022
28023		}
28024	}
28025	*v = sv
28026	return nil
28027}
28028
28029func awsRestjson1_deserializeDocumentTemplateVersionSummaryList(v *[]types.TemplateVersionSummary, value interface{}) error {
28030	if v == nil {
28031		return fmt.Errorf("unexpected nil of type %T", v)
28032	}
28033	if value == nil {
28034		return nil
28035	}
28036
28037	shape, ok := value.([]interface{})
28038	if !ok {
28039		return fmt.Errorf("unexpected JSON type %v", value)
28040	}
28041
28042	var cv []types.TemplateVersionSummary
28043	if *v == nil {
28044		cv = []types.TemplateVersionSummary{}
28045	} else {
28046		cv = *v
28047	}
28048
28049	for _, value := range shape {
28050		var col types.TemplateVersionSummary
28051		destAddr := &col
28052		if err := awsRestjson1_deserializeDocumentTemplateVersionSummary(&destAddr, value); err != nil {
28053			return err
28054		}
28055		col = *destAddr
28056		cv = append(cv, col)
28057
28058	}
28059	*v = cv
28060	return nil
28061}
28062
28063func awsRestjson1_deserializeDocumentTeradataParameters(v **types.TeradataParameters, value interface{}) error {
28064	if v == nil {
28065		return fmt.Errorf("unexpected nil of type %T", v)
28066	}
28067	if value == nil {
28068		return nil
28069	}
28070
28071	shape, ok := value.(map[string]interface{})
28072	if !ok {
28073		return fmt.Errorf("unexpected JSON type %v", value)
28074	}
28075
28076	var sv *types.TeradataParameters
28077	if *v == nil {
28078		sv = &types.TeradataParameters{}
28079	} else {
28080		sv = *v
28081	}
28082
28083	for key, value := range shape {
28084		switch key {
28085		case "Database":
28086			if value != nil {
28087				jtv, ok := value.(string)
28088				if !ok {
28089					return fmt.Errorf("expected Database to be of type string, got %T instead", value)
28090				}
28091				sv.Database = ptr.String(jtv)
28092			}
28093
28094		case "Host":
28095			if value != nil {
28096				jtv, ok := value.(string)
28097				if !ok {
28098					return fmt.Errorf("expected Host to be of type string, got %T instead", value)
28099				}
28100				sv.Host = ptr.String(jtv)
28101			}
28102
28103		case "Port":
28104			if value != nil {
28105				jtv, ok := value.(json.Number)
28106				if !ok {
28107					return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
28108				}
28109				i64, err := jtv.Int64()
28110				if err != nil {
28111					return err
28112				}
28113				sv.Port = int32(i64)
28114			}
28115
28116		default:
28117			_, _ = key, value
28118
28119		}
28120	}
28121	*v = sv
28122	return nil
28123}
28124
28125func awsRestjson1_deserializeDocumentTheme(v **types.Theme, value interface{}) error {
28126	if v == nil {
28127		return fmt.Errorf("unexpected nil of type %T", v)
28128	}
28129	if value == nil {
28130		return nil
28131	}
28132
28133	shape, ok := value.(map[string]interface{})
28134	if !ok {
28135		return fmt.Errorf("unexpected JSON type %v", value)
28136	}
28137
28138	var sv *types.Theme
28139	if *v == nil {
28140		sv = &types.Theme{}
28141	} else {
28142		sv = *v
28143	}
28144
28145	for key, value := range shape {
28146		switch key {
28147		case "Arn":
28148			if value != nil {
28149				jtv, ok := value.(string)
28150				if !ok {
28151					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
28152				}
28153				sv.Arn = ptr.String(jtv)
28154			}
28155
28156		case "CreatedTime":
28157			if value != nil {
28158				jtv, ok := value.(json.Number)
28159				if !ok {
28160					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28161				}
28162				f64, err := jtv.Float64()
28163				if err != nil {
28164					return err
28165				}
28166				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28167			}
28168
28169		case "LastUpdatedTime":
28170			if value != nil {
28171				jtv, ok := value.(json.Number)
28172				if !ok {
28173					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28174				}
28175				f64, err := jtv.Float64()
28176				if err != nil {
28177					return err
28178				}
28179				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28180			}
28181
28182		case "Name":
28183			if value != nil {
28184				jtv, ok := value.(string)
28185				if !ok {
28186					return fmt.Errorf("expected ThemeName to be of type string, got %T instead", value)
28187				}
28188				sv.Name = ptr.String(jtv)
28189			}
28190
28191		case "ThemeId":
28192			if value != nil {
28193				jtv, ok := value.(string)
28194				if !ok {
28195					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
28196				}
28197				sv.ThemeId = ptr.String(jtv)
28198			}
28199
28200		case "Type":
28201			if value != nil {
28202				jtv, ok := value.(string)
28203				if !ok {
28204					return fmt.Errorf("expected ThemeType to be of type string, got %T instead", value)
28205				}
28206				sv.Type = types.ThemeType(jtv)
28207			}
28208
28209		case "Version":
28210			if err := awsRestjson1_deserializeDocumentThemeVersion(&sv.Version, value); err != nil {
28211				return err
28212			}
28213
28214		default:
28215			_, _ = key, value
28216
28217		}
28218	}
28219	*v = sv
28220	return nil
28221}
28222
28223func awsRestjson1_deserializeDocumentThemeAlias(v **types.ThemeAlias, value interface{}) error {
28224	if v == nil {
28225		return fmt.Errorf("unexpected nil of type %T", v)
28226	}
28227	if value == nil {
28228		return nil
28229	}
28230
28231	shape, ok := value.(map[string]interface{})
28232	if !ok {
28233		return fmt.Errorf("unexpected JSON type %v", value)
28234	}
28235
28236	var sv *types.ThemeAlias
28237	if *v == nil {
28238		sv = &types.ThemeAlias{}
28239	} else {
28240		sv = *v
28241	}
28242
28243	for key, value := range shape {
28244		switch key {
28245		case "AliasName":
28246			if value != nil {
28247				jtv, ok := value.(string)
28248				if !ok {
28249					return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
28250				}
28251				sv.AliasName = ptr.String(jtv)
28252			}
28253
28254		case "Arn":
28255			if value != nil {
28256				jtv, ok := value.(string)
28257				if !ok {
28258					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
28259				}
28260				sv.Arn = ptr.String(jtv)
28261			}
28262
28263		case "ThemeVersionNumber":
28264			if value != nil {
28265				jtv, ok := value.(json.Number)
28266				if !ok {
28267					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
28268				}
28269				i64, err := jtv.Int64()
28270				if err != nil {
28271					return err
28272				}
28273				sv.ThemeVersionNumber = ptr.Int64(i64)
28274			}
28275
28276		default:
28277			_, _ = key, value
28278
28279		}
28280	}
28281	*v = sv
28282	return nil
28283}
28284
28285func awsRestjson1_deserializeDocumentThemeAliasList(v *[]types.ThemeAlias, value interface{}) error {
28286	if v == nil {
28287		return fmt.Errorf("unexpected nil of type %T", v)
28288	}
28289	if value == nil {
28290		return nil
28291	}
28292
28293	shape, ok := value.([]interface{})
28294	if !ok {
28295		return fmt.Errorf("unexpected JSON type %v", value)
28296	}
28297
28298	var cv []types.ThemeAlias
28299	if *v == nil {
28300		cv = []types.ThemeAlias{}
28301	} else {
28302		cv = *v
28303	}
28304
28305	for _, value := range shape {
28306		var col types.ThemeAlias
28307		destAddr := &col
28308		if err := awsRestjson1_deserializeDocumentThemeAlias(&destAddr, value); err != nil {
28309			return err
28310		}
28311		col = *destAddr
28312		cv = append(cv, col)
28313
28314	}
28315	*v = cv
28316	return nil
28317}
28318
28319func awsRestjson1_deserializeDocumentThemeConfiguration(v **types.ThemeConfiguration, value interface{}) error {
28320	if v == nil {
28321		return fmt.Errorf("unexpected nil of type %T", v)
28322	}
28323	if value == nil {
28324		return nil
28325	}
28326
28327	shape, ok := value.(map[string]interface{})
28328	if !ok {
28329		return fmt.Errorf("unexpected JSON type %v", value)
28330	}
28331
28332	var sv *types.ThemeConfiguration
28333	if *v == nil {
28334		sv = &types.ThemeConfiguration{}
28335	} else {
28336		sv = *v
28337	}
28338
28339	for key, value := range shape {
28340		switch key {
28341		case "DataColorPalette":
28342			if err := awsRestjson1_deserializeDocumentDataColorPalette(&sv.DataColorPalette, value); err != nil {
28343				return err
28344			}
28345
28346		case "Sheet":
28347			if err := awsRestjson1_deserializeDocumentSheetStyle(&sv.Sheet, value); err != nil {
28348				return err
28349			}
28350
28351		case "UIColorPalette":
28352			if err := awsRestjson1_deserializeDocumentUIColorPalette(&sv.UIColorPalette, value); err != nil {
28353				return err
28354			}
28355
28356		default:
28357			_, _ = key, value
28358
28359		}
28360	}
28361	*v = sv
28362	return nil
28363}
28364
28365func awsRestjson1_deserializeDocumentThemeError(v **types.ThemeError, value interface{}) error {
28366	if v == nil {
28367		return fmt.Errorf("unexpected nil of type %T", v)
28368	}
28369	if value == nil {
28370		return nil
28371	}
28372
28373	shape, ok := value.(map[string]interface{})
28374	if !ok {
28375		return fmt.Errorf("unexpected JSON type %v", value)
28376	}
28377
28378	var sv *types.ThemeError
28379	if *v == nil {
28380		sv = &types.ThemeError{}
28381	} else {
28382		sv = *v
28383	}
28384
28385	for key, value := range shape {
28386		switch key {
28387		case "Message":
28388			if value != nil {
28389				jtv, ok := value.(string)
28390				if !ok {
28391					return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
28392				}
28393				sv.Message = ptr.String(jtv)
28394			}
28395
28396		case "Type":
28397			if value != nil {
28398				jtv, ok := value.(string)
28399				if !ok {
28400					return fmt.Errorf("expected ThemeErrorType to be of type string, got %T instead", value)
28401				}
28402				sv.Type = types.ThemeErrorType(jtv)
28403			}
28404
28405		default:
28406			_, _ = key, value
28407
28408		}
28409	}
28410	*v = sv
28411	return nil
28412}
28413
28414func awsRestjson1_deserializeDocumentThemeErrorList(v *[]types.ThemeError, value interface{}) error {
28415	if v == nil {
28416		return fmt.Errorf("unexpected nil of type %T", v)
28417	}
28418	if value == nil {
28419		return nil
28420	}
28421
28422	shape, ok := value.([]interface{})
28423	if !ok {
28424		return fmt.Errorf("unexpected JSON type %v", value)
28425	}
28426
28427	var cv []types.ThemeError
28428	if *v == nil {
28429		cv = []types.ThemeError{}
28430	} else {
28431		cv = *v
28432	}
28433
28434	for _, value := range shape {
28435		var col types.ThemeError
28436		destAddr := &col
28437		if err := awsRestjson1_deserializeDocumentThemeError(&destAddr, value); err != nil {
28438			return err
28439		}
28440		col = *destAddr
28441		cv = append(cv, col)
28442
28443	}
28444	*v = cv
28445	return nil
28446}
28447
28448func awsRestjson1_deserializeDocumentThemeSummary(v **types.ThemeSummary, value interface{}) error {
28449	if v == nil {
28450		return fmt.Errorf("unexpected nil of type %T", v)
28451	}
28452	if value == nil {
28453		return nil
28454	}
28455
28456	shape, ok := value.(map[string]interface{})
28457	if !ok {
28458		return fmt.Errorf("unexpected JSON type %v", value)
28459	}
28460
28461	var sv *types.ThemeSummary
28462	if *v == nil {
28463		sv = &types.ThemeSummary{}
28464	} else {
28465		sv = *v
28466	}
28467
28468	for key, value := range shape {
28469		switch key {
28470		case "Arn":
28471			if value != nil {
28472				jtv, ok := value.(string)
28473				if !ok {
28474					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
28475				}
28476				sv.Arn = ptr.String(jtv)
28477			}
28478
28479		case "CreatedTime":
28480			if value != nil {
28481				jtv, ok := value.(json.Number)
28482				if !ok {
28483					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28484				}
28485				f64, err := jtv.Float64()
28486				if err != nil {
28487					return err
28488				}
28489				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28490			}
28491
28492		case "LastUpdatedTime":
28493			if value != nil {
28494				jtv, ok := value.(json.Number)
28495				if !ok {
28496					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28497				}
28498				f64, err := jtv.Float64()
28499				if err != nil {
28500					return err
28501				}
28502				sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28503			}
28504
28505		case "LatestVersionNumber":
28506			if value != nil {
28507				jtv, ok := value.(json.Number)
28508				if !ok {
28509					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
28510				}
28511				i64, err := jtv.Int64()
28512				if err != nil {
28513					return err
28514				}
28515				sv.LatestVersionNumber = ptr.Int64(i64)
28516			}
28517
28518		case "Name":
28519			if value != nil {
28520				jtv, ok := value.(string)
28521				if !ok {
28522					return fmt.Errorf("expected ThemeName to be of type string, got %T instead", value)
28523				}
28524				sv.Name = ptr.String(jtv)
28525			}
28526
28527		case "ThemeId":
28528			if value != nil {
28529				jtv, ok := value.(string)
28530				if !ok {
28531					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
28532				}
28533				sv.ThemeId = ptr.String(jtv)
28534			}
28535
28536		default:
28537			_, _ = key, value
28538
28539		}
28540	}
28541	*v = sv
28542	return nil
28543}
28544
28545func awsRestjson1_deserializeDocumentThemeSummaryList(v *[]types.ThemeSummary, value interface{}) error {
28546	if v == nil {
28547		return fmt.Errorf("unexpected nil of type %T", v)
28548	}
28549	if value == nil {
28550		return nil
28551	}
28552
28553	shape, ok := value.([]interface{})
28554	if !ok {
28555		return fmt.Errorf("unexpected JSON type %v", value)
28556	}
28557
28558	var cv []types.ThemeSummary
28559	if *v == nil {
28560		cv = []types.ThemeSummary{}
28561	} else {
28562		cv = *v
28563	}
28564
28565	for _, value := range shape {
28566		var col types.ThemeSummary
28567		destAddr := &col
28568		if err := awsRestjson1_deserializeDocumentThemeSummary(&destAddr, value); err != nil {
28569			return err
28570		}
28571		col = *destAddr
28572		cv = append(cv, col)
28573
28574	}
28575	*v = cv
28576	return nil
28577}
28578
28579func awsRestjson1_deserializeDocumentThemeVersion(v **types.ThemeVersion, value interface{}) error {
28580	if v == nil {
28581		return fmt.Errorf("unexpected nil of type %T", v)
28582	}
28583	if value == nil {
28584		return nil
28585	}
28586
28587	shape, ok := value.(map[string]interface{})
28588	if !ok {
28589		return fmt.Errorf("unexpected JSON type %v", value)
28590	}
28591
28592	var sv *types.ThemeVersion
28593	if *v == nil {
28594		sv = &types.ThemeVersion{}
28595	} else {
28596		sv = *v
28597	}
28598
28599	for key, value := range shape {
28600		switch key {
28601		case "Arn":
28602			if value != nil {
28603				jtv, ok := value.(string)
28604				if !ok {
28605					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
28606				}
28607				sv.Arn = ptr.String(jtv)
28608			}
28609
28610		case "BaseThemeId":
28611			if value != nil {
28612				jtv, ok := value.(string)
28613				if !ok {
28614					return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value)
28615				}
28616				sv.BaseThemeId = ptr.String(jtv)
28617			}
28618
28619		case "Configuration":
28620			if err := awsRestjson1_deserializeDocumentThemeConfiguration(&sv.Configuration, value); err != nil {
28621				return err
28622			}
28623
28624		case "CreatedTime":
28625			if value != nil {
28626				jtv, ok := value.(json.Number)
28627				if !ok {
28628					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28629				}
28630				f64, err := jtv.Float64()
28631				if err != nil {
28632					return err
28633				}
28634				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28635			}
28636
28637		case "Description":
28638			if value != nil {
28639				jtv, ok := value.(string)
28640				if !ok {
28641					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
28642				}
28643				sv.Description = ptr.String(jtv)
28644			}
28645
28646		case "Errors":
28647			if err := awsRestjson1_deserializeDocumentThemeErrorList(&sv.Errors, value); err != nil {
28648				return err
28649			}
28650
28651		case "Status":
28652			if value != nil {
28653				jtv, ok := value.(string)
28654				if !ok {
28655					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
28656				}
28657				sv.Status = types.ResourceStatus(jtv)
28658			}
28659
28660		case "VersionNumber":
28661			if value != nil {
28662				jtv, ok := value.(json.Number)
28663				if !ok {
28664					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
28665				}
28666				i64, err := jtv.Int64()
28667				if err != nil {
28668					return err
28669				}
28670				sv.VersionNumber = ptr.Int64(i64)
28671			}
28672
28673		default:
28674			_, _ = key, value
28675
28676		}
28677	}
28678	*v = sv
28679	return nil
28680}
28681
28682func awsRestjson1_deserializeDocumentThemeVersionSummary(v **types.ThemeVersionSummary, value interface{}) error {
28683	if v == nil {
28684		return fmt.Errorf("unexpected nil of type %T", v)
28685	}
28686	if value == nil {
28687		return nil
28688	}
28689
28690	shape, ok := value.(map[string]interface{})
28691	if !ok {
28692		return fmt.Errorf("unexpected JSON type %v", value)
28693	}
28694
28695	var sv *types.ThemeVersionSummary
28696	if *v == nil {
28697		sv = &types.ThemeVersionSummary{}
28698	} else {
28699		sv = *v
28700	}
28701
28702	for key, value := range shape {
28703		switch key {
28704		case "Arn":
28705			if value != nil {
28706				jtv, ok := value.(string)
28707				if !ok {
28708					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
28709				}
28710				sv.Arn = ptr.String(jtv)
28711			}
28712
28713		case "CreatedTime":
28714			if value != nil {
28715				jtv, ok := value.(json.Number)
28716				if !ok {
28717					return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value)
28718				}
28719				f64, err := jtv.Float64()
28720				if err != nil {
28721					return err
28722				}
28723				sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
28724			}
28725
28726		case "Description":
28727			if value != nil {
28728				jtv, ok := value.(string)
28729				if !ok {
28730					return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value)
28731				}
28732				sv.Description = ptr.String(jtv)
28733			}
28734
28735		case "Status":
28736			if value != nil {
28737				jtv, ok := value.(string)
28738				if !ok {
28739					return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value)
28740				}
28741				sv.Status = types.ResourceStatus(jtv)
28742			}
28743
28744		case "VersionNumber":
28745			if value != nil {
28746				jtv, ok := value.(json.Number)
28747				if !ok {
28748					return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value)
28749				}
28750				i64, err := jtv.Int64()
28751				if err != nil {
28752					return err
28753				}
28754				sv.VersionNumber = ptr.Int64(i64)
28755			}
28756
28757		default:
28758			_, _ = key, value
28759
28760		}
28761	}
28762	*v = sv
28763	return nil
28764}
28765
28766func awsRestjson1_deserializeDocumentThemeVersionSummaryList(v *[]types.ThemeVersionSummary, value interface{}) error {
28767	if v == nil {
28768		return fmt.Errorf("unexpected nil of type %T", v)
28769	}
28770	if value == nil {
28771		return nil
28772	}
28773
28774	shape, ok := value.([]interface{})
28775	if !ok {
28776		return fmt.Errorf("unexpected JSON type %v", value)
28777	}
28778
28779	var cv []types.ThemeVersionSummary
28780	if *v == nil {
28781		cv = []types.ThemeVersionSummary{}
28782	} else {
28783		cv = *v
28784	}
28785
28786	for _, value := range shape {
28787		var col types.ThemeVersionSummary
28788		destAddr := &col
28789		if err := awsRestjson1_deserializeDocumentThemeVersionSummary(&destAddr, value); err != nil {
28790			return err
28791		}
28792		col = *destAddr
28793		cv = append(cv, col)
28794
28795	}
28796	*v = cv
28797	return nil
28798}
28799
28800func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
28801	if v == nil {
28802		return fmt.Errorf("unexpected nil of type %T", v)
28803	}
28804	if value == nil {
28805		return nil
28806	}
28807
28808	shape, ok := value.(map[string]interface{})
28809	if !ok {
28810		return fmt.Errorf("unexpected JSON type %v", value)
28811	}
28812
28813	var sv *types.ThrottlingException
28814	if *v == nil {
28815		sv = &types.ThrottlingException{}
28816	} else {
28817		sv = *v
28818	}
28819
28820	for key, value := range shape {
28821		switch key {
28822		case "Message":
28823			if value != nil {
28824				jtv, ok := value.(string)
28825				if !ok {
28826					return fmt.Errorf("expected String to be of type string, got %T instead", value)
28827				}
28828				sv.Message = ptr.String(jtv)
28829			}
28830
28831		case "RequestId":
28832			if value != nil {
28833				jtv, ok := value.(string)
28834				if !ok {
28835					return fmt.Errorf("expected String to be of type string, got %T instead", value)
28836				}
28837				sv.RequestId = ptr.String(jtv)
28838			}
28839
28840		default:
28841			_, _ = key, value
28842
28843		}
28844	}
28845	*v = sv
28846	return nil
28847}
28848
28849func awsRestjson1_deserializeDocumentTileLayoutStyle(v **types.TileLayoutStyle, value interface{}) error {
28850	if v == nil {
28851		return fmt.Errorf("unexpected nil of type %T", v)
28852	}
28853	if value == nil {
28854		return nil
28855	}
28856
28857	shape, ok := value.(map[string]interface{})
28858	if !ok {
28859		return fmt.Errorf("unexpected JSON type %v", value)
28860	}
28861
28862	var sv *types.TileLayoutStyle
28863	if *v == nil {
28864		sv = &types.TileLayoutStyle{}
28865	} else {
28866		sv = *v
28867	}
28868
28869	for key, value := range shape {
28870		switch key {
28871		case "Gutter":
28872			if err := awsRestjson1_deserializeDocumentGutterStyle(&sv.Gutter, value); err != nil {
28873				return err
28874			}
28875
28876		case "Margin":
28877			if err := awsRestjson1_deserializeDocumentMarginStyle(&sv.Margin, value); err != nil {
28878				return err
28879			}
28880
28881		default:
28882			_, _ = key, value
28883
28884		}
28885	}
28886	*v = sv
28887	return nil
28888}
28889
28890func awsRestjson1_deserializeDocumentTileStyle(v **types.TileStyle, value interface{}) error {
28891	if v == nil {
28892		return fmt.Errorf("unexpected nil of type %T", v)
28893	}
28894	if value == nil {
28895		return nil
28896	}
28897
28898	shape, ok := value.(map[string]interface{})
28899	if !ok {
28900		return fmt.Errorf("unexpected JSON type %v", value)
28901	}
28902
28903	var sv *types.TileStyle
28904	if *v == nil {
28905		sv = &types.TileStyle{}
28906	} else {
28907		sv = *v
28908	}
28909
28910	for key, value := range shape {
28911		switch key {
28912		case "Border":
28913			if err := awsRestjson1_deserializeDocumentBorderStyle(&sv.Border, value); err != nil {
28914				return err
28915			}
28916
28917		default:
28918			_, _ = key, value
28919
28920		}
28921	}
28922	*v = sv
28923	return nil
28924}
28925
28926func awsRestjson1_deserializeDocumentTransformOperation(v *types.TransformOperation, value interface{}) error {
28927	if v == nil {
28928		return fmt.Errorf("unexpected nil of type %T", v)
28929	}
28930	if value == nil {
28931		return nil
28932	}
28933
28934	shape, ok := value.(map[string]interface{})
28935	if !ok {
28936		return fmt.Errorf("unexpected JSON type %v", value)
28937	}
28938
28939	var uv types.TransformOperation
28940loop:
28941	for key, value := range shape {
28942		if value == nil {
28943			continue
28944		}
28945		switch key {
28946		case "CastColumnTypeOperation":
28947			var mv types.CastColumnTypeOperation
28948			destAddr := &mv
28949			if err := awsRestjson1_deserializeDocumentCastColumnTypeOperation(&destAddr, value); err != nil {
28950				return err
28951			}
28952			mv = *destAddr
28953			uv = &types.TransformOperationMemberCastColumnTypeOperation{Value: mv}
28954			break loop
28955
28956		case "CreateColumnsOperation":
28957			var mv types.CreateColumnsOperation
28958			destAddr := &mv
28959			if err := awsRestjson1_deserializeDocumentCreateColumnsOperation(&destAddr, value); err != nil {
28960				return err
28961			}
28962			mv = *destAddr
28963			uv = &types.TransformOperationMemberCreateColumnsOperation{Value: mv}
28964			break loop
28965
28966		case "FilterOperation":
28967			var mv types.FilterOperation
28968			destAddr := &mv
28969			if err := awsRestjson1_deserializeDocumentFilterOperation(&destAddr, value); err != nil {
28970				return err
28971			}
28972			mv = *destAddr
28973			uv = &types.TransformOperationMemberFilterOperation{Value: mv}
28974			break loop
28975
28976		case "ProjectOperation":
28977			var mv types.ProjectOperation
28978			destAddr := &mv
28979			if err := awsRestjson1_deserializeDocumentProjectOperation(&destAddr, value); err != nil {
28980				return err
28981			}
28982			mv = *destAddr
28983			uv = &types.TransformOperationMemberProjectOperation{Value: mv}
28984			break loop
28985
28986		case "RenameColumnOperation":
28987			var mv types.RenameColumnOperation
28988			destAddr := &mv
28989			if err := awsRestjson1_deserializeDocumentRenameColumnOperation(&destAddr, value); err != nil {
28990				return err
28991			}
28992			mv = *destAddr
28993			uv = &types.TransformOperationMemberRenameColumnOperation{Value: mv}
28994			break loop
28995
28996		case "TagColumnOperation":
28997			var mv types.TagColumnOperation
28998			destAddr := &mv
28999			if err := awsRestjson1_deserializeDocumentTagColumnOperation(&destAddr, value); err != nil {
29000				return err
29001			}
29002			mv = *destAddr
29003			uv = &types.TransformOperationMemberTagColumnOperation{Value: mv}
29004			break loop
29005
29006		default:
29007			uv = &types.UnknownUnionMember{Tag: key}
29008			break loop
29009
29010		}
29011	}
29012	*v = uv
29013	return nil
29014}
29015
29016func awsRestjson1_deserializeDocumentTransformOperationList(v *[]types.TransformOperation, value interface{}) error {
29017	if v == nil {
29018		return fmt.Errorf("unexpected nil of type %T", v)
29019	}
29020	if value == nil {
29021		return nil
29022	}
29023
29024	shape, ok := value.([]interface{})
29025	if !ok {
29026		return fmt.Errorf("unexpected JSON type %v", value)
29027	}
29028
29029	var cv []types.TransformOperation
29030	if *v == nil {
29031		cv = []types.TransformOperation{}
29032	} else {
29033		cv = *v
29034	}
29035
29036	for _, value := range shape {
29037		var col types.TransformOperation
29038		if err := awsRestjson1_deserializeDocumentTransformOperation(&col, value); err != nil {
29039			return err
29040		}
29041		cv = append(cv, col)
29042
29043	}
29044	*v = cv
29045	return nil
29046}
29047
29048func awsRestjson1_deserializeDocumentTwitterParameters(v **types.TwitterParameters, value interface{}) error {
29049	if v == nil {
29050		return fmt.Errorf("unexpected nil of type %T", v)
29051	}
29052	if value == nil {
29053		return nil
29054	}
29055
29056	shape, ok := value.(map[string]interface{})
29057	if !ok {
29058		return fmt.Errorf("unexpected JSON type %v", value)
29059	}
29060
29061	var sv *types.TwitterParameters
29062	if *v == nil {
29063		sv = &types.TwitterParameters{}
29064	} else {
29065		sv = *v
29066	}
29067
29068	for key, value := range shape {
29069		switch key {
29070		case "MaxRows":
29071			if value != nil {
29072				jtv, ok := value.(json.Number)
29073				if !ok {
29074					return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value)
29075				}
29076				i64, err := jtv.Int64()
29077				if err != nil {
29078					return err
29079				}
29080				sv.MaxRows = int32(i64)
29081			}
29082
29083		case "Query":
29084			if value != nil {
29085				jtv, ok := value.(string)
29086				if !ok {
29087					return fmt.Errorf("expected Query to be of type string, got %T instead", value)
29088				}
29089				sv.Query = ptr.String(jtv)
29090			}
29091
29092		default:
29093			_, _ = key, value
29094
29095		}
29096	}
29097	*v = sv
29098	return nil
29099}
29100
29101func awsRestjson1_deserializeDocumentUIColorPalette(v **types.UIColorPalette, 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 *types.UIColorPalette
29115	if *v == nil {
29116		sv = &types.UIColorPalette{}
29117	} else {
29118		sv = *v
29119	}
29120
29121	for key, value := range shape {
29122		switch key {
29123		case "Accent":
29124			if value != nil {
29125				jtv, ok := value.(string)
29126				if !ok {
29127					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29128				}
29129				sv.Accent = ptr.String(jtv)
29130			}
29131
29132		case "AccentForeground":
29133			if value != nil {
29134				jtv, ok := value.(string)
29135				if !ok {
29136					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29137				}
29138				sv.AccentForeground = ptr.String(jtv)
29139			}
29140
29141		case "Danger":
29142			if value != nil {
29143				jtv, ok := value.(string)
29144				if !ok {
29145					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29146				}
29147				sv.Danger = ptr.String(jtv)
29148			}
29149
29150		case "DangerForeground":
29151			if value != nil {
29152				jtv, ok := value.(string)
29153				if !ok {
29154					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29155				}
29156				sv.DangerForeground = ptr.String(jtv)
29157			}
29158
29159		case "Dimension":
29160			if value != nil {
29161				jtv, ok := value.(string)
29162				if !ok {
29163					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29164				}
29165				sv.Dimension = ptr.String(jtv)
29166			}
29167
29168		case "DimensionForeground":
29169			if value != nil {
29170				jtv, ok := value.(string)
29171				if !ok {
29172					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29173				}
29174				sv.DimensionForeground = ptr.String(jtv)
29175			}
29176
29177		case "Measure":
29178			if value != nil {
29179				jtv, ok := value.(string)
29180				if !ok {
29181					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29182				}
29183				sv.Measure = ptr.String(jtv)
29184			}
29185
29186		case "MeasureForeground":
29187			if value != nil {
29188				jtv, ok := value.(string)
29189				if !ok {
29190					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29191				}
29192				sv.MeasureForeground = ptr.String(jtv)
29193			}
29194
29195		case "PrimaryBackground":
29196			if value != nil {
29197				jtv, ok := value.(string)
29198				if !ok {
29199					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29200				}
29201				sv.PrimaryBackground = ptr.String(jtv)
29202			}
29203
29204		case "PrimaryForeground":
29205			if value != nil {
29206				jtv, ok := value.(string)
29207				if !ok {
29208					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29209				}
29210				sv.PrimaryForeground = ptr.String(jtv)
29211			}
29212
29213		case "SecondaryBackground":
29214			if value != nil {
29215				jtv, ok := value.(string)
29216				if !ok {
29217					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29218				}
29219				sv.SecondaryBackground = ptr.String(jtv)
29220			}
29221
29222		case "SecondaryForeground":
29223			if value != nil {
29224				jtv, ok := value.(string)
29225				if !ok {
29226					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29227				}
29228				sv.SecondaryForeground = ptr.String(jtv)
29229			}
29230
29231		case "Success":
29232			if value != nil {
29233				jtv, ok := value.(string)
29234				if !ok {
29235					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29236				}
29237				sv.Success = ptr.String(jtv)
29238			}
29239
29240		case "SuccessForeground":
29241			if value != nil {
29242				jtv, ok := value.(string)
29243				if !ok {
29244					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29245				}
29246				sv.SuccessForeground = ptr.String(jtv)
29247			}
29248
29249		case "Warning":
29250			if value != nil {
29251				jtv, ok := value.(string)
29252				if !ok {
29253					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29254				}
29255				sv.Warning = ptr.String(jtv)
29256			}
29257
29258		case "WarningForeground":
29259			if value != nil {
29260				jtv, ok := value.(string)
29261				if !ok {
29262					return fmt.Errorf("expected HexColor to be of type string, got %T instead", value)
29263				}
29264				sv.WarningForeground = ptr.String(jtv)
29265			}
29266
29267		default:
29268			_, _ = key, value
29269
29270		}
29271	}
29272	*v = sv
29273	return nil
29274}
29275
29276func awsRestjson1_deserializeDocumentUnsupportedPricingPlanException(v **types.UnsupportedPricingPlanException, value interface{}) error {
29277	if v == nil {
29278		return fmt.Errorf("unexpected nil of type %T", v)
29279	}
29280	if value == nil {
29281		return nil
29282	}
29283
29284	shape, ok := value.(map[string]interface{})
29285	if !ok {
29286		return fmt.Errorf("unexpected JSON type %v", value)
29287	}
29288
29289	var sv *types.UnsupportedPricingPlanException
29290	if *v == nil {
29291		sv = &types.UnsupportedPricingPlanException{}
29292	} else {
29293		sv = *v
29294	}
29295
29296	for key, value := range shape {
29297		switch key {
29298		case "Message":
29299			if value != nil {
29300				jtv, ok := value.(string)
29301				if !ok {
29302					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29303				}
29304				sv.Message = ptr.String(jtv)
29305			}
29306
29307		case "RequestId":
29308			if value != nil {
29309				jtv, ok := value.(string)
29310				if !ok {
29311					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29312				}
29313				sv.RequestId = ptr.String(jtv)
29314			}
29315
29316		default:
29317			_, _ = key, value
29318
29319		}
29320	}
29321	*v = sv
29322	return nil
29323}
29324
29325func awsRestjson1_deserializeDocumentUnsupportedUserEditionException(v **types.UnsupportedUserEditionException, value interface{}) error {
29326	if v == nil {
29327		return fmt.Errorf("unexpected nil of type %T", v)
29328	}
29329	if value == nil {
29330		return nil
29331	}
29332
29333	shape, ok := value.(map[string]interface{})
29334	if !ok {
29335		return fmt.Errorf("unexpected JSON type %v", value)
29336	}
29337
29338	var sv *types.UnsupportedUserEditionException
29339	if *v == nil {
29340		sv = &types.UnsupportedUserEditionException{}
29341	} else {
29342		sv = *v
29343	}
29344
29345	for key, value := range shape {
29346		switch key {
29347		case "Message":
29348			if value != nil {
29349				jtv, ok := value.(string)
29350				if !ok {
29351					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29352				}
29353				sv.Message = ptr.String(jtv)
29354			}
29355
29356		case "RequestId":
29357			if value != nil {
29358				jtv, ok := value.(string)
29359				if !ok {
29360					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29361				}
29362				sv.RequestId = ptr.String(jtv)
29363			}
29364
29365		default:
29366			_, _ = key, value
29367
29368		}
29369	}
29370	*v = sv
29371	return nil
29372}
29373
29374func awsRestjson1_deserializeDocumentUploadSettings(v **types.UploadSettings, value interface{}) error {
29375	if v == nil {
29376		return fmt.Errorf("unexpected nil of type %T", v)
29377	}
29378	if value == nil {
29379		return nil
29380	}
29381
29382	shape, ok := value.(map[string]interface{})
29383	if !ok {
29384		return fmt.Errorf("unexpected JSON type %v", value)
29385	}
29386
29387	var sv *types.UploadSettings
29388	if *v == nil {
29389		sv = &types.UploadSettings{}
29390	} else {
29391		sv = *v
29392	}
29393
29394	for key, value := range shape {
29395		switch key {
29396		case "ContainsHeader":
29397			if value != nil {
29398				jtv, ok := value.(bool)
29399				if !ok {
29400					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
29401				}
29402				sv.ContainsHeader = jtv
29403			}
29404
29405		case "Delimiter":
29406			if value != nil {
29407				jtv, ok := value.(string)
29408				if !ok {
29409					return fmt.Errorf("expected Delimiter to be of type string, got %T instead", value)
29410				}
29411				sv.Delimiter = ptr.String(jtv)
29412			}
29413
29414		case "Format":
29415			if value != nil {
29416				jtv, ok := value.(string)
29417				if !ok {
29418					return fmt.Errorf("expected FileFormat to be of type string, got %T instead", value)
29419				}
29420				sv.Format = types.FileFormat(jtv)
29421			}
29422
29423		case "StartFromRow":
29424			if value != nil {
29425				jtv, ok := value.(json.Number)
29426				if !ok {
29427					return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value)
29428				}
29429				i64, err := jtv.Int64()
29430				if err != nil {
29431					return err
29432				}
29433				sv.StartFromRow = int32(i64)
29434			}
29435
29436		case "TextQualifier":
29437			if value != nil {
29438				jtv, ok := value.(string)
29439				if !ok {
29440					return fmt.Errorf("expected TextQualifier to be of type string, got %T instead", value)
29441				}
29442				sv.TextQualifier = types.TextQualifier(jtv)
29443			}
29444
29445		default:
29446			_, _ = key, value
29447
29448		}
29449	}
29450	*v = sv
29451	return nil
29452}
29453
29454func awsRestjson1_deserializeDocumentUser(v **types.User, value interface{}) error {
29455	if v == nil {
29456		return fmt.Errorf("unexpected nil of type %T", v)
29457	}
29458	if value == nil {
29459		return nil
29460	}
29461
29462	shape, ok := value.(map[string]interface{})
29463	if !ok {
29464		return fmt.Errorf("unexpected JSON type %v", value)
29465	}
29466
29467	var sv *types.User
29468	if *v == nil {
29469		sv = &types.User{}
29470	} else {
29471		sv = *v
29472	}
29473
29474	for key, value := range shape {
29475		switch key {
29476		case "Active":
29477			if value != nil {
29478				jtv, ok := value.(bool)
29479				if !ok {
29480					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
29481				}
29482				sv.Active = jtv
29483			}
29484
29485		case "Arn":
29486			if value != nil {
29487				jtv, ok := value.(string)
29488				if !ok {
29489					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
29490				}
29491				sv.Arn = ptr.String(jtv)
29492			}
29493
29494		case "CustomPermissionsName":
29495			if value != nil {
29496				jtv, ok := value.(string)
29497				if !ok {
29498					return fmt.Errorf("expected RoleName to be of type string, got %T instead", value)
29499				}
29500				sv.CustomPermissionsName = ptr.String(jtv)
29501			}
29502
29503		case "Email":
29504			if value != nil {
29505				jtv, ok := value.(string)
29506				if !ok {
29507					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29508				}
29509				sv.Email = ptr.String(jtv)
29510			}
29511
29512		case "IdentityType":
29513			if value != nil {
29514				jtv, ok := value.(string)
29515				if !ok {
29516					return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
29517				}
29518				sv.IdentityType = types.IdentityType(jtv)
29519			}
29520
29521		case "PrincipalId":
29522			if value != nil {
29523				jtv, ok := value.(string)
29524				if !ok {
29525					return fmt.Errorf("expected String to be of type string, got %T instead", value)
29526				}
29527				sv.PrincipalId = ptr.String(jtv)
29528			}
29529
29530		case "Role":
29531			if value != nil {
29532				jtv, ok := value.(string)
29533				if !ok {
29534					return fmt.Errorf("expected UserRole to be of type string, got %T instead", value)
29535				}
29536				sv.Role = types.UserRole(jtv)
29537			}
29538
29539		case "UserName":
29540			if value != nil {
29541				jtv, ok := value.(string)
29542				if !ok {
29543					return fmt.Errorf("expected UserName to be of type string, got %T instead", value)
29544				}
29545				sv.UserName = ptr.String(jtv)
29546			}
29547
29548		default:
29549			_, _ = key, value
29550
29551		}
29552	}
29553	*v = sv
29554	return nil
29555}
29556
29557func awsRestjson1_deserializeDocumentUserList(v *[]types.User, value interface{}) error {
29558	if v == nil {
29559		return fmt.Errorf("unexpected nil of type %T", v)
29560	}
29561	if value == nil {
29562		return nil
29563	}
29564
29565	shape, ok := value.([]interface{})
29566	if !ok {
29567		return fmt.Errorf("unexpected JSON type %v", value)
29568	}
29569
29570	var cv []types.User
29571	if *v == nil {
29572		cv = []types.User{}
29573	} else {
29574		cv = *v
29575	}
29576
29577	for _, value := range shape {
29578		var col types.User
29579		destAddr := &col
29580		if err := awsRestjson1_deserializeDocumentUser(&destAddr, value); err != nil {
29581			return err
29582		}
29583		col = *destAddr
29584		cv = append(cv, col)
29585
29586	}
29587	*v = cv
29588	return nil
29589}
29590
29591func awsRestjson1_deserializeDocumentVpcConnectionProperties(v **types.VpcConnectionProperties, value interface{}) error {
29592	if v == nil {
29593		return fmt.Errorf("unexpected nil of type %T", v)
29594	}
29595	if value == nil {
29596		return nil
29597	}
29598
29599	shape, ok := value.(map[string]interface{})
29600	if !ok {
29601		return fmt.Errorf("unexpected JSON type %v", value)
29602	}
29603
29604	var sv *types.VpcConnectionProperties
29605	if *v == nil {
29606		sv = &types.VpcConnectionProperties{}
29607	} else {
29608		sv = *v
29609	}
29610
29611	for key, value := range shape {
29612		switch key {
29613		case "VpcConnectionArn":
29614			if value != nil {
29615				jtv, ok := value.(string)
29616				if !ok {
29617					return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
29618				}
29619				sv.VpcConnectionArn = ptr.String(jtv)
29620			}
29621
29622		default:
29623			_, _ = key, value
29624
29625		}
29626	}
29627	*v = sv
29628	return nil
29629}
29630