1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package autoscalingplans
4
5import (
6	"bytes"
7	"context"
8	"fmt"
9	"github.com/aws/aws-sdk-go-v2/service/autoscalingplans/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 awsAwsjson11_serializeOpCreateScalingPlan struct {
19}
20
21func (*awsAwsjson11_serializeOpCreateScalingPlan) ID() string {
22	return "OperationSerializer"
23}
24
25func (m *awsAwsjson11_serializeOpCreateScalingPlan) 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.(*CreateScalingPlanInput)
34	_ = input
35	if !ok {
36		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
37	}
38
39	request.Request.URL.Path = "/"
40	request.Request.Method = "POST"
41	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
42	if err != nil {
43		return out, metadata, &smithy.SerializationError{Err: err}
44	}
45	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
46	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.CreateScalingPlan")
47
48	jsonEncoder := smithyjson.NewEncoder()
49	if err := awsAwsjson11_serializeOpDocumentCreateScalingPlanInput(input, jsonEncoder.Value); err != nil {
50		return out, metadata, &smithy.SerializationError{Err: err}
51	}
52
53	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
54		return out, metadata, &smithy.SerializationError{Err: err}
55	}
56
57	if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
58		return out, metadata, &smithy.SerializationError{Err: err}
59	}
60	in.Request = request
61
62	return next.HandleSerialize(ctx, in)
63}
64
65type awsAwsjson11_serializeOpDeleteScalingPlan struct {
66}
67
68func (*awsAwsjson11_serializeOpDeleteScalingPlan) ID() string {
69	return "OperationSerializer"
70}
71
72func (m *awsAwsjson11_serializeOpDeleteScalingPlan) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
73	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
74) {
75	request, ok := in.Request.(*smithyhttp.Request)
76	if !ok {
77		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
78	}
79
80	input, ok := in.Parameters.(*DeleteScalingPlanInput)
81	_ = input
82	if !ok {
83		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
84	}
85
86	request.Request.URL.Path = "/"
87	request.Request.Method = "POST"
88	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
89	if err != nil {
90		return out, metadata, &smithy.SerializationError{Err: err}
91	}
92	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
93	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.DeleteScalingPlan")
94
95	jsonEncoder := smithyjson.NewEncoder()
96	if err := awsAwsjson11_serializeOpDocumentDeleteScalingPlanInput(input, jsonEncoder.Value); err != nil {
97		return out, metadata, &smithy.SerializationError{Err: err}
98	}
99
100	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
101		return out, metadata, &smithy.SerializationError{Err: err}
102	}
103
104	if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
105		return out, metadata, &smithy.SerializationError{Err: err}
106	}
107	in.Request = request
108
109	return next.HandleSerialize(ctx, in)
110}
111
112type awsAwsjson11_serializeOpDescribeScalingPlanResources struct {
113}
114
115func (*awsAwsjson11_serializeOpDescribeScalingPlanResources) ID() string {
116	return "OperationSerializer"
117}
118
119func (m *awsAwsjson11_serializeOpDescribeScalingPlanResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
120	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
121) {
122	request, ok := in.Request.(*smithyhttp.Request)
123	if !ok {
124		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
125	}
126
127	input, ok := in.Parameters.(*DescribeScalingPlanResourcesInput)
128	_ = input
129	if !ok {
130		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
131	}
132
133	request.Request.URL.Path = "/"
134	request.Request.Method = "POST"
135	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
136	if err != nil {
137		return out, metadata, &smithy.SerializationError{Err: err}
138	}
139	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
140	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources")
141
142	jsonEncoder := smithyjson.NewEncoder()
143	if err := awsAwsjson11_serializeOpDocumentDescribeScalingPlanResourcesInput(input, jsonEncoder.Value); err != nil {
144		return out, metadata, &smithy.SerializationError{Err: err}
145	}
146
147	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
148		return out, metadata, &smithy.SerializationError{Err: err}
149	}
150
151	if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
152		return out, metadata, &smithy.SerializationError{Err: err}
153	}
154	in.Request = request
155
156	return next.HandleSerialize(ctx, in)
157}
158
159type awsAwsjson11_serializeOpDescribeScalingPlans struct {
160}
161
162func (*awsAwsjson11_serializeOpDescribeScalingPlans) ID() string {
163	return "OperationSerializer"
164}
165
166func (m *awsAwsjson11_serializeOpDescribeScalingPlans) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
167	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
168) {
169	request, ok := in.Request.(*smithyhttp.Request)
170	if !ok {
171		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
172	}
173
174	input, ok := in.Parameters.(*DescribeScalingPlansInput)
175	_ = input
176	if !ok {
177		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
178	}
179
180	request.Request.URL.Path = "/"
181	request.Request.Method = "POST"
182	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
183	if err != nil {
184		return out, metadata, &smithy.SerializationError{Err: err}
185	}
186	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
187	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.DescribeScalingPlans")
188
189	jsonEncoder := smithyjson.NewEncoder()
190	if err := awsAwsjson11_serializeOpDocumentDescribeScalingPlansInput(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 = httpBindingEncoder.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}
205
206type awsAwsjson11_serializeOpGetScalingPlanResourceForecastData struct {
207}
208
209func (*awsAwsjson11_serializeOpGetScalingPlanResourceForecastData) ID() string {
210	return "OperationSerializer"
211}
212
213func (m *awsAwsjson11_serializeOpGetScalingPlanResourceForecastData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
214	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
215) {
216	request, ok := in.Request.(*smithyhttp.Request)
217	if !ok {
218		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
219	}
220
221	input, ok := in.Parameters.(*GetScalingPlanResourceForecastDataInput)
222	_ = input
223	if !ok {
224		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
225	}
226
227	request.Request.URL.Path = "/"
228	request.Request.Method = "POST"
229	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
230	if err != nil {
231		return out, metadata, &smithy.SerializationError{Err: err}
232	}
233	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
234	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData")
235
236	jsonEncoder := smithyjson.NewEncoder()
237	if err := awsAwsjson11_serializeOpDocumentGetScalingPlanResourceForecastDataInput(input, jsonEncoder.Value); err != nil {
238		return out, metadata, &smithy.SerializationError{Err: err}
239	}
240
241	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
242		return out, metadata, &smithy.SerializationError{Err: err}
243	}
244
245	if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
246		return out, metadata, &smithy.SerializationError{Err: err}
247	}
248	in.Request = request
249
250	return next.HandleSerialize(ctx, in)
251}
252
253type awsAwsjson11_serializeOpUpdateScalingPlan struct {
254}
255
256func (*awsAwsjson11_serializeOpUpdateScalingPlan) ID() string {
257	return "OperationSerializer"
258}
259
260func (m *awsAwsjson11_serializeOpUpdateScalingPlan) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
261	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
262) {
263	request, ok := in.Request.(*smithyhttp.Request)
264	if !ok {
265		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
266	}
267
268	input, ok := in.Parameters.(*UpdateScalingPlanInput)
269	_ = input
270	if !ok {
271		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
272	}
273
274	request.Request.URL.Path = "/"
275	request.Request.Method = "POST"
276	httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
277	if err != nil {
278		return out, metadata, &smithy.SerializationError{Err: err}
279	}
280	httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
281	httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleScalingPlannerFrontendService.UpdateScalingPlan")
282
283	jsonEncoder := smithyjson.NewEncoder()
284	if err := awsAwsjson11_serializeOpDocumentUpdateScalingPlanInput(input, jsonEncoder.Value); err != nil {
285		return out, metadata, &smithy.SerializationError{Err: err}
286	}
287
288	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
289		return out, metadata, &smithy.SerializationError{Err: err}
290	}
291
292	if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
293		return out, metadata, &smithy.SerializationError{Err: err}
294	}
295	in.Request = request
296
297	return next.HandleSerialize(ctx, in)
298}
299func awsAwsjson11_serializeDocumentApplicationSource(v *types.ApplicationSource, value smithyjson.Value) error {
300	object := value.Object()
301	defer object.Close()
302
303	if v.CloudFormationStackARN != nil {
304		ok := object.Key("CloudFormationStackARN")
305		ok.String(*v.CloudFormationStackARN)
306	}
307
308	if v.TagFilters != nil {
309		ok := object.Key("TagFilters")
310		if err := awsAwsjson11_serializeDocumentTagFilters(v.TagFilters, ok); err != nil {
311			return err
312		}
313	}
314
315	return nil
316}
317
318func awsAwsjson11_serializeDocumentApplicationSources(v []types.ApplicationSource, value smithyjson.Value) error {
319	array := value.Array()
320	defer array.Close()
321
322	for i := range v {
323		av := array.Value()
324		if err := awsAwsjson11_serializeDocumentApplicationSource(&v[i], av); err != nil {
325			return err
326		}
327	}
328	return nil
329}
330
331func awsAwsjson11_serializeDocumentCustomizedLoadMetricSpecification(v *types.CustomizedLoadMetricSpecification, value smithyjson.Value) error {
332	object := value.Object()
333	defer object.Close()
334
335	if v.Dimensions != nil {
336		ok := object.Key("Dimensions")
337		if err := awsAwsjson11_serializeDocumentMetricDimensions(v.Dimensions, ok); err != nil {
338			return err
339		}
340	}
341
342	if v.MetricName != nil {
343		ok := object.Key("MetricName")
344		ok.String(*v.MetricName)
345	}
346
347	if v.Namespace != nil {
348		ok := object.Key("Namespace")
349		ok.String(*v.Namespace)
350	}
351
352	if len(v.Statistic) > 0 {
353		ok := object.Key("Statistic")
354		ok.String(string(v.Statistic))
355	}
356
357	if v.Unit != nil {
358		ok := object.Key("Unit")
359		ok.String(*v.Unit)
360	}
361
362	return nil
363}
364
365func awsAwsjson11_serializeDocumentCustomizedScalingMetricSpecification(v *types.CustomizedScalingMetricSpecification, value smithyjson.Value) error {
366	object := value.Object()
367	defer object.Close()
368
369	if v.Dimensions != nil {
370		ok := object.Key("Dimensions")
371		if err := awsAwsjson11_serializeDocumentMetricDimensions(v.Dimensions, ok); err != nil {
372			return err
373		}
374	}
375
376	if v.MetricName != nil {
377		ok := object.Key("MetricName")
378		ok.String(*v.MetricName)
379	}
380
381	if v.Namespace != nil {
382		ok := object.Key("Namespace")
383		ok.String(*v.Namespace)
384	}
385
386	if len(v.Statistic) > 0 {
387		ok := object.Key("Statistic")
388		ok.String(string(v.Statistic))
389	}
390
391	if v.Unit != nil {
392		ok := object.Key("Unit")
393		ok.String(*v.Unit)
394	}
395
396	return nil
397}
398
399func awsAwsjson11_serializeDocumentMetricDimension(v *types.MetricDimension, value smithyjson.Value) error {
400	object := value.Object()
401	defer object.Close()
402
403	if v.Name != nil {
404		ok := object.Key("Name")
405		ok.String(*v.Name)
406	}
407
408	if v.Value != nil {
409		ok := object.Key("Value")
410		ok.String(*v.Value)
411	}
412
413	return nil
414}
415
416func awsAwsjson11_serializeDocumentMetricDimensions(v []types.MetricDimension, value smithyjson.Value) error {
417	array := value.Array()
418	defer array.Close()
419
420	for i := range v {
421		av := array.Value()
422		if err := awsAwsjson11_serializeDocumentMetricDimension(&v[i], av); err != nil {
423			return err
424		}
425	}
426	return nil
427}
428
429func awsAwsjson11_serializeDocumentPredefinedLoadMetricSpecification(v *types.PredefinedLoadMetricSpecification, value smithyjson.Value) error {
430	object := value.Object()
431	defer object.Close()
432
433	if len(v.PredefinedLoadMetricType) > 0 {
434		ok := object.Key("PredefinedLoadMetricType")
435		ok.String(string(v.PredefinedLoadMetricType))
436	}
437
438	if v.ResourceLabel != nil {
439		ok := object.Key("ResourceLabel")
440		ok.String(*v.ResourceLabel)
441	}
442
443	return nil
444}
445
446func awsAwsjson11_serializeDocumentPredefinedScalingMetricSpecification(v *types.PredefinedScalingMetricSpecification, value smithyjson.Value) error {
447	object := value.Object()
448	defer object.Close()
449
450	if len(v.PredefinedScalingMetricType) > 0 {
451		ok := object.Key("PredefinedScalingMetricType")
452		ok.String(string(v.PredefinedScalingMetricType))
453	}
454
455	if v.ResourceLabel != nil {
456		ok := object.Key("ResourceLabel")
457		ok.String(*v.ResourceLabel)
458	}
459
460	return nil
461}
462
463func awsAwsjson11_serializeDocumentScalingInstruction(v *types.ScalingInstruction, value smithyjson.Value) error {
464	object := value.Object()
465	defer object.Close()
466
467	if v.CustomizedLoadMetricSpecification != nil {
468		ok := object.Key("CustomizedLoadMetricSpecification")
469		if err := awsAwsjson11_serializeDocumentCustomizedLoadMetricSpecification(v.CustomizedLoadMetricSpecification, ok); err != nil {
470			return err
471		}
472	}
473
474	if v.DisableDynamicScaling != nil {
475		ok := object.Key("DisableDynamicScaling")
476		ok.Boolean(*v.DisableDynamicScaling)
477	}
478
479	if v.MaxCapacity != nil {
480		ok := object.Key("MaxCapacity")
481		ok.Integer(*v.MaxCapacity)
482	}
483
484	if v.MinCapacity != nil {
485		ok := object.Key("MinCapacity")
486		ok.Integer(*v.MinCapacity)
487	}
488
489	if v.PredefinedLoadMetricSpecification != nil {
490		ok := object.Key("PredefinedLoadMetricSpecification")
491		if err := awsAwsjson11_serializeDocumentPredefinedLoadMetricSpecification(v.PredefinedLoadMetricSpecification, ok); err != nil {
492			return err
493		}
494	}
495
496	if len(v.PredictiveScalingMaxCapacityBehavior) > 0 {
497		ok := object.Key("PredictiveScalingMaxCapacityBehavior")
498		ok.String(string(v.PredictiveScalingMaxCapacityBehavior))
499	}
500
501	if v.PredictiveScalingMaxCapacityBuffer != nil {
502		ok := object.Key("PredictiveScalingMaxCapacityBuffer")
503		ok.Integer(*v.PredictiveScalingMaxCapacityBuffer)
504	}
505
506	if len(v.PredictiveScalingMode) > 0 {
507		ok := object.Key("PredictiveScalingMode")
508		ok.String(string(v.PredictiveScalingMode))
509	}
510
511	if v.ResourceId != nil {
512		ok := object.Key("ResourceId")
513		ok.String(*v.ResourceId)
514	}
515
516	if len(v.ScalableDimension) > 0 {
517		ok := object.Key("ScalableDimension")
518		ok.String(string(v.ScalableDimension))
519	}
520
521	if len(v.ScalingPolicyUpdateBehavior) > 0 {
522		ok := object.Key("ScalingPolicyUpdateBehavior")
523		ok.String(string(v.ScalingPolicyUpdateBehavior))
524	}
525
526	if v.ScheduledActionBufferTime != nil {
527		ok := object.Key("ScheduledActionBufferTime")
528		ok.Integer(*v.ScheduledActionBufferTime)
529	}
530
531	if len(v.ServiceNamespace) > 0 {
532		ok := object.Key("ServiceNamespace")
533		ok.String(string(v.ServiceNamespace))
534	}
535
536	if v.TargetTrackingConfigurations != nil {
537		ok := object.Key("TargetTrackingConfigurations")
538		if err := awsAwsjson11_serializeDocumentTargetTrackingConfigurations(v.TargetTrackingConfigurations, ok); err != nil {
539			return err
540		}
541	}
542
543	return nil
544}
545
546func awsAwsjson11_serializeDocumentScalingInstructions(v []types.ScalingInstruction, value smithyjson.Value) error {
547	array := value.Array()
548	defer array.Close()
549
550	for i := range v {
551		av := array.Value()
552		if err := awsAwsjson11_serializeDocumentScalingInstruction(&v[i], av); err != nil {
553			return err
554		}
555	}
556	return nil
557}
558
559func awsAwsjson11_serializeDocumentScalingPlanNames(v []string, value smithyjson.Value) error {
560	array := value.Array()
561	defer array.Close()
562
563	for i := range v {
564		av := array.Value()
565		av.String(v[i])
566	}
567	return nil
568}
569
570func awsAwsjson11_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error {
571	object := value.Object()
572	defer object.Close()
573
574	if v.Key != nil {
575		ok := object.Key("Key")
576		ok.String(*v.Key)
577	}
578
579	if v.Values != nil {
580		ok := object.Key("Values")
581		if err := awsAwsjson11_serializeDocumentTagValues(v.Values, ok); err != nil {
582			return err
583		}
584	}
585
586	return nil
587}
588
589func awsAwsjson11_serializeDocumentTagFilters(v []types.TagFilter, value smithyjson.Value) error {
590	array := value.Array()
591	defer array.Close()
592
593	for i := range v {
594		av := array.Value()
595		if err := awsAwsjson11_serializeDocumentTagFilter(&v[i], av); err != nil {
596			return err
597		}
598	}
599	return nil
600}
601
602func awsAwsjson11_serializeDocumentTagValues(v []string, value smithyjson.Value) error {
603	array := value.Array()
604	defer array.Close()
605
606	for i := range v {
607		av := array.Value()
608		av.String(v[i])
609	}
610	return nil
611}
612
613func awsAwsjson11_serializeDocumentTargetTrackingConfiguration(v *types.TargetTrackingConfiguration, value smithyjson.Value) error {
614	object := value.Object()
615	defer object.Close()
616
617	if v.CustomizedScalingMetricSpecification != nil {
618		ok := object.Key("CustomizedScalingMetricSpecification")
619		if err := awsAwsjson11_serializeDocumentCustomizedScalingMetricSpecification(v.CustomizedScalingMetricSpecification, ok); err != nil {
620			return err
621		}
622	}
623
624	if v.DisableScaleIn != nil {
625		ok := object.Key("DisableScaleIn")
626		ok.Boolean(*v.DisableScaleIn)
627	}
628
629	if v.EstimatedInstanceWarmup != nil {
630		ok := object.Key("EstimatedInstanceWarmup")
631		ok.Integer(*v.EstimatedInstanceWarmup)
632	}
633
634	if v.PredefinedScalingMetricSpecification != nil {
635		ok := object.Key("PredefinedScalingMetricSpecification")
636		if err := awsAwsjson11_serializeDocumentPredefinedScalingMetricSpecification(v.PredefinedScalingMetricSpecification, ok); err != nil {
637			return err
638		}
639	}
640
641	if v.ScaleInCooldown != nil {
642		ok := object.Key("ScaleInCooldown")
643		ok.Integer(*v.ScaleInCooldown)
644	}
645
646	if v.ScaleOutCooldown != nil {
647		ok := object.Key("ScaleOutCooldown")
648		ok.Integer(*v.ScaleOutCooldown)
649	}
650
651	if v.TargetValue != nil {
652		ok := object.Key("TargetValue")
653		ok.Double(*v.TargetValue)
654	}
655
656	return nil
657}
658
659func awsAwsjson11_serializeDocumentTargetTrackingConfigurations(v []types.TargetTrackingConfiguration, value smithyjson.Value) error {
660	array := value.Array()
661	defer array.Close()
662
663	for i := range v {
664		av := array.Value()
665		if err := awsAwsjson11_serializeDocumentTargetTrackingConfiguration(&v[i], av); err != nil {
666			return err
667		}
668	}
669	return nil
670}
671
672func awsAwsjson11_serializeOpDocumentCreateScalingPlanInput(v *CreateScalingPlanInput, value smithyjson.Value) error {
673	object := value.Object()
674	defer object.Close()
675
676	if v.ApplicationSource != nil {
677		ok := object.Key("ApplicationSource")
678		if err := awsAwsjson11_serializeDocumentApplicationSource(v.ApplicationSource, ok); err != nil {
679			return err
680		}
681	}
682
683	if v.ScalingInstructions != nil {
684		ok := object.Key("ScalingInstructions")
685		if err := awsAwsjson11_serializeDocumentScalingInstructions(v.ScalingInstructions, ok); err != nil {
686			return err
687		}
688	}
689
690	if v.ScalingPlanName != nil {
691		ok := object.Key("ScalingPlanName")
692		ok.String(*v.ScalingPlanName)
693	}
694
695	return nil
696}
697
698func awsAwsjson11_serializeOpDocumentDeleteScalingPlanInput(v *DeleteScalingPlanInput, value smithyjson.Value) error {
699	object := value.Object()
700	defer object.Close()
701
702	if v.ScalingPlanName != nil {
703		ok := object.Key("ScalingPlanName")
704		ok.String(*v.ScalingPlanName)
705	}
706
707	if v.ScalingPlanVersion != nil {
708		ok := object.Key("ScalingPlanVersion")
709		ok.Long(*v.ScalingPlanVersion)
710	}
711
712	return nil
713}
714
715func awsAwsjson11_serializeOpDocumentDescribeScalingPlanResourcesInput(v *DescribeScalingPlanResourcesInput, value smithyjson.Value) error {
716	object := value.Object()
717	defer object.Close()
718
719	if v.MaxResults != nil {
720		ok := object.Key("MaxResults")
721		ok.Integer(*v.MaxResults)
722	}
723
724	if v.NextToken != nil {
725		ok := object.Key("NextToken")
726		ok.String(*v.NextToken)
727	}
728
729	if v.ScalingPlanName != nil {
730		ok := object.Key("ScalingPlanName")
731		ok.String(*v.ScalingPlanName)
732	}
733
734	if v.ScalingPlanVersion != nil {
735		ok := object.Key("ScalingPlanVersion")
736		ok.Long(*v.ScalingPlanVersion)
737	}
738
739	return nil
740}
741
742func awsAwsjson11_serializeOpDocumentDescribeScalingPlansInput(v *DescribeScalingPlansInput, value smithyjson.Value) error {
743	object := value.Object()
744	defer object.Close()
745
746	if v.ApplicationSources != nil {
747		ok := object.Key("ApplicationSources")
748		if err := awsAwsjson11_serializeDocumentApplicationSources(v.ApplicationSources, ok); err != nil {
749			return err
750		}
751	}
752
753	if v.MaxResults != nil {
754		ok := object.Key("MaxResults")
755		ok.Integer(*v.MaxResults)
756	}
757
758	if v.NextToken != nil {
759		ok := object.Key("NextToken")
760		ok.String(*v.NextToken)
761	}
762
763	if v.ScalingPlanNames != nil {
764		ok := object.Key("ScalingPlanNames")
765		if err := awsAwsjson11_serializeDocumentScalingPlanNames(v.ScalingPlanNames, ok); err != nil {
766			return err
767		}
768	}
769
770	if v.ScalingPlanVersion != nil {
771		ok := object.Key("ScalingPlanVersion")
772		ok.Long(*v.ScalingPlanVersion)
773	}
774
775	return nil
776}
777
778func awsAwsjson11_serializeOpDocumentGetScalingPlanResourceForecastDataInput(v *GetScalingPlanResourceForecastDataInput, value smithyjson.Value) error {
779	object := value.Object()
780	defer object.Close()
781
782	if v.EndTime != nil {
783		ok := object.Key("EndTime")
784		ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
785	}
786
787	if len(v.ForecastDataType) > 0 {
788		ok := object.Key("ForecastDataType")
789		ok.String(string(v.ForecastDataType))
790	}
791
792	if v.ResourceId != nil {
793		ok := object.Key("ResourceId")
794		ok.String(*v.ResourceId)
795	}
796
797	if len(v.ScalableDimension) > 0 {
798		ok := object.Key("ScalableDimension")
799		ok.String(string(v.ScalableDimension))
800	}
801
802	if v.ScalingPlanName != nil {
803		ok := object.Key("ScalingPlanName")
804		ok.String(*v.ScalingPlanName)
805	}
806
807	if v.ScalingPlanVersion != nil {
808		ok := object.Key("ScalingPlanVersion")
809		ok.Long(*v.ScalingPlanVersion)
810	}
811
812	if len(v.ServiceNamespace) > 0 {
813		ok := object.Key("ServiceNamespace")
814		ok.String(string(v.ServiceNamespace))
815	}
816
817	if v.StartTime != nil {
818		ok := object.Key("StartTime")
819		ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
820	}
821
822	return nil
823}
824
825func awsAwsjson11_serializeOpDocumentUpdateScalingPlanInput(v *UpdateScalingPlanInput, value smithyjson.Value) error {
826	object := value.Object()
827	defer object.Close()
828
829	if v.ApplicationSource != nil {
830		ok := object.Key("ApplicationSource")
831		if err := awsAwsjson11_serializeDocumentApplicationSource(v.ApplicationSource, ok); err != nil {
832			return err
833		}
834	}
835
836	if v.ScalingInstructions != nil {
837		ok := object.Key("ScalingInstructions")
838		if err := awsAwsjson11_serializeDocumentScalingInstructions(v.ScalingInstructions, ok); err != nil {
839			return err
840		}
841	}
842
843	if v.ScalingPlanName != nil {
844		ok := object.Key("ScalingPlanName")
845		ok.String(*v.ScalingPlanName)
846	}
847
848	if v.ScalingPlanVersion != nil {
849		ok := object.Key("ScalingPlanVersion")
850		ok.Long(*v.ScalingPlanVersion)
851	}
852
853	return nil
854}
855