@aws-sdk/client-freetier 3.458.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 (87) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +223 -0
  3. package/dist-cjs/FreeTier.js +13 -0
  4. package/dist-cjs/FreeTierClient.js +43 -0
  5. package/dist-cjs/commands/GetFreeTierUsageCommand.js +50 -0
  6. package/dist-cjs/commands/index.js +4 -0
  7. package/dist-cjs/endpoint/EndpointParameters.js +11 -0
  8. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  9. package/dist-cjs/endpoint/ruleset.js +7 -0
  10. package/dist-cjs/extensionConfiguration.js +2 -0
  11. package/dist-cjs/index.js +12 -0
  12. package/dist-cjs/models/FreeTierServiceException.js +12 -0
  13. package/dist-cjs/models/index.js +4 -0
  14. package/dist-cjs/models/models_0.js +59 -0
  15. package/dist-cjs/pagination/GetFreeTierUsagePaginator.js +29 -0
  16. package/dist-cjs/pagination/Interfaces.js +2 -0
  17. package/dist-cjs/pagination/index.js +5 -0
  18. package/dist-cjs/protocols/Aws_json1_0.js +202 -0
  19. package/dist-cjs/runtimeConfig.browser.js +39 -0
  20. package/dist-cjs/runtimeConfig.js +50 -0
  21. package/dist-cjs/runtimeConfig.native.js +15 -0
  22. package/dist-cjs/runtimeConfig.shared.js +24 -0
  23. package/dist-cjs/runtimeExtensions.js +22 -0
  24. package/dist-es/FreeTier.js +9 -0
  25. package/dist-es/FreeTierClient.js +39 -0
  26. package/dist-es/commands/GetFreeTierUsageCommand.js +46 -0
  27. package/dist-es/commands/index.js +1 -0
  28. package/dist-es/endpoint/EndpointParameters.js +7 -0
  29. package/dist-es/endpoint/endpointResolver.js +8 -0
  30. package/dist-es/endpoint/ruleset.js +4 -0
  31. package/dist-es/extensionConfiguration.js +1 -0
  32. package/dist-es/index.js +7 -0
  33. package/dist-es/models/FreeTierServiceException.js +8 -0
  34. package/dist-es/models/index.js +1 -0
  35. package/dist-es/models/models_0.js +53 -0
  36. package/dist-es/pagination/GetFreeTierUsagePaginator.js +25 -0
  37. package/dist-es/pagination/Interfaces.js +1 -0
  38. package/dist-es/pagination/index.js +2 -0
  39. package/dist-es/protocols/Aws_json1_0.js +197 -0
  40. package/dist-es/runtimeConfig.browser.js +34 -0
  41. package/dist-es/runtimeConfig.js +45 -0
  42. package/dist-es/runtimeConfig.native.js +11 -0
  43. package/dist-es/runtimeConfig.shared.js +20 -0
  44. package/dist-es/runtimeExtensions.js +18 -0
  45. package/dist-types/FreeTier.d.ts +27 -0
  46. package/dist-types/FreeTierClient.d.ts +180 -0
  47. package/dist-types/commands/GetFreeTierUsageCommand.d.ts +132 -0
  48. package/dist-types/commands/index.d.ts +1 -0
  49. package/dist-types/endpoint/EndpointParameters.d.ts +20 -0
  50. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  51. package/dist-types/endpoint/ruleset.d.ts +2 -0
  52. package/dist-types/extensionConfiguration.d.ts +8 -0
  53. package/dist-types/index.d.ts +25 -0
  54. package/dist-types/models/FreeTierServiceException.d.ts +13 -0
  55. package/dist-types/models/index.d.ts +1 -0
  56. package/dist-types/models/models_0.d.ts +254 -0
  57. package/dist-types/pagination/GetFreeTierUsagePaginator.d.ts +7 -0
  58. package/dist-types/pagination/Interfaces.d.ts +8 -0
  59. package/dist-types/pagination/index.d.ts +2 -0
  60. package/dist-types/protocols/Aws_json1_0.d.ts +11 -0
  61. package/dist-types/runtimeConfig.browser.d.ts +46 -0
  62. package/dist-types/runtimeConfig.d.ts +46 -0
  63. package/dist-types/runtimeConfig.native.d.ts +45 -0
  64. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  65. package/dist-types/runtimeExtensions.d.ts +17 -0
  66. package/dist-types/ts3.4/FreeTier.d.ts +22 -0
  67. package/dist-types/ts3.4/FreeTierClient.d.ts +122 -0
  68. package/dist-types/ts3.4/commands/GetFreeTierUsageCommand.d.ts +38 -0
  69. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  70. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +31 -0
  71. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  72. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  73. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  74. package/dist-types/ts3.4/index.d.ts +10 -0
  75. package/dist-types/ts3.4/models/FreeTierServiceException.d.ts +8 -0
  76. package/dist-types/ts3.4/models/index.d.ts +1 -0
  77. package/dist-types/ts3.4/models/models_0.d.ts +73 -0
  78. package/dist-types/ts3.4/pagination/GetFreeTierUsagePaginator.d.ts +11 -0
  79. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  80. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  81. package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +17 -0
  82. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  83. package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
  84. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  85. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  86. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  87. package/package.json +102 -0
@@ -0,0 +1,53 @@
1
+ import { FreeTierServiceException as __BaseException } from "./FreeTierServiceException";
2
+ export const Dimension = {
3
+ DESCRIPTION: "DESCRIPTION",
4
+ FREE_TIER_TYPE: "FREE_TIER_TYPE",
5
+ OPERATION: "OPERATION",
6
+ REGION: "REGION",
7
+ SERVICE: "SERVICE",
8
+ USAGE_PERCENTAGE: "USAGE_PERCENTAGE",
9
+ USAGE_TYPE: "USAGE_TYPE",
10
+ };
11
+ export const MatchOption = {
12
+ CONTAINS: "CONTAINS",
13
+ ENDS_WITH: "ENDS_WITH",
14
+ EQUALS: "EQUALS",
15
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL",
16
+ STARTS_WITH: "STARTS_WITH",
17
+ };
18
+ export class InternalServerException extends __BaseException {
19
+ constructor(opts) {
20
+ super({
21
+ name: "InternalServerException",
22
+ $fault: "server",
23
+ ...opts,
24
+ });
25
+ this.name = "InternalServerException";
26
+ this.$fault = "server";
27
+ Object.setPrototypeOf(this, InternalServerException.prototype);
28
+ }
29
+ }
30
+ export class ThrottlingException extends __BaseException {
31
+ constructor(opts) {
32
+ super({
33
+ name: "ThrottlingException",
34
+ $fault: "client",
35
+ ...opts,
36
+ });
37
+ this.name = "ThrottlingException";
38
+ this.$fault = "client";
39
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
40
+ }
41
+ }
42
+ export class ValidationException extends __BaseException {
43
+ constructor(opts) {
44
+ super({
45
+ name: "ValidationException",
46
+ $fault: "client",
47
+ ...opts,
48
+ });
49
+ this.name = "ValidationException";
50
+ this.$fault = "client";
51
+ Object.setPrototypeOf(this, ValidationException.prototype);
52
+ }
53
+ }
@@ -0,0 +1,25 @@
1
+ import { GetFreeTierUsageCommand, } from "../commands/GetFreeTierUsageCommand";
2
+ import { FreeTierClient } from "../FreeTierClient";
3
+ const makePagedClientRequest = async (client, input, ...args) => {
4
+ return await client.send(new GetFreeTierUsageCommand(input), ...args);
5
+ };
6
+ export async function* paginateGetFreeTierUsage(config, input, ...additionalArguments) {
7
+ let token = config.startingToken || undefined;
8
+ let hasNext = true;
9
+ let page;
10
+ while (hasNext) {
11
+ input.nextToken = token;
12
+ input["maxResults"] = config.pageSize;
13
+ if (config.client instanceof FreeTierClient) {
14
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
+ }
16
+ else {
17
+ throw new Error("Invalid client, expected FreeTier | FreeTierClient");
18
+ }
19
+ yield page;
20
+ const prevToken = token;
21
+ token = page.nextToken;
22
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
+ }
24
+ return undefined;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./GetFreeTierUsagePaginator";
2
+ export * from "./Interfaces";
@@ -0,0 +1,197 @@
1
+ import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { FreeTierServiceException as __BaseException } from "../models/FreeTierServiceException";
4
+ import { InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ export const se_GetFreeTierUsageCommand = async (input, context) => {
6
+ const headers = sharedHeaders("GetFreeTierUsage");
7
+ let body;
8
+ body = JSON.stringify(se_GetFreeTierUsageRequest(input, context));
9
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
+ };
11
+ export const de_GetFreeTierUsageCommand = async (output, context) => {
12
+ if (output.statusCode >= 300) {
13
+ return de_GetFreeTierUsageCommandError(output, context);
14
+ }
15
+ const data = await parseBody(output.body, context);
16
+ let contents = {};
17
+ contents = de_GetFreeTierUsageResponse(data, context);
18
+ const response = {
19
+ $metadata: deserializeMetadata(output),
20
+ ...contents,
21
+ };
22
+ return response;
23
+ };
24
+ const de_GetFreeTierUsageCommandError = async (output, context) => {
25
+ const parsedOutput = {
26
+ ...output,
27
+ body: await parseErrorBody(output.body, context),
28
+ };
29
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
30
+ switch (errorCode) {
31
+ case "InternalServerException":
32
+ case "com.amazonaws.freetier#InternalServerException":
33
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
34
+ case "ThrottlingException":
35
+ case "com.amazonaws.freetier#ThrottlingException":
36
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
37
+ case "ValidationException":
38
+ case "com.amazonaws.freetier#ValidationException":
39
+ throw await de_ValidationExceptionRes(parsedOutput, context);
40
+ default:
41
+ const parsedBody = parsedOutput.body;
42
+ return throwDefaultError({
43
+ output,
44
+ parsedBody,
45
+ errorCode,
46
+ });
47
+ }
48
+ };
49
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
50
+ const body = parsedOutput.body;
51
+ const deserialized = _json(body);
52
+ const exception = new InternalServerException({
53
+ $metadata: deserializeMetadata(parsedOutput),
54
+ ...deserialized,
55
+ });
56
+ return __decorateServiceException(exception, body);
57
+ };
58
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
59
+ const body = parsedOutput.body;
60
+ const deserialized = _json(body);
61
+ const exception = new ThrottlingException({
62
+ $metadata: deserializeMetadata(parsedOutput),
63
+ ...deserialized,
64
+ });
65
+ return __decorateServiceException(exception, body);
66
+ };
67
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
68
+ const body = parsedOutput.body;
69
+ const deserialized = _json(body);
70
+ const exception = new ValidationException({
71
+ $metadata: deserializeMetadata(parsedOutput),
72
+ ...deserialized,
73
+ });
74
+ return __decorateServiceException(exception, body);
75
+ };
76
+ const se_Expression = (input, context) => {
77
+ return take(input, {
78
+ And: (_) => se_Expressions(_, context),
79
+ Dimensions: _json,
80
+ Not: (_) => se_Expression(_, context),
81
+ Or: (_) => se_Expressions(_, context),
82
+ });
83
+ };
84
+ const se_Expressions = (input, context) => {
85
+ return input
86
+ .filter((e) => e != null)
87
+ .map((entry) => {
88
+ return se_Expression(entry, context);
89
+ });
90
+ };
91
+ const se_GetFreeTierUsageRequest = (input, context) => {
92
+ return take(input, {
93
+ filter: (_) => se_Expression(_, context),
94
+ maxResults: [],
95
+ nextToken: [],
96
+ });
97
+ };
98
+ const de_FreeTierUsage = (output, context) => {
99
+ return take(output, {
100
+ actualUsageAmount: __limitedParseDouble,
101
+ description: __expectString,
102
+ forecastedUsageAmount: __limitedParseDouble,
103
+ freeTierType: __expectString,
104
+ limit: __limitedParseDouble,
105
+ operation: __expectString,
106
+ region: __expectString,
107
+ service: __expectString,
108
+ unit: __expectString,
109
+ usageType: __expectString,
110
+ });
111
+ };
112
+ const de_FreeTierUsages = (output, context) => {
113
+ const retVal = (output || [])
114
+ .filter((e) => e != null)
115
+ .map((entry) => {
116
+ return de_FreeTierUsage(entry, context);
117
+ });
118
+ return retVal;
119
+ };
120
+ const de_GetFreeTierUsageResponse = (output, context) => {
121
+ return take(output, {
122
+ freeTierUsages: (_) => de_FreeTierUsages(_, context),
123
+ nextToken: __expectString,
124
+ });
125
+ };
126
+ const deserializeMetadata = (output) => ({
127
+ httpStatusCode: output.statusCode,
128
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
129
+ extendedRequestId: output.headers["x-amz-id-2"],
130
+ cfId: output.headers["x-amz-cf-id"],
131
+ });
132
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
133
+ const throwDefaultError = withBaseException(__BaseException);
134
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
135
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
+ const contents = {
137
+ protocol,
138
+ hostname,
139
+ port,
140
+ method: "POST",
141
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
142
+ headers,
143
+ };
144
+ if (resolvedHostname !== undefined) {
145
+ contents.hostname = resolvedHostname;
146
+ }
147
+ if (body !== undefined) {
148
+ contents.body = body;
149
+ }
150
+ return new __HttpRequest(contents);
151
+ };
152
+ function sharedHeaders(operation) {
153
+ return {
154
+ "content-type": "application/x-amz-json-1.0",
155
+ "x-amz-target": `AWSFreeTierService.${operation}`,
156
+ };
157
+ }
158
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
159
+ if (encoded.length) {
160
+ return JSON.parse(encoded);
161
+ }
162
+ return {};
163
+ });
164
+ const parseErrorBody = async (errorBody, context) => {
165
+ const value = await parseBody(errorBody, context);
166
+ value.message = value.message ?? value.Message;
167
+ return value;
168
+ };
169
+ const loadRestJsonErrorCode = (output, data) => {
170
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
171
+ const sanitizeErrorCode = (rawValue) => {
172
+ let cleanValue = rawValue;
173
+ if (typeof cleanValue === "number") {
174
+ cleanValue = cleanValue.toString();
175
+ }
176
+ if (cleanValue.indexOf(",") >= 0) {
177
+ cleanValue = cleanValue.split(",")[0];
178
+ }
179
+ if (cleanValue.indexOf(":") >= 0) {
180
+ cleanValue = cleanValue.split(":")[0];
181
+ }
182
+ if (cleanValue.indexOf("#") >= 0) {
183
+ cleanValue = cleanValue.split("#")[1];
184
+ }
185
+ return cleanValue;
186
+ };
187
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
188
+ if (headerKey !== undefined) {
189
+ return sanitizeErrorCode(output.headers[headerKey]);
190
+ }
191
+ if (data.code !== undefined) {
192
+ return sanitizeErrorCode(data.code);
193
+ }
194
+ if (data["__type"] !== undefined) {
195
+ return sanitizeErrorCode(data["__type"]);
196
+ }
197
+ };
@@ -0,0 +1,34 @@
1
+ import packageInfo from "../package.json";
2
+ import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
4
+ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
5
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
6
+ import { invalidProvider } from "@smithy/invalid-dependency";
7
+ import { calculateBodyLength } from "@smithy/util-body-length-browser";
8
+ import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
9
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
10
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
11
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
12
+ export const getRuntimeConfig = (config) => {
13
+ const defaultsMode = resolveDefaultsModeConfig(config);
14
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
+ const clientSharedValues = getSharedRuntimeConfig(config);
16
+ return {
17
+ ...clientSharedValues,
18
+ ...config,
19
+ runtime: "browser",
20
+ defaultsMode,
21
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
22
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
23
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
24
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
25
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
26
+ region: config?.region ?? invalidProvider("Region is missing"),
27
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
28
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
29
+ sha256: config?.sha256 ?? Sha256,
30
+ streamCollector: config?.streamCollector ?? streamCollector,
31
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
32
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
33
+ };
34
+ };
@@ -0,0 +1,45 @@
1
+ import packageInfo from "../package.json";
2
+ import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
3
+ import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
4
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
5
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
6
+ import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
7
+ import { Hash } from "@smithy/hash-node";
8
+ import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
9
+ import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
10
+ import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
11
+ import { calculateBodyLength } from "@smithy/util-body-length-node";
12
+ import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
13
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
14
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
15
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
16
+ import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
17
+ export const getRuntimeConfig = (config) => {
18
+ emitWarningIfUnsupportedVersion(process.version);
19
+ const defaultsMode = resolveDefaultsModeConfig(config);
20
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
21
+ const clientSharedValues = getSharedRuntimeConfig(config);
22
+ awsCheckVersion(process.version);
23
+ return {
24
+ ...clientSharedValues,
25
+ ...config,
26
+ runtime: "node",
27
+ defaultsMode,
28
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
29
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
30
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
31
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
33
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
34
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
35
+ retryMode: config?.retryMode ??
36
+ loadNodeConfig({
37
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
38
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
39
+ }),
40
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
41
+ streamCollector: config?.streamCollector ?? streamCollector,
42
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
43
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
44
+ };
45
+ };
@@ -0,0 +1,11 @@
1
+ import { Sha256 } from "@aws-crypto/sha256-js";
2
+ import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
3
+ export const getRuntimeConfig = (config) => {
4
+ const browserDefaults = getBrowserRuntimeConfig(config);
5
+ return {
6
+ ...browserDefaults,
7
+ ...config,
8
+ runtime: "react-native",
9
+ sha256: config?.sha256 ?? Sha256,
10
+ };
11
+ };
@@ -0,0 +1,20 @@
1
+ import { NoOpLogger } from "@smithy/smithy-client";
2
+ import { parseUrl } from "@smithy/url-parser";
3
+ import { fromBase64, toBase64 } from "@smithy/util-base64";
4
+ import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
5
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
6
+ export const getRuntimeConfig = (config) => {
7
+ return {
8
+ apiVersion: "2023-09-07",
9
+ base64Decoder: config?.base64Decoder ?? fromBase64,
10
+ base64Encoder: config?.base64Encoder ?? toBase64,
11
+ disableHostPrefix: config?.disableHostPrefix ?? false,
12
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
13
+ extensions: config?.extensions ?? [],
14
+ logger: config?.logger ?? new NoOpLogger(),
15
+ serviceId: config?.serviceId ?? "FreeTier",
16
+ urlParser: config?.urlParser ?? parseUrl,
17
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
18
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
19
+ };
20
+ };
@@ -0,0 +1,18 @@
1
+ import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
+ import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
+ import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ const asPartial = (t) => t;
5
+ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
+ const extensionConfiguration = {
7
+ ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
8
+ ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
9
+ ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
10
+ };
11
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
12
+ return {
13
+ ...runtimeConfig,
14
+ ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
15
+ ...resolveDefaultRuntimeConfig(extensionConfiguration),
16
+ ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
17
+ };
18
+ };
@@ -0,0 +1,27 @@
1
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2
+ import { GetFreeTierUsageCommandInput, GetFreeTierUsageCommandOutput } from "./commands/GetFreeTierUsageCommand";
3
+ import { FreeTierClient } from "./FreeTierClient";
4
+ export interface FreeTier {
5
+ /**
6
+ * @see {@link GetFreeTierUsageCommand}
7
+ */
8
+ getFreeTierUsage(args: GetFreeTierUsageCommandInput, options?: __HttpHandlerOptions): Promise<GetFreeTierUsageCommandOutput>;
9
+ getFreeTierUsage(args: GetFreeTierUsageCommandInput, cb: (err: any, data?: GetFreeTierUsageCommandOutput) => void): void;
10
+ getFreeTierUsage(args: GetFreeTierUsageCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetFreeTierUsageCommandOutput) => void): void;
11
+ }
12
+ /**
13
+ * @public
14
+ * <p>You can use the Amazon Web Services Free Tier API to query programmatically your Free Tier usage data.</p>
15
+ * <p>Free Tier tracks your monthly usage data for all free tier offers that are associated with your
16
+ * Amazon Web Services account. You can use the Free Tier API to filter and show only the data that you want.</p>
17
+ * <p>Service endpoint</p>
18
+ * <p>The Free Tier API provides the following endpoint:</p>
19
+ * <ul>
20
+ * <li>
21
+ * <p>https://freetier.us-east-1.api.aws</p>
22
+ * </li>
23
+ * </ul>
24
+ * <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html">Using the Amazon Web Services Free Tier</a> in the <i>Billing User Guide</i>.</p>
25
+ */
26
+ export declare class FreeTier extends FreeTierClient implements FreeTier {
27
+ }
@@ -0,0 +1,180 @@
1
+ import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
2
+ import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
3
+ import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
+ import { Credentials as __Credentials } from "@aws-sdk/types";
5
+ import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
6
+ import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
7
+ import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
8
+ import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
9
+ import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
10
+ import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
11
+ import { GetFreeTierUsageCommandInput, GetFreeTierUsageCommandOutput } from "./commands/GetFreeTierUsageCommand";
12
+ import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
13
+ import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
14
+ export { __Client };
15
+ /**
16
+ * @public
17
+ */
18
+ export type ServiceInputTypes = GetFreeTierUsageCommandInput;
19
+ /**
20
+ * @public
21
+ */
22
+ export type ServiceOutputTypes = GetFreeTierUsageCommandOutput;
23
+ /**
24
+ * @public
25
+ */
26
+ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
27
+ /**
28
+ * The HTTP handler to use. Fetch in browser and Https in Nodejs.
29
+ */
30
+ requestHandler?: __HttpHandler;
31
+ /**
32
+ * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface
33
+ * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
34
+ * @internal
35
+ */
36
+ sha256?: __ChecksumConstructor | __HashConstructor;
37
+ /**
38
+ * The function that will be used to convert strings into HTTP endpoints.
39
+ * @internal
40
+ */
41
+ urlParser?: __UrlParser;
42
+ /**
43
+ * A function that can calculate the length of a request body.
44
+ * @internal
45
+ */
46
+ bodyLengthChecker?: __BodyLengthCalculator;
47
+ /**
48
+ * A function that converts a stream into an array of bytes.
49
+ * @internal
50
+ */
51
+ streamCollector?: __StreamCollector;
52
+ /**
53
+ * The function that will be used to convert a base64-encoded string to a byte array.
54
+ * @internal
55
+ */
56
+ base64Decoder?: __Decoder;
57
+ /**
58
+ * The function that will be used to convert binary data to a base64-encoded string.
59
+ * @internal
60
+ */
61
+ base64Encoder?: __Encoder;
62
+ /**
63
+ * The function that will be used to convert a UTF8-encoded string to a byte array.
64
+ * @internal
65
+ */
66
+ utf8Decoder?: __Decoder;
67
+ /**
68
+ * The function that will be used to convert binary data to a UTF-8 encoded string.
69
+ * @internal
70
+ */
71
+ utf8Encoder?: __Encoder;
72
+ /**
73
+ * The runtime environment.
74
+ * @internal
75
+ */
76
+ runtime?: string;
77
+ /**
78
+ * Disable dynamically changing the endpoint of the client based on the hostPrefix
79
+ * trait of an operation.
80
+ */
81
+ disableHostPrefix?: boolean;
82
+ /**
83
+ * Unique service identifier.
84
+ * @internal
85
+ */
86
+ serviceId?: string;
87
+ /**
88
+ * Enables IPv6/IPv4 dualstack endpoint.
89
+ */
90
+ useDualstackEndpoint?: boolean | __Provider<boolean>;
91
+ /**
92
+ * Enables FIPS compatible endpoints.
93
+ */
94
+ useFipsEndpoint?: boolean | __Provider<boolean>;
95
+ /**
96
+ * The AWS region to which this client will send requests
97
+ */
98
+ region?: string | __Provider<string>;
99
+ /**
100
+ * Default credentials provider; Not available in browser runtime.
101
+ * @internal
102
+ */
103
+ credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
104
+ /**
105
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
106
+ * @internal
107
+ */
108
+ defaultUserAgentProvider?: Provider<__UserAgent>;
109
+ /**
110
+ * Value for how many times a request will be made at most in case of retry.
111
+ */
112
+ maxAttempts?: number | __Provider<number>;
113
+ /**
114
+ * Specifies which retry algorithm to use.
115
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/
116
+ *
117
+ */
118
+ retryMode?: string | __Provider<string>;
119
+ /**
120
+ * Optional logger for logging debug/info/warn/error.
121
+ */
122
+ logger?: __Logger;
123
+ /**
124
+ * Optional extensions
125
+ */
126
+ extensions?: RuntimeExtension[];
127
+ /**
128
+ * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
129
+ */
130
+ defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
131
+ }
132
+ /**
133
+ * @public
134
+ */
135
+ export type FreeTierClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
136
+ /**
137
+ * @public
138
+ *
139
+ * The configuration interface of FreeTierClient class constructor that set the region, credentials and other options.
140
+ */
141
+ export interface FreeTierClientConfig extends FreeTierClientConfigType {
142
+ }
143
+ /**
144
+ * @public
145
+ */
146
+ export type FreeTierClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
147
+ /**
148
+ * @public
149
+ *
150
+ * The resolved configuration interface of FreeTierClient class. This is resolved and normalized from the {@link FreeTierClientConfig | constructor configuration interface}.
151
+ */
152
+ export interface FreeTierClientResolvedConfig extends FreeTierClientResolvedConfigType {
153
+ }
154
+ /**
155
+ * @public
156
+ * <p>You can use the Amazon Web Services Free Tier API to query programmatically your Free Tier usage data.</p>
157
+ * <p>Free Tier tracks your monthly usage data for all free tier offers that are associated with your
158
+ * Amazon Web Services account. You can use the Free Tier API to filter and show only the data that you want.</p>
159
+ * <p>Service endpoint</p>
160
+ * <p>The Free Tier API provides the following endpoint:</p>
161
+ * <ul>
162
+ * <li>
163
+ * <p>https://freetier.us-east-1.api.aws</p>
164
+ * </li>
165
+ * </ul>
166
+ * <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html">Using the Amazon Web Services Free Tier</a> in the <i>Billing User Guide</i>.</p>
167
+ */
168
+ export declare class FreeTierClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, FreeTierClientResolvedConfig> {
169
+ /**
170
+ * The resolved configuration of FreeTierClient class. This is resolved and normalized from the {@link FreeTierClientConfig | constructor configuration interface}.
171
+ */
172
+ readonly config: FreeTierClientResolvedConfig;
173
+ constructor(...[configuration]: __CheckOptionalClientConfig<FreeTierClientConfig>);
174
+ /**
175
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
176
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
177
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
178
+ */
179
+ destroy(): void;
180
+ }