@aws-sdk/client-sagemaker-metrics 3.229.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +213 -0
- package/dist-cjs/SageMakerMetrics.js +22 -0
- package/dist-cjs/SageMakerMetricsClient.js +40 -0
- package/dist-cjs/commands/BatchPutMetricsCommand.js +46 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/endpoint/EndpointParameters.js +12 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +303 -0
- package/dist-cjs/index.js +10 -0
- package/dist-cjs/models/SageMakerMetricsServiceException.js +11 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +26 -0
- package/dist-cjs/protocols/Aws_restJson1.js +147 -0
- package/dist-cjs/runtimeConfig.browser.js +42 -0
- package/dist-cjs/runtimeConfig.js +51 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +18 -0
- package/dist-es/SageMakerMetrics.js +18 -0
- package/dist-es/SageMakerMetricsClient.js +36 -0
- package/dist-es/commands/BatchPutMetricsCommand.js +42 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoint/EndpointParameters.js +8 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +300 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/SageMakerMetricsServiceException.js +7 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +19 -0
- package/dist-es/protocols/Aws_restJson1.js +142 -0
- package/dist-es/runtimeConfig.browser.js +37 -0
- package/dist-es/runtimeConfig.js +46 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +14 -0
- package/dist-types/SageMakerMetrics.d.ts +24 -0
- package/dist-types/SageMakerMetricsClient.d.ts +150 -0
- package/dist-types/commands/BatchPutMetricsCommand.d.ts +39 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/index.d.ts +5 -0
- package/dist-types/models/SageMakerMetricsServiceException.d.ts +10 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +91 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +5 -0
- package/dist-types/runtimeConfig.browser.d.ts +42 -0
- package/dist-types/runtimeConfig.d.ts +42 -0
- package/dist-types/runtimeConfig.native.d.ts +41 -0
- package/dist-types/runtimeConfig.shared.d.ts +16 -0
- package/dist-types/ts3.4/SageMakerMetrics.d.ts +21 -0
- package/dist-types/ts3.4/SageMakerMetricsClient.d.ts +116 -0
- package/dist-types/ts3.4/commands/BatchPutMetricsCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +34 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +5 -0
- package/dist-types/ts3.4/models/SageMakerMetricsServiceException.d.ts +7 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +35 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +17 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +82 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +18 -0
- package/package.json +102 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleSet = void 0;
|
|
4
|
+
exports.ruleSet = {
|
|
5
|
+
version: "1.0",
|
|
6
|
+
parameters: {
|
|
7
|
+
Region: {
|
|
8
|
+
builtIn: "AWS::Region",
|
|
9
|
+
required: true,
|
|
10
|
+
documentation: "The AWS region used to dispatch the request.",
|
|
11
|
+
type: "String",
|
|
12
|
+
},
|
|
13
|
+
UseDualStack: {
|
|
14
|
+
builtIn: "AWS::UseDualStack",
|
|
15
|
+
required: true,
|
|
16
|
+
default: false,
|
|
17
|
+
documentation: "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
|
|
18
|
+
type: "Boolean",
|
|
19
|
+
},
|
|
20
|
+
UseFIPS: {
|
|
21
|
+
builtIn: "AWS::UseFIPS",
|
|
22
|
+
required: true,
|
|
23
|
+
default: false,
|
|
24
|
+
documentation: "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
|
|
25
|
+
type: "Boolean",
|
|
26
|
+
},
|
|
27
|
+
Endpoint: {
|
|
28
|
+
builtIn: "SDK::Endpoint",
|
|
29
|
+
required: false,
|
|
30
|
+
documentation: "Override the endpoint used to send this request",
|
|
31
|
+
type: "String",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
rules: [
|
|
35
|
+
{
|
|
36
|
+
conditions: [
|
|
37
|
+
{
|
|
38
|
+
fn: "aws.partition",
|
|
39
|
+
argv: [
|
|
40
|
+
{
|
|
41
|
+
ref: "Region",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
assign: "PartitionResult",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
type: "tree",
|
|
48
|
+
rules: [
|
|
49
|
+
{
|
|
50
|
+
conditions: [
|
|
51
|
+
{
|
|
52
|
+
fn: "isSet",
|
|
53
|
+
argv: [
|
|
54
|
+
{
|
|
55
|
+
ref: "Endpoint",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
type: "tree",
|
|
61
|
+
rules: [
|
|
62
|
+
{
|
|
63
|
+
conditions: [
|
|
64
|
+
{
|
|
65
|
+
fn: "booleanEquals",
|
|
66
|
+
argv: [
|
|
67
|
+
{
|
|
68
|
+
ref: "UseFIPS",
|
|
69
|
+
},
|
|
70
|
+
true,
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
|
|
75
|
+
type: "error",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
conditions: [],
|
|
79
|
+
type: "tree",
|
|
80
|
+
rules: [
|
|
81
|
+
{
|
|
82
|
+
conditions: [
|
|
83
|
+
{
|
|
84
|
+
fn: "booleanEquals",
|
|
85
|
+
argv: [
|
|
86
|
+
{
|
|
87
|
+
ref: "UseDualStack",
|
|
88
|
+
},
|
|
89
|
+
true,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
|
|
94
|
+
type: "error",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
conditions: [],
|
|
98
|
+
endpoint: {
|
|
99
|
+
url: {
|
|
100
|
+
ref: "Endpoint",
|
|
101
|
+
},
|
|
102
|
+
properties: {},
|
|
103
|
+
headers: {},
|
|
104
|
+
},
|
|
105
|
+
type: "endpoint",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
conditions: [
|
|
113
|
+
{
|
|
114
|
+
fn: "booleanEquals",
|
|
115
|
+
argv: [
|
|
116
|
+
{
|
|
117
|
+
ref: "UseFIPS",
|
|
118
|
+
},
|
|
119
|
+
true,
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
fn: "booleanEquals",
|
|
124
|
+
argv: [
|
|
125
|
+
{
|
|
126
|
+
ref: "UseDualStack",
|
|
127
|
+
},
|
|
128
|
+
true,
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
type: "tree",
|
|
133
|
+
rules: [
|
|
134
|
+
{
|
|
135
|
+
conditions: [
|
|
136
|
+
{
|
|
137
|
+
fn: "booleanEquals",
|
|
138
|
+
argv: [
|
|
139
|
+
true,
|
|
140
|
+
{
|
|
141
|
+
fn: "getAttr",
|
|
142
|
+
argv: [
|
|
143
|
+
{
|
|
144
|
+
ref: "PartitionResult",
|
|
145
|
+
},
|
|
146
|
+
"supportsFIPS",
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
fn: "booleanEquals",
|
|
153
|
+
argv: [
|
|
154
|
+
true,
|
|
155
|
+
{
|
|
156
|
+
fn: "getAttr",
|
|
157
|
+
argv: [
|
|
158
|
+
{
|
|
159
|
+
ref: "PartitionResult",
|
|
160
|
+
},
|
|
161
|
+
"supportsDualStack",
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
type: "tree",
|
|
168
|
+
rules: [
|
|
169
|
+
{
|
|
170
|
+
conditions: [],
|
|
171
|
+
endpoint: {
|
|
172
|
+
url: "https://metrics.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
173
|
+
properties: {},
|
|
174
|
+
headers: {},
|
|
175
|
+
},
|
|
176
|
+
type: "endpoint",
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
conditions: [],
|
|
182
|
+
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
|
|
183
|
+
type: "error",
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
conditions: [
|
|
189
|
+
{
|
|
190
|
+
fn: "booleanEquals",
|
|
191
|
+
argv: [
|
|
192
|
+
{
|
|
193
|
+
ref: "UseFIPS",
|
|
194
|
+
},
|
|
195
|
+
true,
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
type: "tree",
|
|
200
|
+
rules: [
|
|
201
|
+
{
|
|
202
|
+
conditions: [
|
|
203
|
+
{
|
|
204
|
+
fn: "booleanEquals",
|
|
205
|
+
argv: [
|
|
206
|
+
true,
|
|
207
|
+
{
|
|
208
|
+
fn: "getAttr",
|
|
209
|
+
argv: [
|
|
210
|
+
{
|
|
211
|
+
ref: "PartitionResult",
|
|
212
|
+
},
|
|
213
|
+
"supportsFIPS",
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
type: "tree",
|
|
220
|
+
rules: [
|
|
221
|
+
{
|
|
222
|
+
conditions: [],
|
|
223
|
+
endpoint: {
|
|
224
|
+
url: "https://metrics.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}",
|
|
225
|
+
properties: {},
|
|
226
|
+
headers: {},
|
|
227
|
+
},
|
|
228
|
+
type: "endpoint",
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
conditions: [],
|
|
234
|
+
error: "FIPS is enabled but this partition does not support FIPS",
|
|
235
|
+
type: "error",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
conditions: [
|
|
241
|
+
{
|
|
242
|
+
fn: "booleanEquals",
|
|
243
|
+
argv: [
|
|
244
|
+
{
|
|
245
|
+
ref: "UseDualStack",
|
|
246
|
+
},
|
|
247
|
+
true,
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
type: "tree",
|
|
252
|
+
rules: [
|
|
253
|
+
{
|
|
254
|
+
conditions: [
|
|
255
|
+
{
|
|
256
|
+
fn: "booleanEquals",
|
|
257
|
+
argv: [
|
|
258
|
+
true,
|
|
259
|
+
{
|
|
260
|
+
fn: "getAttr",
|
|
261
|
+
argv: [
|
|
262
|
+
{
|
|
263
|
+
ref: "PartitionResult",
|
|
264
|
+
},
|
|
265
|
+
"supportsDualStack",
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
type: "tree",
|
|
272
|
+
rules: [
|
|
273
|
+
{
|
|
274
|
+
conditions: [],
|
|
275
|
+
endpoint: {
|
|
276
|
+
url: "https://metrics.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
277
|
+
properties: {},
|
|
278
|
+
headers: {},
|
|
279
|
+
},
|
|
280
|
+
type: "endpoint",
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
conditions: [],
|
|
286
|
+
error: "DualStack is enabled but this partition does not support DualStack",
|
|
287
|
+
type: "error",
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
conditions: [],
|
|
293
|
+
endpoint: {
|
|
294
|
+
url: "https://metrics.sagemaker.{Region}.{PartitionResult#dnsSuffix}",
|
|
295
|
+
properties: {},
|
|
296
|
+
headers: {},
|
|
297
|
+
},
|
|
298
|
+
type: "endpoint",
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SageMakerMetricsServiceException = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./SageMakerMetrics"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./SageMakerMetricsClient"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./commands"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./models"), exports);
|
|
9
|
+
var SageMakerMetricsServiceException_1 = require("./models/SageMakerMetricsServiceException");
|
|
10
|
+
Object.defineProperty(exports, "SageMakerMetricsServiceException", { enumerable: true, get: function () { return SageMakerMetricsServiceException_1.SageMakerMetricsServiceException; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SageMakerMetricsServiceException = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
5
|
+
class SageMakerMetricsServiceException extends smithy_client_1.ServiceException {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
Object.setPrototypeOf(this, SageMakerMetricsServiceException.prototype);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SageMakerMetricsServiceException = SageMakerMetricsServiceException;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BatchPutMetricsResponseFilterSensitiveLog = exports.BatchPutMetricsErrorFilterSensitiveLog = exports.BatchPutMetricsRequestFilterSensitiveLog = exports.RawMetricDataFilterSensitiveLog = exports.PutMetricsErrorCode = void 0;
|
|
4
|
+
var PutMetricsErrorCode;
|
|
5
|
+
(function (PutMetricsErrorCode) {
|
|
6
|
+
PutMetricsErrorCode["CONFLICT_ERROR"] = "CONFLICT_ERROR";
|
|
7
|
+
PutMetricsErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
8
|
+
PutMetricsErrorCode["METRIC_LIMIT_EXCEEDED"] = "METRIC_LIMIT_EXCEEDED";
|
|
9
|
+
PutMetricsErrorCode["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
10
|
+
})(PutMetricsErrorCode = exports.PutMetricsErrorCode || (exports.PutMetricsErrorCode = {}));
|
|
11
|
+
const RawMetricDataFilterSensitiveLog = (obj) => ({
|
|
12
|
+
...obj,
|
|
13
|
+
});
|
|
14
|
+
exports.RawMetricDataFilterSensitiveLog = RawMetricDataFilterSensitiveLog;
|
|
15
|
+
const BatchPutMetricsRequestFilterSensitiveLog = (obj) => ({
|
|
16
|
+
...obj,
|
|
17
|
+
});
|
|
18
|
+
exports.BatchPutMetricsRequestFilterSensitiveLog = BatchPutMetricsRequestFilterSensitiveLog;
|
|
19
|
+
const BatchPutMetricsErrorFilterSensitiveLog = (obj) => ({
|
|
20
|
+
...obj,
|
|
21
|
+
});
|
|
22
|
+
exports.BatchPutMetricsErrorFilterSensitiveLog = BatchPutMetricsErrorFilterSensitiveLog;
|
|
23
|
+
const BatchPutMetricsResponseFilterSensitiveLog = (obj) => ({
|
|
24
|
+
...obj,
|
|
25
|
+
});
|
|
26
|
+
exports.BatchPutMetricsResponseFilterSensitiveLog = BatchPutMetricsResponseFilterSensitiveLog;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAws_restJson1BatchPutMetricsCommand = exports.serializeAws_restJson1BatchPutMetricsCommand = void 0;
|
|
4
|
+
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
|
+
const SageMakerMetricsServiceException_1 = require("../models/SageMakerMetricsServiceException");
|
|
7
|
+
const serializeAws_restJson1BatchPutMetricsCommand = async (input, context) => {
|
|
8
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
9
|
+
const headers = {
|
|
10
|
+
"content-type": "application/json",
|
|
11
|
+
};
|
|
12
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchPutMetrics";
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify({
|
|
15
|
+
...(input.MetricData != null && { MetricData: serializeAws_restJson1RawMetricDataList(input.MetricData, context) }),
|
|
16
|
+
...(input.TrialComponentName != null && { TrialComponentName: input.TrialComponentName }),
|
|
17
|
+
});
|
|
18
|
+
return new protocol_http_1.HttpRequest({
|
|
19
|
+
protocol,
|
|
20
|
+
hostname,
|
|
21
|
+
port,
|
|
22
|
+
method: "PUT",
|
|
23
|
+
headers,
|
|
24
|
+
path: resolvedPath,
|
|
25
|
+
body,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
exports.serializeAws_restJson1BatchPutMetricsCommand = serializeAws_restJson1BatchPutMetricsCommand;
|
|
29
|
+
const deserializeAws_restJson1BatchPutMetricsCommand = async (output, context) => {
|
|
30
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31
|
+
return deserializeAws_restJson1BatchPutMetricsCommandError(output, context);
|
|
32
|
+
}
|
|
33
|
+
const contents = map({
|
|
34
|
+
$metadata: deserializeMetadata(output),
|
|
35
|
+
});
|
|
36
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
37
|
+
if (data.Errors != null) {
|
|
38
|
+
contents.Errors = deserializeAws_restJson1BatchPutMetricsErrorList(data.Errors, context);
|
|
39
|
+
}
|
|
40
|
+
return contents;
|
|
41
|
+
};
|
|
42
|
+
exports.deserializeAws_restJson1BatchPutMetricsCommand = deserializeAws_restJson1BatchPutMetricsCommand;
|
|
43
|
+
const deserializeAws_restJson1BatchPutMetricsCommandError = async (output, context) => {
|
|
44
|
+
const parsedOutput = {
|
|
45
|
+
...output,
|
|
46
|
+
body: await parseErrorBody(output.body, context),
|
|
47
|
+
};
|
|
48
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
49
|
+
const parsedBody = parsedOutput.body;
|
|
50
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
51
|
+
output,
|
|
52
|
+
parsedBody,
|
|
53
|
+
exceptionCtor: SageMakerMetricsServiceException_1.SageMakerMetricsServiceException,
|
|
54
|
+
errorCode,
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const map = smithy_client_1.map;
|
|
58
|
+
const serializeAws_restJson1RawMetricData = (input, context) => {
|
|
59
|
+
return {
|
|
60
|
+
...(input.MetricName != null && { MetricName: input.MetricName }),
|
|
61
|
+
...(input.Step != null && { Step: input.Step }),
|
|
62
|
+
...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
|
|
63
|
+
...(input.Value != null && { Value: (0, smithy_client_1.serializeFloat)(input.Value) }),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const serializeAws_restJson1RawMetricDataList = (input, context) => {
|
|
67
|
+
return input
|
|
68
|
+
.filter((e) => e != null)
|
|
69
|
+
.map((entry) => {
|
|
70
|
+
return serializeAws_restJson1RawMetricData(entry, context);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const deserializeAws_restJson1BatchPutMetricsError = (output, context) => {
|
|
74
|
+
return {
|
|
75
|
+
Code: (0, smithy_client_1.expectString)(output.Code),
|
|
76
|
+
MetricIndex: (0, smithy_client_1.expectInt32)(output.MetricIndex),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const deserializeAws_restJson1BatchPutMetricsErrorList = (output, context) => {
|
|
80
|
+
const retVal = (output || [])
|
|
81
|
+
.filter((e) => e != null)
|
|
82
|
+
.map((entry) => {
|
|
83
|
+
if (entry === null) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return deserializeAws_restJson1BatchPutMetricsError(entry, context);
|
|
87
|
+
});
|
|
88
|
+
return retVal;
|
|
89
|
+
};
|
|
90
|
+
const deserializeMetadata = (output) => ({
|
|
91
|
+
httpStatusCode: output.statusCode,
|
|
92
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
93
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
94
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
95
|
+
});
|
|
96
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
97
|
+
if (streamBody instanceof Uint8Array) {
|
|
98
|
+
return Promise.resolve(streamBody);
|
|
99
|
+
}
|
|
100
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
101
|
+
};
|
|
102
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
103
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
104
|
+
value !== null &&
|
|
105
|
+
value !== "" &&
|
|
106
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
107
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
108
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
109
|
+
if (encoded.length) {
|
|
110
|
+
return JSON.parse(encoded);
|
|
111
|
+
}
|
|
112
|
+
return {};
|
|
113
|
+
});
|
|
114
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
115
|
+
const value = await parseBody(errorBody, context);
|
|
116
|
+
value.message = value.message ?? value.Message;
|
|
117
|
+
return value;
|
|
118
|
+
};
|
|
119
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
120
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
121
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
122
|
+
let cleanValue = rawValue;
|
|
123
|
+
if (typeof cleanValue === "number") {
|
|
124
|
+
cleanValue = cleanValue.toString();
|
|
125
|
+
}
|
|
126
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
127
|
+
cleanValue = cleanValue.split(",")[0];
|
|
128
|
+
}
|
|
129
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
130
|
+
cleanValue = cleanValue.split(":")[0];
|
|
131
|
+
}
|
|
132
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
133
|
+
cleanValue = cleanValue.split("#")[1];
|
|
134
|
+
}
|
|
135
|
+
return cleanValue;
|
|
136
|
+
};
|
|
137
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
138
|
+
if (headerKey !== undefined) {
|
|
139
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
140
|
+
}
|
|
141
|
+
if (data.code !== undefined) {
|
|
142
|
+
return sanitizeErrorCode(data.code);
|
|
143
|
+
}
|
|
144
|
+
if (data["__type"] !== undefined) {
|
|
145
|
+
return sanitizeErrorCode(data["__type"]);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const config_resolver_1 = require("@aws-sdk/config-resolver");
|
|
8
|
+
const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler");
|
|
9
|
+
const invalid_dependency_1 = require("@aws-sdk/invalid-dependency");
|
|
10
|
+
const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser");
|
|
11
|
+
const util_retry_1 = require("@aws-sdk/util-retry");
|
|
12
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
13
|
+
const util_utf8_browser_1 = require("@aws-sdk/util-utf8-browser");
|
|
14
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
15
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
16
|
+
const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser");
|
|
17
|
+
const getRuntimeConfig = (config) => {
|
|
18
|
+
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
|
19
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
20
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
21
|
+
return {
|
|
22
|
+
...clientSharedValues,
|
|
23
|
+
...config,
|
|
24
|
+
runtime: "browser",
|
|
25
|
+
defaultsMode,
|
|
26
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
27
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
29
|
+
(0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
30
|
+
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
31
|
+
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
|
32
|
+
requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
|
|
33
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
34
|
+
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
35
|
+
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
36
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
37
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
|
38
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_browser_1.fromUtf8,
|
|
39
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_browser_1.toUtf8,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
7
|
+
const config_resolver_1 = require("@aws-sdk/config-resolver");
|
|
8
|
+
const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
9
|
+
const hash_node_1 = require("@aws-sdk/hash-node");
|
|
10
|
+
const middleware_retry_1 = require("@aws-sdk/middleware-retry");
|
|
11
|
+
const node_config_provider_1 = require("@aws-sdk/node-config-provider");
|
|
12
|
+
const node_http_handler_1 = require("@aws-sdk/node-http-handler");
|
|
13
|
+
const util_body_length_node_1 = require("@aws-sdk/util-body-length-node");
|
|
14
|
+
const util_retry_1 = require("@aws-sdk/util-retry");
|
|
15
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
16
|
+
const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
|
|
17
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
18
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
19
|
+
const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node");
|
|
20
|
+
const smithy_client_2 = require("@aws-sdk/smithy-client");
|
|
21
|
+
const getRuntimeConfig = (config) => {
|
|
22
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
23
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
24
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
25
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
26
|
+
return {
|
|
27
|
+
...clientSharedValues,
|
|
28
|
+
...config,
|
|
29
|
+
runtime: "node",
|
|
30
|
+
defaultsMode,
|
|
31
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
32
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
|
|
33
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
34
|
+
(0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
35
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
36
|
+
region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
37
|
+
requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
|
|
38
|
+
retryMode: config?.retryMode ??
|
|
39
|
+
(0, node_config_provider_1.loadConfig)({
|
|
40
|
+
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
41
|
+
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
|
|
42
|
+
}),
|
|
43
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
44
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
45
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
46
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
47
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_node_1.fromUtf8,
|
|
48
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_node_1.toUtf8,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
|
+
const getRuntimeConfig = (config) => {
|
|
7
|
+
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
8
|
+
return {
|
|
9
|
+
...browserDefaults,
|
|
10
|
+
...config,
|
|
11
|
+
runtime: "react-native",
|
|
12
|
+
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
5
|
+
const url_parser_1 = require("@aws-sdk/url-parser");
|
|
6
|
+
const util_base64_1 = require("@aws-sdk/util-base64");
|
|
7
|
+
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
8
|
+
const getRuntimeConfig = (config) => ({
|
|
9
|
+
apiVersion: "2022-09-30",
|
|
10
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
11
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
12
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
13
|
+
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
14
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
15
|
+
serviceId: config?.serviceId ?? "SageMaker Metrics",
|
|
16
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
17
|
+
});
|
|
18
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BatchPutMetricsCommand, } from "./commands/BatchPutMetricsCommand";
|
|
2
|
+
import { SageMakerMetricsClient } from "./SageMakerMetricsClient";
|
|
3
|
+
export class SageMakerMetrics extends SageMakerMetricsClient {
|
|
4
|
+
batchPutMetrics(args, optionsOrCb, cb) {
|
|
5
|
+
const command = new BatchPutMetricsCommand(args);
|
|
6
|
+
if (typeof optionsOrCb === "function") {
|
|
7
|
+
this.send(command, optionsOrCb);
|
|
8
|
+
}
|
|
9
|
+
else if (typeof cb === "function") {
|
|
10
|
+
if (typeof optionsOrCb !== "object")
|
|
11
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
12
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return this.send(command, optionsOrCb);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|