@aws-sdk/client-sagemaker-metrics 3.899.0 → 3.906.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +301 -383
  2. package/package.json +37 -37
package/dist-cjs/index.js CHANGED
@@ -1,407 +1,325 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- BatchGetMetricsCommand: () => BatchGetMetricsCommand,
25
- BatchPutMetricsCommand: () => BatchPutMetricsCommand,
26
- MetricQueryResultStatus: () => MetricQueryResultStatus,
27
- MetricStatistic: () => MetricStatistic,
28
- Period: () => Period,
29
- PutMetricsErrorCode: () => PutMetricsErrorCode,
30
- SageMakerMetrics: () => SageMakerMetrics,
31
- SageMakerMetricsClient: () => SageMakerMetricsClient,
32
- SageMakerMetricsServiceException: () => SageMakerMetricsServiceException,
33
- XAxisType: () => XAxisType,
34
- __Client: () => import_smithy_client.Client
35
- });
36
- module.exports = __toCommonJS(index_exports);
37
-
38
- // src/SageMakerMetricsClient.ts
39
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
40
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
41
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
42
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
43
- var import_config_resolver = require("@smithy/config-resolver");
44
- var import_core = require("@smithy/core");
45
- var import_middleware_content_length = require("@smithy/middleware-content-length");
46
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
47
- var import_middleware_retry = require("@smithy/middleware-retry");
1
+ 'use strict';
48
2
 
49
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
50
19
 
51
- // src/endpoint/EndpointParameters.ts
52
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
53
- return Object.assign(options, {
54
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
55
- useFipsEndpoint: options.useFipsEndpoint ?? false,
56
- defaultSigningName: "sagemaker"
57
- });
58
- }, "resolveClientEndpointParameters");
59
- var commonParams = {
60
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61
- Endpoint: { type: "builtInParams", name: "endpoint" },
62
- Region: { type: "builtInParams", name: "region" },
63
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "sagemaker",
25
+ });
26
+ };
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
64
32
  };
65
33
 
66
- // src/SageMakerMetricsClient.ts
67
- var import_runtimeConfig = require("././runtimeConfig");
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
71
+ };
68
72
 
69
- // src/runtimeExtensions.ts
70
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
71
- var import_protocol_http = require("@smithy/protocol-http");
72
- var import_smithy_client = require("@smithy/smithy-client");
73
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
74
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
75
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
76
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
77
+ };
73
78
 
74
- // src/auth/httpAuthExtensionConfiguration.ts
75
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
76
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
77
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
78
- let _credentials = runtimeConfig.credentials;
79
- return {
80
- setHttpAuthScheme(httpAuthScheme) {
81
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
82
- if (index === -1) {
83
- _httpAuthSchemes.push(httpAuthScheme);
84
- } else {
85
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
86
- }
87
- },
88
- httpAuthSchemes() {
89
- return _httpAuthSchemes;
90
- },
91
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
92
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
93
- },
94
- httpAuthSchemeProvider() {
95
- return _httpAuthSchemeProvider;
96
- },
97
- setCredentials(credentials) {
98
- _credentials = credentials;
99
- },
100
- credentials() {
101
- return _credentials;
79
+ class SageMakerMetricsClient extends smithyClient.Client {
80
+ config;
81
+ constructor(...[configuration]) {
82
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
83
+ super(_config_0);
84
+ this.initConfig = _config_0;
85
+ const _config_1 = resolveClientEndpointParameters(_config_0);
86
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
87
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
88
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
89
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
90
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
91
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
+ this.config = _config_8;
94
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
97
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
98
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
99
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
100
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
101
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSageMakerMetricsHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
107
+ }
108
+ destroy() {
109
+ super.destroy();
102
110
  }
103
- };
104
- }, "getHttpAuthExtensionConfiguration");
105
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
106
- return {
107
- httpAuthSchemes: config.httpAuthSchemes(),
108
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
109
- credentials: config.credentials()
110
- };
111
- }, "resolveHttpAuthRuntimeConfig");
111
+ }
112
112
 
113
- // src/runtimeExtensions.ts
114
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
115
- const extensionConfiguration = Object.assign(
116
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
117
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
118
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
119
- getHttpAuthExtensionConfiguration(runtimeConfig)
120
- );
121
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
122
- return Object.assign(
123
- runtimeConfig,
124
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
125
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
126
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
127
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
128
- );
129
- }, "resolveRuntimeExtensions");
113
+ class SageMakerMetricsServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, SageMakerMetricsServiceException.prototype);
117
+ }
118
+ }
130
119
 
131
- // src/SageMakerMetricsClient.ts
132
- var SageMakerMetricsClient = class extends import_smithy_client.Client {
133
- static {
134
- __name(this, "SageMakerMetricsClient");
135
- }
136
- /**
137
- * The resolved configuration of SageMakerMetricsClient class. This is resolved and normalized from the {@link SageMakerMetricsClientConfig | constructor configuration interface}.
138
- */
139
- config;
140
- constructor(...[configuration]) {
141
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
142
- super(_config_0);
143
- this.initConfig = _config_0;
144
- const _config_1 = resolveClientEndpointParameters(_config_0);
145
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
146
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
147
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
148
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
149
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
150
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
151
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
152
- this.config = _config_8;
153
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
154
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
155
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
156
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
157
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
158
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
159
- this.middlewareStack.use(
160
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
161
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSageMakerMetricsHttpAuthSchemeParametersProvider,
162
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
163
- "aws.auth#sigv4": config.credentials
164
- }), "identityProviderConfigProvider")
165
- })
166
- );
167
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
168
- }
169
- /**
170
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
171
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
172
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
173
- */
174
- destroy() {
175
- super.destroy();
176
- }
120
+ const se_BatchGetMetricsCommand = async (input, context) => {
121
+ const b = core.requestBuilder(input, context);
122
+ const headers = {
123
+ "content-type": "application/json",
124
+ };
125
+ b.bp("/BatchGetMetrics");
126
+ let body;
127
+ body = JSON.stringify(smithyClient.take(input, {
128
+ MetricQueries: (_) => smithyClient._json(_),
129
+ }));
130
+ b.m("POST").h(headers).b(body);
131
+ return b.build();
177
132
  };
178
-
179
- // src/SageMakerMetrics.ts
180
-
181
-
182
- // src/commands/BatchGetMetricsCommand.ts
183
-
184
- var import_middleware_serde = require("@smithy/middleware-serde");
185
-
186
-
187
- // src/protocols/Aws_restJson1.ts
188
- var import_core2 = require("@aws-sdk/core");
189
-
190
-
191
-
192
- // src/models/SageMakerMetricsServiceException.ts
193
-
194
- var SageMakerMetricsServiceException = class _SageMakerMetricsServiceException extends import_smithy_client.ServiceException {
195
- static {
196
- __name(this, "SageMakerMetricsServiceException");
197
- }
198
- /**
199
- * @internal
200
- */
201
- constructor(options) {
202
- super(options);
203
- Object.setPrototypeOf(this, _SageMakerMetricsServiceException.prototype);
204
- }
133
+ const se_BatchPutMetricsCommand = async (input, context) => {
134
+ const b = core.requestBuilder(input, context);
135
+ const headers = {
136
+ "content-type": "application/json",
137
+ };
138
+ b.bp("/BatchPutMetrics");
139
+ let body;
140
+ body = JSON.stringify(smithyClient.take(input, {
141
+ MetricData: (_) => se_RawMetricDataList(_),
142
+ TrialComponentName: [],
143
+ }));
144
+ b.m("PUT").h(headers).b(body);
145
+ return b.build();
205
146
  };
206
-
207
- // src/protocols/Aws_restJson1.ts
208
- var se_BatchGetMetricsCommand = /* @__PURE__ */ __name(async (input, context) => {
209
- const b = (0, import_core.requestBuilder)(input, context);
210
- const headers = {
211
- "content-type": "application/json"
212
- };
213
- b.bp("/BatchGetMetrics");
214
- let body;
215
- body = JSON.stringify(
216
- (0, import_smithy_client.take)(input, {
217
- MetricQueries: /* @__PURE__ */ __name((_) => (0, import_smithy_client._json)(_), "MetricQueries")
218
- })
219
- );
220
- b.m("POST").h(headers).b(body);
221
- return b.build();
222
- }, "se_BatchGetMetricsCommand");
223
- var se_BatchPutMetricsCommand = /* @__PURE__ */ __name(async (input, context) => {
224
- const b = (0, import_core.requestBuilder)(input, context);
225
- const headers = {
226
- "content-type": "application/json"
227
- };
228
- b.bp("/BatchPutMetrics");
229
- let body;
230
- body = JSON.stringify(
231
- (0, import_smithy_client.take)(input, {
232
- MetricData: /* @__PURE__ */ __name((_) => se_RawMetricDataList(_, context), "MetricData"),
233
- TrialComponentName: []
234
- })
235
- );
236
- b.m("PUT").h(headers).b(body);
237
- return b.build();
238
- }, "se_BatchPutMetricsCommand");
239
- var de_BatchGetMetricsCommand = /* @__PURE__ */ __name(async (output, context) => {
240
- if (output.statusCode !== 200 && output.statusCode >= 300) {
241
- return de_CommandError(output, context);
242
- }
243
- const contents = (0, import_smithy_client.map)({
244
- $metadata: deserializeMetadata(output)
245
- });
246
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
247
- const doc = (0, import_smithy_client.take)(data, {
248
- MetricQueryResults: /* @__PURE__ */ __name((_) => de_MetricQueryResultList(_, context), "MetricQueryResults")
249
- });
250
- Object.assign(contents, doc);
251
- return contents;
252
- }, "de_BatchGetMetricsCommand");
253
- var de_BatchPutMetricsCommand = /* @__PURE__ */ __name(async (output, context) => {
254
- if (output.statusCode !== 200 && output.statusCode >= 300) {
255
- return de_CommandError(output, context);
256
- }
257
- const contents = (0, import_smithy_client.map)({
258
- $metadata: deserializeMetadata(output)
259
- });
260
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
261
- const doc = (0, import_smithy_client.take)(data, {
262
- Errors: import_smithy_client._json
263
- });
264
- Object.assign(contents, doc);
265
- return contents;
266
- }, "de_BatchPutMetricsCommand");
267
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
268
- const parsedOutput = {
269
- ...output,
270
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
271
- };
272
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
273
- const parsedBody = parsedOutput.body;
274
- return throwDefaultError({
275
- output,
276
- parsedBody,
277
- errorCode
278
- });
279
- }, "de_CommandError");
280
- var throwDefaultError = (0, import_smithy_client.withBaseException)(SageMakerMetricsServiceException);
281
- var se_RawMetricData = /* @__PURE__ */ __name((input, context) => {
282
- return (0, import_smithy_client.take)(input, {
283
- MetricName: [],
284
- Step: [],
285
- Timestamp: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "Timestamp"),
286
- Value: import_smithy_client.serializeFloat
287
- });
288
- }, "se_RawMetricData");
289
- var se_RawMetricDataList = /* @__PURE__ */ __name((input, context) => {
290
- return input.filter((e) => e != null).map((entry) => {
291
- return se_RawMetricData(entry, context);
292
- });
293
- }, "se_RawMetricDataList");
294
- var de_MetricQueryResult = /* @__PURE__ */ __name((output, context) => {
295
- return (0, import_smithy_client.take)(output, {
296
- Message: import_smithy_client.expectString,
297
- MetricValues: /* @__PURE__ */ __name((_) => de_MetricValues(_, context), "MetricValues"),
298
- Status: import_smithy_client.expectString,
299
- XAxisValues: import_smithy_client._json
300
- });
301
- }, "de_MetricQueryResult");
302
- var de_MetricQueryResultList = /* @__PURE__ */ __name((output, context) => {
303
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
304
- return de_MetricQueryResult(entry, context);
305
- });
306
- return retVal;
307
- }, "de_MetricQueryResultList");
308
- var de_MetricValues = /* @__PURE__ */ __name((output, context) => {
309
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
310
- return (0, import_smithy_client.limitedParseDouble)(entry);
311
- });
312
- return retVal;
313
- }, "de_MetricValues");
314
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
315
- httpStatusCode: output.statusCode,
316
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
317
- extendedRequestId: output.headers["x-amz-id-2"],
318
- cfId: output.headers["x-amz-cf-id"]
319
- }), "deserializeMetadata");
320
-
321
- // src/commands/BatchGetMetricsCommand.ts
322
- var BatchGetMetricsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
323
- return [
324
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
325
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
326
- ];
327
- }).s("SageMakerMetricsService", "BatchGetMetrics", {}).n("SageMakerMetricsClient", "BatchGetMetricsCommand").f(void 0, void 0).ser(se_BatchGetMetricsCommand).de(de_BatchGetMetricsCommand).build() {
328
- static {
329
- __name(this, "BatchGetMetricsCommand");
330
- }
147
+ const de_BatchGetMetricsCommand = async (output, context) => {
148
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
149
+ return de_CommandError(output, context);
150
+ }
151
+ const contents = smithyClient.map({
152
+ $metadata: deserializeMetadata(output),
153
+ });
154
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
155
+ const doc = smithyClient.take(data, {
156
+ MetricQueryResults: (_) => de_MetricQueryResultList(_),
157
+ });
158
+ Object.assign(contents, doc);
159
+ return contents;
331
160
  };
161
+ const de_BatchPutMetricsCommand = async (output, context) => {
162
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
163
+ return de_CommandError(output, context);
164
+ }
165
+ const contents = smithyClient.map({
166
+ $metadata: deserializeMetadata(output),
167
+ });
168
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
169
+ const doc = smithyClient.take(data, {
170
+ Errors: smithyClient._json,
171
+ });
172
+ Object.assign(contents, doc);
173
+ return contents;
174
+ };
175
+ const de_CommandError = async (output, context) => {
176
+ const parsedOutput = {
177
+ ...output,
178
+ body: await core$1.parseJsonErrorBody(output.body, context),
179
+ };
180
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
181
+ const parsedBody = parsedOutput.body;
182
+ return throwDefaultError({
183
+ output,
184
+ parsedBody,
185
+ errorCode,
186
+ });
187
+ };
188
+ const throwDefaultError = smithyClient.withBaseException(SageMakerMetricsServiceException);
189
+ const se_RawMetricData = (input, context) => {
190
+ return smithyClient.take(input, {
191
+ MetricName: [],
192
+ Step: [],
193
+ Timestamp: (_) => _.getTime() / 1_000,
194
+ Value: smithyClient.serializeFloat,
195
+ });
196
+ };
197
+ const se_RawMetricDataList = (input, context) => {
198
+ return input
199
+ .filter((e) => e != null)
200
+ .map((entry) => {
201
+ return se_RawMetricData(entry);
202
+ });
203
+ };
204
+ const de_MetricQueryResult = (output, context) => {
205
+ return smithyClient.take(output, {
206
+ Message: smithyClient.expectString,
207
+ MetricValues: (_) => de_MetricValues(_),
208
+ Status: smithyClient.expectString,
209
+ XAxisValues: smithyClient._json,
210
+ });
211
+ };
212
+ const de_MetricQueryResultList = (output, context) => {
213
+ const retVal = (output || [])
214
+ .filter((e) => e != null)
215
+ .map((entry) => {
216
+ return de_MetricQueryResult(entry);
217
+ });
218
+ return retVal;
219
+ };
220
+ const de_MetricValues = (output, context) => {
221
+ const retVal = (output || [])
222
+ .filter((e) => e != null)
223
+ .map((entry) => {
224
+ return smithyClient.limitedParseDouble(entry);
225
+ });
226
+ return retVal;
227
+ };
228
+ const deserializeMetadata = (output) => ({
229
+ httpStatusCode: output.statusCode,
230
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
231
+ extendedRequestId: output.headers["x-amz-id-2"],
232
+ cfId: output.headers["x-amz-cf-id"],
233
+ });
332
234
 
333
- // src/commands/BatchPutMetricsCommand.ts
334
-
335
-
235
+ class BatchGetMetricsCommand extends smithyClient.Command
236
+ .classBuilder()
237
+ .ep(commonParams)
238
+ .m(function (Command, cs, config, o) {
239
+ return [
240
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
241
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
242
+ ];
243
+ })
244
+ .s("SageMakerMetricsService", "BatchGetMetrics", {})
245
+ .n("SageMakerMetricsClient", "BatchGetMetricsCommand")
246
+ .f(void 0, void 0)
247
+ .ser(se_BatchGetMetricsCommand)
248
+ .de(de_BatchGetMetricsCommand)
249
+ .build() {
250
+ }
336
251
 
337
- var BatchPutMetricsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
338
- return [
339
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
340
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
341
- ];
342
- }).s("SageMakerMetricsService", "BatchPutMetrics", {}).n("SageMakerMetricsClient", "BatchPutMetricsCommand").f(void 0, void 0).ser(se_BatchPutMetricsCommand).de(de_BatchPutMetricsCommand).build() {
343
- static {
344
- __name(this, "BatchPutMetricsCommand");
345
- }
346
- };
252
+ class BatchPutMetricsCommand extends smithyClient.Command
253
+ .classBuilder()
254
+ .ep(commonParams)
255
+ .m(function (Command, cs, config, o) {
256
+ return [
257
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
258
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
259
+ ];
260
+ })
261
+ .s("SageMakerMetricsService", "BatchPutMetrics", {})
262
+ .n("SageMakerMetricsClient", "BatchPutMetricsCommand")
263
+ .f(void 0, void 0)
264
+ .ser(se_BatchPutMetricsCommand)
265
+ .de(de_BatchPutMetricsCommand)
266
+ .build() {
267
+ }
347
268
 
348
- // src/SageMakerMetrics.ts
349
- var commands = {
350
- BatchGetMetricsCommand,
351
- BatchPutMetricsCommand
352
- };
353
- var SageMakerMetrics = class extends SageMakerMetricsClient {
354
- static {
355
- __name(this, "SageMakerMetrics");
356
- }
269
+ const commands = {
270
+ BatchGetMetricsCommand,
271
+ BatchPutMetricsCommand,
357
272
  };
358
- (0, import_smithy_client.createAggregatedClient)(commands, SageMakerMetrics);
273
+ class SageMakerMetrics extends SageMakerMetricsClient {
274
+ }
275
+ smithyClient.createAggregatedClient(commands, SageMakerMetrics);
359
276
 
360
- // src/models/models_0.ts
361
- var MetricStatistic = {
362
- AVG: "Avg",
363
- COUNT: "Count",
364
- LAST: "Last",
365
- MAX: "Max",
366
- MIN: "Min",
367
- STD_DEV: "StdDev"
277
+ const MetricStatistic = {
278
+ AVG: "Avg",
279
+ COUNT: "Count",
280
+ LAST: "Last",
281
+ MAX: "Max",
282
+ MIN: "Min",
283
+ STD_DEV: "StdDev",
368
284
  };
369
- var Period = {
370
- FIVE_MINUTE: "FiveMinute",
371
- ITERATION_NUMBER: "IterationNumber",
372
- ONE_HOUR: "OneHour",
373
- ONE_MINUTE: "OneMinute"
285
+ const Period = {
286
+ FIVE_MINUTE: "FiveMinute",
287
+ ITERATION_NUMBER: "IterationNumber",
288
+ ONE_HOUR: "OneHour",
289
+ ONE_MINUTE: "OneMinute",
374
290
  };
375
- var XAxisType = {
376
- ITERATION_NUMBER: "IterationNumber",
377
- TIMESTAMP: "Timestamp"
291
+ const XAxisType = {
292
+ ITERATION_NUMBER: "IterationNumber",
293
+ TIMESTAMP: "Timestamp",
378
294
  };
379
- var MetricQueryResultStatus = {
380
- COMPLETE: "Complete",
381
- INTERNAL_ERROR: "InternalError",
382
- TRUNCATED: "Truncated",
383
- VALIDATION_ERROR: "ValidationError"
295
+ const MetricQueryResultStatus = {
296
+ COMPLETE: "Complete",
297
+ INTERNAL_ERROR: "InternalError",
298
+ TRUNCATED: "Truncated",
299
+ VALIDATION_ERROR: "ValidationError",
384
300
  };
385
- var PutMetricsErrorCode = {
386
- CONFLICT_ERROR: "CONFLICT_ERROR",
387
- INTERNAL_ERROR: "INTERNAL_ERROR",
388
- METRIC_LIMIT_EXCEEDED: "METRIC_LIMIT_EXCEEDED",
389
- VALIDATION_ERROR: "VALIDATION_ERROR"
301
+ const PutMetricsErrorCode = {
302
+ CONFLICT_ERROR: "CONFLICT_ERROR",
303
+ INTERNAL_ERROR: "INTERNAL_ERROR",
304
+ METRIC_LIMIT_EXCEEDED: "METRIC_LIMIT_EXCEEDED",
305
+ VALIDATION_ERROR: "VALIDATION_ERROR",
390
306
  };
391
- // Annotate the CommonJS export names for ESM import in node:
392
307
 
393
- 0 && (module.exports = {
394
- SageMakerMetricsServiceException,
395
- __Client,
396
- SageMakerMetricsClient,
397
- SageMakerMetrics,
398
- $Command,
399
- BatchGetMetricsCommand,
400
- BatchPutMetricsCommand,
401
- MetricStatistic,
402
- Period,
403
- XAxisType,
404
- MetricQueryResultStatus,
405
- PutMetricsErrorCode
308
+ Object.defineProperty(exports, "$Command", {
309
+ enumerable: true,
310
+ get: function () { return smithyClient.Command; }
406
311
  });
407
-
312
+ Object.defineProperty(exports, "__Client", {
313
+ enumerable: true,
314
+ get: function () { return smithyClient.Client; }
315
+ });
316
+ exports.BatchGetMetricsCommand = BatchGetMetricsCommand;
317
+ exports.BatchPutMetricsCommand = BatchPutMetricsCommand;
318
+ exports.MetricQueryResultStatus = MetricQueryResultStatus;
319
+ exports.MetricStatistic = MetricStatistic;
320
+ exports.Period = Period;
321
+ exports.PutMetricsErrorCode = PutMetricsErrorCode;
322
+ exports.SageMakerMetrics = SageMakerMetrics;
323
+ exports.SageMakerMetricsClient = SageMakerMetricsClient;
324
+ exports.SageMakerMetricsServiceException = SageMakerMetricsServiceException;
325
+ exports.XAxisType = XAxisType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-metrics",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Metrics Client for Node.js, Browser and React Native",
4
- "version": "3.899.0",
4
+ "version": "3.906.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-sagemaker-metrics",
@@ -20,42 +20,42 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.899.0",
24
- "@aws-sdk/credential-provider-node": "3.899.0",
25
- "@aws-sdk/middleware-host-header": "3.893.0",
26
- "@aws-sdk/middleware-logger": "3.893.0",
27
- "@aws-sdk/middleware-recursion-detection": "3.893.0",
28
- "@aws-sdk/middleware-user-agent": "3.899.0",
29
- "@aws-sdk/region-config-resolver": "3.893.0",
30
- "@aws-sdk/types": "3.893.0",
31
- "@aws-sdk/util-endpoints": "3.895.0",
32
- "@aws-sdk/util-user-agent-browser": "3.893.0",
33
- "@aws-sdk/util-user-agent-node": "3.899.0",
34
- "@smithy/config-resolver": "^4.2.2",
35
- "@smithy/core": "^3.13.0",
36
- "@smithy/fetch-http-handler": "^5.2.1",
37
- "@smithy/hash-node": "^4.1.1",
38
- "@smithy/invalid-dependency": "^4.1.1",
39
- "@smithy/middleware-content-length": "^4.1.1",
40
- "@smithy/middleware-endpoint": "^4.2.5",
41
- "@smithy/middleware-retry": "^4.3.1",
42
- "@smithy/middleware-serde": "^4.1.1",
43
- "@smithy/middleware-stack": "^4.1.1",
44
- "@smithy/node-config-provider": "^4.2.2",
45
- "@smithy/node-http-handler": "^4.2.1",
46
- "@smithy/protocol-http": "^5.2.1",
47
- "@smithy/smithy-client": "^4.6.5",
48
- "@smithy/types": "^4.5.0",
49
- "@smithy/url-parser": "^4.1.1",
50
- "@smithy/util-base64": "^4.1.0",
51
- "@smithy/util-body-length-browser": "^4.1.0",
52
- "@smithy/util-body-length-node": "^4.1.0",
53
- "@smithy/util-defaults-mode-browser": "^4.1.5",
54
- "@smithy/util-defaults-mode-node": "^4.1.5",
55
- "@smithy/util-endpoints": "^3.1.2",
56
- "@smithy/util-middleware": "^4.1.1",
57
- "@smithy/util-retry": "^4.1.2",
58
- "@smithy/util-utf8": "^4.1.0",
23
+ "@aws-sdk/core": "3.906.0",
24
+ "@aws-sdk/credential-provider-node": "3.906.0",
25
+ "@aws-sdk/middleware-host-header": "3.901.0",
26
+ "@aws-sdk/middleware-logger": "3.901.0",
27
+ "@aws-sdk/middleware-recursion-detection": "3.901.0",
28
+ "@aws-sdk/middleware-user-agent": "3.906.0",
29
+ "@aws-sdk/region-config-resolver": "3.901.0",
30
+ "@aws-sdk/types": "3.901.0",
31
+ "@aws-sdk/util-endpoints": "3.901.0",
32
+ "@aws-sdk/util-user-agent-browser": "3.901.0",
33
+ "@aws-sdk/util-user-agent-node": "3.906.0",
34
+ "@smithy/config-resolver": "^4.3.0",
35
+ "@smithy/core": "^3.14.0",
36
+ "@smithy/fetch-http-handler": "^5.3.0",
37
+ "@smithy/hash-node": "^4.2.0",
38
+ "@smithy/invalid-dependency": "^4.2.0",
39
+ "@smithy/middleware-content-length": "^4.2.0",
40
+ "@smithy/middleware-endpoint": "^4.3.0",
41
+ "@smithy/middleware-retry": "^4.4.0",
42
+ "@smithy/middleware-serde": "^4.2.0",
43
+ "@smithy/middleware-stack": "^4.2.0",
44
+ "@smithy/node-config-provider": "^4.3.0",
45
+ "@smithy/node-http-handler": "^4.3.0",
46
+ "@smithy/protocol-http": "^5.3.0",
47
+ "@smithy/smithy-client": "^4.7.0",
48
+ "@smithy/types": "^4.6.0",
49
+ "@smithy/url-parser": "^4.2.0",
50
+ "@smithy/util-base64": "^4.2.0",
51
+ "@smithy/util-body-length-browser": "^4.2.0",
52
+ "@smithy/util-body-length-node": "^4.2.0",
53
+ "@smithy/util-defaults-mode-browser": "^4.2.0",
54
+ "@smithy/util-defaults-mode-node": "^4.2.0",
55
+ "@smithy/util-endpoints": "^3.2.0",
56
+ "@smithy/util-middleware": "^4.2.0",
57
+ "@smithy/util-retry": "^4.2.0",
58
+ "@smithy/util-utf8": "^4.2.0",
59
59
  "tslib": "^2.6.2"
60
60
  },
61
61
  "devDependencies": {