1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package ram
4
5import (
6	"bytes"
7	"context"
8	"fmt"
9	"github.com/aws/aws-sdk-go-v2/service/ram/types"
10	smithy "github.com/aws/smithy-go"
11	"github.com/aws/smithy-go/encoding/httpbinding"
12	smithyjson "github.com/aws/smithy-go/encoding/json"
13	"github.com/aws/smithy-go/middleware"
14	smithyhttp "github.com/aws/smithy-go/transport/http"
15)
16
17type awsRestjson1_serializeOpAcceptResourceShareInvitation struct {
18}
19
20func (*awsRestjson1_serializeOpAcceptResourceShareInvitation) ID() string {
21	return "OperationSerializer"
22}
23
24func (m *awsRestjson1_serializeOpAcceptResourceShareInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
25	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
26) {
27	request, ok := in.Request.(*smithyhttp.Request)
28	if !ok {
29		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
30	}
31
32	input, ok := in.Parameters.(*AcceptResourceShareInvitationInput)
33	_ = input
34	if !ok {
35		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
36	}
37
38	opPath, opQuery := httpbinding.SplitURI("/acceptresourceshareinvitation")
39	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
40	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
41	request.Method = "POST"
42	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
43	if err != nil {
44		return out, metadata, &smithy.SerializationError{Err: err}
45	}
46
47	restEncoder.SetHeader("Content-Type").String("application/json")
48
49	jsonEncoder := smithyjson.NewEncoder()
50	if err := awsRestjson1_serializeOpDocumentAcceptResourceShareInvitationInput(input, jsonEncoder.Value); err != nil {
51		return out, metadata, &smithy.SerializationError{Err: err}
52	}
53
54	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
55		return out, metadata, &smithy.SerializationError{Err: err}
56	}
57
58	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
59		return out, metadata, &smithy.SerializationError{Err: err}
60	}
61	in.Request = request
62
63	return next.HandleSerialize(ctx, in)
64}
65func awsRestjson1_serializeOpHttpBindingsAcceptResourceShareInvitationInput(v *AcceptResourceShareInvitationInput, encoder *httpbinding.Encoder) error {
66	if v == nil {
67		return fmt.Errorf("unsupported serialization of nil %T", v)
68	}
69
70	return nil
71}
72
73func awsRestjson1_serializeOpDocumentAcceptResourceShareInvitationInput(v *AcceptResourceShareInvitationInput, value smithyjson.Value) error {
74	object := value.Object()
75	defer object.Close()
76
77	if v.ClientToken != nil {
78		ok := object.Key("clientToken")
79		ok.String(*v.ClientToken)
80	}
81
82	if v.ResourceShareInvitationArn != nil {
83		ok := object.Key("resourceShareInvitationArn")
84		ok.String(*v.ResourceShareInvitationArn)
85	}
86
87	return nil
88}
89
90type awsRestjson1_serializeOpAssociateResourceShare struct {
91}
92
93func (*awsRestjson1_serializeOpAssociateResourceShare) ID() string {
94	return "OperationSerializer"
95}
96
97func (m *awsRestjson1_serializeOpAssociateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
98	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
99) {
100	request, ok := in.Request.(*smithyhttp.Request)
101	if !ok {
102		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
103	}
104
105	input, ok := in.Parameters.(*AssociateResourceShareInput)
106	_ = input
107	if !ok {
108		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
109	}
110
111	opPath, opQuery := httpbinding.SplitURI("/associateresourceshare")
112	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
113	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
114	request.Method = "POST"
115	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
116	if err != nil {
117		return out, metadata, &smithy.SerializationError{Err: err}
118	}
119
120	restEncoder.SetHeader("Content-Type").String("application/json")
121
122	jsonEncoder := smithyjson.NewEncoder()
123	if err := awsRestjson1_serializeOpDocumentAssociateResourceShareInput(input, jsonEncoder.Value); err != nil {
124		return out, metadata, &smithy.SerializationError{Err: err}
125	}
126
127	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
128		return out, metadata, &smithy.SerializationError{Err: err}
129	}
130
131	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
132		return out, metadata, &smithy.SerializationError{Err: err}
133	}
134	in.Request = request
135
136	return next.HandleSerialize(ctx, in)
137}
138func awsRestjson1_serializeOpHttpBindingsAssociateResourceShareInput(v *AssociateResourceShareInput, encoder *httpbinding.Encoder) error {
139	if v == nil {
140		return fmt.Errorf("unsupported serialization of nil %T", v)
141	}
142
143	return nil
144}
145
146func awsRestjson1_serializeOpDocumentAssociateResourceShareInput(v *AssociateResourceShareInput, value smithyjson.Value) error {
147	object := value.Object()
148	defer object.Close()
149
150	if v.ClientToken != nil {
151		ok := object.Key("clientToken")
152		ok.String(*v.ClientToken)
153	}
154
155	if v.Principals != nil {
156		ok := object.Key("principals")
157		if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil {
158			return err
159		}
160	}
161
162	if v.ResourceArns != nil {
163		ok := object.Key("resourceArns")
164		if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
165			return err
166		}
167	}
168
169	if v.ResourceShareArn != nil {
170		ok := object.Key("resourceShareArn")
171		ok.String(*v.ResourceShareArn)
172	}
173
174	return nil
175}
176
177type awsRestjson1_serializeOpAssociateResourceSharePermission struct {
178}
179
180func (*awsRestjson1_serializeOpAssociateResourceSharePermission) ID() string {
181	return "OperationSerializer"
182}
183
184func (m *awsRestjson1_serializeOpAssociateResourceSharePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
185	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
186) {
187	request, ok := in.Request.(*smithyhttp.Request)
188	if !ok {
189		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
190	}
191
192	input, ok := in.Parameters.(*AssociateResourceSharePermissionInput)
193	_ = input
194	if !ok {
195		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
196	}
197
198	opPath, opQuery := httpbinding.SplitURI("/associateresourcesharepermission")
199	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
200	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
201	request.Method = "POST"
202	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
203	if err != nil {
204		return out, metadata, &smithy.SerializationError{Err: err}
205	}
206
207	restEncoder.SetHeader("Content-Type").String("application/json")
208
209	jsonEncoder := smithyjson.NewEncoder()
210	if err := awsRestjson1_serializeOpDocumentAssociateResourceSharePermissionInput(input, jsonEncoder.Value); err != nil {
211		return out, metadata, &smithy.SerializationError{Err: err}
212	}
213
214	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
215		return out, metadata, &smithy.SerializationError{Err: err}
216	}
217
218	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
219		return out, metadata, &smithy.SerializationError{Err: err}
220	}
221	in.Request = request
222
223	return next.HandleSerialize(ctx, in)
224}
225func awsRestjson1_serializeOpHttpBindingsAssociateResourceSharePermissionInput(v *AssociateResourceSharePermissionInput, encoder *httpbinding.Encoder) error {
226	if v == nil {
227		return fmt.Errorf("unsupported serialization of nil %T", v)
228	}
229
230	return nil
231}
232
233func awsRestjson1_serializeOpDocumentAssociateResourceSharePermissionInput(v *AssociateResourceSharePermissionInput, value smithyjson.Value) error {
234	object := value.Object()
235	defer object.Close()
236
237	if v.ClientToken != nil {
238		ok := object.Key("clientToken")
239		ok.String(*v.ClientToken)
240	}
241
242	if v.PermissionArn != nil {
243		ok := object.Key("permissionArn")
244		ok.String(*v.PermissionArn)
245	}
246
247	if v.PermissionVersion != nil {
248		ok := object.Key("permissionVersion")
249		ok.Integer(*v.PermissionVersion)
250	}
251
252	if v.Replace != nil {
253		ok := object.Key("replace")
254		ok.Boolean(*v.Replace)
255	}
256
257	if v.ResourceShareArn != nil {
258		ok := object.Key("resourceShareArn")
259		ok.String(*v.ResourceShareArn)
260	}
261
262	return nil
263}
264
265type awsRestjson1_serializeOpCreateResourceShare struct {
266}
267
268func (*awsRestjson1_serializeOpCreateResourceShare) ID() string {
269	return "OperationSerializer"
270}
271
272func (m *awsRestjson1_serializeOpCreateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
273	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
274) {
275	request, ok := in.Request.(*smithyhttp.Request)
276	if !ok {
277		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
278	}
279
280	input, ok := in.Parameters.(*CreateResourceShareInput)
281	_ = input
282	if !ok {
283		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
284	}
285
286	opPath, opQuery := httpbinding.SplitURI("/createresourceshare")
287	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
288	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
289	request.Method = "POST"
290	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
291	if err != nil {
292		return out, metadata, &smithy.SerializationError{Err: err}
293	}
294
295	restEncoder.SetHeader("Content-Type").String("application/json")
296
297	jsonEncoder := smithyjson.NewEncoder()
298	if err := awsRestjson1_serializeOpDocumentCreateResourceShareInput(input, jsonEncoder.Value); err != nil {
299		return out, metadata, &smithy.SerializationError{Err: err}
300	}
301
302	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
303		return out, metadata, &smithy.SerializationError{Err: err}
304	}
305
306	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
307		return out, metadata, &smithy.SerializationError{Err: err}
308	}
309	in.Request = request
310
311	return next.HandleSerialize(ctx, in)
312}
313func awsRestjson1_serializeOpHttpBindingsCreateResourceShareInput(v *CreateResourceShareInput, encoder *httpbinding.Encoder) error {
314	if v == nil {
315		return fmt.Errorf("unsupported serialization of nil %T", v)
316	}
317
318	return nil
319}
320
321func awsRestjson1_serializeOpDocumentCreateResourceShareInput(v *CreateResourceShareInput, value smithyjson.Value) error {
322	object := value.Object()
323	defer object.Close()
324
325	if v.AllowExternalPrincipals != nil {
326		ok := object.Key("allowExternalPrincipals")
327		ok.Boolean(*v.AllowExternalPrincipals)
328	}
329
330	if v.ClientToken != nil {
331		ok := object.Key("clientToken")
332		ok.String(*v.ClientToken)
333	}
334
335	if v.Name != nil {
336		ok := object.Key("name")
337		ok.String(*v.Name)
338	}
339
340	if v.PermissionArns != nil {
341		ok := object.Key("permissionArns")
342		if err := awsRestjson1_serializeDocumentPermissionArnList(v.PermissionArns, ok); err != nil {
343			return err
344		}
345	}
346
347	if v.Principals != nil {
348		ok := object.Key("principals")
349		if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil {
350			return err
351		}
352	}
353
354	if v.ResourceArns != nil {
355		ok := object.Key("resourceArns")
356		if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
357			return err
358		}
359	}
360
361	if v.Tags != nil {
362		ok := object.Key("tags")
363		if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
364			return err
365		}
366	}
367
368	return nil
369}
370
371type awsRestjson1_serializeOpDeleteResourceShare struct {
372}
373
374func (*awsRestjson1_serializeOpDeleteResourceShare) ID() string {
375	return "OperationSerializer"
376}
377
378func (m *awsRestjson1_serializeOpDeleteResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
379	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
380) {
381	request, ok := in.Request.(*smithyhttp.Request)
382	if !ok {
383		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
384	}
385
386	input, ok := in.Parameters.(*DeleteResourceShareInput)
387	_ = input
388	if !ok {
389		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
390	}
391
392	opPath, opQuery := httpbinding.SplitURI("/deleteresourceshare")
393	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
394	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
395	request.Method = "DELETE"
396	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
397	if err != nil {
398		return out, metadata, &smithy.SerializationError{Err: err}
399	}
400
401	if err := awsRestjson1_serializeOpHttpBindingsDeleteResourceShareInput(input, restEncoder); err != nil {
402		return out, metadata, &smithy.SerializationError{Err: err}
403	}
404
405	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
406		return out, metadata, &smithy.SerializationError{Err: err}
407	}
408	in.Request = request
409
410	return next.HandleSerialize(ctx, in)
411}
412func awsRestjson1_serializeOpHttpBindingsDeleteResourceShareInput(v *DeleteResourceShareInput, encoder *httpbinding.Encoder) error {
413	if v == nil {
414		return fmt.Errorf("unsupported serialization of nil %T", v)
415	}
416
417	if v.ClientToken != nil {
418		encoder.SetQuery("clientToken").String(*v.ClientToken)
419	}
420
421	if v.ResourceShareArn != nil {
422		encoder.SetQuery("resourceShareArn").String(*v.ResourceShareArn)
423	}
424
425	return nil
426}
427
428type awsRestjson1_serializeOpDisassociateResourceShare struct {
429}
430
431func (*awsRestjson1_serializeOpDisassociateResourceShare) ID() string {
432	return "OperationSerializer"
433}
434
435func (m *awsRestjson1_serializeOpDisassociateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
436	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
437) {
438	request, ok := in.Request.(*smithyhttp.Request)
439	if !ok {
440		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
441	}
442
443	input, ok := in.Parameters.(*DisassociateResourceShareInput)
444	_ = input
445	if !ok {
446		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
447	}
448
449	opPath, opQuery := httpbinding.SplitURI("/disassociateresourceshare")
450	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
451	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
452	request.Method = "POST"
453	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
454	if err != nil {
455		return out, metadata, &smithy.SerializationError{Err: err}
456	}
457
458	restEncoder.SetHeader("Content-Type").String("application/json")
459
460	jsonEncoder := smithyjson.NewEncoder()
461	if err := awsRestjson1_serializeOpDocumentDisassociateResourceShareInput(input, jsonEncoder.Value); err != nil {
462		return out, metadata, &smithy.SerializationError{Err: err}
463	}
464
465	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
466		return out, metadata, &smithy.SerializationError{Err: err}
467	}
468
469	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
470		return out, metadata, &smithy.SerializationError{Err: err}
471	}
472	in.Request = request
473
474	return next.HandleSerialize(ctx, in)
475}
476func awsRestjson1_serializeOpHttpBindingsDisassociateResourceShareInput(v *DisassociateResourceShareInput, encoder *httpbinding.Encoder) error {
477	if v == nil {
478		return fmt.Errorf("unsupported serialization of nil %T", v)
479	}
480
481	return nil
482}
483
484func awsRestjson1_serializeOpDocumentDisassociateResourceShareInput(v *DisassociateResourceShareInput, value smithyjson.Value) error {
485	object := value.Object()
486	defer object.Close()
487
488	if v.ClientToken != nil {
489		ok := object.Key("clientToken")
490		ok.String(*v.ClientToken)
491	}
492
493	if v.Principals != nil {
494		ok := object.Key("principals")
495		if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil {
496			return err
497		}
498	}
499
500	if v.ResourceArns != nil {
501		ok := object.Key("resourceArns")
502		if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
503			return err
504		}
505	}
506
507	if v.ResourceShareArn != nil {
508		ok := object.Key("resourceShareArn")
509		ok.String(*v.ResourceShareArn)
510	}
511
512	return nil
513}
514
515type awsRestjson1_serializeOpDisassociateResourceSharePermission struct {
516}
517
518func (*awsRestjson1_serializeOpDisassociateResourceSharePermission) ID() string {
519	return "OperationSerializer"
520}
521
522func (m *awsRestjson1_serializeOpDisassociateResourceSharePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
523	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
524) {
525	request, ok := in.Request.(*smithyhttp.Request)
526	if !ok {
527		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
528	}
529
530	input, ok := in.Parameters.(*DisassociateResourceSharePermissionInput)
531	_ = input
532	if !ok {
533		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
534	}
535
536	opPath, opQuery := httpbinding.SplitURI("/disassociateresourcesharepermission")
537	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
538	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
539	request.Method = "POST"
540	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
541	if err != nil {
542		return out, metadata, &smithy.SerializationError{Err: err}
543	}
544
545	restEncoder.SetHeader("Content-Type").String("application/json")
546
547	jsonEncoder := smithyjson.NewEncoder()
548	if err := awsRestjson1_serializeOpDocumentDisassociateResourceSharePermissionInput(input, jsonEncoder.Value); err != nil {
549		return out, metadata, &smithy.SerializationError{Err: err}
550	}
551
552	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
553		return out, metadata, &smithy.SerializationError{Err: err}
554	}
555
556	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
557		return out, metadata, &smithy.SerializationError{Err: err}
558	}
559	in.Request = request
560
561	return next.HandleSerialize(ctx, in)
562}
563func awsRestjson1_serializeOpHttpBindingsDisassociateResourceSharePermissionInput(v *DisassociateResourceSharePermissionInput, encoder *httpbinding.Encoder) error {
564	if v == nil {
565		return fmt.Errorf("unsupported serialization of nil %T", v)
566	}
567
568	return nil
569}
570
571func awsRestjson1_serializeOpDocumentDisassociateResourceSharePermissionInput(v *DisassociateResourceSharePermissionInput, value smithyjson.Value) error {
572	object := value.Object()
573	defer object.Close()
574
575	if v.ClientToken != nil {
576		ok := object.Key("clientToken")
577		ok.String(*v.ClientToken)
578	}
579
580	if v.PermissionArn != nil {
581		ok := object.Key("permissionArn")
582		ok.String(*v.PermissionArn)
583	}
584
585	if v.ResourceShareArn != nil {
586		ok := object.Key("resourceShareArn")
587		ok.String(*v.ResourceShareArn)
588	}
589
590	return nil
591}
592
593type awsRestjson1_serializeOpEnableSharingWithAwsOrganization struct {
594}
595
596func (*awsRestjson1_serializeOpEnableSharingWithAwsOrganization) ID() string {
597	return "OperationSerializer"
598}
599
600func (m *awsRestjson1_serializeOpEnableSharingWithAwsOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
601	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
602) {
603	request, ok := in.Request.(*smithyhttp.Request)
604	if !ok {
605		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
606	}
607
608	input, ok := in.Parameters.(*EnableSharingWithAwsOrganizationInput)
609	_ = input
610	if !ok {
611		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
612	}
613
614	opPath, opQuery := httpbinding.SplitURI("/enablesharingwithawsorganization")
615	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
616	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
617	request.Method = "POST"
618	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
619	if err != nil {
620		return out, metadata, &smithy.SerializationError{Err: err}
621	}
622
623	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
624		return out, metadata, &smithy.SerializationError{Err: err}
625	}
626	in.Request = request
627
628	return next.HandleSerialize(ctx, in)
629}
630func awsRestjson1_serializeOpHttpBindingsEnableSharingWithAwsOrganizationInput(v *EnableSharingWithAwsOrganizationInput, encoder *httpbinding.Encoder) error {
631	if v == nil {
632		return fmt.Errorf("unsupported serialization of nil %T", v)
633	}
634
635	return nil
636}
637
638type awsRestjson1_serializeOpGetPermission struct {
639}
640
641func (*awsRestjson1_serializeOpGetPermission) ID() string {
642	return "OperationSerializer"
643}
644
645func (m *awsRestjson1_serializeOpGetPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
646	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
647) {
648	request, ok := in.Request.(*smithyhttp.Request)
649	if !ok {
650		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
651	}
652
653	input, ok := in.Parameters.(*GetPermissionInput)
654	_ = input
655	if !ok {
656		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
657	}
658
659	opPath, opQuery := httpbinding.SplitURI("/getpermission")
660	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
661	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
662	request.Method = "POST"
663	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
664	if err != nil {
665		return out, metadata, &smithy.SerializationError{Err: err}
666	}
667
668	restEncoder.SetHeader("Content-Type").String("application/json")
669
670	jsonEncoder := smithyjson.NewEncoder()
671	if err := awsRestjson1_serializeOpDocumentGetPermissionInput(input, jsonEncoder.Value); err != nil {
672		return out, metadata, &smithy.SerializationError{Err: err}
673	}
674
675	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
676		return out, metadata, &smithy.SerializationError{Err: err}
677	}
678
679	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
680		return out, metadata, &smithy.SerializationError{Err: err}
681	}
682	in.Request = request
683
684	return next.HandleSerialize(ctx, in)
685}
686func awsRestjson1_serializeOpHttpBindingsGetPermissionInput(v *GetPermissionInput, encoder *httpbinding.Encoder) error {
687	if v == nil {
688		return fmt.Errorf("unsupported serialization of nil %T", v)
689	}
690
691	return nil
692}
693
694func awsRestjson1_serializeOpDocumentGetPermissionInput(v *GetPermissionInput, value smithyjson.Value) error {
695	object := value.Object()
696	defer object.Close()
697
698	if v.PermissionArn != nil {
699		ok := object.Key("permissionArn")
700		ok.String(*v.PermissionArn)
701	}
702
703	if v.PermissionVersion != nil {
704		ok := object.Key("permissionVersion")
705		ok.Integer(*v.PermissionVersion)
706	}
707
708	return nil
709}
710
711type awsRestjson1_serializeOpGetResourcePolicies struct {
712}
713
714func (*awsRestjson1_serializeOpGetResourcePolicies) ID() string {
715	return "OperationSerializer"
716}
717
718func (m *awsRestjson1_serializeOpGetResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
719	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
720) {
721	request, ok := in.Request.(*smithyhttp.Request)
722	if !ok {
723		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
724	}
725
726	input, ok := in.Parameters.(*GetResourcePoliciesInput)
727	_ = input
728	if !ok {
729		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
730	}
731
732	opPath, opQuery := httpbinding.SplitURI("/getresourcepolicies")
733	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
734	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
735	request.Method = "POST"
736	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
737	if err != nil {
738		return out, metadata, &smithy.SerializationError{Err: err}
739	}
740
741	restEncoder.SetHeader("Content-Type").String("application/json")
742
743	jsonEncoder := smithyjson.NewEncoder()
744	if err := awsRestjson1_serializeOpDocumentGetResourcePoliciesInput(input, jsonEncoder.Value); err != nil {
745		return out, metadata, &smithy.SerializationError{Err: err}
746	}
747
748	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
749		return out, metadata, &smithy.SerializationError{Err: err}
750	}
751
752	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
753		return out, metadata, &smithy.SerializationError{Err: err}
754	}
755	in.Request = request
756
757	return next.HandleSerialize(ctx, in)
758}
759func awsRestjson1_serializeOpHttpBindingsGetResourcePoliciesInput(v *GetResourcePoliciesInput, encoder *httpbinding.Encoder) error {
760	if v == nil {
761		return fmt.Errorf("unsupported serialization of nil %T", v)
762	}
763
764	return nil
765}
766
767func awsRestjson1_serializeOpDocumentGetResourcePoliciesInput(v *GetResourcePoliciesInput, value smithyjson.Value) error {
768	object := value.Object()
769	defer object.Close()
770
771	if v.MaxResults != nil {
772		ok := object.Key("maxResults")
773		ok.Integer(*v.MaxResults)
774	}
775
776	if v.NextToken != nil {
777		ok := object.Key("nextToken")
778		ok.String(*v.NextToken)
779	}
780
781	if v.Principal != nil {
782		ok := object.Key("principal")
783		ok.String(*v.Principal)
784	}
785
786	if v.ResourceArns != nil {
787		ok := object.Key("resourceArns")
788		if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
789			return err
790		}
791	}
792
793	return nil
794}
795
796type awsRestjson1_serializeOpGetResourceShareAssociations struct {
797}
798
799func (*awsRestjson1_serializeOpGetResourceShareAssociations) ID() string {
800	return "OperationSerializer"
801}
802
803func (m *awsRestjson1_serializeOpGetResourceShareAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
804	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
805) {
806	request, ok := in.Request.(*smithyhttp.Request)
807	if !ok {
808		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
809	}
810
811	input, ok := in.Parameters.(*GetResourceShareAssociationsInput)
812	_ = input
813	if !ok {
814		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
815	}
816
817	opPath, opQuery := httpbinding.SplitURI("/getresourceshareassociations")
818	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
819	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
820	request.Method = "POST"
821	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
822	if err != nil {
823		return out, metadata, &smithy.SerializationError{Err: err}
824	}
825
826	restEncoder.SetHeader("Content-Type").String("application/json")
827
828	jsonEncoder := smithyjson.NewEncoder()
829	if err := awsRestjson1_serializeOpDocumentGetResourceShareAssociationsInput(input, jsonEncoder.Value); err != nil {
830		return out, metadata, &smithy.SerializationError{Err: err}
831	}
832
833	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
834		return out, metadata, &smithy.SerializationError{Err: err}
835	}
836
837	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
838		return out, metadata, &smithy.SerializationError{Err: err}
839	}
840	in.Request = request
841
842	return next.HandleSerialize(ctx, in)
843}
844func awsRestjson1_serializeOpHttpBindingsGetResourceShareAssociationsInput(v *GetResourceShareAssociationsInput, encoder *httpbinding.Encoder) error {
845	if v == nil {
846		return fmt.Errorf("unsupported serialization of nil %T", v)
847	}
848
849	return nil
850}
851
852func awsRestjson1_serializeOpDocumentGetResourceShareAssociationsInput(v *GetResourceShareAssociationsInput, value smithyjson.Value) error {
853	object := value.Object()
854	defer object.Close()
855
856	if len(v.AssociationStatus) > 0 {
857		ok := object.Key("associationStatus")
858		ok.String(string(v.AssociationStatus))
859	}
860
861	if len(v.AssociationType) > 0 {
862		ok := object.Key("associationType")
863		ok.String(string(v.AssociationType))
864	}
865
866	if v.MaxResults != nil {
867		ok := object.Key("maxResults")
868		ok.Integer(*v.MaxResults)
869	}
870
871	if v.NextToken != nil {
872		ok := object.Key("nextToken")
873		ok.String(*v.NextToken)
874	}
875
876	if v.Principal != nil {
877		ok := object.Key("principal")
878		ok.String(*v.Principal)
879	}
880
881	if v.ResourceArn != nil {
882		ok := object.Key("resourceArn")
883		ok.String(*v.ResourceArn)
884	}
885
886	if v.ResourceShareArns != nil {
887		ok := object.Key("resourceShareArns")
888		if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil {
889			return err
890		}
891	}
892
893	return nil
894}
895
896type awsRestjson1_serializeOpGetResourceShareInvitations struct {
897}
898
899func (*awsRestjson1_serializeOpGetResourceShareInvitations) ID() string {
900	return "OperationSerializer"
901}
902
903func (m *awsRestjson1_serializeOpGetResourceShareInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
904	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
905) {
906	request, ok := in.Request.(*smithyhttp.Request)
907	if !ok {
908		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
909	}
910
911	input, ok := in.Parameters.(*GetResourceShareInvitationsInput)
912	_ = input
913	if !ok {
914		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
915	}
916
917	opPath, opQuery := httpbinding.SplitURI("/getresourceshareinvitations")
918	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
919	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
920	request.Method = "POST"
921	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
922	if err != nil {
923		return out, metadata, &smithy.SerializationError{Err: err}
924	}
925
926	restEncoder.SetHeader("Content-Type").String("application/json")
927
928	jsonEncoder := smithyjson.NewEncoder()
929	if err := awsRestjson1_serializeOpDocumentGetResourceShareInvitationsInput(input, jsonEncoder.Value); err != nil {
930		return out, metadata, &smithy.SerializationError{Err: err}
931	}
932
933	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
934		return out, metadata, &smithy.SerializationError{Err: err}
935	}
936
937	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
938		return out, metadata, &smithy.SerializationError{Err: err}
939	}
940	in.Request = request
941
942	return next.HandleSerialize(ctx, in)
943}
944func awsRestjson1_serializeOpHttpBindingsGetResourceShareInvitationsInput(v *GetResourceShareInvitationsInput, encoder *httpbinding.Encoder) error {
945	if v == nil {
946		return fmt.Errorf("unsupported serialization of nil %T", v)
947	}
948
949	return nil
950}
951
952func awsRestjson1_serializeOpDocumentGetResourceShareInvitationsInput(v *GetResourceShareInvitationsInput, value smithyjson.Value) error {
953	object := value.Object()
954	defer object.Close()
955
956	if v.MaxResults != nil {
957		ok := object.Key("maxResults")
958		ok.Integer(*v.MaxResults)
959	}
960
961	if v.NextToken != nil {
962		ok := object.Key("nextToken")
963		ok.String(*v.NextToken)
964	}
965
966	if v.ResourceShareArns != nil {
967		ok := object.Key("resourceShareArns")
968		if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil {
969			return err
970		}
971	}
972
973	if v.ResourceShareInvitationArns != nil {
974		ok := object.Key("resourceShareInvitationArns")
975		if err := awsRestjson1_serializeDocumentResourceShareInvitationArnList(v.ResourceShareInvitationArns, ok); err != nil {
976			return err
977		}
978	}
979
980	return nil
981}
982
983type awsRestjson1_serializeOpGetResourceShares struct {
984}
985
986func (*awsRestjson1_serializeOpGetResourceShares) ID() string {
987	return "OperationSerializer"
988}
989
990func (m *awsRestjson1_serializeOpGetResourceShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
991	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
992) {
993	request, ok := in.Request.(*smithyhttp.Request)
994	if !ok {
995		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
996	}
997
998	input, ok := in.Parameters.(*GetResourceSharesInput)
999	_ = input
1000	if !ok {
1001		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1002	}
1003
1004	opPath, opQuery := httpbinding.SplitURI("/getresourceshares")
1005	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1006	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1007	request.Method = "POST"
1008	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1009	if err != nil {
1010		return out, metadata, &smithy.SerializationError{Err: err}
1011	}
1012
1013	restEncoder.SetHeader("Content-Type").String("application/json")
1014
1015	jsonEncoder := smithyjson.NewEncoder()
1016	if err := awsRestjson1_serializeOpDocumentGetResourceSharesInput(input, jsonEncoder.Value); err != nil {
1017		return out, metadata, &smithy.SerializationError{Err: err}
1018	}
1019
1020	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1021		return out, metadata, &smithy.SerializationError{Err: err}
1022	}
1023
1024	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1025		return out, metadata, &smithy.SerializationError{Err: err}
1026	}
1027	in.Request = request
1028
1029	return next.HandleSerialize(ctx, in)
1030}
1031func awsRestjson1_serializeOpHttpBindingsGetResourceSharesInput(v *GetResourceSharesInput, encoder *httpbinding.Encoder) error {
1032	if v == nil {
1033		return fmt.Errorf("unsupported serialization of nil %T", v)
1034	}
1035
1036	return nil
1037}
1038
1039func awsRestjson1_serializeOpDocumentGetResourceSharesInput(v *GetResourceSharesInput, value smithyjson.Value) error {
1040	object := value.Object()
1041	defer object.Close()
1042
1043	if v.MaxResults != nil {
1044		ok := object.Key("maxResults")
1045		ok.Integer(*v.MaxResults)
1046	}
1047
1048	if v.Name != nil {
1049		ok := object.Key("name")
1050		ok.String(*v.Name)
1051	}
1052
1053	if v.NextToken != nil {
1054		ok := object.Key("nextToken")
1055		ok.String(*v.NextToken)
1056	}
1057
1058	if v.PermissionArn != nil {
1059		ok := object.Key("permissionArn")
1060		ok.String(*v.PermissionArn)
1061	}
1062
1063	if len(v.ResourceOwner) > 0 {
1064		ok := object.Key("resourceOwner")
1065		ok.String(string(v.ResourceOwner))
1066	}
1067
1068	if v.ResourceShareArns != nil {
1069		ok := object.Key("resourceShareArns")
1070		if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil {
1071			return err
1072		}
1073	}
1074
1075	if len(v.ResourceShareStatus) > 0 {
1076		ok := object.Key("resourceShareStatus")
1077		ok.String(string(v.ResourceShareStatus))
1078	}
1079
1080	if v.TagFilters != nil {
1081		ok := object.Key("tagFilters")
1082		if err := awsRestjson1_serializeDocumentTagFilters(v.TagFilters, ok); err != nil {
1083			return err
1084		}
1085	}
1086
1087	return nil
1088}
1089
1090type awsRestjson1_serializeOpListPendingInvitationResources struct {
1091}
1092
1093func (*awsRestjson1_serializeOpListPendingInvitationResources) ID() string {
1094	return "OperationSerializer"
1095}
1096
1097func (m *awsRestjson1_serializeOpListPendingInvitationResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1098	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1099) {
1100	request, ok := in.Request.(*smithyhttp.Request)
1101	if !ok {
1102		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1103	}
1104
1105	input, ok := in.Parameters.(*ListPendingInvitationResourcesInput)
1106	_ = input
1107	if !ok {
1108		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1109	}
1110
1111	opPath, opQuery := httpbinding.SplitURI("/listpendinginvitationresources")
1112	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1113	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1114	request.Method = "POST"
1115	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1116	if err != nil {
1117		return out, metadata, &smithy.SerializationError{Err: err}
1118	}
1119
1120	restEncoder.SetHeader("Content-Type").String("application/json")
1121
1122	jsonEncoder := smithyjson.NewEncoder()
1123	if err := awsRestjson1_serializeOpDocumentListPendingInvitationResourcesInput(input, jsonEncoder.Value); err != nil {
1124		return out, metadata, &smithy.SerializationError{Err: err}
1125	}
1126
1127	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1128		return out, metadata, &smithy.SerializationError{Err: err}
1129	}
1130
1131	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1132		return out, metadata, &smithy.SerializationError{Err: err}
1133	}
1134	in.Request = request
1135
1136	return next.HandleSerialize(ctx, in)
1137}
1138func awsRestjson1_serializeOpHttpBindingsListPendingInvitationResourcesInput(v *ListPendingInvitationResourcesInput, encoder *httpbinding.Encoder) error {
1139	if v == nil {
1140		return fmt.Errorf("unsupported serialization of nil %T", v)
1141	}
1142
1143	return nil
1144}
1145
1146func awsRestjson1_serializeOpDocumentListPendingInvitationResourcesInput(v *ListPendingInvitationResourcesInput, value smithyjson.Value) error {
1147	object := value.Object()
1148	defer object.Close()
1149
1150	if v.MaxResults != nil {
1151		ok := object.Key("maxResults")
1152		ok.Integer(*v.MaxResults)
1153	}
1154
1155	if v.NextToken != nil {
1156		ok := object.Key("nextToken")
1157		ok.String(*v.NextToken)
1158	}
1159
1160	if v.ResourceShareInvitationArn != nil {
1161		ok := object.Key("resourceShareInvitationArn")
1162		ok.String(*v.ResourceShareInvitationArn)
1163	}
1164
1165	return nil
1166}
1167
1168type awsRestjson1_serializeOpListPermissions struct {
1169}
1170
1171func (*awsRestjson1_serializeOpListPermissions) ID() string {
1172	return "OperationSerializer"
1173}
1174
1175func (m *awsRestjson1_serializeOpListPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1176	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1177) {
1178	request, ok := in.Request.(*smithyhttp.Request)
1179	if !ok {
1180		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1181	}
1182
1183	input, ok := in.Parameters.(*ListPermissionsInput)
1184	_ = input
1185	if !ok {
1186		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1187	}
1188
1189	opPath, opQuery := httpbinding.SplitURI("/listpermissions")
1190	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1191	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1192	request.Method = "POST"
1193	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1194	if err != nil {
1195		return out, metadata, &smithy.SerializationError{Err: err}
1196	}
1197
1198	restEncoder.SetHeader("Content-Type").String("application/json")
1199
1200	jsonEncoder := smithyjson.NewEncoder()
1201	if err := awsRestjson1_serializeOpDocumentListPermissionsInput(input, jsonEncoder.Value); err != nil {
1202		return out, metadata, &smithy.SerializationError{Err: err}
1203	}
1204
1205	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1206		return out, metadata, &smithy.SerializationError{Err: err}
1207	}
1208
1209	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1210		return out, metadata, &smithy.SerializationError{Err: err}
1211	}
1212	in.Request = request
1213
1214	return next.HandleSerialize(ctx, in)
1215}
1216func awsRestjson1_serializeOpHttpBindingsListPermissionsInput(v *ListPermissionsInput, encoder *httpbinding.Encoder) error {
1217	if v == nil {
1218		return fmt.Errorf("unsupported serialization of nil %T", v)
1219	}
1220
1221	return nil
1222}
1223
1224func awsRestjson1_serializeOpDocumentListPermissionsInput(v *ListPermissionsInput, value smithyjson.Value) error {
1225	object := value.Object()
1226	defer object.Close()
1227
1228	if v.MaxResults != nil {
1229		ok := object.Key("maxResults")
1230		ok.Integer(*v.MaxResults)
1231	}
1232
1233	if v.NextToken != nil {
1234		ok := object.Key("nextToken")
1235		ok.String(*v.NextToken)
1236	}
1237
1238	if v.ResourceType != nil {
1239		ok := object.Key("resourceType")
1240		ok.String(*v.ResourceType)
1241	}
1242
1243	return nil
1244}
1245
1246type awsRestjson1_serializeOpListPrincipals struct {
1247}
1248
1249func (*awsRestjson1_serializeOpListPrincipals) ID() string {
1250	return "OperationSerializer"
1251}
1252
1253func (m *awsRestjson1_serializeOpListPrincipals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1254	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1255) {
1256	request, ok := in.Request.(*smithyhttp.Request)
1257	if !ok {
1258		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1259	}
1260
1261	input, ok := in.Parameters.(*ListPrincipalsInput)
1262	_ = input
1263	if !ok {
1264		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1265	}
1266
1267	opPath, opQuery := httpbinding.SplitURI("/listprincipals")
1268	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1269	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1270	request.Method = "POST"
1271	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1272	if err != nil {
1273		return out, metadata, &smithy.SerializationError{Err: err}
1274	}
1275
1276	restEncoder.SetHeader("Content-Type").String("application/json")
1277
1278	jsonEncoder := smithyjson.NewEncoder()
1279	if err := awsRestjson1_serializeOpDocumentListPrincipalsInput(input, jsonEncoder.Value); err != nil {
1280		return out, metadata, &smithy.SerializationError{Err: err}
1281	}
1282
1283	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1284		return out, metadata, &smithy.SerializationError{Err: err}
1285	}
1286
1287	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1288		return out, metadata, &smithy.SerializationError{Err: err}
1289	}
1290	in.Request = request
1291
1292	return next.HandleSerialize(ctx, in)
1293}
1294func awsRestjson1_serializeOpHttpBindingsListPrincipalsInput(v *ListPrincipalsInput, encoder *httpbinding.Encoder) error {
1295	if v == nil {
1296		return fmt.Errorf("unsupported serialization of nil %T", v)
1297	}
1298
1299	return nil
1300}
1301
1302func awsRestjson1_serializeOpDocumentListPrincipalsInput(v *ListPrincipalsInput, value smithyjson.Value) error {
1303	object := value.Object()
1304	defer object.Close()
1305
1306	if v.MaxResults != nil {
1307		ok := object.Key("maxResults")
1308		ok.Integer(*v.MaxResults)
1309	}
1310
1311	if v.NextToken != nil {
1312		ok := object.Key("nextToken")
1313		ok.String(*v.NextToken)
1314	}
1315
1316	if v.Principals != nil {
1317		ok := object.Key("principals")
1318		if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil {
1319			return err
1320		}
1321	}
1322
1323	if v.ResourceArn != nil {
1324		ok := object.Key("resourceArn")
1325		ok.String(*v.ResourceArn)
1326	}
1327
1328	if len(v.ResourceOwner) > 0 {
1329		ok := object.Key("resourceOwner")
1330		ok.String(string(v.ResourceOwner))
1331	}
1332
1333	if v.ResourceShareArns != nil {
1334		ok := object.Key("resourceShareArns")
1335		if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil {
1336			return err
1337		}
1338	}
1339
1340	if v.ResourceType != nil {
1341		ok := object.Key("resourceType")
1342		ok.String(*v.ResourceType)
1343	}
1344
1345	return nil
1346}
1347
1348type awsRestjson1_serializeOpListResources struct {
1349}
1350
1351func (*awsRestjson1_serializeOpListResources) ID() string {
1352	return "OperationSerializer"
1353}
1354
1355func (m *awsRestjson1_serializeOpListResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1356	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1357) {
1358	request, ok := in.Request.(*smithyhttp.Request)
1359	if !ok {
1360		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1361	}
1362
1363	input, ok := in.Parameters.(*ListResourcesInput)
1364	_ = input
1365	if !ok {
1366		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1367	}
1368
1369	opPath, opQuery := httpbinding.SplitURI("/listresources")
1370	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1371	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1372	request.Method = "POST"
1373	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1374	if err != nil {
1375		return out, metadata, &smithy.SerializationError{Err: err}
1376	}
1377
1378	restEncoder.SetHeader("Content-Type").String("application/json")
1379
1380	jsonEncoder := smithyjson.NewEncoder()
1381	if err := awsRestjson1_serializeOpDocumentListResourcesInput(input, jsonEncoder.Value); err != nil {
1382		return out, metadata, &smithy.SerializationError{Err: err}
1383	}
1384
1385	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1386		return out, metadata, &smithy.SerializationError{Err: err}
1387	}
1388
1389	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1390		return out, metadata, &smithy.SerializationError{Err: err}
1391	}
1392	in.Request = request
1393
1394	return next.HandleSerialize(ctx, in)
1395}
1396func awsRestjson1_serializeOpHttpBindingsListResourcesInput(v *ListResourcesInput, encoder *httpbinding.Encoder) error {
1397	if v == nil {
1398		return fmt.Errorf("unsupported serialization of nil %T", v)
1399	}
1400
1401	return nil
1402}
1403
1404func awsRestjson1_serializeOpDocumentListResourcesInput(v *ListResourcesInput, value smithyjson.Value) error {
1405	object := value.Object()
1406	defer object.Close()
1407
1408	if v.MaxResults != nil {
1409		ok := object.Key("maxResults")
1410		ok.Integer(*v.MaxResults)
1411	}
1412
1413	if v.NextToken != nil {
1414		ok := object.Key("nextToken")
1415		ok.String(*v.NextToken)
1416	}
1417
1418	if v.Principal != nil {
1419		ok := object.Key("principal")
1420		ok.String(*v.Principal)
1421	}
1422
1423	if v.ResourceArns != nil {
1424		ok := object.Key("resourceArns")
1425		if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
1426			return err
1427		}
1428	}
1429
1430	if len(v.ResourceOwner) > 0 {
1431		ok := object.Key("resourceOwner")
1432		ok.String(string(v.ResourceOwner))
1433	}
1434
1435	if v.ResourceShareArns != nil {
1436		ok := object.Key("resourceShareArns")
1437		if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil {
1438			return err
1439		}
1440	}
1441
1442	if v.ResourceType != nil {
1443		ok := object.Key("resourceType")
1444		ok.String(*v.ResourceType)
1445	}
1446
1447	return nil
1448}
1449
1450type awsRestjson1_serializeOpListResourceSharePermissions struct {
1451}
1452
1453func (*awsRestjson1_serializeOpListResourceSharePermissions) ID() string {
1454	return "OperationSerializer"
1455}
1456
1457func (m *awsRestjson1_serializeOpListResourceSharePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1458	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1459) {
1460	request, ok := in.Request.(*smithyhttp.Request)
1461	if !ok {
1462		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1463	}
1464
1465	input, ok := in.Parameters.(*ListResourceSharePermissionsInput)
1466	_ = input
1467	if !ok {
1468		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1469	}
1470
1471	opPath, opQuery := httpbinding.SplitURI("/listresourcesharepermissions")
1472	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1473	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1474	request.Method = "POST"
1475	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1476	if err != nil {
1477		return out, metadata, &smithy.SerializationError{Err: err}
1478	}
1479
1480	restEncoder.SetHeader("Content-Type").String("application/json")
1481
1482	jsonEncoder := smithyjson.NewEncoder()
1483	if err := awsRestjson1_serializeOpDocumentListResourceSharePermissionsInput(input, jsonEncoder.Value); err != nil {
1484		return out, metadata, &smithy.SerializationError{Err: err}
1485	}
1486
1487	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1488		return out, metadata, &smithy.SerializationError{Err: err}
1489	}
1490
1491	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1492		return out, metadata, &smithy.SerializationError{Err: err}
1493	}
1494	in.Request = request
1495
1496	return next.HandleSerialize(ctx, in)
1497}
1498func awsRestjson1_serializeOpHttpBindingsListResourceSharePermissionsInput(v *ListResourceSharePermissionsInput, encoder *httpbinding.Encoder) error {
1499	if v == nil {
1500		return fmt.Errorf("unsupported serialization of nil %T", v)
1501	}
1502
1503	return nil
1504}
1505
1506func awsRestjson1_serializeOpDocumentListResourceSharePermissionsInput(v *ListResourceSharePermissionsInput, value smithyjson.Value) error {
1507	object := value.Object()
1508	defer object.Close()
1509
1510	if v.MaxResults != nil {
1511		ok := object.Key("maxResults")
1512		ok.Integer(*v.MaxResults)
1513	}
1514
1515	if v.NextToken != nil {
1516		ok := object.Key("nextToken")
1517		ok.String(*v.NextToken)
1518	}
1519
1520	if v.ResourceShareArn != nil {
1521		ok := object.Key("resourceShareArn")
1522		ok.String(*v.ResourceShareArn)
1523	}
1524
1525	return nil
1526}
1527
1528type awsRestjson1_serializeOpListResourceTypes struct {
1529}
1530
1531func (*awsRestjson1_serializeOpListResourceTypes) ID() string {
1532	return "OperationSerializer"
1533}
1534
1535func (m *awsRestjson1_serializeOpListResourceTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1536	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1537) {
1538	request, ok := in.Request.(*smithyhttp.Request)
1539	if !ok {
1540		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1541	}
1542
1543	input, ok := in.Parameters.(*ListResourceTypesInput)
1544	_ = input
1545	if !ok {
1546		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1547	}
1548
1549	opPath, opQuery := httpbinding.SplitURI("/listresourcetypes")
1550	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1551	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1552	request.Method = "POST"
1553	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1554	if err != nil {
1555		return out, metadata, &smithy.SerializationError{Err: err}
1556	}
1557
1558	restEncoder.SetHeader("Content-Type").String("application/json")
1559
1560	jsonEncoder := smithyjson.NewEncoder()
1561	if err := awsRestjson1_serializeOpDocumentListResourceTypesInput(input, jsonEncoder.Value); err != nil {
1562		return out, metadata, &smithy.SerializationError{Err: err}
1563	}
1564
1565	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1566		return out, metadata, &smithy.SerializationError{Err: err}
1567	}
1568
1569	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1570		return out, metadata, &smithy.SerializationError{Err: err}
1571	}
1572	in.Request = request
1573
1574	return next.HandleSerialize(ctx, in)
1575}
1576func awsRestjson1_serializeOpHttpBindingsListResourceTypesInput(v *ListResourceTypesInput, encoder *httpbinding.Encoder) error {
1577	if v == nil {
1578		return fmt.Errorf("unsupported serialization of nil %T", v)
1579	}
1580
1581	return nil
1582}
1583
1584func awsRestjson1_serializeOpDocumentListResourceTypesInput(v *ListResourceTypesInput, value smithyjson.Value) error {
1585	object := value.Object()
1586	defer object.Close()
1587
1588	if v.MaxResults != nil {
1589		ok := object.Key("maxResults")
1590		ok.Integer(*v.MaxResults)
1591	}
1592
1593	if v.NextToken != nil {
1594		ok := object.Key("nextToken")
1595		ok.String(*v.NextToken)
1596	}
1597
1598	return nil
1599}
1600
1601type awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy struct {
1602}
1603
1604func (*awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy) ID() string {
1605	return "OperationSerializer"
1606}
1607
1608func (m *awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1609	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1610) {
1611	request, ok := in.Request.(*smithyhttp.Request)
1612	if !ok {
1613		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1614	}
1615
1616	input, ok := in.Parameters.(*PromoteResourceShareCreatedFromPolicyInput)
1617	_ = input
1618	if !ok {
1619		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1620	}
1621
1622	opPath, opQuery := httpbinding.SplitURI("/promoteresourcesharecreatedfrompolicy")
1623	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1624	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1625	request.Method = "POST"
1626	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1627	if err != nil {
1628		return out, metadata, &smithy.SerializationError{Err: err}
1629	}
1630
1631	if err := awsRestjson1_serializeOpHttpBindingsPromoteResourceShareCreatedFromPolicyInput(input, restEncoder); err != nil {
1632		return out, metadata, &smithy.SerializationError{Err: err}
1633	}
1634
1635	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1636		return out, metadata, &smithy.SerializationError{Err: err}
1637	}
1638	in.Request = request
1639
1640	return next.HandleSerialize(ctx, in)
1641}
1642func awsRestjson1_serializeOpHttpBindingsPromoteResourceShareCreatedFromPolicyInput(v *PromoteResourceShareCreatedFromPolicyInput, encoder *httpbinding.Encoder) error {
1643	if v == nil {
1644		return fmt.Errorf("unsupported serialization of nil %T", v)
1645	}
1646
1647	if v.ResourceShareArn != nil {
1648		encoder.SetQuery("resourceShareArn").String(*v.ResourceShareArn)
1649	}
1650
1651	return nil
1652}
1653
1654type awsRestjson1_serializeOpRejectResourceShareInvitation struct {
1655}
1656
1657func (*awsRestjson1_serializeOpRejectResourceShareInvitation) ID() string {
1658	return "OperationSerializer"
1659}
1660
1661func (m *awsRestjson1_serializeOpRejectResourceShareInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1662	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1663) {
1664	request, ok := in.Request.(*smithyhttp.Request)
1665	if !ok {
1666		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1667	}
1668
1669	input, ok := in.Parameters.(*RejectResourceShareInvitationInput)
1670	_ = input
1671	if !ok {
1672		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1673	}
1674
1675	opPath, opQuery := httpbinding.SplitURI("/rejectresourceshareinvitation")
1676	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1677	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1678	request.Method = "POST"
1679	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1680	if err != nil {
1681		return out, metadata, &smithy.SerializationError{Err: err}
1682	}
1683
1684	restEncoder.SetHeader("Content-Type").String("application/json")
1685
1686	jsonEncoder := smithyjson.NewEncoder()
1687	if err := awsRestjson1_serializeOpDocumentRejectResourceShareInvitationInput(input, jsonEncoder.Value); err != nil {
1688		return out, metadata, &smithy.SerializationError{Err: err}
1689	}
1690
1691	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1692		return out, metadata, &smithy.SerializationError{Err: err}
1693	}
1694
1695	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1696		return out, metadata, &smithy.SerializationError{Err: err}
1697	}
1698	in.Request = request
1699
1700	return next.HandleSerialize(ctx, in)
1701}
1702func awsRestjson1_serializeOpHttpBindingsRejectResourceShareInvitationInput(v *RejectResourceShareInvitationInput, encoder *httpbinding.Encoder) error {
1703	if v == nil {
1704		return fmt.Errorf("unsupported serialization of nil %T", v)
1705	}
1706
1707	return nil
1708}
1709
1710func awsRestjson1_serializeOpDocumentRejectResourceShareInvitationInput(v *RejectResourceShareInvitationInput, value smithyjson.Value) error {
1711	object := value.Object()
1712	defer object.Close()
1713
1714	if v.ClientToken != nil {
1715		ok := object.Key("clientToken")
1716		ok.String(*v.ClientToken)
1717	}
1718
1719	if v.ResourceShareInvitationArn != nil {
1720		ok := object.Key("resourceShareInvitationArn")
1721		ok.String(*v.ResourceShareInvitationArn)
1722	}
1723
1724	return nil
1725}
1726
1727type awsRestjson1_serializeOpTagResource struct {
1728}
1729
1730func (*awsRestjson1_serializeOpTagResource) ID() string {
1731	return "OperationSerializer"
1732}
1733
1734func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1735	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1736) {
1737	request, ok := in.Request.(*smithyhttp.Request)
1738	if !ok {
1739		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1740	}
1741
1742	input, ok := in.Parameters.(*TagResourceInput)
1743	_ = input
1744	if !ok {
1745		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1746	}
1747
1748	opPath, opQuery := httpbinding.SplitURI("/tagresource")
1749	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1750	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1751	request.Method = "POST"
1752	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1753	if err != nil {
1754		return out, metadata, &smithy.SerializationError{Err: err}
1755	}
1756
1757	restEncoder.SetHeader("Content-Type").String("application/json")
1758
1759	jsonEncoder := smithyjson.NewEncoder()
1760	if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
1761		return out, metadata, &smithy.SerializationError{Err: err}
1762	}
1763
1764	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1765		return out, metadata, &smithy.SerializationError{Err: err}
1766	}
1767
1768	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1769		return out, metadata, &smithy.SerializationError{Err: err}
1770	}
1771	in.Request = request
1772
1773	return next.HandleSerialize(ctx, in)
1774}
1775func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
1776	if v == nil {
1777		return fmt.Errorf("unsupported serialization of nil %T", v)
1778	}
1779
1780	return nil
1781}
1782
1783func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
1784	object := value.Object()
1785	defer object.Close()
1786
1787	if v.ResourceShareArn != nil {
1788		ok := object.Key("resourceShareArn")
1789		ok.String(*v.ResourceShareArn)
1790	}
1791
1792	if v.Tags != nil {
1793		ok := object.Key("tags")
1794		if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
1795			return err
1796		}
1797	}
1798
1799	return nil
1800}
1801
1802type awsRestjson1_serializeOpUntagResource struct {
1803}
1804
1805func (*awsRestjson1_serializeOpUntagResource) ID() string {
1806	return "OperationSerializer"
1807}
1808
1809func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1810	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1811) {
1812	request, ok := in.Request.(*smithyhttp.Request)
1813	if !ok {
1814		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1815	}
1816
1817	input, ok := in.Parameters.(*UntagResourceInput)
1818	_ = input
1819	if !ok {
1820		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1821	}
1822
1823	opPath, opQuery := httpbinding.SplitURI("/untagresource")
1824	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1825	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1826	request.Method = "POST"
1827	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1828	if err != nil {
1829		return out, metadata, &smithy.SerializationError{Err: err}
1830	}
1831
1832	restEncoder.SetHeader("Content-Type").String("application/json")
1833
1834	jsonEncoder := smithyjson.NewEncoder()
1835	if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
1836		return out, metadata, &smithy.SerializationError{Err: err}
1837	}
1838
1839	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1840		return out, metadata, &smithy.SerializationError{Err: err}
1841	}
1842
1843	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1844		return out, metadata, &smithy.SerializationError{Err: err}
1845	}
1846	in.Request = request
1847
1848	return next.HandleSerialize(ctx, in)
1849}
1850func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
1851	if v == nil {
1852		return fmt.Errorf("unsupported serialization of nil %T", v)
1853	}
1854
1855	return nil
1856}
1857
1858func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
1859	object := value.Object()
1860	defer object.Close()
1861
1862	if v.ResourceShareArn != nil {
1863		ok := object.Key("resourceShareArn")
1864		ok.String(*v.ResourceShareArn)
1865	}
1866
1867	if v.TagKeys != nil {
1868		ok := object.Key("tagKeys")
1869		if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
1870			return err
1871		}
1872	}
1873
1874	return nil
1875}
1876
1877type awsRestjson1_serializeOpUpdateResourceShare struct {
1878}
1879
1880func (*awsRestjson1_serializeOpUpdateResourceShare) ID() string {
1881	return "OperationSerializer"
1882}
1883
1884func (m *awsRestjson1_serializeOpUpdateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1885	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1886) {
1887	request, ok := in.Request.(*smithyhttp.Request)
1888	if !ok {
1889		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1890	}
1891
1892	input, ok := in.Parameters.(*UpdateResourceShareInput)
1893	_ = input
1894	if !ok {
1895		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1896	}
1897
1898	opPath, opQuery := httpbinding.SplitURI("/updateresourceshare")
1899	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1900	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1901	request.Method = "POST"
1902	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1903	if err != nil {
1904		return out, metadata, &smithy.SerializationError{Err: err}
1905	}
1906
1907	restEncoder.SetHeader("Content-Type").String("application/json")
1908
1909	jsonEncoder := smithyjson.NewEncoder()
1910	if err := awsRestjson1_serializeOpDocumentUpdateResourceShareInput(input, jsonEncoder.Value); err != nil {
1911		return out, metadata, &smithy.SerializationError{Err: err}
1912	}
1913
1914	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
1915		return out, metadata, &smithy.SerializationError{Err: err}
1916	}
1917
1918	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1919		return out, metadata, &smithy.SerializationError{Err: err}
1920	}
1921	in.Request = request
1922
1923	return next.HandleSerialize(ctx, in)
1924}
1925func awsRestjson1_serializeOpHttpBindingsUpdateResourceShareInput(v *UpdateResourceShareInput, encoder *httpbinding.Encoder) error {
1926	if v == nil {
1927		return fmt.Errorf("unsupported serialization of nil %T", v)
1928	}
1929
1930	return nil
1931}
1932
1933func awsRestjson1_serializeOpDocumentUpdateResourceShareInput(v *UpdateResourceShareInput, value smithyjson.Value) error {
1934	object := value.Object()
1935	defer object.Close()
1936
1937	if v.AllowExternalPrincipals != nil {
1938		ok := object.Key("allowExternalPrincipals")
1939		ok.Boolean(*v.AllowExternalPrincipals)
1940	}
1941
1942	if v.ClientToken != nil {
1943		ok := object.Key("clientToken")
1944		ok.String(*v.ClientToken)
1945	}
1946
1947	if v.Name != nil {
1948		ok := object.Key("name")
1949		ok.String(*v.Name)
1950	}
1951
1952	if v.ResourceShareArn != nil {
1953		ok := object.Key("resourceShareArn")
1954		ok.String(*v.ResourceShareArn)
1955	}
1956
1957	return nil
1958}
1959
1960func awsRestjson1_serializeDocumentPermissionArnList(v []string, value smithyjson.Value) error {
1961	array := value.Array()
1962	defer array.Close()
1963
1964	for i := range v {
1965		av := array.Value()
1966		av.String(v[i])
1967	}
1968	return nil
1969}
1970
1971func awsRestjson1_serializeDocumentPrincipalArnOrIdList(v []string, value smithyjson.Value) error {
1972	array := value.Array()
1973	defer array.Close()
1974
1975	for i := range v {
1976		av := array.Value()
1977		av.String(v[i])
1978	}
1979	return nil
1980}
1981
1982func awsRestjson1_serializeDocumentResourceArnList(v []string, value smithyjson.Value) error {
1983	array := value.Array()
1984	defer array.Close()
1985
1986	for i := range v {
1987		av := array.Value()
1988		av.String(v[i])
1989	}
1990	return nil
1991}
1992
1993func awsRestjson1_serializeDocumentResourceShareArnList(v []string, value smithyjson.Value) error {
1994	array := value.Array()
1995	defer array.Close()
1996
1997	for i := range v {
1998		av := array.Value()
1999		av.String(v[i])
2000	}
2001	return nil
2002}
2003
2004func awsRestjson1_serializeDocumentResourceShareInvitationArnList(v []string, value smithyjson.Value) error {
2005	array := value.Array()
2006	defer array.Close()
2007
2008	for i := range v {
2009		av := array.Value()
2010		av.String(v[i])
2011	}
2012	return nil
2013}
2014
2015func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
2016	object := value.Object()
2017	defer object.Close()
2018
2019	if v.Key != nil {
2020		ok := object.Key("key")
2021		ok.String(*v.Key)
2022	}
2023
2024	if v.Value != nil {
2025		ok := object.Key("value")
2026		ok.String(*v.Value)
2027	}
2028
2029	return nil
2030}
2031
2032func awsRestjson1_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error {
2033	object := value.Object()
2034	defer object.Close()
2035
2036	if v.TagKey != nil {
2037		ok := object.Key("tagKey")
2038		ok.String(*v.TagKey)
2039	}
2040
2041	if v.TagValues != nil {
2042		ok := object.Key("tagValues")
2043		if err := awsRestjson1_serializeDocumentTagValueList(v.TagValues, ok); err != nil {
2044			return err
2045		}
2046	}
2047
2048	return nil
2049}
2050
2051func awsRestjson1_serializeDocumentTagFilters(v []types.TagFilter, value smithyjson.Value) error {
2052	array := value.Array()
2053	defer array.Close()
2054
2055	for i := range v {
2056		av := array.Value()
2057		if err := awsRestjson1_serializeDocumentTagFilter(&v[i], av); err != nil {
2058			return err
2059		}
2060	}
2061	return nil
2062}
2063
2064func awsRestjson1_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
2065	array := value.Array()
2066	defer array.Close()
2067
2068	for i := range v {
2069		av := array.Value()
2070		av.String(v[i])
2071	}
2072	return nil
2073}
2074
2075func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
2076	array := value.Array()
2077	defer array.Close()
2078
2079	for i := range v {
2080		av := array.Value()
2081		if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil {
2082			return err
2083		}
2084	}
2085	return nil
2086}
2087
2088func awsRestjson1_serializeDocumentTagValueList(v []string, value smithyjson.Value) error {
2089	array := value.Array()
2090	defer array.Close()
2091
2092	for i := range v {
2093		av := array.Value()
2094		av.String(v[i])
2095	}
2096	return nil
2097}
2098