@aws-sdk/client-billing 3.691.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 +219 -0
- package/dist-cjs/Billing.js +13 -0
- package/dist-cjs/BillingClient.js +50 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/ListBillingViewsCommand.js +27 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/endpoint/EndpointParameters.js +16 -0
- package/dist-cjs/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/BillingServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +81 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListBillingViewsPaginator.js +7 -0
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_json1_0.js +138 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +25 -0
- package/dist-es/Billing.js +9 -0
- package/dist-es/BillingClient.js +46 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/ListBillingViewsCommand.js +23 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoint/EndpointParameters.js +12 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/BillingServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +72 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListBillingViewsPaginator.js +4 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_json1_0.js +133 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +21 -0
- package/dist-types/Billing.d.ts +23 -0
- package/dist-types/BillingClient.d.ts +176 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/commands/ListBillingViewsCommand.d.ts +141 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +34 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +20 -0
- package/dist-types/models/BillingServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +202 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListBillingViewsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_json1_0.d.ts +11 -0
- package/dist-types/runtimeConfig.browser.d.ts +48 -0
- package/dist-types/runtimeConfig.d.ts +48 -0
- package/dist-types/runtimeConfig.native.d.ts +47 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/Billing.d.ts +22 -0
- package/dist-types/ts3.4/BillingClient.d.ts +122 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/commands/ListBillingViewsCommand.d.ts +46 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +45 -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/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/BillingServiceException.d.ts +9 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +75 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListBillingViewsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +17 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +94 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +87 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +101 -0
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class BillingServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, BillingServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models_0";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SENSITIVE_STRING } from "@smithy/smithy-client";
|
|
2
|
+
import { BillingServiceException as __BaseException } from "./BillingServiceException";
|
|
3
|
+
export class AccessDeniedException extends __BaseException {
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
super({
|
|
6
|
+
name: "AccessDeniedException",
|
|
7
|
+
$fault: "client",
|
|
8
|
+
...opts,
|
|
9
|
+
});
|
|
10
|
+
this.name = "AccessDeniedException";
|
|
11
|
+
this.$fault = "client";
|
|
12
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class InternalServerException extends __BaseException {
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
super({
|
|
18
|
+
name: "InternalServerException",
|
|
19
|
+
$fault: "server",
|
|
20
|
+
...opts,
|
|
21
|
+
});
|
|
22
|
+
this.name = "InternalServerException";
|
|
23
|
+
this.$fault = "server";
|
|
24
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const BillingViewType = {
|
|
28
|
+
BILLING_GROUP: "BILLING_GROUP",
|
|
29
|
+
PRIMARY: "PRIMARY",
|
|
30
|
+
};
|
|
31
|
+
export class ThrottlingException extends __BaseException {
|
|
32
|
+
constructor(opts) {
|
|
33
|
+
super({
|
|
34
|
+
name: "ThrottlingException",
|
|
35
|
+
$fault: "client",
|
|
36
|
+
...opts,
|
|
37
|
+
});
|
|
38
|
+
this.name = "ThrottlingException";
|
|
39
|
+
this.$fault = "client";
|
|
40
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export const ValidationExceptionReason = {
|
|
44
|
+
CANNOT_PARSE: "cannotParse",
|
|
45
|
+
FIELD_VALIDATION_FAILED: "fieldValidationFailed",
|
|
46
|
+
OTHER: "other",
|
|
47
|
+
UNKNOWN_OPERATION: "unknownOperation",
|
|
48
|
+
};
|
|
49
|
+
export class ValidationException extends __BaseException {
|
|
50
|
+
constructor(opts) {
|
|
51
|
+
super({
|
|
52
|
+
name: "ValidationException",
|
|
53
|
+
$fault: "client",
|
|
54
|
+
...opts,
|
|
55
|
+
});
|
|
56
|
+
this.name = "ValidationException";
|
|
57
|
+
this.$fault = "client";
|
|
58
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
59
|
+
this.reason = opts.reason;
|
|
60
|
+
this.fieldList = opts.fieldList;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const BillingViewListElementFilterSensitiveLog = (obj) => ({
|
|
64
|
+
...obj,
|
|
65
|
+
...(obj.name && { name: SENSITIVE_STRING }),
|
|
66
|
+
});
|
|
67
|
+
export const ListBillingViewsResponseFilterSensitiveLog = (obj) => ({
|
|
68
|
+
...obj,
|
|
69
|
+
...(obj.billingViews && {
|
|
70
|
+
billingViews: obj.billingViews.map((item) => BillingViewListElementFilterSensitiveLog(item)),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createPaginator } from "@smithy/core";
|
|
2
|
+
import { BillingClient } from "../BillingClient";
|
|
3
|
+
import { ListBillingViewsCommand, } from "../commands/ListBillingViewsCommand";
|
|
4
|
+
export const paginateListBillingViews = createPaginator(BillingClient, ListBillingViewsCommand, "nextToken", "nextToken", "maxResults");
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { BillingServiceException as __BaseException } from "../models/BillingServiceException";
|
|
5
|
+
import { AccessDeniedException, InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_ListBillingViewsCommand = async (input, context) => {
|
|
7
|
+
const headers = sharedHeaders("ListBillingViews");
|
|
8
|
+
let body;
|
|
9
|
+
body = JSON.stringify(se_ListBillingViewsRequest(input, context));
|
|
10
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
11
|
+
};
|
|
12
|
+
export const de_ListBillingViewsCommand = async (output, context) => {
|
|
13
|
+
if (output.statusCode >= 300) {
|
|
14
|
+
return de_CommandError(output, context);
|
|
15
|
+
}
|
|
16
|
+
const data = await parseBody(output.body, context);
|
|
17
|
+
let contents = {};
|
|
18
|
+
contents = _json(data);
|
|
19
|
+
const response = {
|
|
20
|
+
$metadata: deserializeMetadata(output),
|
|
21
|
+
...contents,
|
|
22
|
+
};
|
|
23
|
+
return response;
|
|
24
|
+
};
|
|
25
|
+
const de_CommandError = async (output, context) => {
|
|
26
|
+
const parsedOutput = {
|
|
27
|
+
...output,
|
|
28
|
+
body: await parseErrorBody(output.body, context),
|
|
29
|
+
};
|
|
30
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
31
|
+
switch (errorCode) {
|
|
32
|
+
case "AccessDeniedException":
|
|
33
|
+
case "com.amazonaws.billing#AccessDeniedException":
|
|
34
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
35
|
+
case "InternalServerException":
|
|
36
|
+
case "com.amazonaws.billing#InternalServerException":
|
|
37
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
38
|
+
case "ThrottlingException":
|
|
39
|
+
case "com.amazonaws.billing#ThrottlingException":
|
|
40
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
41
|
+
case "ValidationException":
|
|
42
|
+
case "com.amazonaws.billing#ValidationException":
|
|
43
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
44
|
+
default:
|
|
45
|
+
const parsedBody = parsedOutput.body;
|
|
46
|
+
return throwDefaultError({
|
|
47
|
+
output,
|
|
48
|
+
parsedBody,
|
|
49
|
+
errorCode,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
54
|
+
const body = parsedOutput.body;
|
|
55
|
+
const deserialized = _json(body);
|
|
56
|
+
const exception = new AccessDeniedException({
|
|
57
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
58
|
+
...deserialized,
|
|
59
|
+
});
|
|
60
|
+
return __decorateServiceException(exception, body);
|
|
61
|
+
};
|
|
62
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
63
|
+
const body = parsedOutput.body;
|
|
64
|
+
const deserialized = _json(body);
|
|
65
|
+
const exception = new InternalServerException({
|
|
66
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
67
|
+
...deserialized,
|
|
68
|
+
});
|
|
69
|
+
return __decorateServiceException(exception, body);
|
|
70
|
+
};
|
|
71
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
72
|
+
const body = parsedOutput.body;
|
|
73
|
+
const deserialized = _json(body);
|
|
74
|
+
const exception = new ThrottlingException({
|
|
75
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
76
|
+
...deserialized,
|
|
77
|
+
});
|
|
78
|
+
return __decorateServiceException(exception, body);
|
|
79
|
+
};
|
|
80
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
81
|
+
const body = parsedOutput.body;
|
|
82
|
+
const deserialized = _json(body);
|
|
83
|
+
const exception = new ValidationException({
|
|
84
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
85
|
+
...deserialized,
|
|
86
|
+
});
|
|
87
|
+
return __decorateServiceException(exception, body);
|
|
88
|
+
};
|
|
89
|
+
const se_ActiveTimeRange = (input, context) => {
|
|
90
|
+
return take(input, {
|
|
91
|
+
activeAfterInclusive: (_) => _.getTime() / 1000,
|
|
92
|
+
activeBeforeInclusive: (_) => _.getTime() / 1000,
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const se_ListBillingViewsRequest = (input, context) => {
|
|
96
|
+
return take(input, {
|
|
97
|
+
activeTimeRange: (_) => se_ActiveTimeRange(_, context),
|
|
98
|
+
maxResults: [],
|
|
99
|
+
nextToken: [],
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const deserializeMetadata = (output) => ({
|
|
103
|
+
httpStatusCode: output.statusCode,
|
|
104
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
105
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
106
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
107
|
+
});
|
|
108
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
109
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
110
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
111
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
112
|
+
const contents = {
|
|
113
|
+
protocol,
|
|
114
|
+
hostname,
|
|
115
|
+
port,
|
|
116
|
+
method: "POST",
|
|
117
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
118
|
+
headers,
|
|
119
|
+
};
|
|
120
|
+
if (resolvedHostname !== undefined) {
|
|
121
|
+
contents.hostname = resolvedHostname;
|
|
122
|
+
}
|
|
123
|
+
if (body !== undefined) {
|
|
124
|
+
contents.body = body;
|
|
125
|
+
}
|
|
126
|
+
return new __HttpRequest(contents);
|
|
127
|
+
};
|
|
128
|
+
function sharedHeaders(operation) {
|
|
129
|
+
return {
|
|
130
|
+
"content-type": "application/x-amz-json-1.0",
|
|
131
|
+
"x-amz-target": `AWSBilling.${operation}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } 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
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: RequestHandler.create(config?.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 { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
+
import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
|
|
5
|
+
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";
|
|
6
|
+
import { Hash } from "@smithy/hash-node";
|
|
7
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
8
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
11
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
12
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
15
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
16
|
+
export const getRuntimeConfig = (config) => {
|
|
17
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
18
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
19
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
20
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
21
|
+
awsCheckVersion(process.version);
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
28
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
29
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
30
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
32
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
33
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
34
|
+
retryMode: config?.retryMode ??
|
|
35
|
+
loadNodeConfig({
|
|
36
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
37
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
38
|
+
}),
|
|
39
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
40
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
41
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
42
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_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,30 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
4
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
6
|
+
import { defaultBillingHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
7
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
8
|
+
export const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "2023-09-07",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
15
|
+
extensions: config?.extensions ?? [],
|
|
16
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultBillingHttpAuthSchemeProvider,
|
|
17
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
18
|
+
{
|
|
19
|
+
schemeId: "aws.auth#sigv4",
|
|
20
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
21
|
+
signer: new AwsSdkSigV4Signer(),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
25
|
+
serviceId: config?.serviceId ?? "Billing",
|
|
26
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
27
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
28
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
const asPartial = (t) => t;
|
|
6
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
7
|
+
const extensionConfiguration = {
|
|
8
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
12
|
+
};
|
|
13
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
14
|
+
return {
|
|
15
|
+
...runtimeConfig,
|
|
16
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
17
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
18
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { BillingClient } from "./BillingClient";
|
|
3
|
+
import { ListBillingViewsCommandInput, ListBillingViewsCommandOutput } from "./commands/ListBillingViewsCommand";
|
|
4
|
+
export interface Billing {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link ListBillingViewsCommand}
|
|
7
|
+
*/
|
|
8
|
+
listBillingViews(args: ListBillingViewsCommandInput, options?: __HttpHandlerOptions): Promise<ListBillingViewsCommandOutput>;
|
|
9
|
+
listBillingViews(args: ListBillingViewsCommandInput, cb: (err: any, data?: ListBillingViewsCommandOutput) => void): void;
|
|
10
|
+
listBillingViews(args: ListBillingViewsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListBillingViewsCommandOutput) => void): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* <p>
|
|
14
|
+
* You can use the Billing API to programatically list the billing views available to you for a given time period. A billing view represents a set of billing data.
|
|
15
|
+
* </p>
|
|
16
|
+
* <p>The Billing API provides the following endpoint:</p>
|
|
17
|
+
* <p>
|
|
18
|
+
* <code>https://billing.us-east-1.api.aws</code>
|
|
19
|
+
* </p>
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare class Billing extends BillingClient implements Billing {
|
|
23
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
2
|
+
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
3
|
+
import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
4
|
+
import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
|
|
5
|
+
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
6
|
+
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
7
|
+
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
8
|
+
import { AwsCredentialIdentityProvider, 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";
|
|
9
|
+
import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
|
|
10
|
+
import { ListBillingViewsCommandInput, ListBillingViewsCommandOutput } from "./commands/ListBillingViewsCommand";
|
|
11
|
+
import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
|
|
12
|
+
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
13
|
+
export { __Client };
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type ServiceInputTypes = ListBillingViewsCommandInput;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type ServiceOutputTypes = ListBillingViewsCommandOutput;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {
|
|
26
|
+
/**
|
|
27
|
+
* The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.
|
|
28
|
+
*/
|
|
29
|
+
requestHandler?: __HttpHandlerUserInput;
|
|
30
|
+
/**
|
|
31
|
+
* A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface
|
|
32
|
+
* that computes the SHA-256 HMAC or checksum of a string or binary buffer.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
sha256?: __ChecksumConstructor | __HashConstructor;
|
|
36
|
+
/**
|
|
37
|
+
* The function that will be used to convert strings into HTTP endpoints.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
urlParser?: __UrlParser;
|
|
41
|
+
/**
|
|
42
|
+
* A function that can calculate the length of a request body.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
bodyLengthChecker?: __BodyLengthCalculator;
|
|
46
|
+
/**
|
|
47
|
+
* A function that converts a stream into an array of bytes.
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
streamCollector?: __StreamCollector;
|
|
51
|
+
/**
|
|
52
|
+
* The function that will be used to convert a base64-encoded string to a byte array.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
base64Decoder?: __Decoder;
|
|
56
|
+
/**
|
|
57
|
+
* The function that will be used to convert binary data to a base64-encoded string.
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
base64Encoder?: __Encoder;
|
|
61
|
+
/**
|
|
62
|
+
* The function that will be used to convert a UTF8-encoded string to a byte array.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
utf8Decoder?: __Decoder;
|
|
66
|
+
/**
|
|
67
|
+
* The function that will be used to convert binary data to a UTF-8 encoded string.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
utf8Encoder?: __Encoder;
|
|
71
|
+
/**
|
|
72
|
+
* The runtime environment.
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
runtime?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
|
|
78
|
+
* trait of an operation.
|
|
79
|
+
*/
|
|
80
|
+
disableHostPrefix?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Unique service identifier.
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
serviceId?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Enables IPv6/IPv4 dualstack endpoint.
|
|
88
|
+
*/
|
|
89
|
+
useDualstackEndpoint?: boolean | __Provider<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* Enables FIPS compatible endpoints.
|
|
92
|
+
*/
|
|
93
|
+
useFipsEndpoint?: boolean | __Provider<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* The AWS region to which this client will send requests
|
|
96
|
+
*/
|
|
97
|
+
region?: string | __Provider<string>;
|
|
98
|
+
/**
|
|
99
|
+
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
defaultUserAgentProvider?: Provider<__UserAgent>;
|
|
103
|
+
/**
|
|
104
|
+
* Default credentials provider; Not available in browser runtime.
|
|
105
|
+
* @deprecated
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
|
|
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 BillingClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> & HttpAuthSchemeInputConfig & ClientInputEndpointParameters;
|
|
136
|
+
/**
|
|
137
|
+
* @public
|
|
138
|
+
*
|
|
139
|
+
* The configuration interface of BillingClient class constructor that set the region, credentials and other options.
|
|
140
|
+
*/
|
|
141
|
+
export interface BillingClientConfig extends BillingClientConfigType {
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
export type BillingClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> & HttpAuthSchemeResolvedConfig & ClientResolvedEndpointParameters;
|
|
147
|
+
/**
|
|
148
|
+
* @public
|
|
149
|
+
*
|
|
150
|
+
* The resolved configuration interface of BillingClient class. This is resolved and normalized from the {@link BillingClientConfig | constructor configuration interface}.
|
|
151
|
+
*/
|
|
152
|
+
export interface BillingClientResolvedConfig extends BillingClientResolvedConfigType {
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* <p>
|
|
156
|
+
* You can use the Billing API to programatically list the billing views available to you for a given time period. A billing view represents a set of billing data.
|
|
157
|
+
* </p>
|
|
158
|
+
* <p>The Billing API provides the following endpoint:</p>
|
|
159
|
+
* <p>
|
|
160
|
+
* <code>https://billing.us-east-1.api.aws</code>
|
|
161
|
+
* </p>
|
|
162
|
+
* @public
|
|
163
|
+
*/
|
|
164
|
+
export declare class BillingClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, BillingClientResolvedConfig> {
|
|
165
|
+
/**
|
|
166
|
+
* The resolved configuration of BillingClient class. This is resolved and normalized from the {@link BillingClientConfig | constructor configuration interface}.
|
|
167
|
+
*/
|
|
168
|
+
readonly config: BillingClientResolvedConfig;
|
|
169
|
+
constructor(...[configuration]: __CheckOptionalClientConfig<BillingClientConfig>);
|
|
170
|
+
/**
|
|
171
|
+
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
172
|
+
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
173
|
+
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
174
|
+
*/
|
|
175
|
+
destroy(): void;
|
|
176
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
|
|
2
|
+
import { BillingHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface HttpAuthExtensionConfiguration {
|
|
7
|
+
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
|
|
8
|
+
httpAuthSchemes(): HttpAuthScheme[];
|
|
9
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider: BillingHttpAuthSchemeProvider): void;
|
|
10
|
+
httpAuthSchemeProvider(): BillingHttpAuthSchemeProvider;
|
|
11
|
+
setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
|
|
12
|
+
credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export type HttpAuthRuntimeConfig = Partial<{
|
|
18
|
+
httpAuthSchemes: HttpAuthScheme[];
|
|
19
|
+
httpAuthSchemeProvider: BillingHttpAuthSchemeProvider;
|
|
20
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;
|