1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package workdocs
4
5import (
6	"bytes"
7	"context"
8	"fmt"
9	"github.com/aws/aws-sdk-go-v2/service/workdocs/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	smithytime "github.com/aws/smithy-go/time"
15	smithyhttp "github.com/aws/smithy-go/transport/http"
16)
17
18type awsRestjson1_serializeOpAbortDocumentVersionUpload struct {
19}
20
21func (*awsRestjson1_serializeOpAbortDocumentVersionUpload) ID() string {
22	return "OperationSerializer"
23}
24
25func (m *awsRestjson1_serializeOpAbortDocumentVersionUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
26	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
27) {
28	request, ok := in.Request.(*smithyhttp.Request)
29	if !ok {
30		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
31	}
32
33	input, ok := in.Parameters.(*AbortDocumentVersionUploadInput)
34	_ = input
35	if !ok {
36		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
37	}
38
39	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}")
40	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
41	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
42	request.Method = "DELETE"
43	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
44	if err != nil {
45		return out, metadata, &smithy.SerializationError{Err: err}
46	}
47
48	if err := awsRestjson1_serializeOpHttpBindingsAbortDocumentVersionUploadInput(input, restEncoder); err != nil {
49		return out, metadata, &smithy.SerializationError{Err: err}
50	}
51
52	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
53		return out, metadata, &smithy.SerializationError{Err: err}
54	}
55	in.Request = request
56
57	return next.HandleSerialize(ctx, in)
58}
59func awsRestjson1_serializeOpHttpBindingsAbortDocumentVersionUploadInput(v *AbortDocumentVersionUploadInput, encoder *httpbinding.Encoder) error {
60	if v == nil {
61		return fmt.Errorf("unsupported serialization of nil %T", v)
62	}
63
64	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
65		locationName := "Authentication"
66		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
67	}
68
69	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
70		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
71	}
72	if v.DocumentId != nil {
73		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
74			return err
75		}
76	}
77
78	if v.VersionId == nil || len(*v.VersionId) == 0 {
79		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
80	}
81	if v.VersionId != nil {
82		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
83			return err
84		}
85	}
86
87	return nil
88}
89
90type awsRestjson1_serializeOpActivateUser struct {
91}
92
93func (*awsRestjson1_serializeOpActivateUser) ID() string {
94	return "OperationSerializer"
95}
96
97func (m *awsRestjson1_serializeOpActivateUser) 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.(*ActivateUserInput)
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("/api/v1/users/{UserId}/activation")
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	if err := awsRestjson1_serializeOpHttpBindingsActivateUserInput(input, restEncoder); err != nil {
121		return out, metadata, &smithy.SerializationError{Err: err}
122	}
123
124	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
125		return out, metadata, &smithy.SerializationError{Err: err}
126	}
127	in.Request = request
128
129	return next.HandleSerialize(ctx, in)
130}
131func awsRestjson1_serializeOpHttpBindingsActivateUserInput(v *ActivateUserInput, encoder *httpbinding.Encoder) error {
132	if v == nil {
133		return fmt.Errorf("unsupported serialization of nil %T", v)
134	}
135
136	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
137		locationName := "Authentication"
138		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
139	}
140
141	if v.UserId == nil || len(*v.UserId) == 0 {
142		return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")}
143	}
144	if v.UserId != nil {
145		if err := encoder.SetURI("UserId").String(*v.UserId); err != nil {
146			return err
147		}
148	}
149
150	return nil
151}
152
153type awsRestjson1_serializeOpAddResourcePermissions struct {
154}
155
156func (*awsRestjson1_serializeOpAddResourcePermissions) ID() string {
157	return "OperationSerializer"
158}
159
160func (m *awsRestjson1_serializeOpAddResourcePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
161	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
162) {
163	request, ok := in.Request.(*smithyhttp.Request)
164	if !ok {
165		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
166	}
167
168	input, ok := in.Parameters.(*AddResourcePermissionsInput)
169	_ = input
170	if !ok {
171		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
172	}
173
174	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/permissions")
175	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
176	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
177	request.Method = "POST"
178	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
179	if err != nil {
180		return out, metadata, &smithy.SerializationError{Err: err}
181	}
182
183	if err := awsRestjson1_serializeOpHttpBindingsAddResourcePermissionsInput(input, restEncoder); err != nil {
184		return out, metadata, &smithy.SerializationError{Err: err}
185	}
186
187	restEncoder.SetHeader("Content-Type").String("application/json")
188
189	jsonEncoder := smithyjson.NewEncoder()
190	if err := awsRestjson1_serializeOpDocumentAddResourcePermissionsInput(input, jsonEncoder.Value); err != nil {
191		return out, metadata, &smithy.SerializationError{Err: err}
192	}
193
194	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
195		return out, metadata, &smithy.SerializationError{Err: err}
196	}
197
198	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
199		return out, metadata, &smithy.SerializationError{Err: err}
200	}
201	in.Request = request
202
203	return next.HandleSerialize(ctx, in)
204}
205func awsRestjson1_serializeOpHttpBindingsAddResourcePermissionsInput(v *AddResourcePermissionsInput, encoder *httpbinding.Encoder) error {
206	if v == nil {
207		return fmt.Errorf("unsupported serialization of nil %T", v)
208	}
209
210	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
211		locationName := "Authentication"
212		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
213	}
214
215	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
216		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
217	}
218	if v.ResourceId != nil {
219		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
220			return err
221		}
222	}
223
224	return nil
225}
226
227func awsRestjson1_serializeOpDocumentAddResourcePermissionsInput(v *AddResourcePermissionsInput, value smithyjson.Value) error {
228	object := value.Object()
229	defer object.Close()
230
231	if v.NotificationOptions != nil {
232		ok := object.Key("NotificationOptions")
233		if err := awsRestjson1_serializeDocumentNotificationOptions(v.NotificationOptions, ok); err != nil {
234			return err
235		}
236	}
237
238	if v.Principals != nil {
239		ok := object.Key("Principals")
240		if err := awsRestjson1_serializeDocumentSharePrincipalList(v.Principals, ok); err != nil {
241			return err
242		}
243	}
244
245	return nil
246}
247
248type awsRestjson1_serializeOpCreateComment struct {
249}
250
251func (*awsRestjson1_serializeOpCreateComment) ID() string {
252	return "OperationSerializer"
253}
254
255func (m *awsRestjson1_serializeOpCreateComment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
256	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
257) {
258	request, ok := in.Request.(*smithyhttp.Request)
259	if !ok {
260		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
261	}
262
263	input, ok := in.Parameters.(*CreateCommentInput)
264	_ = input
265	if !ok {
266		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
267	}
268
269	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}/comment")
270	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
271	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
272	request.Method = "POST"
273	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
274	if err != nil {
275		return out, metadata, &smithy.SerializationError{Err: err}
276	}
277
278	if err := awsRestjson1_serializeOpHttpBindingsCreateCommentInput(input, restEncoder); err != nil {
279		return out, metadata, &smithy.SerializationError{Err: err}
280	}
281
282	restEncoder.SetHeader("Content-Type").String("application/json")
283
284	jsonEncoder := smithyjson.NewEncoder()
285	if err := awsRestjson1_serializeOpDocumentCreateCommentInput(input, jsonEncoder.Value); err != nil {
286		return out, metadata, &smithy.SerializationError{Err: err}
287	}
288
289	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
290		return out, metadata, &smithy.SerializationError{Err: err}
291	}
292
293	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
294		return out, metadata, &smithy.SerializationError{Err: err}
295	}
296	in.Request = request
297
298	return next.HandleSerialize(ctx, in)
299}
300func awsRestjson1_serializeOpHttpBindingsCreateCommentInput(v *CreateCommentInput, encoder *httpbinding.Encoder) error {
301	if v == nil {
302		return fmt.Errorf("unsupported serialization of nil %T", v)
303	}
304
305	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
306		locationName := "Authentication"
307		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
308	}
309
310	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
311		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
312	}
313	if v.DocumentId != nil {
314		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
315			return err
316		}
317	}
318
319	if v.VersionId == nil || len(*v.VersionId) == 0 {
320		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
321	}
322	if v.VersionId != nil {
323		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
324			return err
325		}
326	}
327
328	return nil
329}
330
331func awsRestjson1_serializeOpDocumentCreateCommentInput(v *CreateCommentInput, value smithyjson.Value) error {
332	object := value.Object()
333	defer object.Close()
334
335	if v.NotifyCollaborators {
336		ok := object.Key("NotifyCollaborators")
337		ok.Boolean(v.NotifyCollaborators)
338	}
339
340	if v.ParentId != nil {
341		ok := object.Key("ParentId")
342		ok.String(*v.ParentId)
343	}
344
345	if v.Text != nil {
346		ok := object.Key("Text")
347		ok.String(*v.Text)
348	}
349
350	if v.ThreadId != nil {
351		ok := object.Key("ThreadId")
352		ok.String(*v.ThreadId)
353	}
354
355	if len(v.Visibility) > 0 {
356		ok := object.Key("Visibility")
357		ok.String(string(v.Visibility))
358	}
359
360	return nil
361}
362
363type awsRestjson1_serializeOpCreateCustomMetadata struct {
364}
365
366func (*awsRestjson1_serializeOpCreateCustomMetadata) ID() string {
367	return "OperationSerializer"
368}
369
370func (m *awsRestjson1_serializeOpCreateCustomMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
371	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
372) {
373	request, ok := in.Request.(*smithyhttp.Request)
374	if !ok {
375		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
376	}
377
378	input, ok := in.Parameters.(*CreateCustomMetadataInput)
379	_ = input
380	if !ok {
381		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
382	}
383
384	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/customMetadata")
385	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
386	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
387	request.Method = "PUT"
388	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
389	if err != nil {
390		return out, metadata, &smithy.SerializationError{Err: err}
391	}
392
393	if err := awsRestjson1_serializeOpHttpBindingsCreateCustomMetadataInput(input, restEncoder); err != nil {
394		return out, metadata, &smithy.SerializationError{Err: err}
395	}
396
397	restEncoder.SetHeader("Content-Type").String("application/json")
398
399	jsonEncoder := smithyjson.NewEncoder()
400	if err := awsRestjson1_serializeOpDocumentCreateCustomMetadataInput(input, jsonEncoder.Value); err != nil {
401		return out, metadata, &smithy.SerializationError{Err: err}
402	}
403
404	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
405		return out, metadata, &smithy.SerializationError{Err: err}
406	}
407
408	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
409		return out, metadata, &smithy.SerializationError{Err: err}
410	}
411	in.Request = request
412
413	return next.HandleSerialize(ctx, in)
414}
415func awsRestjson1_serializeOpHttpBindingsCreateCustomMetadataInput(v *CreateCustomMetadataInput, encoder *httpbinding.Encoder) error {
416	if v == nil {
417		return fmt.Errorf("unsupported serialization of nil %T", v)
418	}
419
420	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
421		locationName := "Authentication"
422		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
423	}
424
425	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
426		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
427	}
428	if v.ResourceId != nil {
429		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
430			return err
431		}
432	}
433
434	if v.VersionId != nil {
435		encoder.SetQuery("versionid").String(*v.VersionId)
436	}
437
438	return nil
439}
440
441func awsRestjson1_serializeOpDocumentCreateCustomMetadataInput(v *CreateCustomMetadataInput, value smithyjson.Value) error {
442	object := value.Object()
443	defer object.Close()
444
445	if v.CustomMetadata != nil {
446		ok := object.Key("CustomMetadata")
447		if err := awsRestjson1_serializeDocumentCustomMetadataMap(v.CustomMetadata, ok); err != nil {
448			return err
449		}
450	}
451
452	return nil
453}
454
455type awsRestjson1_serializeOpCreateFolder struct {
456}
457
458func (*awsRestjson1_serializeOpCreateFolder) ID() string {
459	return "OperationSerializer"
460}
461
462func (m *awsRestjson1_serializeOpCreateFolder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
463	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
464) {
465	request, ok := in.Request.(*smithyhttp.Request)
466	if !ok {
467		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
468	}
469
470	input, ok := in.Parameters.(*CreateFolderInput)
471	_ = input
472	if !ok {
473		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
474	}
475
476	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders")
477	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
478	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
479	request.Method = "POST"
480	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
481	if err != nil {
482		return out, metadata, &smithy.SerializationError{Err: err}
483	}
484
485	if err := awsRestjson1_serializeOpHttpBindingsCreateFolderInput(input, restEncoder); err != nil {
486		return out, metadata, &smithy.SerializationError{Err: err}
487	}
488
489	restEncoder.SetHeader("Content-Type").String("application/json")
490
491	jsonEncoder := smithyjson.NewEncoder()
492	if err := awsRestjson1_serializeOpDocumentCreateFolderInput(input, jsonEncoder.Value); err != nil {
493		return out, metadata, &smithy.SerializationError{Err: err}
494	}
495
496	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
497		return out, metadata, &smithy.SerializationError{Err: err}
498	}
499
500	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
501		return out, metadata, &smithy.SerializationError{Err: err}
502	}
503	in.Request = request
504
505	return next.HandleSerialize(ctx, in)
506}
507func awsRestjson1_serializeOpHttpBindingsCreateFolderInput(v *CreateFolderInput, encoder *httpbinding.Encoder) error {
508	if v == nil {
509		return fmt.Errorf("unsupported serialization of nil %T", v)
510	}
511
512	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
513		locationName := "Authentication"
514		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
515	}
516
517	return nil
518}
519
520func awsRestjson1_serializeOpDocumentCreateFolderInput(v *CreateFolderInput, value smithyjson.Value) error {
521	object := value.Object()
522	defer object.Close()
523
524	if v.Name != nil {
525		ok := object.Key("Name")
526		ok.String(*v.Name)
527	}
528
529	if v.ParentFolderId != nil {
530		ok := object.Key("ParentFolderId")
531		ok.String(*v.ParentFolderId)
532	}
533
534	return nil
535}
536
537type awsRestjson1_serializeOpCreateLabels struct {
538}
539
540func (*awsRestjson1_serializeOpCreateLabels) ID() string {
541	return "OperationSerializer"
542}
543
544func (m *awsRestjson1_serializeOpCreateLabels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
545	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
546) {
547	request, ok := in.Request.(*smithyhttp.Request)
548	if !ok {
549		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
550	}
551
552	input, ok := in.Parameters.(*CreateLabelsInput)
553	_ = input
554	if !ok {
555		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
556	}
557
558	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/labels")
559	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
560	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
561	request.Method = "PUT"
562	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
563	if err != nil {
564		return out, metadata, &smithy.SerializationError{Err: err}
565	}
566
567	if err := awsRestjson1_serializeOpHttpBindingsCreateLabelsInput(input, restEncoder); err != nil {
568		return out, metadata, &smithy.SerializationError{Err: err}
569	}
570
571	restEncoder.SetHeader("Content-Type").String("application/json")
572
573	jsonEncoder := smithyjson.NewEncoder()
574	if err := awsRestjson1_serializeOpDocumentCreateLabelsInput(input, jsonEncoder.Value); err != nil {
575		return out, metadata, &smithy.SerializationError{Err: err}
576	}
577
578	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
579		return out, metadata, &smithy.SerializationError{Err: err}
580	}
581
582	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
583		return out, metadata, &smithy.SerializationError{Err: err}
584	}
585	in.Request = request
586
587	return next.HandleSerialize(ctx, in)
588}
589func awsRestjson1_serializeOpHttpBindingsCreateLabelsInput(v *CreateLabelsInput, encoder *httpbinding.Encoder) error {
590	if v == nil {
591		return fmt.Errorf("unsupported serialization of nil %T", v)
592	}
593
594	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
595		locationName := "Authentication"
596		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
597	}
598
599	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
600		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
601	}
602	if v.ResourceId != nil {
603		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
604			return err
605		}
606	}
607
608	return nil
609}
610
611func awsRestjson1_serializeOpDocumentCreateLabelsInput(v *CreateLabelsInput, value smithyjson.Value) error {
612	object := value.Object()
613	defer object.Close()
614
615	if v.Labels != nil {
616		ok := object.Key("Labels")
617		if err := awsRestjson1_serializeDocumentSharedLabels(v.Labels, ok); err != nil {
618			return err
619		}
620	}
621
622	return nil
623}
624
625type awsRestjson1_serializeOpCreateNotificationSubscription struct {
626}
627
628func (*awsRestjson1_serializeOpCreateNotificationSubscription) ID() string {
629	return "OperationSerializer"
630}
631
632func (m *awsRestjson1_serializeOpCreateNotificationSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
633	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
634) {
635	request, ok := in.Request.(*smithyhttp.Request)
636	if !ok {
637		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
638	}
639
640	input, ok := in.Parameters.(*CreateNotificationSubscriptionInput)
641	_ = input
642	if !ok {
643		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
644	}
645
646	opPath, opQuery := httpbinding.SplitURI("/api/v1/organizations/{OrganizationId}/subscriptions")
647	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
648	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
649	request.Method = "POST"
650	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
651	if err != nil {
652		return out, metadata, &smithy.SerializationError{Err: err}
653	}
654
655	if err := awsRestjson1_serializeOpHttpBindingsCreateNotificationSubscriptionInput(input, restEncoder); err != nil {
656		return out, metadata, &smithy.SerializationError{Err: err}
657	}
658
659	restEncoder.SetHeader("Content-Type").String("application/json")
660
661	jsonEncoder := smithyjson.NewEncoder()
662	if err := awsRestjson1_serializeOpDocumentCreateNotificationSubscriptionInput(input, jsonEncoder.Value); err != nil {
663		return out, metadata, &smithy.SerializationError{Err: err}
664	}
665
666	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
667		return out, metadata, &smithy.SerializationError{Err: err}
668	}
669
670	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
671		return out, metadata, &smithy.SerializationError{Err: err}
672	}
673	in.Request = request
674
675	return next.HandleSerialize(ctx, in)
676}
677func awsRestjson1_serializeOpHttpBindingsCreateNotificationSubscriptionInput(v *CreateNotificationSubscriptionInput, encoder *httpbinding.Encoder) error {
678	if v == nil {
679		return fmt.Errorf("unsupported serialization of nil %T", v)
680	}
681
682	if v.OrganizationId == nil || len(*v.OrganizationId) == 0 {
683		return &smithy.SerializationError{Err: fmt.Errorf("input member OrganizationId must not be empty")}
684	}
685	if v.OrganizationId != nil {
686		if err := encoder.SetURI("OrganizationId").String(*v.OrganizationId); err != nil {
687			return err
688		}
689	}
690
691	return nil
692}
693
694func awsRestjson1_serializeOpDocumentCreateNotificationSubscriptionInput(v *CreateNotificationSubscriptionInput, value smithyjson.Value) error {
695	object := value.Object()
696	defer object.Close()
697
698	if v.Endpoint != nil {
699		ok := object.Key("Endpoint")
700		ok.String(*v.Endpoint)
701	}
702
703	if len(v.Protocol) > 0 {
704		ok := object.Key("Protocol")
705		ok.String(string(v.Protocol))
706	}
707
708	if len(v.SubscriptionType) > 0 {
709		ok := object.Key("SubscriptionType")
710		ok.String(string(v.SubscriptionType))
711	}
712
713	return nil
714}
715
716type awsRestjson1_serializeOpCreateUser struct {
717}
718
719func (*awsRestjson1_serializeOpCreateUser) ID() string {
720	return "OperationSerializer"
721}
722
723func (m *awsRestjson1_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
724	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
725) {
726	request, ok := in.Request.(*smithyhttp.Request)
727	if !ok {
728		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
729	}
730
731	input, ok := in.Parameters.(*CreateUserInput)
732	_ = input
733	if !ok {
734		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
735	}
736
737	opPath, opQuery := httpbinding.SplitURI("/api/v1/users")
738	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
739	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
740	request.Method = "POST"
741	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
742	if err != nil {
743		return out, metadata, &smithy.SerializationError{Err: err}
744	}
745
746	if err := awsRestjson1_serializeOpHttpBindingsCreateUserInput(input, restEncoder); err != nil {
747		return out, metadata, &smithy.SerializationError{Err: err}
748	}
749
750	restEncoder.SetHeader("Content-Type").String("application/json")
751
752	jsonEncoder := smithyjson.NewEncoder()
753	if err := awsRestjson1_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil {
754		return out, metadata, &smithy.SerializationError{Err: err}
755	}
756
757	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
758		return out, metadata, &smithy.SerializationError{Err: err}
759	}
760
761	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
762		return out, metadata, &smithy.SerializationError{Err: err}
763	}
764	in.Request = request
765
766	return next.HandleSerialize(ctx, in)
767}
768func awsRestjson1_serializeOpHttpBindingsCreateUserInput(v *CreateUserInput, encoder *httpbinding.Encoder) error {
769	if v == nil {
770		return fmt.Errorf("unsupported serialization of nil %T", v)
771	}
772
773	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
774		locationName := "Authentication"
775		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
776	}
777
778	return nil
779}
780
781func awsRestjson1_serializeOpDocumentCreateUserInput(v *CreateUserInput, value smithyjson.Value) error {
782	object := value.Object()
783	defer object.Close()
784
785	if v.EmailAddress != nil {
786		ok := object.Key("EmailAddress")
787		ok.String(*v.EmailAddress)
788	}
789
790	if v.GivenName != nil {
791		ok := object.Key("GivenName")
792		ok.String(*v.GivenName)
793	}
794
795	if v.OrganizationId != nil {
796		ok := object.Key("OrganizationId")
797		ok.String(*v.OrganizationId)
798	}
799
800	if v.Password != nil {
801		ok := object.Key("Password")
802		ok.String(*v.Password)
803	}
804
805	if v.StorageRule != nil {
806		ok := object.Key("StorageRule")
807		if err := awsRestjson1_serializeDocumentStorageRuleType(v.StorageRule, ok); err != nil {
808			return err
809		}
810	}
811
812	if v.Surname != nil {
813		ok := object.Key("Surname")
814		ok.String(*v.Surname)
815	}
816
817	if v.TimeZoneId != nil {
818		ok := object.Key("TimeZoneId")
819		ok.String(*v.TimeZoneId)
820	}
821
822	if v.Username != nil {
823		ok := object.Key("Username")
824		ok.String(*v.Username)
825	}
826
827	return nil
828}
829
830type awsRestjson1_serializeOpDeactivateUser struct {
831}
832
833func (*awsRestjson1_serializeOpDeactivateUser) ID() string {
834	return "OperationSerializer"
835}
836
837func (m *awsRestjson1_serializeOpDeactivateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
838	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
839) {
840	request, ok := in.Request.(*smithyhttp.Request)
841	if !ok {
842		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
843	}
844
845	input, ok := in.Parameters.(*DeactivateUserInput)
846	_ = input
847	if !ok {
848		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
849	}
850
851	opPath, opQuery := httpbinding.SplitURI("/api/v1/users/{UserId}/activation")
852	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
853	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
854	request.Method = "DELETE"
855	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
856	if err != nil {
857		return out, metadata, &smithy.SerializationError{Err: err}
858	}
859
860	if err := awsRestjson1_serializeOpHttpBindingsDeactivateUserInput(input, restEncoder); err != nil {
861		return out, metadata, &smithy.SerializationError{Err: err}
862	}
863
864	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
865		return out, metadata, &smithy.SerializationError{Err: err}
866	}
867	in.Request = request
868
869	return next.HandleSerialize(ctx, in)
870}
871func awsRestjson1_serializeOpHttpBindingsDeactivateUserInput(v *DeactivateUserInput, encoder *httpbinding.Encoder) error {
872	if v == nil {
873		return fmt.Errorf("unsupported serialization of nil %T", v)
874	}
875
876	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
877		locationName := "Authentication"
878		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
879	}
880
881	if v.UserId == nil || len(*v.UserId) == 0 {
882		return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")}
883	}
884	if v.UserId != nil {
885		if err := encoder.SetURI("UserId").String(*v.UserId); err != nil {
886			return err
887		}
888	}
889
890	return nil
891}
892
893type awsRestjson1_serializeOpDeleteComment struct {
894}
895
896func (*awsRestjson1_serializeOpDeleteComment) ID() string {
897	return "OperationSerializer"
898}
899
900func (m *awsRestjson1_serializeOpDeleteComment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
901	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
902) {
903	request, ok := in.Request.(*smithyhttp.Request)
904	if !ok {
905		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
906	}
907
908	input, ok := in.Parameters.(*DeleteCommentInput)
909	_ = input
910	if !ok {
911		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
912	}
913
914	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}/comment/{CommentId}")
915	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
916	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
917	request.Method = "DELETE"
918	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
919	if err != nil {
920		return out, metadata, &smithy.SerializationError{Err: err}
921	}
922
923	if err := awsRestjson1_serializeOpHttpBindingsDeleteCommentInput(input, restEncoder); err != nil {
924		return out, metadata, &smithy.SerializationError{Err: err}
925	}
926
927	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
928		return out, metadata, &smithy.SerializationError{Err: err}
929	}
930	in.Request = request
931
932	return next.HandleSerialize(ctx, in)
933}
934func awsRestjson1_serializeOpHttpBindingsDeleteCommentInput(v *DeleteCommentInput, encoder *httpbinding.Encoder) error {
935	if v == nil {
936		return fmt.Errorf("unsupported serialization of nil %T", v)
937	}
938
939	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
940		locationName := "Authentication"
941		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
942	}
943
944	if v.CommentId == nil || len(*v.CommentId) == 0 {
945		return &smithy.SerializationError{Err: fmt.Errorf("input member CommentId must not be empty")}
946	}
947	if v.CommentId != nil {
948		if err := encoder.SetURI("CommentId").String(*v.CommentId); err != nil {
949			return err
950		}
951	}
952
953	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
954		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
955	}
956	if v.DocumentId != nil {
957		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
958			return err
959		}
960	}
961
962	if v.VersionId == nil || len(*v.VersionId) == 0 {
963		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
964	}
965	if v.VersionId != nil {
966		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
967			return err
968		}
969	}
970
971	return nil
972}
973
974type awsRestjson1_serializeOpDeleteCustomMetadata struct {
975}
976
977func (*awsRestjson1_serializeOpDeleteCustomMetadata) ID() string {
978	return "OperationSerializer"
979}
980
981func (m *awsRestjson1_serializeOpDeleteCustomMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
982	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
983) {
984	request, ok := in.Request.(*smithyhttp.Request)
985	if !ok {
986		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
987	}
988
989	input, ok := in.Parameters.(*DeleteCustomMetadataInput)
990	_ = input
991	if !ok {
992		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
993	}
994
995	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/customMetadata")
996	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
997	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
998	request.Method = "DELETE"
999	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1000	if err != nil {
1001		return out, metadata, &smithy.SerializationError{Err: err}
1002	}
1003
1004	if err := awsRestjson1_serializeOpHttpBindingsDeleteCustomMetadataInput(input, restEncoder); err != nil {
1005		return out, metadata, &smithy.SerializationError{Err: err}
1006	}
1007
1008	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1009		return out, metadata, &smithy.SerializationError{Err: err}
1010	}
1011	in.Request = request
1012
1013	return next.HandleSerialize(ctx, in)
1014}
1015func awsRestjson1_serializeOpHttpBindingsDeleteCustomMetadataInput(v *DeleteCustomMetadataInput, encoder *httpbinding.Encoder) error {
1016	if v == nil {
1017		return fmt.Errorf("unsupported serialization of nil %T", v)
1018	}
1019
1020	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1021		locationName := "Authentication"
1022		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1023	}
1024
1025	if v.DeleteAll {
1026		encoder.SetQuery("deleteAll").Boolean(v.DeleteAll)
1027	}
1028
1029	if v.Keys != nil {
1030		for i := range v.Keys {
1031			encoder.AddQuery("keys").String(v.Keys[i])
1032		}
1033	}
1034
1035	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
1036		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
1037	}
1038	if v.ResourceId != nil {
1039		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
1040			return err
1041		}
1042	}
1043
1044	if v.VersionId != nil {
1045		encoder.SetQuery("versionId").String(*v.VersionId)
1046	}
1047
1048	return nil
1049}
1050
1051type awsRestjson1_serializeOpDeleteDocument struct {
1052}
1053
1054func (*awsRestjson1_serializeOpDeleteDocument) ID() string {
1055	return "OperationSerializer"
1056}
1057
1058func (m *awsRestjson1_serializeOpDeleteDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1059	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1060) {
1061	request, ok := in.Request.(*smithyhttp.Request)
1062	if !ok {
1063		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1064	}
1065
1066	input, ok := in.Parameters.(*DeleteDocumentInput)
1067	_ = input
1068	if !ok {
1069		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1070	}
1071
1072	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}")
1073	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1074	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1075	request.Method = "DELETE"
1076	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1077	if err != nil {
1078		return out, metadata, &smithy.SerializationError{Err: err}
1079	}
1080
1081	if err := awsRestjson1_serializeOpHttpBindingsDeleteDocumentInput(input, restEncoder); err != nil {
1082		return out, metadata, &smithy.SerializationError{Err: err}
1083	}
1084
1085	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1086		return out, metadata, &smithy.SerializationError{Err: err}
1087	}
1088	in.Request = request
1089
1090	return next.HandleSerialize(ctx, in)
1091}
1092func awsRestjson1_serializeOpHttpBindingsDeleteDocumentInput(v *DeleteDocumentInput, encoder *httpbinding.Encoder) error {
1093	if v == nil {
1094		return fmt.Errorf("unsupported serialization of nil %T", v)
1095	}
1096
1097	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1098		locationName := "Authentication"
1099		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1100	}
1101
1102	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
1103		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
1104	}
1105	if v.DocumentId != nil {
1106		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
1107			return err
1108		}
1109	}
1110
1111	return nil
1112}
1113
1114type awsRestjson1_serializeOpDeleteFolder struct {
1115}
1116
1117func (*awsRestjson1_serializeOpDeleteFolder) ID() string {
1118	return "OperationSerializer"
1119}
1120
1121func (m *awsRestjson1_serializeOpDeleteFolder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1122	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1123) {
1124	request, ok := in.Request.(*smithyhttp.Request)
1125	if !ok {
1126		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1127	}
1128
1129	input, ok := in.Parameters.(*DeleteFolderInput)
1130	_ = input
1131	if !ok {
1132		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1133	}
1134
1135	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}")
1136	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1137	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1138	request.Method = "DELETE"
1139	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1140	if err != nil {
1141		return out, metadata, &smithy.SerializationError{Err: err}
1142	}
1143
1144	if err := awsRestjson1_serializeOpHttpBindingsDeleteFolderInput(input, restEncoder); err != nil {
1145		return out, metadata, &smithy.SerializationError{Err: err}
1146	}
1147
1148	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1149		return out, metadata, &smithy.SerializationError{Err: err}
1150	}
1151	in.Request = request
1152
1153	return next.HandleSerialize(ctx, in)
1154}
1155func awsRestjson1_serializeOpHttpBindingsDeleteFolderInput(v *DeleteFolderInput, encoder *httpbinding.Encoder) error {
1156	if v == nil {
1157		return fmt.Errorf("unsupported serialization of nil %T", v)
1158	}
1159
1160	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1161		locationName := "Authentication"
1162		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1163	}
1164
1165	if v.FolderId == nil || len(*v.FolderId) == 0 {
1166		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
1167	}
1168	if v.FolderId != nil {
1169		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
1170			return err
1171		}
1172	}
1173
1174	return nil
1175}
1176
1177type awsRestjson1_serializeOpDeleteFolderContents struct {
1178}
1179
1180func (*awsRestjson1_serializeOpDeleteFolderContents) ID() string {
1181	return "OperationSerializer"
1182}
1183
1184func (m *awsRestjson1_serializeOpDeleteFolderContents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1185	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1186) {
1187	request, ok := in.Request.(*smithyhttp.Request)
1188	if !ok {
1189		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1190	}
1191
1192	input, ok := in.Parameters.(*DeleteFolderContentsInput)
1193	_ = input
1194	if !ok {
1195		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1196	}
1197
1198	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}/contents")
1199	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1200	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1201	request.Method = "DELETE"
1202	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1203	if err != nil {
1204		return out, metadata, &smithy.SerializationError{Err: err}
1205	}
1206
1207	if err := awsRestjson1_serializeOpHttpBindingsDeleteFolderContentsInput(input, restEncoder); err != nil {
1208		return out, metadata, &smithy.SerializationError{Err: err}
1209	}
1210
1211	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1212		return out, metadata, &smithy.SerializationError{Err: err}
1213	}
1214	in.Request = request
1215
1216	return next.HandleSerialize(ctx, in)
1217}
1218func awsRestjson1_serializeOpHttpBindingsDeleteFolderContentsInput(v *DeleteFolderContentsInput, encoder *httpbinding.Encoder) error {
1219	if v == nil {
1220		return fmt.Errorf("unsupported serialization of nil %T", v)
1221	}
1222
1223	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1224		locationName := "Authentication"
1225		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1226	}
1227
1228	if v.FolderId == nil || len(*v.FolderId) == 0 {
1229		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
1230	}
1231	if v.FolderId != nil {
1232		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
1233			return err
1234		}
1235	}
1236
1237	return nil
1238}
1239
1240type awsRestjson1_serializeOpDeleteLabels struct {
1241}
1242
1243func (*awsRestjson1_serializeOpDeleteLabels) ID() string {
1244	return "OperationSerializer"
1245}
1246
1247func (m *awsRestjson1_serializeOpDeleteLabels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1248	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1249) {
1250	request, ok := in.Request.(*smithyhttp.Request)
1251	if !ok {
1252		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1253	}
1254
1255	input, ok := in.Parameters.(*DeleteLabelsInput)
1256	_ = input
1257	if !ok {
1258		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1259	}
1260
1261	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/labels")
1262	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1263	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1264	request.Method = "DELETE"
1265	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1266	if err != nil {
1267		return out, metadata, &smithy.SerializationError{Err: err}
1268	}
1269
1270	if err := awsRestjson1_serializeOpHttpBindingsDeleteLabelsInput(input, restEncoder); err != nil {
1271		return out, metadata, &smithy.SerializationError{Err: err}
1272	}
1273
1274	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1275		return out, metadata, &smithy.SerializationError{Err: err}
1276	}
1277	in.Request = request
1278
1279	return next.HandleSerialize(ctx, in)
1280}
1281func awsRestjson1_serializeOpHttpBindingsDeleteLabelsInput(v *DeleteLabelsInput, encoder *httpbinding.Encoder) error {
1282	if v == nil {
1283		return fmt.Errorf("unsupported serialization of nil %T", v)
1284	}
1285
1286	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1287		locationName := "Authentication"
1288		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1289	}
1290
1291	if v.DeleteAll {
1292		encoder.SetQuery("deleteAll").Boolean(v.DeleteAll)
1293	}
1294
1295	if v.Labels != nil {
1296		for i := range v.Labels {
1297			encoder.AddQuery("labels").String(v.Labels[i])
1298		}
1299	}
1300
1301	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
1302		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
1303	}
1304	if v.ResourceId != nil {
1305		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
1306			return err
1307		}
1308	}
1309
1310	return nil
1311}
1312
1313type awsRestjson1_serializeOpDeleteNotificationSubscription struct {
1314}
1315
1316func (*awsRestjson1_serializeOpDeleteNotificationSubscription) ID() string {
1317	return "OperationSerializer"
1318}
1319
1320func (m *awsRestjson1_serializeOpDeleteNotificationSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1321	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1322) {
1323	request, ok := in.Request.(*smithyhttp.Request)
1324	if !ok {
1325		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1326	}
1327
1328	input, ok := in.Parameters.(*DeleteNotificationSubscriptionInput)
1329	_ = input
1330	if !ok {
1331		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1332	}
1333
1334	opPath, opQuery := httpbinding.SplitURI("/api/v1/organizations/{OrganizationId}/subscriptions/{SubscriptionId}")
1335	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1336	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1337	request.Method = "DELETE"
1338	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1339	if err != nil {
1340		return out, metadata, &smithy.SerializationError{Err: err}
1341	}
1342
1343	if err := awsRestjson1_serializeOpHttpBindingsDeleteNotificationSubscriptionInput(input, restEncoder); err != nil {
1344		return out, metadata, &smithy.SerializationError{Err: err}
1345	}
1346
1347	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1348		return out, metadata, &smithy.SerializationError{Err: err}
1349	}
1350	in.Request = request
1351
1352	return next.HandleSerialize(ctx, in)
1353}
1354func awsRestjson1_serializeOpHttpBindingsDeleteNotificationSubscriptionInput(v *DeleteNotificationSubscriptionInput, encoder *httpbinding.Encoder) error {
1355	if v == nil {
1356		return fmt.Errorf("unsupported serialization of nil %T", v)
1357	}
1358
1359	if v.OrganizationId == nil || len(*v.OrganizationId) == 0 {
1360		return &smithy.SerializationError{Err: fmt.Errorf("input member OrganizationId must not be empty")}
1361	}
1362	if v.OrganizationId != nil {
1363		if err := encoder.SetURI("OrganizationId").String(*v.OrganizationId); err != nil {
1364			return err
1365		}
1366	}
1367
1368	if v.SubscriptionId == nil || len(*v.SubscriptionId) == 0 {
1369		return &smithy.SerializationError{Err: fmt.Errorf("input member SubscriptionId must not be empty")}
1370	}
1371	if v.SubscriptionId != nil {
1372		if err := encoder.SetURI("SubscriptionId").String(*v.SubscriptionId); err != nil {
1373			return err
1374		}
1375	}
1376
1377	return nil
1378}
1379
1380type awsRestjson1_serializeOpDeleteUser struct {
1381}
1382
1383func (*awsRestjson1_serializeOpDeleteUser) ID() string {
1384	return "OperationSerializer"
1385}
1386
1387func (m *awsRestjson1_serializeOpDeleteUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1388	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1389) {
1390	request, ok := in.Request.(*smithyhttp.Request)
1391	if !ok {
1392		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1393	}
1394
1395	input, ok := in.Parameters.(*DeleteUserInput)
1396	_ = input
1397	if !ok {
1398		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1399	}
1400
1401	opPath, opQuery := httpbinding.SplitURI("/api/v1/users/{UserId}")
1402	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1403	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1404	request.Method = "DELETE"
1405	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1406	if err != nil {
1407		return out, metadata, &smithy.SerializationError{Err: err}
1408	}
1409
1410	if err := awsRestjson1_serializeOpHttpBindingsDeleteUserInput(input, restEncoder); err != nil {
1411		return out, metadata, &smithy.SerializationError{Err: err}
1412	}
1413
1414	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1415		return out, metadata, &smithy.SerializationError{Err: err}
1416	}
1417	in.Request = request
1418
1419	return next.HandleSerialize(ctx, in)
1420}
1421func awsRestjson1_serializeOpHttpBindingsDeleteUserInput(v *DeleteUserInput, encoder *httpbinding.Encoder) error {
1422	if v == nil {
1423		return fmt.Errorf("unsupported serialization of nil %T", v)
1424	}
1425
1426	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1427		locationName := "Authentication"
1428		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1429	}
1430
1431	if v.UserId == nil || len(*v.UserId) == 0 {
1432		return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")}
1433	}
1434	if v.UserId != nil {
1435		if err := encoder.SetURI("UserId").String(*v.UserId); err != nil {
1436			return err
1437		}
1438	}
1439
1440	return nil
1441}
1442
1443type awsRestjson1_serializeOpDescribeActivities struct {
1444}
1445
1446func (*awsRestjson1_serializeOpDescribeActivities) ID() string {
1447	return "OperationSerializer"
1448}
1449
1450func (m *awsRestjson1_serializeOpDescribeActivities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1451	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1452) {
1453	request, ok := in.Request.(*smithyhttp.Request)
1454	if !ok {
1455		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1456	}
1457
1458	input, ok := in.Parameters.(*DescribeActivitiesInput)
1459	_ = input
1460	if !ok {
1461		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1462	}
1463
1464	opPath, opQuery := httpbinding.SplitURI("/api/v1/activities")
1465	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1466	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1467	request.Method = "GET"
1468	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1469	if err != nil {
1470		return out, metadata, &smithy.SerializationError{Err: err}
1471	}
1472
1473	if err := awsRestjson1_serializeOpHttpBindingsDescribeActivitiesInput(input, restEncoder); err != nil {
1474		return out, metadata, &smithy.SerializationError{Err: err}
1475	}
1476
1477	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1478		return out, metadata, &smithy.SerializationError{Err: err}
1479	}
1480	in.Request = request
1481
1482	return next.HandleSerialize(ctx, in)
1483}
1484func awsRestjson1_serializeOpHttpBindingsDescribeActivitiesInput(v *DescribeActivitiesInput, encoder *httpbinding.Encoder) error {
1485	if v == nil {
1486		return fmt.Errorf("unsupported serialization of nil %T", v)
1487	}
1488
1489	if v.ActivityTypes != nil {
1490		encoder.SetQuery("activityTypes").String(*v.ActivityTypes)
1491	}
1492
1493	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1494		locationName := "Authentication"
1495		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1496	}
1497
1498	if v.EndTime != nil {
1499		encoder.SetQuery("endTime").String(smithytime.FormatDateTime(*v.EndTime))
1500	}
1501
1502	if v.IncludeIndirectActivities {
1503		encoder.SetQuery("includeIndirectActivities").Boolean(v.IncludeIndirectActivities)
1504	}
1505
1506	if v.Limit != nil {
1507		encoder.SetQuery("limit").Integer(*v.Limit)
1508	}
1509
1510	if v.Marker != nil {
1511		encoder.SetQuery("marker").String(*v.Marker)
1512	}
1513
1514	if v.OrganizationId != nil {
1515		encoder.SetQuery("organizationId").String(*v.OrganizationId)
1516	}
1517
1518	if v.ResourceId != nil {
1519		encoder.SetQuery("resourceId").String(*v.ResourceId)
1520	}
1521
1522	if v.StartTime != nil {
1523		encoder.SetQuery("startTime").String(smithytime.FormatDateTime(*v.StartTime))
1524	}
1525
1526	if v.UserId != nil {
1527		encoder.SetQuery("userId").String(*v.UserId)
1528	}
1529
1530	return nil
1531}
1532
1533type awsRestjson1_serializeOpDescribeComments struct {
1534}
1535
1536func (*awsRestjson1_serializeOpDescribeComments) ID() string {
1537	return "OperationSerializer"
1538}
1539
1540func (m *awsRestjson1_serializeOpDescribeComments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1541	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1542) {
1543	request, ok := in.Request.(*smithyhttp.Request)
1544	if !ok {
1545		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1546	}
1547
1548	input, ok := in.Parameters.(*DescribeCommentsInput)
1549	_ = input
1550	if !ok {
1551		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1552	}
1553
1554	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}/comments")
1555	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1556	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1557	request.Method = "GET"
1558	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1559	if err != nil {
1560		return out, metadata, &smithy.SerializationError{Err: err}
1561	}
1562
1563	if err := awsRestjson1_serializeOpHttpBindingsDescribeCommentsInput(input, restEncoder); err != nil {
1564		return out, metadata, &smithy.SerializationError{Err: err}
1565	}
1566
1567	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1568		return out, metadata, &smithy.SerializationError{Err: err}
1569	}
1570	in.Request = request
1571
1572	return next.HandleSerialize(ctx, in)
1573}
1574func awsRestjson1_serializeOpHttpBindingsDescribeCommentsInput(v *DescribeCommentsInput, encoder *httpbinding.Encoder) error {
1575	if v == nil {
1576		return fmt.Errorf("unsupported serialization of nil %T", v)
1577	}
1578
1579	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1580		locationName := "Authentication"
1581		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1582	}
1583
1584	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
1585		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
1586	}
1587	if v.DocumentId != nil {
1588		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
1589			return err
1590		}
1591	}
1592
1593	if v.Limit != nil {
1594		encoder.SetQuery("limit").Integer(*v.Limit)
1595	}
1596
1597	if v.Marker != nil {
1598		encoder.SetQuery("marker").String(*v.Marker)
1599	}
1600
1601	if v.VersionId == nil || len(*v.VersionId) == 0 {
1602		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
1603	}
1604	if v.VersionId != nil {
1605		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
1606			return err
1607		}
1608	}
1609
1610	return nil
1611}
1612
1613type awsRestjson1_serializeOpDescribeDocumentVersions struct {
1614}
1615
1616func (*awsRestjson1_serializeOpDescribeDocumentVersions) ID() string {
1617	return "OperationSerializer"
1618}
1619
1620func (m *awsRestjson1_serializeOpDescribeDocumentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1621	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1622) {
1623	request, ok := in.Request.(*smithyhttp.Request)
1624	if !ok {
1625		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1626	}
1627
1628	input, ok := in.Parameters.(*DescribeDocumentVersionsInput)
1629	_ = input
1630	if !ok {
1631		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1632	}
1633
1634	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions")
1635	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1636	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1637	request.Method = "GET"
1638	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1639	if err != nil {
1640		return out, metadata, &smithy.SerializationError{Err: err}
1641	}
1642
1643	if err := awsRestjson1_serializeOpHttpBindingsDescribeDocumentVersionsInput(input, restEncoder); err != nil {
1644		return out, metadata, &smithy.SerializationError{Err: err}
1645	}
1646
1647	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1648		return out, metadata, &smithy.SerializationError{Err: err}
1649	}
1650	in.Request = request
1651
1652	return next.HandleSerialize(ctx, in)
1653}
1654func awsRestjson1_serializeOpHttpBindingsDescribeDocumentVersionsInput(v *DescribeDocumentVersionsInput, encoder *httpbinding.Encoder) error {
1655	if v == nil {
1656		return fmt.Errorf("unsupported serialization of nil %T", v)
1657	}
1658
1659	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1660		locationName := "Authentication"
1661		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1662	}
1663
1664	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
1665		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
1666	}
1667	if v.DocumentId != nil {
1668		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
1669			return err
1670		}
1671	}
1672
1673	if v.Fields != nil {
1674		encoder.SetQuery("fields").String(*v.Fields)
1675	}
1676
1677	if v.Include != nil {
1678		encoder.SetQuery("include").String(*v.Include)
1679	}
1680
1681	if v.Limit != nil {
1682		encoder.SetQuery("limit").Integer(*v.Limit)
1683	}
1684
1685	if v.Marker != nil {
1686		encoder.SetQuery("marker").String(*v.Marker)
1687	}
1688
1689	return nil
1690}
1691
1692type awsRestjson1_serializeOpDescribeFolderContents struct {
1693}
1694
1695func (*awsRestjson1_serializeOpDescribeFolderContents) ID() string {
1696	return "OperationSerializer"
1697}
1698
1699func (m *awsRestjson1_serializeOpDescribeFolderContents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1700	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1701) {
1702	request, ok := in.Request.(*smithyhttp.Request)
1703	if !ok {
1704		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1705	}
1706
1707	input, ok := in.Parameters.(*DescribeFolderContentsInput)
1708	_ = input
1709	if !ok {
1710		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1711	}
1712
1713	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}/contents")
1714	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1715	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1716	request.Method = "GET"
1717	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1718	if err != nil {
1719		return out, metadata, &smithy.SerializationError{Err: err}
1720	}
1721
1722	if err := awsRestjson1_serializeOpHttpBindingsDescribeFolderContentsInput(input, restEncoder); err != nil {
1723		return out, metadata, &smithy.SerializationError{Err: err}
1724	}
1725
1726	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1727		return out, metadata, &smithy.SerializationError{Err: err}
1728	}
1729	in.Request = request
1730
1731	return next.HandleSerialize(ctx, in)
1732}
1733func awsRestjson1_serializeOpHttpBindingsDescribeFolderContentsInput(v *DescribeFolderContentsInput, encoder *httpbinding.Encoder) error {
1734	if v == nil {
1735		return fmt.Errorf("unsupported serialization of nil %T", v)
1736	}
1737
1738	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1739		locationName := "Authentication"
1740		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1741	}
1742
1743	if v.FolderId == nil || len(*v.FolderId) == 0 {
1744		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
1745	}
1746	if v.FolderId != nil {
1747		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
1748			return err
1749		}
1750	}
1751
1752	if v.Include != nil {
1753		encoder.SetQuery("include").String(*v.Include)
1754	}
1755
1756	if v.Limit != nil {
1757		encoder.SetQuery("limit").Integer(*v.Limit)
1758	}
1759
1760	if v.Marker != nil {
1761		encoder.SetQuery("marker").String(*v.Marker)
1762	}
1763
1764	if len(v.Order) > 0 {
1765		encoder.SetQuery("order").String(string(v.Order))
1766	}
1767
1768	if len(v.Sort) > 0 {
1769		encoder.SetQuery("sort").String(string(v.Sort))
1770	}
1771
1772	if len(v.Type) > 0 {
1773		encoder.SetQuery("type").String(string(v.Type))
1774	}
1775
1776	return nil
1777}
1778
1779type awsRestjson1_serializeOpDescribeGroups struct {
1780}
1781
1782func (*awsRestjson1_serializeOpDescribeGroups) ID() string {
1783	return "OperationSerializer"
1784}
1785
1786func (m *awsRestjson1_serializeOpDescribeGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1787	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1788) {
1789	request, ok := in.Request.(*smithyhttp.Request)
1790	if !ok {
1791		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1792	}
1793
1794	input, ok := in.Parameters.(*DescribeGroupsInput)
1795	_ = input
1796	if !ok {
1797		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1798	}
1799
1800	opPath, opQuery := httpbinding.SplitURI("/api/v1/groups")
1801	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1802	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1803	request.Method = "GET"
1804	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1805	if err != nil {
1806		return out, metadata, &smithy.SerializationError{Err: err}
1807	}
1808
1809	if err := awsRestjson1_serializeOpHttpBindingsDescribeGroupsInput(input, restEncoder); err != nil {
1810		return out, metadata, &smithy.SerializationError{Err: err}
1811	}
1812
1813	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1814		return out, metadata, &smithy.SerializationError{Err: err}
1815	}
1816	in.Request = request
1817
1818	return next.HandleSerialize(ctx, in)
1819}
1820func awsRestjson1_serializeOpHttpBindingsDescribeGroupsInput(v *DescribeGroupsInput, encoder *httpbinding.Encoder) error {
1821	if v == nil {
1822		return fmt.Errorf("unsupported serialization of nil %T", v)
1823	}
1824
1825	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1826		locationName := "Authentication"
1827		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1828	}
1829
1830	if v.Limit != nil {
1831		encoder.SetQuery("limit").Integer(*v.Limit)
1832	}
1833
1834	if v.Marker != nil {
1835		encoder.SetQuery("marker").String(*v.Marker)
1836	}
1837
1838	if v.OrganizationId != nil {
1839		encoder.SetQuery("organizationId").String(*v.OrganizationId)
1840	}
1841
1842	if v.SearchQuery != nil {
1843		encoder.SetQuery("searchQuery").String(*v.SearchQuery)
1844	}
1845
1846	return nil
1847}
1848
1849type awsRestjson1_serializeOpDescribeNotificationSubscriptions struct {
1850}
1851
1852func (*awsRestjson1_serializeOpDescribeNotificationSubscriptions) ID() string {
1853	return "OperationSerializer"
1854}
1855
1856func (m *awsRestjson1_serializeOpDescribeNotificationSubscriptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1857	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1858) {
1859	request, ok := in.Request.(*smithyhttp.Request)
1860	if !ok {
1861		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1862	}
1863
1864	input, ok := in.Parameters.(*DescribeNotificationSubscriptionsInput)
1865	_ = input
1866	if !ok {
1867		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1868	}
1869
1870	opPath, opQuery := httpbinding.SplitURI("/api/v1/organizations/{OrganizationId}/subscriptions")
1871	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1872	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1873	request.Method = "GET"
1874	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1875	if err != nil {
1876		return out, metadata, &smithy.SerializationError{Err: err}
1877	}
1878
1879	if err := awsRestjson1_serializeOpHttpBindingsDescribeNotificationSubscriptionsInput(input, restEncoder); err != nil {
1880		return out, metadata, &smithy.SerializationError{Err: err}
1881	}
1882
1883	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1884		return out, metadata, &smithy.SerializationError{Err: err}
1885	}
1886	in.Request = request
1887
1888	return next.HandleSerialize(ctx, in)
1889}
1890func awsRestjson1_serializeOpHttpBindingsDescribeNotificationSubscriptionsInput(v *DescribeNotificationSubscriptionsInput, encoder *httpbinding.Encoder) error {
1891	if v == nil {
1892		return fmt.Errorf("unsupported serialization of nil %T", v)
1893	}
1894
1895	if v.Limit != nil {
1896		encoder.SetQuery("limit").Integer(*v.Limit)
1897	}
1898
1899	if v.Marker != nil {
1900		encoder.SetQuery("marker").String(*v.Marker)
1901	}
1902
1903	if v.OrganizationId == nil || len(*v.OrganizationId) == 0 {
1904		return &smithy.SerializationError{Err: fmt.Errorf("input member OrganizationId must not be empty")}
1905	}
1906	if v.OrganizationId != nil {
1907		if err := encoder.SetURI("OrganizationId").String(*v.OrganizationId); err != nil {
1908			return err
1909		}
1910	}
1911
1912	return nil
1913}
1914
1915type awsRestjson1_serializeOpDescribeResourcePermissions struct {
1916}
1917
1918func (*awsRestjson1_serializeOpDescribeResourcePermissions) ID() string {
1919	return "OperationSerializer"
1920}
1921
1922func (m *awsRestjson1_serializeOpDescribeResourcePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1923	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1924) {
1925	request, ok := in.Request.(*smithyhttp.Request)
1926	if !ok {
1927		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
1928	}
1929
1930	input, ok := in.Parameters.(*DescribeResourcePermissionsInput)
1931	_ = input
1932	if !ok {
1933		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
1934	}
1935
1936	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/permissions")
1937	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
1938	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
1939	request.Method = "GET"
1940	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
1941	if err != nil {
1942		return out, metadata, &smithy.SerializationError{Err: err}
1943	}
1944
1945	if err := awsRestjson1_serializeOpHttpBindingsDescribeResourcePermissionsInput(input, restEncoder); err != nil {
1946		return out, metadata, &smithy.SerializationError{Err: err}
1947	}
1948
1949	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
1950		return out, metadata, &smithy.SerializationError{Err: err}
1951	}
1952	in.Request = request
1953
1954	return next.HandleSerialize(ctx, in)
1955}
1956func awsRestjson1_serializeOpHttpBindingsDescribeResourcePermissionsInput(v *DescribeResourcePermissionsInput, encoder *httpbinding.Encoder) error {
1957	if v == nil {
1958		return fmt.Errorf("unsupported serialization of nil %T", v)
1959	}
1960
1961	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
1962		locationName := "Authentication"
1963		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
1964	}
1965
1966	if v.Limit != nil {
1967		encoder.SetQuery("limit").Integer(*v.Limit)
1968	}
1969
1970	if v.Marker != nil {
1971		encoder.SetQuery("marker").String(*v.Marker)
1972	}
1973
1974	if v.PrincipalId != nil {
1975		encoder.SetQuery("principalId").String(*v.PrincipalId)
1976	}
1977
1978	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
1979		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
1980	}
1981	if v.ResourceId != nil {
1982		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
1983			return err
1984		}
1985	}
1986
1987	return nil
1988}
1989
1990type awsRestjson1_serializeOpDescribeRootFolders struct {
1991}
1992
1993func (*awsRestjson1_serializeOpDescribeRootFolders) ID() string {
1994	return "OperationSerializer"
1995}
1996
1997func (m *awsRestjson1_serializeOpDescribeRootFolders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
1998	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
1999) {
2000	request, ok := in.Request.(*smithyhttp.Request)
2001	if !ok {
2002		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2003	}
2004
2005	input, ok := in.Parameters.(*DescribeRootFoldersInput)
2006	_ = input
2007	if !ok {
2008		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2009	}
2010
2011	opPath, opQuery := httpbinding.SplitURI("/api/v1/me/root")
2012	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2013	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2014	request.Method = "GET"
2015	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2016	if err != nil {
2017		return out, metadata, &smithy.SerializationError{Err: err}
2018	}
2019
2020	if err := awsRestjson1_serializeOpHttpBindingsDescribeRootFoldersInput(input, restEncoder); err != nil {
2021		return out, metadata, &smithy.SerializationError{Err: err}
2022	}
2023
2024	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2025		return out, metadata, &smithy.SerializationError{Err: err}
2026	}
2027	in.Request = request
2028
2029	return next.HandleSerialize(ctx, in)
2030}
2031func awsRestjson1_serializeOpHttpBindingsDescribeRootFoldersInput(v *DescribeRootFoldersInput, encoder *httpbinding.Encoder) error {
2032	if v == nil {
2033		return fmt.Errorf("unsupported serialization of nil %T", v)
2034	}
2035
2036	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2037		locationName := "Authentication"
2038		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2039	}
2040
2041	if v.Limit != nil {
2042		encoder.SetQuery("limit").Integer(*v.Limit)
2043	}
2044
2045	if v.Marker != nil {
2046		encoder.SetQuery("marker").String(*v.Marker)
2047	}
2048
2049	return nil
2050}
2051
2052type awsRestjson1_serializeOpDescribeUsers struct {
2053}
2054
2055func (*awsRestjson1_serializeOpDescribeUsers) ID() string {
2056	return "OperationSerializer"
2057}
2058
2059func (m *awsRestjson1_serializeOpDescribeUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2060	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2061) {
2062	request, ok := in.Request.(*smithyhttp.Request)
2063	if !ok {
2064		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2065	}
2066
2067	input, ok := in.Parameters.(*DescribeUsersInput)
2068	_ = input
2069	if !ok {
2070		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2071	}
2072
2073	opPath, opQuery := httpbinding.SplitURI("/api/v1/users")
2074	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2075	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2076	request.Method = "GET"
2077	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2078	if err != nil {
2079		return out, metadata, &smithy.SerializationError{Err: err}
2080	}
2081
2082	if err := awsRestjson1_serializeOpHttpBindingsDescribeUsersInput(input, restEncoder); err != nil {
2083		return out, metadata, &smithy.SerializationError{Err: err}
2084	}
2085
2086	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2087		return out, metadata, &smithy.SerializationError{Err: err}
2088	}
2089	in.Request = request
2090
2091	return next.HandleSerialize(ctx, in)
2092}
2093func awsRestjson1_serializeOpHttpBindingsDescribeUsersInput(v *DescribeUsersInput, encoder *httpbinding.Encoder) error {
2094	if v == nil {
2095		return fmt.Errorf("unsupported serialization of nil %T", v)
2096	}
2097
2098	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2099		locationName := "Authentication"
2100		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2101	}
2102
2103	if v.Fields != nil {
2104		encoder.SetQuery("fields").String(*v.Fields)
2105	}
2106
2107	if len(v.Include) > 0 {
2108		encoder.SetQuery("include").String(string(v.Include))
2109	}
2110
2111	if v.Limit != nil {
2112		encoder.SetQuery("limit").Integer(*v.Limit)
2113	}
2114
2115	if v.Marker != nil {
2116		encoder.SetQuery("marker").String(*v.Marker)
2117	}
2118
2119	if len(v.Order) > 0 {
2120		encoder.SetQuery("order").String(string(v.Order))
2121	}
2122
2123	if v.OrganizationId != nil {
2124		encoder.SetQuery("organizationId").String(*v.OrganizationId)
2125	}
2126
2127	if v.Query != nil {
2128		encoder.SetQuery("query").String(*v.Query)
2129	}
2130
2131	if len(v.Sort) > 0 {
2132		encoder.SetQuery("sort").String(string(v.Sort))
2133	}
2134
2135	if v.UserIds != nil {
2136		encoder.SetQuery("userIds").String(*v.UserIds)
2137	}
2138
2139	return nil
2140}
2141
2142type awsRestjson1_serializeOpGetCurrentUser struct {
2143}
2144
2145func (*awsRestjson1_serializeOpGetCurrentUser) ID() string {
2146	return "OperationSerializer"
2147}
2148
2149func (m *awsRestjson1_serializeOpGetCurrentUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2150	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2151) {
2152	request, ok := in.Request.(*smithyhttp.Request)
2153	if !ok {
2154		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2155	}
2156
2157	input, ok := in.Parameters.(*GetCurrentUserInput)
2158	_ = input
2159	if !ok {
2160		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2161	}
2162
2163	opPath, opQuery := httpbinding.SplitURI("/api/v1/me")
2164	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2165	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2166	request.Method = "GET"
2167	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2168	if err != nil {
2169		return out, metadata, &smithy.SerializationError{Err: err}
2170	}
2171
2172	if err := awsRestjson1_serializeOpHttpBindingsGetCurrentUserInput(input, restEncoder); err != nil {
2173		return out, metadata, &smithy.SerializationError{Err: err}
2174	}
2175
2176	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2177		return out, metadata, &smithy.SerializationError{Err: err}
2178	}
2179	in.Request = request
2180
2181	return next.HandleSerialize(ctx, in)
2182}
2183func awsRestjson1_serializeOpHttpBindingsGetCurrentUserInput(v *GetCurrentUserInput, encoder *httpbinding.Encoder) error {
2184	if v == nil {
2185		return fmt.Errorf("unsupported serialization of nil %T", v)
2186	}
2187
2188	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2189		locationName := "Authentication"
2190		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2191	}
2192
2193	return nil
2194}
2195
2196type awsRestjson1_serializeOpGetDocument struct {
2197}
2198
2199func (*awsRestjson1_serializeOpGetDocument) ID() string {
2200	return "OperationSerializer"
2201}
2202
2203func (m *awsRestjson1_serializeOpGetDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2204	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2205) {
2206	request, ok := in.Request.(*smithyhttp.Request)
2207	if !ok {
2208		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2209	}
2210
2211	input, ok := in.Parameters.(*GetDocumentInput)
2212	_ = input
2213	if !ok {
2214		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2215	}
2216
2217	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}")
2218	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2219	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2220	request.Method = "GET"
2221	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2222	if err != nil {
2223		return out, metadata, &smithy.SerializationError{Err: err}
2224	}
2225
2226	if err := awsRestjson1_serializeOpHttpBindingsGetDocumentInput(input, restEncoder); err != nil {
2227		return out, metadata, &smithy.SerializationError{Err: err}
2228	}
2229
2230	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2231		return out, metadata, &smithy.SerializationError{Err: err}
2232	}
2233	in.Request = request
2234
2235	return next.HandleSerialize(ctx, in)
2236}
2237func awsRestjson1_serializeOpHttpBindingsGetDocumentInput(v *GetDocumentInput, encoder *httpbinding.Encoder) error {
2238	if v == nil {
2239		return fmt.Errorf("unsupported serialization of nil %T", v)
2240	}
2241
2242	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2243		locationName := "Authentication"
2244		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2245	}
2246
2247	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
2248		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
2249	}
2250	if v.DocumentId != nil {
2251		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
2252			return err
2253		}
2254	}
2255
2256	if v.IncludeCustomMetadata {
2257		encoder.SetQuery("includeCustomMetadata").Boolean(v.IncludeCustomMetadata)
2258	}
2259
2260	return nil
2261}
2262
2263type awsRestjson1_serializeOpGetDocumentPath struct {
2264}
2265
2266func (*awsRestjson1_serializeOpGetDocumentPath) ID() string {
2267	return "OperationSerializer"
2268}
2269
2270func (m *awsRestjson1_serializeOpGetDocumentPath) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2271	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2272) {
2273	request, ok := in.Request.(*smithyhttp.Request)
2274	if !ok {
2275		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2276	}
2277
2278	input, ok := in.Parameters.(*GetDocumentPathInput)
2279	_ = input
2280	if !ok {
2281		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2282	}
2283
2284	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/path")
2285	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2286	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2287	request.Method = "GET"
2288	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2289	if err != nil {
2290		return out, metadata, &smithy.SerializationError{Err: err}
2291	}
2292
2293	if err := awsRestjson1_serializeOpHttpBindingsGetDocumentPathInput(input, restEncoder); err != nil {
2294		return out, metadata, &smithy.SerializationError{Err: err}
2295	}
2296
2297	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2298		return out, metadata, &smithy.SerializationError{Err: err}
2299	}
2300	in.Request = request
2301
2302	return next.HandleSerialize(ctx, in)
2303}
2304func awsRestjson1_serializeOpHttpBindingsGetDocumentPathInput(v *GetDocumentPathInput, encoder *httpbinding.Encoder) error {
2305	if v == nil {
2306		return fmt.Errorf("unsupported serialization of nil %T", v)
2307	}
2308
2309	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2310		locationName := "Authentication"
2311		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2312	}
2313
2314	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
2315		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
2316	}
2317	if v.DocumentId != nil {
2318		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
2319			return err
2320		}
2321	}
2322
2323	if v.Fields != nil {
2324		encoder.SetQuery("fields").String(*v.Fields)
2325	}
2326
2327	if v.Limit != nil {
2328		encoder.SetQuery("limit").Integer(*v.Limit)
2329	}
2330
2331	if v.Marker != nil {
2332		encoder.SetQuery("marker").String(*v.Marker)
2333	}
2334
2335	return nil
2336}
2337
2338type awsRestjson1_serializeOpGetDocumentVersion struct {
2339}
2340
2341func (*awsRestjson1_serializeOpGetDocumentVersion) ID() string {
2342	return "OperationSerializer"
2343}
2344
2345func (m *awsRestjson1_serializeOpGetDocumentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2346	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2347) {
2348	request, ok := in.Request.(*smithyhttp.Request)
2349	if !ok {
2350		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2351	}
2352
2353	input, ok := in.Parameters.(*GetDocumentVersionInput)
2354	_ = input
2355	if !ok {
2356		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2357	}
2358
2359	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}")
2360	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2361	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2362	request.Method = "GET"
2363	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2364	if err != nil {
2365		return out, metadata, &smithy.SerializationError{Err: err}
2366	}
2367
2368	if err := awsRestjson1_serializeOpHttpBindingsGetDocumentVersionInput(input, restEncoder); err != nil {
2369		return out, metadata, &smithy.SerializationError{Err: err}
2370	}
2371
2372	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2373		return out, metadata, &smithy.SerializationError{Err: err}
2374	}
2375	in.Request = request
2376
2377	return next.HandleSerialize(ctx, in)
2378}
2379func awsRestjson1_serializeOpHttpBindingsGetDocumentVersionInput(v *GetDocumentVersionInput, encoder *httpbinding.Encoder) error {
2380	if v == nil {
2381		return fmt.Errorf("unsupported serialization of nil %T", v)
2382	}
2383
2384	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2385		locationName := "Authentication"
2386		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2387	}
2388
2389	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
2390		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
2391	}
2392	if v.DocumentId != nil {
2393		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
2394			return err
2395		}
2396	}
2397
2398	if v.Fields != nil {
2399		encoder.SetQuery("fields").String(*v.Fields)
2400	}
2401
2402	if v.IncludeCustomMetadata {
2403		encoder.SetQuery("includeCustomMetadata").Boolean(v.IncludeCustomMetadata)
2404	}
2405
2406	if v.VersionId == nil || len(*v.VersionId) == 0 {
2407		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
2408	}
2409	if v.VersionId != nil {
2410		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
2411			return err
2412		}
2413	}
2414
2415	return nil
2416}
2417
2418type awsRestjson1_serializeOpGetFolder struct {
2419}
2420
2421func (*awsRestjson1_serializeOpGetFolder) ID() string {
2422	return "OperationSerializer"
2423}
2424
2425func (m *awsRestjson1_serializeOpGetFolder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2426	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2427) {
2428	request, ok := in.Request.(*smithyhttp.Request)
2429	if !ok {
2430		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2431	}
2432
2433	input, ok := in.Parameters.(*GetFolderInput)
2434	_ = input
2435	if !ok {
2436		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2437	}
2438
2439	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}")
2440	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2441	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2442	request.Method = "GET"
2443	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2444	if err != nil {
2445		return out, metadata, &smithy.SerializationError{Err: err}
2446	}
2447
2448	if err := awsRestjson1_serializeOpHttpBindingsGetFolderInput(input, restEncoder); err != nil {
2449		return out, metadata, &smithy.SerializationError{Err: err}
2450	}
2451
2452	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2453		return out, metadata, &smithy.SerializationError{Err: err}
2454	}
2455	in.Request = request
2456
2457	return next.HandleSerialize(ctx, in)
2458}
2459func awsRestjson1_serializeOpHttpBindingsGetFolderInput(v *GetFolderInput, encoder *httpbinding.Encoder) error {
2460	if v == nil {
2461		return fmt.Errorf("unsupported serialization of nil %T", v)
2462	}
2463
2464	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2465		locationName := "Authentication"
2466		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2467	}
2468
2469	if v.FolderId == nil || len(*v.FolderId) == 0 {
2470		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
2471	}
2472	if v.FolderId != nil {
2473		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
2474			return err
2475		}
2476	}
2477
2478	if v.IncludeCustomMetadata {
2479		encoder.SetQuery("includeCustomMetadata").Boolean(v.IncludeCustomMetadata)
2480	}
2481
2482	return nil
2483}
2484
2485type awsRestjson1_serializeOpGetFolderPath struct {
2486}
2487
2488func (*awsRestjson1_serializeOpGetFolderPath) ID() string {
2489	return "OperationSerializer"
2490}
2491
2492func (m *awsRestjson1_serializeOpGetFolderPath) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2493	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2494) {
2495	request, ok := in.Request.(*smithyhttp.Request)
2496	if !ok {
2497		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2498	}
2499
2500	input, ok := in.Parameters.(*GetFolderPathInput)
2501	_ = input
2502	if !ok {
2503		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2504	}
2505
2506	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}/path")
2507	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2508	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2509	request.Method = "GET"
2510	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2511	if err != nil {
2512		return out, metadata, &smithy.SerializationError{Err: err}
2513	}
2514
2515	if err := awsRestjson1_serializeOpHttpBindingsGetFolderPathInput(input, restEncoder); err != nil {
2516		return out, metadata, &smithy.SerializationError{Err: err}
2517	}
2518
2519	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2520		return out, metadata, &smithy.SerializationError{Err: err}
2521	}
2522	in.Request = request
2523
2524	return next.HandleSerialize(ctx, in)
2525}
2526func awsRestjson1_serializeOpHttpBindingsGetFolderPathInput(v *GetFolderPathInput, encoder *httpbinding.Encoder) error {
2527	if v == nil {
2528		return fmt.Errorf("unsupported serialization of nil %T", v)
2529	}
2530
2531	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2532		locationName := "Authentication"
2533		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2534	}
2535
2536	if v.Fields != nil {
2537		encoder.SetQuery("fields").String(*v.Fields)
2538	}
2539
2540	if v.FolderId == nil || len(*v.FolderId) == 0 {
2541		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
2542	}
2543	if v.FolderId != nil {
2544		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
2545			return err
2546		}
2547	}
2548
2549	if v.Limit != nil {
2550		encoder.SetQuery("limit").Integer(*v.Limit)
2551	}
2552
2553	if v.Marker != nil {
2554		encoder.SetQuery("marker").String(*v.Marker)
2555	}
2556
2557	return nil
2558}
2559
2560type awsRestjson1_serializeOpGetResources struct {
2561}
2562
2563func (*awsRestjson1_serializeOpGetResources) ID() string {
2564	return "OperationSerializer"
2565}
2566
2567func (m *awsRestjson1_serializeOpGetResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2568	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2569) {
2570	request, ok := in.Request.(*smithyhttp.Request)
2571	if !ok {
2572		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2573	}
2574
2575	input, ok := in.Parameters.(*GetResourcesInput)
2576	_ = input
2577	if !ok {
2578		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2579	}
2580
2581	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources")
2582	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2583	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2584	request.Method = "GET"
2585	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2586	if err != nil {
2587		return out, metadata, &smithy.SerializationError{Err: err}
2588	}
2589
2590	if err := awsRestjson1_serializeOpHttpBindingsGetResourcesInput(input, restEncoder); err != nil {
2591		return out, metadata, &smithy.SerializationError{Err: err}
2592	}
2593
2594	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2595		return out, metadata, &smithy.SerializationError{Err: err}
2596	}
2597	in.Request = request
2598
2599	return next.HandleSerialize(ctx, in)
2600}
2601func awsRestjson1_serializeOpHttpBindingsGetResourcesInput(v *GetResourcesInput, encoder *httpbinding.Encoder) error {
2602	if v == nil {
2603		return fmt.Errorf("unsupported serialization of nil %T", v)
2604	}
2605
2606	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2607		locationName := "Authentication"
2608		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2609	}
2610
2611	if len(v.CollectionType) > 0 {
2612		encoder.SetQuery("collectionType").String(string(v.CollectionType))
2613	}
2614
2615	if v.Limit != nil {
2616		encoder.SetQuery("limit").Integer(*v.Limit)
2617	}
2618
2619	if v.Marker != nil {
2620		encoder.SetQuery("marker").String(*v.Marker)
2621	}
2622
2623	if v.UserId != nil {
2624		encoder.SetQuery("userId").String(*v.UserId)
2625	}
2626
2627	return nil
2628}
2629
2630type awsRestjson1_serializeOpInitiateDocumentVersionUpload struct {
2631}
2632
2633func (*awsRestjson1_serializeOpInitiateDocumentVersionUpload) ID() string {
2634	return "OperationSerializer"
2635}
2636
2637func (m *awsRestjson1_serializeOpInitiateDocumentVersionUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2638	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2639) {
2640	request, ok := in.Request.(*smithyhttp.Request)
2641	if !ok {
2642		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2643	}
2644
2645	input, ok := in.Parameters.(*InitiateDocumentVersionUploadInput)
2646	_ = input
2647	if !ok {
2648		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2649	}
2650
2651	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents")
2652	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2653	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2654	request.Method = "POST"
2655	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2656	if err != nil {
2657		return out, metadata, &smithy.SerializationError{Err: err}
2658	}
2659
2660	if err := awsRestjson1_serializeOpHttpBindingsInitiateDocumentVersionUploadInput(input, restEncoder); err != nil {
2661		return out, metadata, &smithy.SerializationError{Err: err}
2662	}
2663
2664	restEncoder.SetHeader("Content-Type").String("application/json")
2665
2666	jsonEncoder := smithyjson.NewEncoder()
2667	if err := awsRestjson1_serializeOpDocumentInitiateDocumentVersionUploadInput(input, jsonEncoder.Value); err != nil {
2668		return out, metadata, &smithy.SerializationError{Err: err}
2669	}
2670
2671	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
2672		return out, metadata, &smithy.SerializationError{Err: err}
2673	}
2674
2675	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2676		return out, metadata, &smithy.SerializationError{Err: err}
2677	}
2678	in.Request = request
2679
2680	return next.HandleSerialize(ctx, in)
2681}
2682func awsRestjson1_serializeOpHttpBindingsInitiateDocumentVersionUploadInput(v *InitiateDocumentVersionUploadInput, encoder *httpbinding.Encoder) error {
2683	if v == nil {
2684		return fmt.Errorf("unsupported serialization of nil %T", v)
2685	}
2686
2687	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2688		locationName := "Authentication"
2689		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2690	}
2691
2692	return nil
2693}
2694
2695func awsRestjson1_serializeOpDocumentInitiateDocumentVersionUploadInput(v *InitiateDocumentVersionUploadInput, value smithyjson.Value) error {
2696	object := value.Object()
2697	defer object.Close()
2698
2699	if v.ContentCreatedTimestamp != nil {
2700		ok := object.Key("ContentCreatedTimestamp")
2701		ok.Double(smithytime.FormatEpochSeconds(*v.ContentCreatedTimestamp))
2702	}
2703
2704	if v.ContentModifiedTimestamp != nil {
2705		ok := object.Key("ContentModifiedTimestamp")
2706		ok.Double(smithytime.FormatEpochSeconds(*v.ContentModifiedTimestamp))
2707	}
2708
2709	if v.ContentType != nil {
2710		ok := object.Key("ContentType")
2711		ok.String(*v.ContentType)
2712	}
2713
2714	if v.DocumentSizeInBytes != nil {
2715		ok := object.Key("DocumentSizeInBytes")
2716		ok.Long(*v.DocumentSizeInBytes)
2717	}
2718
2719	if v.Id != nil {
2720		ok := object.Key("Id")
2721		ok.String(*v.Id)
2722	}
2723
2724	if v.Name != nil {
2725		ok := object.Key("Name")
2726		ok.String(*v.Name)
2727	}
2728
2729	if v.ParentFolderId != nil {
2730		ok := object.Key("ParentFolderId")
2731		ok.String(*v.ParentFolderId)
2732	}
2733
2734	return nil
2735}
2736
2737type awsRestjson1_serializeOpRemoveAllResourcePermissions struct {
2738}
2739
2740func (*awsRestjson1_serializeOpRemoveAllResourcePermissions) ID() string {
2741	return "OperationSerializer"
2742}
2743
2744func (m *awsRestjson1_serializeOpRemoveAllResourcePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2745	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2746) {
2747	request, ok := in.Request.(*smithyhttp.Request)
2748	if !ok {
2749		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2750	}
2751
2752	input, ok := in.Parameters.(*RemoveAllResourcePermissionsInput)
2753	_ = input
2754	if !ok {
2755		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2756	}
2757
2758	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/permissions")
2759	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2760	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2761	request.Method = "DELETE"
2762	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2763	if err != nil {
2764		return out, metadata, &smithy.SerializationError{Err: err}
2765	}
2766
2767	if err := awsRestjson1_serializeOpHttpBindingsRemoveAllResourcePermissionsInput(input, restEncoder); err != nil {
2768		return out, metadata, &smithy.SerializationError{Err: err}
2769	}
2770
2771	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2772		return out, metadata, &smithy.SerializationError{Err: err}
2773	}
2774	in.Request = request
2775
2776	return next.HandleSerialize(ctx, in)
2777}
2778func awsRestjson1_serializeOpHttpBindingsRemoveAllResourcePermissionsInput(v *RemoveAllResourcePermissionsInput, encoder *httpbinding.Encoder) error {
2779	if v == nil {
2780		return fmt.Errorf("unsupported serialization of nil %T", v)
2781	}
2782
2783	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2784		locationName := "Authentication"
2785		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2786	}
2787
2788	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
2789		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
2790	}
2791	if v.ResourceId != nil {
2792		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
2793			return err
2794		}
2795	}
2796
2797	return nil
2798}
2799
2800type awsRestjson1_serializeOpRemoveResourcePermission struct {
2801}
2802
2803func (*awsRestjson1_serializeOpRemoveResourcePermission) ID() string {
2804	return "OperationSerializer"
2805}
2806
2807func (m *awsRestjson1_serializeOpRemoveResourcePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2808	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2809) {
2810	request, ok := in.Request.(*smithyhttp.Request)
2811	if !ok {
2812		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2813	}
2814
2815	input, ok := in.Parameters.(*RemoveResourcePermissionInput)
2816	_ = input
2817	if !ok {
2818		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2819	}
2820
2821	opPath, opQuery := httpbinding.SplitURI("/api/v1/resources/{ResourceId}/permissions/{PrincipalId}")
2822	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2823	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2824	request.Method = "DELETE"
2825	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2826	if err != nil {
2827		return out, metadata, &smithy.SerializationError{Err: err}
2828	}
2829
2830	if err := awsRestjson1_serializeOpHttpBindingsRemoveResourcePermissionInput(input, restEncoder); err != nil {
2831		return out, metadata, &smithy.SerializationError{Err: err}
2832	}
2833
2834	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2835		return out, metadata, &smithy.SerializationError{Err: err}
2836	}
2837	in.Request = request
2838
2839	return next.HandleSerialize(ctx, in)
2840}
2841func awsRestjson1_serializeOpHttpBindingsRemoveResourcePermissionInput(v *RemoveResourcePermissionInput, encoder *httpbinding.Encoder) error {
2842	if v == nil {
2843		return fmt.Errorf("unsupported serialization of nil %T", v)
2844	}
2845
2846	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2847		locationName := "Authentication"
2848		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2849	}
2850
2851	if v.PrincipalId == nil || len(*v.PrincipalId) == 0 {
2852		return &smithy.SerializationError{Err: fmt.Errorf("input member PrincipalId must not be empty")}
2853	}
2854	if v.PrincipalId != nil {
2855		if err := encoder.SetURI("PrincipalId").String(*v.PrincipalId); err != nil {
2856			return err
2857		}
2858	}
2859
2860	if len(v.PrincipalType) > 0 {
2861		encoder.SetQuery("type").String(string(v.PrincipalType))
2862	}
2863
2864	if v.ResourceId == nil || len(*v.ResourceId) == 0 {
2865		return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceId must not be empty")}
2866	}
2867	if v.ResourceId != nil {
2868		if err := encoder.SetURI("ResourceId").String(*v.ResourceId); err != nil {
2869			return err
2870		}
2871	}
2872
2873	return nil
2874}
2875
2876type awsRestjson1_serializeOpUpdateDocument struct {
2877}
2878
2879func (*awsRestjson1_serializeOpUpdateDocument) ID() string {
2880	return "OperationSerializer"
2881}
2882
2883func (m *awsRestjson1_serializeOpUpdateDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2884	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2885) {
2886	request, ok := in.Request.(*smithyhttp.Request)
2887	if !ok {
2888		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2889	}
2890
2891	input, ok := in.Parameters.(*UpdateDocumentInput)
2892	_ = input
2893	if !ok {
2894		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2895	}
2896
2897	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}")
2898	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2899	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2900	request.Method = "PATCH"
2901	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2902	if err != nil {
2903		return out, metadata, &smithy.SerializationError{Err: err}
2904	}
2905
2906	if err := awsRestjson1_serializeOpHttpBindingsUpdateDocumentInput(input, restEncoder); err != nil {
2907		return out, metadata, &smithy.SerializationError{Err: err}
2908	}
2909
2910	restEncoder.SetHeader("Content-Type").String("application/json")
2911
2912	jsonEncoder := smithyjson.NewEncoder()
2913	if err := awsRestjson1_serializeOpDocumentUpdateDocumentInput(input, jsonEncoder.Value); err != nil {
2914		return out, metadata, &smithy.SerializationError{Err: err}
2915	}
2916
2917	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
2918		return out, metadata, &smithy.SerializationError{Err: err}
2919	}
2920
2921	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
2922		return out, metadata, &smithy.SerializationError{Err: err}
2923	}
2924	in.Request = request
2925
2926	return next.HandleSerialize(ctx, in)
2927}
2928func awsRestjson1_serializeOpHttpBindingsUpdateDocumentInput(v *UpdateDocumentInput, encoder *httpbinding.Encoder) error {
2929	if v == nil {
2930		return fmt.Errorf("unsupported serialization of nil %T", v)
2931	}
2932
2933	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
2934		locationName := "Authentication"
2935		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
2936	}
2937
2938	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
2939		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
2940	}
2941	if v.DocumentId != nil {
2942		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
2943			return err
2944		}
2945	}
2946
2947	return nil
2948}
2949
2950func awsRestjson1_serializeOpDocumentUpdateDocumentInput(v *UpdateDocumentInput, value smithyjson.Value) error {
2951	object := value.Object()
2952	defer object.Close()
2953
2954	if v.Name != nil {
2955		ok := object.Key("Name")
2956		ok.String(*v.Name)
2957	}
2958
2959	if v.ParentFolderId != nil {
2960		ok := object.Key("ParentFolderId")
2961		ok.String(*v.ParentFolderId)
2962	}
2963
2964	if len(v.ResourceState) > 0 {
2965		ok := object.Key("ResourceState")
2966		ok.String(string(v.ResourceState))
2967	}
2968
2969	return nil
2970}
2971
2972type awsRestjson1_serializeOpUpdateDocumentVersion struct {
2973}
2974
2975func (*awsRestjson1_serializeOpUpdateDocumentVersion) ID() string {
2976	return "OperationSerializer"
2977}
2978
2979func (m *awsRestjson1_serializeOpUpdateDocumentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
2980	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
2981) {
2982	request, ok := in.Request.(*smithyhttp.Request)
2983	if !ok {
2984		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
2985	}
2986
2987	input, ok := in.Parameters.(*UpdateDocumentVersionInput)
2988	_ = input
2989	if !ok {
2990		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
2991	}
2992
2993	opPath, opQuery := httpbinding.SplitURI("/api/v1/documents/{DocumentId}/versions/{VersionId}")
2994	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
2995	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
2996	request.Method = "PATCH"
2997	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
2998	if err != nil {
2999		return out, metadata, &smithy.SerializationError{Err: err}
3000	}
3001
3002	if err := awsRestjson1_serializeOpHttpBindingsUpdateDocumentVersionInput(input, restEncoder); err != nil {
3003		return out, metadata, &smithy.SerializationError{Err: err}
3004	}
3005
3006	restEncoder.SetHeader("Content-Type").String("application/json")
3007
3008	jsonEncoder := smithyjson.NewEncoder()
3009	if err := awsRestjson1_serializeOpDocumentUpdateDocumentVersionInput(input, jsonEncoder.Value); err != nil {
3010		return out, metadata, &smithy.SerializationError{Err: err}
3011	}
3012
3013	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
3014		return out, metadata, &smithy.SerializationError{Err: err}
3015	}
3016
3017	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
3018		return out, metadata, &smithy.SerializationError{Err: err}
3019	}
3020	in.Request = request
3021
3022	return next.HandleSerialize(ctx, in)
3023}
3024func awsRestjson1_serializeOpHttpBindingsUpdateDocumentVersionInput(v *UpdateDocumentVersionInput, encoder *httpbinding.Encoder) error {
3025	if v == nil {
3026		return fmt.Errorf("unsupported serialization of nil %T", v)
3027	}
3028
3029	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
3030		locationName := "Authentication"
3031		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
3032	}
3033
3034	if v.DocumentId == nil || len(*v.DocumentId) == 0 {
3035		return &smithy.SerializationError{Err: fmt.Errorf("input member DocumentId must not be empty")}
3036	}
3037	if v.DocumentId != nil {
3038		if err := encoder.SetURI("DocumentId").String(*v.DocumentId); err != nil {
3039			return err
3040		}
3041	}
3042
3043	if v.VersionId == nil || len(*v.VersionId) == 0 {
3044		return &smithy.SerializationError{Err: fmt.Errorf("input member VersionId must not be empty")}
3045	}
3046	if v.VersionId != nil {
3047		if err := encoder.SetURI("VersionId").String(*v.VersionId); err != nil {
3048			return err
3049		}
3050	}
3051
3052	return nil
3053}
3054
3055func awsRestjson1_serializeOpDocumentUpdateDocumentVersionInput(v *UpdateDocumentVersionInput, value smithyjson.Value) error {
3056	object := value.Object()
3057	defer object.Close()
3058
3059	if len(v.VersionStatus) > 0 {
3060		ok := object.Key("VersionStatus")
3061		ok.String(string(v.VersionStatus))
3062	}
3063
3064	return nil
3065}
3066
3067type awsRestjson1_serializeOpUpdateFolder struct {
3068}
3069
3070func (*awsRestjson1_serializeOpUpdateFolder) ID() string {
3071	return "OperationSerializer"
3072}
3073
3074func (m *awsRestjson1_serializeOpUpdateFolder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
3075	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
3076) {
3077	request, ok := in.Request.(*smithyhttp.Request)
3078	if !ok {
3079		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
3080	}
3081
3082	input, ok := in.Parameters.(*UpdateFolderInput)
3083	_ = input
3084	if !ok {
3085		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
3086	}
3087
3088	opPath, opQuery := httpbinding.SplitURI("/api/v1/folders/{FolderId}")
3089	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
3090	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
3091	request.Method = "PATCH"
3092	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
3093	if err != nil {
3094		return out, metadata, &smithy.SerializationError{Err: err}
3095	}
3096
3097	if err := awsRestjson1_serializeOpHttpBindingsUpdateFolderInput(input, restEncoder); err != nil {
3098		return out, metadata, &smithy.SerializationError{Err: err}
3099	}
3100
3101	restEncoder.SetHeader("Content-Type").String("application/json")
3102
3103	jsonEncoder := smithyjson.NewEncoder()
3104	if err := awsRestjson1_serializeOpDocumentUpdateFolderInput(input, jsonEncoder.Value); err != nil {
3105		return out, metadata, &smithy.SerializationError{Err: err}
3106	}
3107
3108	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
3109		return out, metadata, &smithy.SerializationError{Err: err}
3110	}
3111
3112	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
3113		return out, metadata, &smithy.SerializationError{Err: err}
3114	}
3115	in.Request = request
3116
3117	return next.HandleSerialize(ctx, in)
3118}
3119func awsRestjson1_serializeOpHttpBindingsUpdateFolderInput(v *UpdateFolderInput, encoder *httpbinding.Encoder) error {
3120	if v == nil {
3121		return fmt.Errorf("unsupported serialization of nil %T", v)
3122	}
3123
3124	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
3125		locationName := "Authentication"
3126		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
3127	}
3128
3129	if v.FolderId == nil || len(*v.FolderId) == 0 {
3130		return &smithy.SerializationError{Err: fmt.Errorf("input member FolderId must not be empty")}
3131	}
3132	if v.FolderId != nil {
3133		if err := encoder.SetURI("FolderId").String(*v.FolderId); err != nil {
3134			return err
3135		}
3136	}
3137
3138	return nil
3139}
3140
3141func awsRestjson1_serializeOpDocumentUpdateFolderInput(v *UpdateFolderInput, value smithyjson.Value) error {
3142	object := value.Object()
3143	defer object.Close()
3144
3145	if v.Name != nil {
3146		ok := object.Key("Name")
3147		ok.String(*v.Name)
3148	}
3149
3150	if v.ParentFolderId != nil {
3151		ok := object.Key("ParentFolderId")
3152		ok.String(*v.ParentFolderId)
3153	}
3154
3155	if len(v.ResourceState) > 0 {
3156		ok := object.Key("ResourceState")
3157		ok.String(string(v.ResourceState))
3158	}
3159
3160	return nil
3161}
3162
3163type awsRestjson1_serializeOpUpdateUser struct {
3164}
3165
3166func (*awsRestjson1_serializeOpUpdateUser) ID() string {
3167	return "OperationSerializer"
3168}
3169
3170func (m *awsRestjson1_serializeOpUpdateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
3171	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
3172) {
3173	request, ok := in.Request.(*smithyhttp.Request)
3174	if !ok {
3175		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
3176	}
3177
3178	input, ok := in.Parameters.(*UpdateUserInput)
3179	_ = input
3180	if !ok {
3181		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
3182	}
3183
3184	opPath, opQuery := httpbinding.SplitURI("/api/v1/users/{UserId}")
3185	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
3186	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
3187	request.Method = "PATCH"
3188	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
3189	if err != nil {
3190		return out, metadata, &smithy.SerializationError{Err: err}
3191	}
3192
3193	if err := awsRestjson1_serializeOpHttpBindingsUpdateUserInput(input, restEncoder); err != nil {
3194		return out, metadata, &smithy.SerializationError{Err: err}
3195	}
3196
3197	restEncoder.SetHeader("Content-Type").String("application/json")
3198
3199	jsonEncoder := smithyjson.NewEncoder()
3200	if err := awsRestjson1_serializeOpDocumentUpdateUserInput(input, jsonEncoder.Value); err != nil {
3201		return out, metadata, &smithy.SerializationError{Err: err}
3202	}
3203
3204	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
3205		return out, metadata, &smithy.SerializationError{Err: err}
3206	}
3207
3208	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
3209		return out, metadata, &smithy.SerializationError{Err: err}
3210	}
3211	in.Request = request
3212
3213	return next.HandleSerialize(ctx, in)
3214}
3215func awsRestjson1_serializeOpHttpBindingsUpdateUserInput(v *UpdateUserInput, encoder *httpbinding.Encoder) error {
3216	if v == nil {
3217		return fmt.Errorf("unsupported serialization of nil %T", v)
3218	}
3219
3220	if v.AuthenticationToken != nil && len(*v.AuthenticationToken) > 0 {
3221		locationName := "Authentication"
3222		encoder.SetHeader(locationName).String(*v.AuthenticationToken)
3223	}
3224
3225	if v.UserId == nil || len(*v.UserId) == 0 {
3226		return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")}
3227	}
3228	if v.UserId != nil {
3229		if err := encoder.SetURI("UserId").String(*v.UserId); err != nil {
3230			return err
3231		}
3232	}
3233
3234	return nil
3235}
3236
3237func awsRestjson1_serializeOpDocumentUpdateUserInput(v *UpdateUserInput, value smithyjson.Value) error {
3238	object := value.Object()
3239	defer object.Close()
3240
3241	if v.GivenName != nil {
3242		ok := object.Key("GivenName")
3243		ok.String(*v.GivenName)
3244	}
3245
3246	if len(v.GrantPoweruserPrivileges) > 0 {
3247		ok := object.Key("GrantPoweruserPrivileges")
3248		ok.String(string(v.GrantPoweruserPrivileges))
3249	}
3250
3251	if len(v.Locale) > 0 {
3252		ok := object.Key("Locale")
3253		ok.String(string(v.Locale))
3254	}
3255
3256	if v.StorageRule != nil {
3257		ok := object.Key("StorageRule")
3258		if err := awsRestjson1_serializeDocumentStorageRuleType(v.StorageRule, ok); err != nil {
3259			return err
3260		}
3261	}
3262
3263	if v.Surname != nil {
3264		ok := object.Key("Surname")
3265		ok.String(*v.Surname)
3266	}
3267
3268	if v.TimeZoneId != nil {
3269		ok := object.Key("TimeZoneId")
3270		ok.String(*v.TimeZoneId)
3271	}
3272
3273	if len(v.Type) > 0 {
3274		ok := object.Key("Type")
3275		ok.String(string(v.Type))
3276	}
3277
3278	return nil
3279}
3280
3281func awsRestjson1_serializeDocumentCustomMetadataMap(v map[string]string, value smithyjson.Value) error {
3282	object := value.Object()
3283	defer object.Close()
3284
3285	for key := range v {
3286		om := object.Key(key)
3287		om.String(v[key])
3288	}
3289	return nil
3290}
3291
3292func awsRestjson1_serializeDocumentNotificationOptions(v *types.NotificationOptions, value smithyjson.Value) error {
3293	object := value.Object()
3294	defer object.Close()
3295
3296	if v.EmailMessage != nil {
3297		ok := object.Key("EmailMessage")
3298		ok.String(*v.EmailMessage)
3299	}
3300
3301	if v.SendEmail {
3302		ok := object.Key("SendEmail")
3303		ok.Boolean(v.SendEmail)
3304	}
3305
3306	return nil
3307}
3308
3309func awsRestjson1_serializeDocumentSharedLabels(v []string, value smithyjson.Value) error {
3310	array := value.Array()
3311	defer array.Close()
3312
3313	for i := range v {
3314		av := array.Value()
3315		av.String(v[i])
3316	}
3317	return nil
3318}
3319
3320func awsRestjson1_serializeDocumentSharePrincipal(v *types.SharePrincipal, value smithyjson.Value) error {
3321	object := value.Object()
3322	defer object.Close()
3323
3324	if v.Id != nil {
3325		ok := object.Key("Id")
3326		ok.String(*v.Id)
3327	}
3328
3329	if len(v.Role) > 0 {
3330		ok := object.Key("Role")
3331		ok.String(string(v.Role))
3332	}
3333
3334	if len(v.Type) > 0 {
3335		ok := object.Key("Type")
3336		ok.String(string(v.Type))
3337	}
3338
3339	return nil
3340}
3341
3342func awsRestjson1_serializeDocumentSharePrincipalList(v []types.SharePrincipal, value smithyjson.Value) error {
3343	array := value.Array()
3344	defer array.Close()
3345
3346	for i := range v {
3347		av := array.Value()
3348		if err := awsRestjson1_serializeDocumentSharePrincipal(&v[i], av); err != nil {
3349			return err
3350		}
3351	}
3352	return nil
3353}
3354
3355func awsRestjson1_serializeDocumentStorageRuleType(v *types.StorageRuleType, value smithyjson.Value) error {
3356	object := value.Object()
3357	defer object.Close()
3358
3359	if v.StorageAllocatedInBytes != nil {
3360		ok := object.Key("StorageAllocatedInBytes")
3361		ok.Long(*v.StorageAllocatedInBytes)
3362	}
3363
3364	if len(v.StorageType) > 0 {
3365		ok := object.Key("StorageType")
3366		ok.String(string(v.StorageType))
3367	}
3368
3369	return nil
3370}
3371