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