1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package braket
4
5import (
6	"bytes"
7	"context"
8	"fmt"
9	"github.com/aws/aws-sdk-go-v2/service/braket/types"
10	smithy "github.com/aws/smithy-go"
11	"github.com/aws/smithy-go/encoding/httpbinding"
12	smithyjson "github.com/aws/smithy-go/encoding/json"
13	"github.com/aws/smithy-go/middleware"
14	smithyhttp "github.com/aws/smithy-go/transport/http"
15)
16
17type awsRestjson1_serializeOpCancelQuantumTask struct {
18}
19
20func (*awsRestjson1_serializeOpCancelQuantumTask) ID() string {
21	return "OperationSerializer"
22}
23
24func (m *awsRestjson1_serializeOpCancelQuantumTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
25	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
26) {
27	request, ok := in.Request.(*smithyhttp.Request)
28	if !ok {
29		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
30	}
31
32	input, ok := in.Parameters.(*CancelQuantumTaskInput)
33	_ = input
34	if !ok {
35		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
36	}
37
38	opPath, opQuery := httpbinding.SplitURI("/quantum-task/{quantumTaskArn}/cancel")
39	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
40	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
41	request.Method = "PUT"
42	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
43	if err != nil {
44		return out, metadata, &smithy.SerializationError{Err: err}
45	}
46
47	if err := awsRestjson1_serializeOpHttpBindingsCancelQuantumTaskInput(input, restEncoder); err != nil {
48		return out, metadata, &smithy.SerializationError{Err: err}
49	}
50
51	restEncoder.SetHeader("Content-Type").String("application/json")
52
53	jsonEncoder := smithyjson.NewEncoder()
54	if err := awsRestjson1_serializeOpDocumentCancelQuantumTaskInput(input, jsonEncoder.Value); err != nil {
55		return out, metadata, &smithy.SerializationError{Err: err}
56	}
57
58	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
59		return out, metadata, &smithy.SerializationError{Err: err}
60	}
61
62	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
63		return out, metadata, &smithy.SerializationError{Err: err}
64	}
65	in.Request = request
66
67	return next.HandleSerialize(ctx, in)
68}
69func awsRestjson1_serializeOpHttpBindingsCancelQuantumTaskInput(v *CancelQuantumTaskInput, encoder *httpbinding.Encoder) error {
70	if v == nil {
71		return fmt.Errorf("unsupported serialization of nil %T", v)
72	}
73
74	if v.QuantumTaskArn == nil || len(*v.QuantumTaskArn) == 0 {
75		return &smithy.SerializationError{Err: fmt.Errorf("input member quantumTaskArn must not be empty")}
76	}
77	if v.QuantumTaskArn != nil {
78		if err := encoder.SetURI("quantumTaskArn").String(*v.QuantumTaskArn); err != nil {
79			return err
80		}
81	}
82
83	return nil
84}
85
86func awsRestjson1_serializeOpDocumentCancelQuantumTaskInput(v *CancelQuantumTaskInput, value smithyjson.Value) error {
87	object := value.Object()
88	defer object.Close()
89
90	if v.ClientToken != nil {
91		ok := object.Key("clientToken")
92		ok.String(*v.ClientToken)
93	}
94
95	return nil
96}
97
98type awsRestjson1_serializeOpCreateQuantumTask struct {
99}
100
101func (*awsRestjson1_serializeOpCreateQuantumTask) ID() string {
102	return "OperationSerializer"
103}
104
105func (m *awsRestjson1_serializeOpCreateQuantumTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
106	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
107) {
108	request, ok := in.Request.(*smithyhttp.Request)
109	if !ok {
110		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
111	}
112
113	input, ok := in.Parameters.(*CreateQuantumTaskInput)
114	_ = input
115	if !ok {
116		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
117	}
118
119	opPath, opQuery := httpbinding.SplitURI("/quantum-task")
120	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
121	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
122	request.Method = "POST"
123	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
124	if err != nil {
125		return out, metadata, &smithy.SerializationError{Err: err}
126	}
127
128	restEncoder.SetHeader("Content-Type").String("application/json")
129
130	jsonEncoder := smithyjson.NewEncoder()
131	if err := awsRestjson1_serializeOpDocumentCreateQuantumTaskInput(input, jsonEncoder.Value); err != nil {
132		return out, metadata, &smithy.SerializationError{Err: err}
133	}
134
135	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
136		return out, metadata, &smithy.SerializationError{Err: err}
137	}
138
139	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
140		return out, metadata, &smithy.SerializationError{Err: err}
141	}
142	in.Request = request
143
144	return next.HandleSerialize(ctx, in)
145}
146func awsRestjson1_serializeOpHttpBindingsCreateQuantumTaskInput(v *CreateQuantumTaskInput, encoder *httpbinding.Encoder) error {
147	if v == nil {
148		return fmt.Errorf("unsupported serialization of nil %T", v)
149	}
150
151	return nil
152}
153
154func awsRestjson1_serializeOpDocumentCreateQuantumTaskInput(v *CreateQuantumTaskInput, value smithyjson.Value) error {
155	object := value.Object()
156	defer object.Close()
157
158	if v.Action != nil {
159		ok := object.Key("action")
160		ok.String(*v.Action)
161	}
162
163	if v.ClientToken != nil {
164		ok := object.Key("clientToken")
165		ok.String(*v.ClientToken)
166	}
167
168	if v.DeviceArn != nil {
169		ok := object.Key("deviceArn")
170		ok.String(*v.DeviceArn)
171	}
172
173	if v.DeviceParameters != nil {
174		ok := object.Key("deviceParameters")
175		ok.String(*v.DeviceParameters)
176	}
177
178	if v.OutputS3Bucket != nil {
179		ok := object.Key("outputS3Bucket")
180		ok.String(*v.OutputS3Bucket)
181	}
182
183	if v.OutputS3KeyPrefix != nil {
184		ok := object.Key("outputS3KeyPrefix")
185		ok.String(*v.OutputS3KeyPrefix)
186	}
187
188	if v.Shots != nil {
189		ok := object.Key("shots")
190		ok.Long(*v.Shots)
191	}
192
193	if v.Tags != nil {
194		ok := object.Key("tags")
195		if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil {
196			return err
197		}
198	}
199
200	return nil
201}
202
203type awsRestjson1_serializeOpGetDevice struct {
204}
205
206func (*awsRestjson1_serializeOpGetDevice) ID() string {
207	return "OperationSerializer"
208}
209
210func (m *awsRestjson1_serializeOpGetDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
211	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
212) {
213	request, ok := in.Request.(*smithyhttp.Request)
214	if !ok {
215		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
216	}
217
218	input, ok := in.Parameters.(*GetDeviceInput)
219	_ = input
220	if !ok {
221		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
222	}
223
224	opPath, opQuery := httpbinding.SplitURI("/device/{deviceArn}")
225	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
226	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
227	request.Method = "GET"
228	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
229	if err != nil {
230		return out, metadata, &smithy.SerializationError{Err: err}
231	}
232
233	if err := awsRestjson1_serializeOpHttpBindingsGetDeviceInput(input, restEncoder); err != nil {
234		return out, metadata, &smithy.SerializationError{Err: err}
235	}
236
237	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
238		return out, metadata, &smithy.SerializationError{Err: err}
239	}
240	in.Request = request
241
242	return next.HandleSerialize(ctx, in)
243}
244func awsRestjson1_serializeOpHttpBindingsGetDeviceInput(v *GetDeviceInput, encoder *httpbinding.Encoder) error {
245	if v == nil {
246		return fmt.Errorf("unsupported serialization of nil %T", v)
247	}
248
249	if v.DeviceArn == nil || len(*v.DeviceArn) == 0 {
250		return &smithy.SerializationError{Err: fmt.Errorf("input member deviceArn must not be empty")}
251	}
252	if v.DeviceArn != nil {
253		if err := encoder.SetURI("deviceArn").String(*v.DeviceArn); err != nil {
254			return err
255		}
256	}
257
258	return nil
259}
260
261type awsRestjson1_serializeOpGetQuantumTask struct {
262}
263
264func (*awsRestjson1_serializeOpGetQuantumTask) ID() string {
265	return "OperationSerializer"
266}
267
268func (m *awsRestjson1_serializeOpGetQuantumTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
269	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
270) {
271	request, ok := in.Request.(*smithyhttp.Request)
272	if !ok {
273		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
274	}
275
276	input, ok := in.Parameters.(*GetQuantumTaskInput)
277	_ = input
278	if !ok {
279		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
280	}
281
282	opPath, opQuery := httpbinding.SplitURI("/quantum-task/{quantumTaskArn}")
283	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
284	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
285	request.Method = "GET"
286	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
287	if err != nil {
288		return out, metadata, &smithy.SerializationError{Err: err}
289	}
290
291	if err := awsRestjson1_serializeOpHttpBindingsGetQuantumTaskInput(input, restEncoder); err != nil {
292		return out, metadata, &smithy.SerializationError{Err: err}
293	}
294
295	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
296		return out, metadata, &smithy.SerializationError{Err: err}
297	}
298	in.Request = request
299
300	return next.HandleSerialize(ctx, in)
301}
302func awsRestjson1_serializeOpHttpBindingsGetQuantumTaskInput(v *GetQuantumTaskInput, encoder *httpbinding.Encoder) error {
303	if v == nil {
304		return fmt.Errorf("unsupported serialization of nil %T", v)
305	}
306
307	if v.QuantumTaskArn == nil || len(*v.QuantumTaskArn) == 0 {
308		return &smithy.SerializationError{Err: fmt.Errorf("input member quantumTaskArn must not be empty")}
309	}
310	if v.QuantumTaskArn != nil {
311		if err := encoder.SetURI("quantumTaskArn").String(*v.QuantumTaskArn); err != nil {
312			return err
313		}
314	}
315
316	return nil
317}
318
319type awsRestjson1_serializeOpListTagsForResource struct {
320}
321
322func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
323	return "OperationSerializer"
324}
325
326func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
327	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
328) {
329	request, ok := in.Request.(*smithyhttp.Request)
330	if !ok {
331		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
332	}
333
334	input, ok := in.Parameters.(*ListTagsForResourceInput)
335	_ = input
336	if !ok {
337		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
338	}
339
340	opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
341	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
342	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
343	request.Method = "GET"
344	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
345	if err != nil {
346		return out, metadata, &smithy.SerializationError{Err: err}
347	}
348
349	if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
350		return out, metadata, &smithy.SerializationError{Err: err}
351	}
352
353	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
354		return out, metadata, &smithy.SerializationError{Err: err}
355	}
356	in.Request = request
357
358	return next.HandleSerialize(ctx, in)
359}
360func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
361	if v == nil {
362		return fmt.Errorf("unsupported serialization of nil %T", v)
363	}
364
365	if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
366		return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
367	}
368	if v.ResourceArn != nil {
369		if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
370			return err
371		}
372	}
373
374	return nil
375}
376
377type awsRestjson1_serializeOpSearchDevices struct {
378}
379
380func (*awsRestjson1_serializeOpSearchDevices) ID() string {
381	return "OperationSerializer"
382}
383
384func (m *awsRestjson1_serializeOpSearchDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
385	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
386) {
387	request, ok := in.Request.(*smithyhttp.Request)
388	if !ok {
389		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
390	}
391
392	input, ok := in.Parameters.(*SearchDevicesInput)
393	_ = input
394	if !ok {
395		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
396	}
397
398	opPath, opQuery := httpbinding.SplitURI("/devices")
399	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
400	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
401	request.Method = "POST"
402	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
403	if err != nil {
404		return out, metadata, &smithy.SerializationError{Err: err}
405	}
406
407	restEncoder.SetHeader("Content-Type").String("application/json")
408
409	jsonEncoder := smithyjson.NewEncoder()
410	if err := awsRestjson1_serializeOpDocumentSearchDevicesInput(input, jsonEncoder.Value); err != nil {
411		return out, metadata, &smithy.SerializationError{Err: err}
412	}
413
414	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
415		return out, metadata, &smithy.SerializationError{Err: err}
416	}
417
418	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
419		return out, metadata, &smithy.SerializationError{Err: err}
420	}
421	in.Request = request
422
423	return next.HandleSerialize(ctx, in)
424}
425func awsRestjson1_serializeOpHttpBindingsSearchDevicesInput(v *SearchDevicesInput, encoder *httpbinding.Encoder) error {
426	if v == nil {
427		return fmt.Errorf("unsupported serialization of nil %T", v)
428	}
429
430	return nil
431}
432
433func awsRestjson1_serializeOpDocumentSearchDevicesInput(v *SearchDevicesInput, value smithyjson.Value) error {
434	object := value.Object()
435	defer object.Close()
436
437	if v.Filters != nil {
438		ok := object.Key("filters")
439		if err := awsRestjson1_serializeDocumentSearchDevicesFilterList(v.Filters, ok); err != nil {
440			return err
441		}
442	}
443
444	if v.MaxResults != nil {
445		ok := object.Key("maxResults")
446		ok.Integer(*v.MaxResults)
447	}
448
449	if v.NextToken != nil {
450		ok := object.Key("nextToken")
451		ok.String(*v.NextToken)
452	}
453
454	return nil
455}
456
457type awsRestjson1_serializeOpSearchQuantumTasks struct {
458}
459
460func (*awsRestjson1_serializeOpSearchQuantumTasks) ID() string {
461	return "OperationSerializer"
462}
463
464func (m *awsRestjson1_serializeOpSearchQuantumTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
465	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
466) {
467	request, ok := in.Request.(*smithyhttp.Request)
468	if !ok {
469		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
470	}
471
472	input, ok := in.Parameters.(*SearchQuantumTasksInput)
473	_ = input
474	if !ok {
475		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
476	}
477
478	opPath, opQuery := httpbinding.SplitURI("/quantum-tasks")
479	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
480	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
481	request.Method = "POST"
482	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
483	if err != nil {
484		return out, metadata, &smithy.SerializationError{Err: err}
485	}
486
487	restEncoder.SetHeader("Content-Type").String("application/json")
488
489	jsonEncoder := smithyjson.NewEncoder()
490	if err := awsRestjson1_serializeOpDocumentSearchQuantumTasksInput(input, jsonEncoder.Value); err != nil {
491		return out, metadata, &smithy.SerializationError{Err: err}
492	}
493
494	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
495		return out, metadata, &smithy.SerializationError{Err: err}
496	}
497
498	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
499		return out, metadata, &smithy.SerializationError{Err: err}
500	}
501	in.Request = request
502
503	return next.HandleSerialize(ctx, in)
504}
505func awsRestjson1_serializeOpHttpBindingsSearchQuantumTasksInput(v *SearchQuantumTasksInput, encoder *httpbinding.Encoder) error {
506	if v == nil {
507		return fmt.Errorf("unsupported serialization of nil %T", v)
508	}
509
510	return nil
511}
512
513func awsRestjson1_serializeOpDocumentSearchQuantumTasksInput(v *SearchQuantumTasksInput, value smithyjson.Value) error {
514	object := value.Object()
515	defer object.Close()
516
517	if v.Filters != nil {
518		ok := object.Key("filters")
519		if err := awsRestjson1_serializeDocumentSearchQuantumTasksFilterList(v.Filters, ok); err != nil {
520			return err
521		}
522	}
523
524	if v.MaxResults != nil {
525		ok := object.Key("maxResults")
526		ok.Integer(*v.MaxResults)
527	}
528
529	if v.NextToken != nil {
530		ok := object.Key("nextToken")
531		ok.String(*v.NextToken)
532	}
533
534	return nil
535}
536
537type awsRestjson1_serializeOpTagResource struct {
538}
539
540func (*awsRestjson1_serializeOpTagResource) ID() string {
541	return "OperationSerializer"
542}
543
544func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput)
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("/tags/{resourceArn}")
559	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
560	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
561	request.Method = "POST"
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_serializeOpHttpBindingsTagResourceInput(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_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
590	if v == nil {
591		return fmt.Errorf("unsupported serialization of nil %T", v)
592	}
593
594	if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
595		return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
596	}
597	if v.ResourceArn != nil {
598		if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
599			return err
600		}
601	}
602
603	return nil
604}
605
606func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
607	object := value.Object()
608	defer object.Close()
609
610	if v.Tags != nil {
611		ok := object.Key("tags")
612		if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil {
613			return err
614		}
615	}
616
617	return nil
618}
619
620type awsRestjson1_serializeOpUntagResource struct {
621}
622
623func (*awsRestjson1_serializeOpUntagResource) ID() string {
624	return "OperationSerializer"
625}
626
627func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
628	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
629) {
630	request, ok := in.Request.(*smithyhttp.Request)
631	if !ok {
632		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
633	}
634
635	input, ok := in.Parameters.(*UntagResourceInput)
636	_ = input
637	if !ok {
638		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
639	}
640
641	opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
642	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
643	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
644	request.Method = "DELETE"
645	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
646	if err != nil {
647		return out, metadata, &smithy.SerializationError{Err: err}
648	}
649
650	if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
651		return out, metadata, &smithy.SerializationError{Err: err}
652	}
653
654	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
655		return out, metadata, &smithy.SerializationError{Err: err}
656	}
657	in.Request = request
658
659	return next.HandleSerialize(ctx, in)
660}
661func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
662	if v == nil {
663		return fmt.Errorf("unsupported serialization of nil %T", v)
664	}
665
666	if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
667		return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
668	}
669	if v.ResourceArn != nil {
670		if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
671			return err
672		}
673	}
674
675	if v.TagKeys != nil {
676		for i := range v.TagKeys {
677			encoder.AddQuery("tagKeys").String(v.TagKeys[i])
678		}
679	}
680
681	return nil
682}
683
684func awsRestjson1_serializeDocumentSearchDevicesFilter(v *types.SearchDevicesFilter, value smithyjson.Value) error {
685	object := value.Object()
686	defer object.Close()
687
688	if v.Name != nil {
689		ok := object.Key("name")
690		ok.String(*v.Name)
691	}
692
693	if v.Values != nil {
694		ok := object.Key("values")
695		if err := awsRestjson1_serializeDocumentString256List(v.Values, ok); err != nil {
696			return err
697		}
698	}
699
700	return nil
701}
702
703func awsRestjson1_serializeDocumentSearchDevicesFilterList(v []types.SearchDevicesFilter, value smithyjson.Value) error {
704	array := value.Array()
705	defer array.Close()
706
707	for i := range v {
708		av := array.Value()
709		if err := awsRestjson1_serializeDocumentSearchDevicesFilter(&v[i], av); err != nil {
710			return err
711		}
712	}
713	return nil
714}
715
716func awsRestjson1_serializeDocumentSearchQuantumTasksFilter(v *types.SearchQuantumTasksFilter, value smithyjson.Value) error {
717	object := value.Object()
718	defer object.Close()
719
720	if v.Name != nil {
721		ok := object.Key("name")
722		ok.String(*v.Name)
723	}
724
725	if len(v.Operator) > 0 {
726		ok := object.Key("operator")
727		ok.String(string(v.Operator))
728	}
729
730	if v.Values != nil {
731		ok := object.Key("values")
732		if err := awsRestjson1_serializeDocumentString256List(v.Values, ok); err != nil {
733			return err
734		}
735	}
736
737	return nil
738}
739
740func awsRestjson1_serializeDocumentSearchQuantumTasksFilterList(v []types.SearchQuantumTasksFilter, value smithyjson.Value) error {
741	array := value.Array()
742	defer array.Close()
743
744	for i := range v {
745		av := array.Value()
746		if err := awsRestjson1_serializeDocumentSearchQuantumTasksFilter(&v[i], av); err != nil {
747			return err
748		}
749	}
750	return nil
751}
752
753func awsRestjson1_serializeDocumentString256List(v []string, value smithyjson.Value) error {
754	array := value.Array()
755	defer array.Close()
756
757	for i := range v {
758		av := array.Value()
759		av.String(v[i])
760	}
761	return nil
762}
763
764func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error {
765	object := value.Object()
766	defer object.Close()
767
768	for key := range v {
769		om := object.Key(key)
770		om.String(v[key])
771	}
772	return nil
773}
774