1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/sagemaker/model/CreateTransformJobRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::SageMaker::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14
CreateTransformJobRequest()15 CreateTransformJobRequest::CreateTransformJobRequest() :
16 m_transformJobNameHasBeenSet(false),
17 m_modelNameHasBeenSet(false),
18 m_maxConcurrentTransforms(0),
19 m_maxConcurrentTransformsHasBeenSet(false),
20 m_modelClientConfigHasBeenSet(false),
21 m_maxPayloadInMB(0),
22 m_maxPayloadInMBHasBeenSet(false),
23 m_batchStrategy(BatchStrategy::NOT_SET),
24 m_batchStrategyHasBeenSet(false),
25 m_environmentHasBeenSet(false),
26 m_transformInputHasBeenSet(false),
27 m_transformOutputHasBeenSet(false),
28 m_transformResourcesHasBeenSet(false),
29 m_dataProcessingHasBeenSet(false),
30 m_tagsHasBeenSet(false),
31 m_experimentConfigHasBeenSet(false)
32 {
33 }
34
SerializePayload() const35 Aws::String CreateTransformJobRequest::SerializePayload() const
36 {
37 JsonValue payload;
38
39 if(m_transformJobNameHasBeenSet)
40 {
41 payload.WithString("TransformJobName", m_transformJobName);
42
43 }
44
45 if(m_modelNameHasBeenSet)
46 {
47 payload.WithString("ModelName", m_modelName);
48
49 }
50
51 if(m_maxConcurrentTransformsHasBeenSet)
52 {
53 payload.WithInteger("MaxConcurrentTransforms", m_maxConcurrentTransforms);
54
55 }
56
57 if(m_modelClientConfigHasBeenSet)
58 {
59 payload.WithObject("ModelClientConfig", m_modelClientConfig.Jsonize());
60
61 }
62
63 if(m_maxPayloadInMBHasBeenSet)
64 {
65 payload.WithInteger("MaxPayloadInMB", m_maxPayloadInMB);
66
67 }
68
69 if(m_batchStrategyHasBeenSet)
70 {
71 payload.WithString("BatchStrategy", BatchStrategyMapper::GetNameForBatchStrategy(m_batchStrategy));
72 }
73
74 if(m_environmentHasBeenSet)
75 {
76 JsonValue environmentJsonMap;
77 for(auto& environmentItem : m_environment)
78 {
79 environmentJsonMap.WithString(environmentItem.first, environmentItem.second);
80 }
81 payload.WithObject("Environment", std::move(environmentJsonMap));
82
83 }
84
85 if(m_transformInputHasBeenSet)
86 {
87 payload.WithObject("TransformInput", m_transformInput.Jsonize());
88
89 }
90
91 if(m_transformOutputHasBeenSet)
92 {
93 payload.WithObject("TransformOutput", m_transformOutput.Jsonize());
94
95 }
96
97 if(m_transformResourcesHasBeenSet)
98 {
99 payload.WithObject("TransformResources", m_transformResources.Jsonize());
100
101 }
102
103 if(m_dataProcessingHasBeenSet)
104 {
105 payload.WithObject("DataProcessing", m_dataProcessing.Jsonize());
106
107 }
108
109 if(m_tagsHasBeenSet)
110 {
111 Array<JsonValue> tagsJsonList(m_tags.size());
112 for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
113 {
114 tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
115 }
116 payload.WithArray("Tags", std::move(tagsJsonList));
117
118 }
119
120 if(m_experimentConfigHasBeenSet)
121 {
122 payload.WithObject("ExperimentConfig", m_experimentConfig.Jsonize());
123
124 }
125
126 return payload.View().WriteReadable();
127 }
128
GetRequestSpecificHeaders() const129 Aws::Http::HeaderValueCollection CreateTransformJobRequest::GetRequestSpecificHeaders() const
130 {
131 Aws::Http::HeaderValueCollection headers;
132 headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "SageMaker.CreateTransformJob"));
133 return headers;
134
135 }
136
137
138
139
140