@aws-sdk/client-account
Version:
AWS SDK for JavaScript Account Client for Node.js, Browser and React Native
1,154 lines (1,081 loc) • 46.1 kB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
AcceptPrimaryEmailUpdateCommand: () => AcceptPrimaryEmailUpdateCommand,
AcceptPrimaryEmailUpdateRequestFilterSensitiveLog: () => AcceptPrimaryEmailUpdateRequestFilterSensitiveLog,
AccessDeniedException: () => AccessDeniedException,
Account: () => Account,
AccountClient: () => AccountClient,
AccountServiceException: () => AccountServiceException,
AlternateContactFilterSensitiveLog: () => AlternateContactFilterSensitiveLog,
AlternateContactType: () => AlternateContactType,
ConflictException: () => ConflictException,
ContactInformationFilterSensitiveLog: () => ContactInformationFilterSensitiveLog,
DeleteAlternateContactCommand: () => DeleteAlternateContactCommand,
DisableRegionCommand: () => DisableRegionCommand,
EnableRegionCommand: () => EnableRegionCommand,
GetAlternateContactCommand: () => GetAlternateContactCommand,
GetAlternateContactResponseFilterSensitiveLog: () => GetAlternateContactResponseFilterSensitiveLog,
GetContactInformationCommand: () => GetContactInformationCommand,
GetContactInformationResponseFilterSensitiveLog: () => GetContactInformationResponseFilterSensitiveLog,
GetPrimaryEmailCommand: () => GetPrimaryEmailCommand,
GetPrimaryEmailResponseFilterSensitiveLog: () => GetPrimaryEmailResponseFilterSensitiveLog,
GetRegionOptStatusCommand: () => GetRegionOptStatusCommand,
InternalServerException: () => InternalServerException,
ListRegionsCommand: () => ListRegionsCommand,
PrimaryEmailUpdateStatus: () => PrimaryEmailUpdateStatus,
PutAlternateContactCommand: () => PutAlternateContactCommand,
PutAlternateContactRequestFilterSensitiveLog: () => PutAlternateContactRequestFilterSensitiveLog,
PutContactInformationCommand: () => PutContactInformationCommand,
PutContactInformationRequestFilterSensitiveLog: () => PutContactInformationRequestFilterSensitiveLog,
RegionOptStatus: () => RegionOptStatus,
ResourceNotFoundException: () => ResourceNotFoundException,
StartPrimaryEmailUpdateCommand: () => StartPrimaryEmailUpdateCommand,
StartPrimaryEmailUpdateRequestFilterSensitiveLog: () => StartPrimaryEmailUpdateRequestFilterSensitiveLog,
TooManyRequestsException: () => TooManyRequestsException,
ValidationException: () => ValidationException,
ValidationExceptionFieldFilterSensitiveLog: () => ValidationExceptionFieldFilterSensitiveLog,
ValidationExceptionReason: () => ValidationExceptionReason,
__Client: () => import_smithy_client.Client,
paginateListRegions: () => paginateListRegions
});
module.exports = __toCommonJS(src_exports);
// src/AccountClient.ts
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
var import_middleware_logger = require("@aws-sdk/middleware-logger");
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
var import_config_resolver = require("@smithy/config-resolver");
var import_core = require("@smithy/core");
var import_middleware_content_length = require("@smithy/middleware-content-length");
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
var import_middleware_retry = require("@smithy/middleware-retry");
var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
// src/endpoint/EndpointParameters.ts
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "account"
};
}, "resolveClientEndpointParameters");
var commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
};
// src/AccountClient.ts
var import_runtimeConfig = require("././runtimeConfig");
// src/runtimeExtensions.ts
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
var import_protocol_http = require("@smithy/protocol-http");
var import_smithy_client = require("@smithy/smithy-client");
// src/auth/httpAuthExtensionConfiguration.ts
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
} else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
}
};
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials()
};
}, "resolveHttpAuthRuntimeConfig");
// src/runtimeExtensions.ts
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...resolveHttpAuthRuntimeConfig(extensionConfiguration)
};
}, "resolveRuntimeExtensions");
// src/AccountClient.ts
var AccountClient = class extends import_smithy_client.Client {
static {
__name(this, "AccountClient");
}
/**
* The resolved configuration of AccountClient class. This is resolved and normalized from the {@link AccountClientConfig | constructor configuration interface}.
*/
config;
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultAccountHttpAuthSchemeParametersProvider,
identityProviderConfigProvider: async (config) => new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials
})
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
}
/**
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
*/
destroy() {
super.destroy();
}
};
// src/Account.ts
// src/commands/AcceptPrimaryEmailUpdateCommand.ts
var import_middleware_serde = require("@smithy/middleware-serde");
// src/models/models_0.ts
// src/models/AccountServiceException.ts
var AccountServiceException = class _AccountServiceException extends import_smithy_client.ServiceException {
static {
__name(this, "AccountServiceException");
}
/**
* @internal
*/
constructor(options) {
super(options);
Object.setPrototypeOf(this, _AccountServiceException.prototype);
}
};
// src/models/models_0.ts
var PrimaryEmailUpdateStatus = {
ACCEPTED: "ACCEPTED",
PENDING: "PENDING"
};
var AccessDeniedException = class _AccessDeniedException extends AccountServiceException {
static {
__name(this, "AccessDeniedException");
}
name = "AccessDeniedException";
$fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
name: "AccessDeniedException",
$fault: "client",
...opts
});
Object.setPrototypeOf(this, _AccessDeniedException.prototype);
}
};
var ConflictException = class _ConflictException extends AccountServiceException {
static {
__name(this, "ConflictException");
}
name = "ConflictException";
$fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
name: "ConflictException",
$fault: "client",
...opts
});
Object.setPrototypeOf(this, _ConflictException.prototype);
}
};
var InternalServerException = class _InternalServerException extends AccountServiceException {
static {
__name(this, "InternalServerException");
}
name = "InternalServerException";
$fault = "server";
$retryable = {};
/**
* @internal
*/
constructor(opts) {
super({
name: "InternalServerException",
$fault: "server",
...opts
});
Object.setPrototypeOf(this, _InternalServerException.prototype);
}
};
var ResourceNotFoundException = class _ResourceNotFoundException extends AccountServiceException {
static {
__name(this, "ResourceNotFoundException");
}
name = "ResourceNotFoundException";
$fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts
});
Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
}
};
var TooManyRequestsException = class _TooManyRequestsException extends AccountServiceException {
static {
__name(this, "TooManyRequestsException");
}
name = "TooManyRequestsException";
$fault = "client";
$retryable = {
throttling: true
};
/**
* @internal
*/
constructor(opts) {
super({
name: "TooManyRequestsException",
$fault: "client",
...opts
});
Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
}
};
var ValidationExceptionReason = {
FIELD_VALIDATION_FAILED: "fieldValidationFailed",
INVALID_REGION_OPT_TARGET: "invalidRegionOptTarget"
};
var ValidationException = class _ValidationException extends AccountServiceException {
static {
__name(this, "ValidationException");
}
name = "ValidationException";
$fault = "client";
/**
* <p>The reason that validation failed.</p>
* @public
*/
reason;
/**
* <p>The field where the invalid entry was detected.</p>
* @public
*/
fieldList;
/**
* @internal
*/
constructor(opts) {
super({
name: "ValidationException",
$fault: "client",
...opts
});
Object.setPrototypeOf(this, _ValidationException.prototype);
this.reason = opts.reason;
this.fieldList = opts.fieldList;
}
};
var AlternateContactType = {
BILLING: "BILLING",
OPERATIONS: "OPERATIONS",
SECURITY: "SECURITY"
};
var RegionOptStatus = {
DISABLED: "DISABLED",
DISABLING: "DISABLING",
ENABLED: "ENABLED",
ENABLED_BY_DEFAULT: "ENABLED_BY_DEFAULT",
ENABLING: "ENABLING"
};
var AcceptPrimaryEmailUpdateRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.PrimaryEmail && { PrimaryEmail: import_smithy_client.SENSITIVE_STRING },
...obj.Otp && { Otp: import_smithy_client.SENSITIVE_STRING }
}), "AcceptPrimaryEmailUpdateRequestFilterSensitiveLog");
var ValidationExceptionFieldFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.message && { message: import_smithy_client.SENSITIVE_STRING }
}), "ValidationExceptionFieldFilterSensitiveLog");
var AlternateContactFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.Name && { Name: import_smithy_client.SENSITIVE_STRING },
...obj.Title && { Title: import_smithy_client.SENSITIVE_STRING },
...obj.EmailAddress && { EmailAddress: import_smithy_client.SENSITIVE_STRING },
...obj.PhoneNumber && { PhoneNumber: import_smithy_client.SENSITIVE_STRING }
}), "AlternateContactFilterSensitiveLog");
var GetAlternateContactResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.AlternateContact && { AlternateContact: AlternateContactFilterSensitiveLog(obj.AlternateContact) }
}), "GetAlternateContactResponseFilterSensitiveLog");
var PutAlternateContactRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.Name && { Name: import_smithy_client.SENSITIVE_STRING },
...obj.Title && { Title: import_smithy_client.SENSITIVE_STRING },
...obj.EmailAddress && { EmailAddress: import_smithy_client.SENSITIVE_STRING },
...obj.PhoneNumber && { PhoneNumber: import_smithy_client.SENSITIVE_STRING }
}), "PutAlternateContactRequestFilterSensitiveLog");
var ContactInformationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.FullName && { FullName: import_smithy_client.SENSITIVE_STRING },
...obj.AddressLine1 && { AddressLine1: import_smithy_client.SENSITIVE_STRING },
...obj.AddressLine2 && { AddressLine2: import_smithy_client.SENSITIVE_STRING },
...obj.AddressLine3 && { AddressLine3: import_smithy_client.SENSITIVE_STRING },
...obj.City && { City: import_smithy_client.SENSITIVE_STRING },
...obj.StateOrRegion && { StateOrRegion: import_smithy_client.SENSITIVE_STRING },
...obj.DistrictOrCounty && { DistrictOrCounty: import_smithy_client.SENSITIVE_STRING },
...obj.PostalCode && { PostalCode: import_smithy_client.SENSITIVE_STRING },
...obj.CountryCode && { CountryCode: import_smithy_client.SENSITIVE_STRING },
...obj.PhoneNumber && { PhoneNumber: import_smithy_client.SENSITIVE_STRING },
...obj.CompanyName && { CompanyName: import_smithy_client.SENSITIVE_STRING },
...obj.WebsiteUrl && { WebsiteUrl: import_smithy_client.SENSITIVE_STRING }
}), "ContactInformationFilterSensitiveLog");
var GetContactInformationResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.ContactInformation && { ContactInformation: ContactInformationFilterSensitiveLog(obj.ContactInformation) }
}), "GetContactInformationResponseFilterSensitiveLog");
var PutContactInformationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.ContactInformation && { ContactInformation: ContactInformationFilterSensitiveLog(obj.ContactInformation) }
}), "PutContactInformationRequestFilterSensitiveLog");
var GetPrimaryEmailResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.PrimaryEmail && { PrimaryEmail: import_smithy_client.SENSITIVE_STRING }
}), "GetPrimaryEmailResponseFilterSensitiveLog");
var StartPrimaryEmailUpdateRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.PrimaryEmail && { PrimaryEmail: import_smithy_client.SENSITIVE_STRING }
}), "StartPrimaryEmailUpdateRequestFilterSensitiveLog");
// src/protocols/Aws_restJson1.ts
var import_core2 = require("@aws-sdk/core");
var se_AcceptPrimaryEmailUpdateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/acceptPrimaryEmailUpdate");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
Otp: [],
PrimaryEmail: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_AcceptPrimaryEmailUpdateCommand");
var se_DeleteAlternateContactCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/deleteAlternateContact");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
AlternateContactType: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_DeleteAlternateContactCommand");
var se_DisableRegionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/disableRegion");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
RegionName: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_DisableRegionCommand");
var se_EnableRegionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/enableRegion");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
RegionName: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_EnableRegionCommand");
var se_GetAlternateContactCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/getAlternateContact");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
AlternateContactType: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetAlternateContactCommand");
var se_GetContactInformationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/getContactInformation");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetContactInformationCommand");
var se_GetPrimaryEmailCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/getPrimaryEmail");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetPrimaryEmailCommand");
var se_GetRegionOptStatusCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/getRegionOptStatus");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
RegionName: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetRegionOptStatusCommand");
var se_ListRegionsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/listRegions");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
MaxResults: [],
NextToken: [],
RegionOptStatusContains: (_) => (0, import_smithy_client._json)(_)
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_ListRegionsCommand");
var se_PutAlternateContactCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/putAlternateContact");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
AlternateContactType: [],
EmailAddress: [],
Name: [],
PhoneNumber: [],
Title: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_PutAlternateContactCommand");
var se_PutContactInformationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/putContactInformation");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
ContactInformation: (_) => (0, import_smithy_client._json)(_)
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_PutContactInformationCommand");
var se_StartPrimaryEmailUpdateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json"
};
b.bp("/startPrimaryEmailUpdate");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AccountId: [],
PrimaryEmail: []
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_StartPrimaryEmailUpdateCommand");
var de_AcceptPrimaryEmailUpdateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
Status: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
}, "de_AcceptPrimaryEmailUpdateCommand");
var de_DeleteAlternateContactCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteAlternateContactCommand");
var de_DisableRegionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisableRegionCommand");
var de_EnableRegionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_EnableRegionCommand");
var de_GetAlternateContactCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
AlternateContact: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
}, "de_GetAlternateContactCommand");
var de_GetContactInformationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
ContactInformation: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
}, "de_GetContactInformationCommand");
var de_GetPrimaryEmailCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
PrimaryEmail: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
}, "de_GetPrimaryEmailCommand");
var de_GetRegionOptStatusCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
RegionName: import_smithy_client.expectString,
RegionOptStatus: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
}, "de_GetRegionOptStatusCommand");
var de_ListRegionsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
Regions: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
}, "de_ListRegionsCommand");
var de_PutAlternateContactCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_PutAlternateContactCommand");
var de_PutContactInformationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_PutContactInformationCommand");
var de_StartPrimaryEmailUpdateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
Status: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
}, "de_StartPrimaryEmailUpdateCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
};
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
switch (errorCode) {
case "AccessDeniedException":
case "com.amazonaws.account#AccessDeniedException":
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
case "ConflictException":
case "com.amazonaws.account#ConflictException":
throw await de_ConflictExceptionRes(parsedOutput, context);
case "InternalServerException":
case "com.amazonaws.account#InternalServerException":
throw await de_InternalServerExceptionRes(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.account#ResourceNotFoundException":
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
case "TooManyRequestsException":
case "com.amazonaws.account#TooManyRequestsException":
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
case "ValidationException":
case "com.amazonaws.account#ValidationException":
throw await de_ValidationExceptionRes(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody,
errorCode
});
}
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(AccountServiceException);
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new AccessDeniedException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_AccessDeniedExceptionRes");
var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new ConflictException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ConflictExceptionRes");
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new InternalServerException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InternalServerExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new ResourceNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new TooManyRequestsException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
fieldList: import_smithy_client._json,
message: import_smithy_client.expectString,
reason: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new ValidationException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ValidationExceptionRes");
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
httpStatusCode: output.statusCode,
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"]
}), "deserializeMetadata");
// src/commands/AcceptPrimaryEmailUpdateCommand.ts
var AcceptPrimaryEmailUpdateCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "AcceptPrimaryEmailUpdate", {}).n("AccountClient", "AcceptPrimaryEmailUpdateCommand").f(AcceptPrimaryEmailUpdateRequestFilterSensitiveLog, void 0).ser(se_AcceptPrimaryEmailUpdateCommand).de(de_AcceptPrimaryEmailUpdateCommand).build() {
static {
__name(this, "AcceptPrimaryEmailUpdateCommand");
}
};
// src/commands/DeleteAlternateContactCommand.ts
var DeleteAlternateContactCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "DeleteAlternateContact", {}).n("AccountClient", "DeleteAlternateContactCommand").f(void 0, void 0).ser(se_DeleteAlternateContactCommand).de(de_DeleteAlternateContactCommand).build() {
static {
__name(this, "DeleteAlternateContactCommand");
}
};
// src/commands/DisableRegionCommand.ts
var DisableRegionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "DisableRegion", {}).n("AccountClient", "DisableRegionCommand").f(void 0, void 0).ser(se_DisableRegionCommand).de(de_DisableRegionCommand).build() {
static {
__name(this, "DisableRegionCommand");
}
};
// src/commands/EnableRegionCommand.ts
var EnableRegionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "EnableRegion", {}).n("AccountClient", "EnableRegionCommand").f(void 0, void 0).ser(se_EnableRegionCommand).de(de_EnableRegionCommand).build() {
static {
__name(this, "EnableRegionCommand");
}
};
// src/commands/GetAlternateContactCommand.ts
var GetAlternateContactCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "GetAlternateContact", {}).n("AccountClient", "GetAlternateContactCommand").f(void 0, GetAlternateContactResponseFilterSensitiveLog).ser(se_GetAlternateContactCommand).de(de_GetAlternateContactCommand).build() {
static {
__name(this, "GetAlternateContactCommand");
}
};
// src/commands/GetContactInformationCommand.ts
var GetContactInformationCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "GetContactInformation", {}).n("AccountClient", "GetContactInformationCommand").f(void 0, GetContactInformationResponseFilterSensitiveLog).ser(se_GetContactInformationCommand).de(de_GetContactInformationCommand).build() {
static {
__name(this, "GetContactInformationCommand");
}
};
// src/commands/GetPrimaryEmailCommand.ts
var GetPrimaryEmailCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "GetPrimaryEmail", {}).n("AccountClient", "GetPrimaryEmailCommand").f(void 0, GetPrimaryEmailResponseFilterSensitiveLog).ser(se_GetPrimaryEmailCommand).de(de_GetPrimaryEmailCommand).build() {
static {
__name(this, "GetPrimaryEmailCommand");
}
};
// src/commands/GetRegionOptStatusCommand.ts
var GetRegionOptStatusCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "GetRegionOptStatus", {}).n("AccountClient", "GetRegionOptStatusCommand").f(void 0, void 0).ser(se_GetRegionOptStatusCommand).de(de_GetRegionOptStatusCommand).build() {
static {
__name(this, "GetRegionOptStatusCommand");
}
};
// src/commands/ListRegionsCommand.ts
var ListRegionsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "ListRegions", {}).n("AccountClient", "ListRegionsCommand").f(void 0, void 0).ser(se_ListRegionsCommand).de(de_ListRegionsCommand).build() {
static {
__name(this, "ListRegionsCommand");
}
};
// src/commands/PutAlternateContactCommand.ts
var PutAlternateContactCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "PutAlternateContact", {}).n("AccountClient", "PutAlternateContactCommand").f(PutAlternateContactRequestFilterSensitiveLog, void 0).ser(se_PutAlternateContactCommand).de(de_PutAlternateContactCommand).build() {
static {
__name(this, "PutAlternateContactCommand");
}
};
// src/commands/PutContactInformationCommand.ts
var PutContactInformationCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "PutContactInformation", {}).n("AccountClient", "PutContactInformationCommand").f(PutContactInformationRequestFilterSensitiveLog, void 0).ser(se_PutContactInformationCommand).de(de_PutContactInformationCommand).build() {
static {
__name(this, "PutContactInformationCommand");
}
};
// src/commands/StartPrimaryEmailUpdateCommand.ts
var StartPrimaryEmailUpdateCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("Account", "StartPrimaryEmailUpdate", {}).n("AccountClient", "StartPrimaryEmailUpdateCommand").f(StartPrimaryEmailUpdateRequestFilterSensitiveLog, void 0).ser(se_StartPrimaryEmailUpdateCommand).de(de_StartPrimaryEmailUpdateCommand).build() {
static {
__name(this, "StartPrimaryEmailUpdateCommand");
}
};
// src/Account.ts
var commands = {
AcceptPrimaryEmailUpdateCommand,
DeleteAlternateContactCommand,
DisableRegionCommand,
EnableRegionCommand,
GetAlternateContactCommand,
GetContactInformationCommand,
GetPrimaryEmailCommand,
GetRegionOptStatusCommand,
ListRegionsCommand,
PutAlternateContactCommand,
PutContactInformationCommand,
StartPrimaryEmailUpdateCommand
};
var Account = class extends AccountClient {
static {
__name(this, "Account");
}
};
(0, import_smithy_client.createAggregatedClient)(commands, Account);
// src/pagination/ListRegionsPaginator.ts
var paginateListRegions = (0, import_core.createPaginator)(AccountClient, ListRegionsCommand, "NextToken", "NextToken", "MaxResults");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AccountServiceException,
__Client,
AccountClient,
Account,
$Command,
AcceptPrimaryEmailUpdateCommand,
DeleteAlternateContactCommand,
DisableRegionCommand,
EnableRegionCommand,
GetAlternateContactCommand,
GetContactInformationCommand,
GetPrimaryEmailCommand,
GetRegionOptStatusCommand,
ListRegionsCommand,
PutAlternateContactCommand,
PutContactInformationCommand,
StartPrimaryEmailUpdateCommand,
paginateListRegions,
PrimaryEmailUpdateStatus,
AccessDeniedException,
ConflictException,
InternalServerException,
ResourceNotFoundException,
TooManyRequestsException,
ValidationExceptionReason,
ValidationException,
AlternateContactType,
RegionOptStatus,
AcceptPrimaryEmailUpdateRequestFilterSensitiveLog,
ValidationExceptionFieldFilterSensitiveLog,
AlternateContactFilterSensitiveLog,
GetAlternateContactResponseFilterSensitiveLog,
PutAlternateContactRequestFilterSensitiveLog,
ContactInformationFilterSensitiveLog,
GetContactInformationResponseFilterSensitiveLog,
PutContactInformationRequestFilterSensitiveLog,
GetPrimaryEmailResponseFilterSensitiveLog,
StartPrimaryEmailUpdateRequestFilterSensitiveLog
});