@aws-sdk/client-iot
Version:
AWS SDK for JavaScript Iot Client for Node.js, Browser and React Native
1,394 lines • 332 kB
JavaScript
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
import { requestBuilder as rb } from "@smithy/core";
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, serializeDateTime as __serializeDateTime, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
import { v4 as generateIdempotencyToken } from "uuid";
import { IoTServiceException as __BaseException } from "../models/IoTServiceException";
import { CertificateValidationException, ConflictException, ConflictingResourceUpdateException, IndexNotReadyException, InternalException, InternalFailureException, InternalServerException, InvalidAggregationException, InvalidQueryException, InvalidRequestException, InvalidStateTransitionException, LimitExceededException, MalformedPolicyException, ResourceAlreadyExistsException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, SqlParseException, ThrottlingException, TransferAlreadyCompletedException, UnauthorizedException, ValidationException, VersionConflictException, VersionsLimitExceededException, } from "../models/models_0";
import { CertificateStateException, DeleteConflictException, NotConfiguredException, } from "../models/models_1";
import { CertificateConflictException, InvalidResponseException, RegistrationCodeValidationException, ResourceRegistrationFailureException, TaskAlreadyExistsException, TransferConflictException, } from "../models/models_2";
export const se_AcceptCertificateTransferCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/accept-certificate-transfer/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
const query = map({
[_sAA]: [() => input.setAsActive !== void 0, () => input[_sAA].toString()],
});
let body;
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
};
export const se_AddThingToBillingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/billing-groups/addThingToBillingGroup");
let body;
body = JSON.stringify(take(input, {
billingGroupArn: [],
billingGroupName: [],
thingArn: [],
thingName: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_AddThingToThingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/thing-groups/addThingToThingGroup");
let body;
body = JSON.stringify(take(input, {
overrideDynamicGroups: [],
thingArn: [],
thingGroupArn: [],
thingGroupName: [],
thingName: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_AssociateSbomWithPackageVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/packages/{packageName}/versions/{versionName}/sbom");
b.p("packageName", () => input.packageName, "{packageName}", false);
b.p("versionName", () => input.versionName, "{versionName}", false);
const query = map({
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
});
let body;
body = JSON.stringify(take(input, {
sbom: (_) => _json(_),
}));
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_AssociateTargetsWithJobCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/jobs/{jobId}/targets");
b.p("jobId", () => input.jobId, "{jobId}", false);
const query = map({
[_nI]: [, input[_nI]],
});
let body;
body = JSON.stringify(take(input, {
comment: [],
targets: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_AttachPolicyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/target-policies/{policyName}");
b.p("policyName", () => input.policyName, "{policyName}", false);
let body;
body = JSON.stringify(take(input, {
target: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_AttachPrincipalPolicyCommand = async (input, context) => {
const b = rb(input, context);
const headers = map({}, isSerializableHeaderValue, {
[_xaip]: input[_p],
});
b.bp("/principal-policies/{policyName}");
b.p("policyName", () => input.policyName, "{policyName}", false);
let body;
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_AttachSecurityProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/security-profiles/{securityProfileName}/targets");
b.p("securityProfileName", () => input.securityProfileName, "{securityProfileName}", false);
const query = map({
[_sPTA]: [, __expectNonNull(input[_sPTA], `securityProfileTargetArn`)],
});
let body;
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_AttachThingPrincipalCommand = async (input, context) => {
const b = rb(input, context);
const headers = map({}, isSerializableHeaderValue, {
[_xap]: input[_p],
});
b.bp("/things/{thingName}/principals");
b.p("thingName", () => input.thingName, "{thingName}", false);
const query = map({
[_tPT]: [, input[_tPT]],
});
let body;
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_CancelAuditMitigationActionsTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/mitigationactions/tasks/{taskId}/cancel");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CancelAuditTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/tasks/{taskId}/cancel");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CancelCertificateTransferCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/cancel-certificate-transfer/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
let body;
b.m("PATCH").h(headers).b(body);
return b.build();
};
export const se_CancelDetectMitigationActionsTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/detect/mitigationactions/tasks/{taskId}/cancel");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CancelJobCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/jobs/{jobId}/cancel");
b.p("jobId", () => input.jobId, "{jobId}", false);
const query = map({
[_f]: [() => input.force !== void 0, () => input[_f].toString()],
});
let body;
body = JSON.stringify(take(input, {
comment: [],
reasonCode: [],
}));
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_CancelJobExecutionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/things/{thingName}/jobs/{jobId}/cancel");
b.p("jobId", () => input.jobId, "{jobId}", false);
b.p("thingName", () => input.thingName, "{thingName}", false);
const query = map({
[_f]: [() => input.force !== void 0, () => input[_f].toString()],
});
let body;
body = JSON.stringify(take(input, {
expectedVersion: [],
statusDetails: (_) => _json(_),
}));
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_ClearDefaultAuthorizerCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/default-authorizer");
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_ConfirmTopicRuleDestinationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/confirmdestination/{confirmationToken+}");
b.p("confirmationToken", () => input.confirmationToken, "{confirmationToken+}", true);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_CreateAuditSuppressionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/audit/suppressions/create");
let body;
body = JSON.stringify(take(input, {
checkName: [],
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
description: [],
expirationDate: (_) => _.getTime() / 1_000,
resourceIdentifier: (_) => _json(_),
suppressIndefinitely: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateAuthorizerCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/authorizer/{authorizerName}");
b.p("authorizerName", () => input.authorizerName, "{authorizerName}", false);
let body;
body = JSON.stringify(take(input, {
authorizerFunctionArn: [],
enableCachingForHttp: [],
signingDisabled: [],
status: [],
tags: (_) => _json(_),
tokenKeyName: [],
tokenSigningPublicKeys: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateBillingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/billing-groups/{billingGroupName}");
b.p("billingGroupName", () => input.billingGroupName, "{billingGroupName}", false);
let body;
body = JSON.stringify(take(input, {
billingGroupProperties: (_) => _json(_),
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateCertificateFromCsrCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/certificates");
const query = map({
[_sAA]: [() => input.setAsActive !== void 0, () => input[_sAA].toString()],
});
let body;
body = JSON.stringify(take(input, {
certificateSigningRequest: [],
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_CreateCertificateProviderCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/certificate-providers/{certificateProviderName}");
b.p("certificateProviderName", () => input.certificateProviderName, "{certificateProviderName}", false);
let body;
body = JSON.stringify(take(input, {
accountDefaultForOperations: (_) => _json(_),
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
lambdaFunctionArn: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateCommandCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/commands/{commandId}");
b.p("commandId", () => input.commandId, "{commandId}", false);
let body;
body = JSON.stringify(take(input, {
description: [],
displayName: [],
mandatoryParameters: (_) => se_CommandParameterList(_, context),
namespace: [],
payload: (_) => se_CommandPayload(_, context),
roleArn: [],
tags: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CreateCustomMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/custom-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
let body;
body = JSON.stringify(take(input, {
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
displayName: [],
metricType: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateDimensionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/dimensions/{name}");
b.p("name", () => input.name, "{name}", false);
let body;
body = JSON.stringify(take(input, {
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
stringValues: (_) => _json(_),
tags: (_) => _json(_),
type: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateDomainConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/domainConfigurations/{domainConfigurationName}");
b.p("domainConfigurationName", () => input.domainConfigurationName, "{domainConfigurationName}", false);
let body;
body = JSON.stringify(take(input, {
applicationProtocol: [],
authenticationType: [],
authorizerConfig: (_) => _json(_),
clientCertificateConfig: (_) => _json(_),
domainName: [],
serverCertificateArns: (_) => _json(_),
serverCertificateConfig: (_) => _json(_),
serviceType: [],
tags: (_) => _json(_),
tlsConfig: (_) => _json(_),
validationCertificateArn: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateDynamicThingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/dynamic-thing-groups/{thingGroupName}");
b.p("thingGroupName", () => input.thingGroupName, "{thingGroupName}", false);
let body;
body = JSON.stringify(take(input, {
indexName: [],
queryString: [],
queryVersion: [],
tags: (_) => _json(_),
thingGroupProperties: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateFleetMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fleet-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
let body;
body = JSON.stringify(take(input, {
aggregationField: [],
aggregationType: (_) => _json(_),
description: [],
indexName: [],
period: [],
queryString: [],
queryVersion: [],
tags: (_) => _json(_),
unit: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CreateJobCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/jobs/{jobId}");
b.p("jobId", () => input.jobId, "{jobId}", false);
let body;
body = JSON.stringify(take(input, {
abortConfig: (_) => se_AbortConfig(_, context),
description: [],
destinationPackageVersions: (_) => _json(_),
document: [],
documentParameters: (_) => _json(_),
documentSource: [],
jobExecutionsRetryConfig: (_) => _json(_),
jobExecutionsRolloutConfig: (_) => se_JobExecutionsRolloutConfig(_, context),
jobTemplateArn: [],
namespaceId: [],
presignedUrlConfig: (_) => _json(_),
schedulingConfig: (_) => _json(_),
tags: (_) => _json(_),
targetSelection: [],
targets: (_) => _json(_),
timeoutConfig: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CreateJobTemplateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/job-templates/{jobTemplateId}");
b.p("jobTemplateId", () => input.jobTemplateId, "{jobTemplateId}", false);
let body;
body = JSON.stringify(take(input, {
abortConfig: (_) => se_AbortConfig(_, context),
description: [],
destinationPackageVersions: (_) => _json(_),
document: [],
documentSource: [],
jobArn: [],
jobExecutionsRetryConfig: (_) => _json(_),
jobExecutionsRolloutConfig: (_) => se_JobExecutionsRolloutConfig(_, context),
maintenanceWindows: (_) => _json(_),
presignedUrlConfig: (_) => _json(_),
tags: (_) => _json(_),
timeoutConfig: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_CreateKeysAndCertificateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/keys-and-certificate");
const query = map({
[_sAA]: [() => input.setAsActive !== void 0, () => input[_sAA].toString()],
});
let body;
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_CreateMitigationActionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/mitigationactions/actions/{actionName}");
b.p("actionName", () => input.actionName, "{actionName}", false);
let body;
body = JSON.stringify(take(input, {
actionParams: (_) => _json(_),
roleArn: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateOTAUpdateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/otaUpdates/{otaUpdateId}");
b.p("otaUpdateId", () => input.otaUpdateId, "{otaUpdateId}", false);
let body;
body = JSON.stringify(take(input, {
additionalParameters: (_) => _json(_),
awsJobAbortConfig: (_) => se_AwsJobAbortConfig(_, context),
awsJobExecutionsRolloutConfig: (_) => se_AwsJobExecutionsRolloutConfig(_, context),
awsJobPresignedUrlConfig: (_) => _json(_),
awsJobTimeoutConfig: (_) => _json(_),
description: [],
files: (_) => se_OTAUpdateFiles(_, context),
protocols: (_) => _json(_),
roleArn: [],
tags: (_) => _json(_),
targetSelection: [],
targets: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreatePackageCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/packages/{packageName}");
b.p("packageName", () => input.packageName, "{packageName}", false);
const query = map({
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
});
let body;
body = JSON.stringify(take(input, {
description: [],
tags: (_) => _json(_),
}));
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_CreatePackageVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/packages/{packageName}/versions/{versionName}");
b.p("packageName", () => input.packageName, "{packageName}", false);
b.p("versionName", () => input.versionName, "{versionName}", false);
const query = map({
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
});
let body;
body = JSON.stringify(take(input, {
artifact: (_) => _json(_),
attributes: (_) => _json(_),
description: [],
recipe: [],
tags: (_) => _json(_),
}));
b.m("PUT").h(headers).q(query).b(body);
return b.build();
};
export const se_CreatePolicyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/policies/{policyName}");
b.p("policyName", () => input.policyName, "{policyName}", false);
let body;
body = JSON.stringify(take(input, {
policyDocument: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreatePolicyVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/policies/{policyName}/version");
b.p("policyName", () => input.policyName, "{policyName}", false);
const query = map({
[_sAD]: [() => input.setAsDefault !== void 0, () => input[_sAD].toString()],
});
let body;
body = JSON.stringify(take(input, {
policyDocument: [],
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_CreateProvisioningClaimCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/provisioning-templates/{templateName}/provisioning-claim");
b.p("templateName", () => input.templateName, "{templateName}", false);
let body;
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateProvisioningTemplateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/provisioning-templates");
let body;
body = JSON.stringify(take(input, {
description: [],
enabled: [],
preProvisioningHook: (_) => _json(_),
provisioningRoleArn: [],
tags: (_) => _json(_),
templateBody: [],
templateName: [],
type: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateProvisioningTemplateVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/provisioning-templates/{templateName}/versions");
b.p("templateName", () => input.templateName, "{templateName}", false);
const query = map({
[_sAD]: [() => input.setAsDefault !== void 0, () => input[_sAD].toString()],
});
let body;
body = JSON.stringify(take(input, {
templateBody: [],
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_CreateRoleAliasCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/role-aliases/{roleAlias}");
b.p("roleAlias", () => input.roleAlias, "{roleAlias}", false);
let body;
body = JSON.stringify(take(input, {
credentialDurationSeconds: [],
roleArn: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateScheduledAuditCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/audit/scheduledaudits/{scheduledAuditName}");
b.p("scheduledAuditName", () => input.scheduledAuditName, "{scheduledAuditName}", false);
let body;
body = JSON.stringify(take(input, {
dayOfMonth: [],
dayOfWeek: [],
frequency: [],
tags: (_) => _json(_),
targetCheckNames: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateSecurityProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/security-profiles/{securityProfileName}");
b.p("securityProfileName", () => input.securityProfileName, "{securityProfileName}", false);
let body;
body = JSON.stringify(take(input, {
additionalMetricsToRetain: (_) => _json(_),
additionalMetricsToRetainV2: (_) => _json(_),
alertTargets: (_) => _json(_),
behaviors: (_) => se_Behaviors(_, context),
metricsExportConfig: (_) => _json(_),
securityProfileDescription: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateStreamCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/streams/{streamId}");
b.p("streamId", () => input.streamId, "{streamId}", false);
let body;
body = JSON.stringify(take(input, {
description: [],
files: (_) => _json(_),
roleArn: [],
tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateThingCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/things/{thingName}");
b.p("thingName", () => input.thingName, "{thingName}", false);
let body;
body = JSON.stringify(take(input, {
attributePayload: (_) => _json(_),
billingGroupName: [],
thingTypeName: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateThingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/thing-groups/{thingGroupName}");
b.p("thingGroupName", () => input.thingGroupName, "{thingGroupName}", false);
let body;
body = JSON.stringify(take(input, {
parentGroupName: [],
tags: (_) => _json(_),
thingGroupProperties: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateThingTypeCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/thing-types/{thingTypeName}");
b.p("thingTypeName", () => input.thingTypeName, "{thingTypeName}", false);
let body;
body = JSON.stringify(take(input, {
tags: (_) => _json(_),
thingTypeProperties: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateTopicRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xat]: input[_t],
});
b.bp("/rules/{ruleName}");
b.p("ruleName", () => input.ruleName, "{ruleName}", false);
let body;
if (input.topicRulePayload !== undefined) {
body = _json(input.topicRulePayload);
}
if (body === undefined) {
body = {};
}
body = JSON.stringify(body);
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateTopicRuleDestinationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/destinations");
let body;
body = JSON.stringify(take(input, {
destinationConfiguration: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_DeleteAccountAuditConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/configuration");
const query = map({
[_dSA]: [() => input.deleteScheduledAudits !== void 0, () => input[_dSA].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteAuditSuppressionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/audit/suppressions/delete");
let body;
body = JSON.stringify(take(input, {
checkName: [],
resourceIdentifier: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_DeleteAuthorizerCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/authorizer/{authorizerName}");
b.p("authorizerName", () => input.authorizerName, "{authorizerName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteBillingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/billing-groups/{billingGroupName}");
b.p("billingGroupName", () => input.billingGroupName, "{billingGroupName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteCACertificateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/cacertificate/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteCertificateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/certificates/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
const query = map({
[_fD]: [() => input.forceDelete !== void 0, () => input[_fD].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteCertificateProviderCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/certificate-providers/{certificateProviderName}");
b.p("certificateProviderName", () => input.certificateProviderName, "{certificateProviderName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteCommandCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/commands/{commandId}");
b.p("commandId", () => input.commandId, "{commandId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteCommandExecutionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/command-executions/{executionId}");
b.p("executionId", () => input.executionId, "{executionId}", false);
const query = map({
[_tA]: [, __expectNonNull(input[_tA], `targetArn`)],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteCustomMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/custom-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteDimensionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/dimensions/{name}");
b.p("name", () => input.name, "{name}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteDomainConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/domainConfigurations/{domainConfigurationName}");
b.p("domainConfigurationName", () => input.domainConfigurationName, "{domainConfigurationName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteDynamicThingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/dynamic-thing-groups/{thingGroupName}");
b.p("thingGroupName", () => input.thingGroupName, "{thingGroupName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteFleetMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/fleet-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteJobCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/jobs/{jobId}");
b.p("jobId", () => input.jobId, "{jobId}", false);
const query = map({
[_f]: [() => input.force !== void 0, () => input[_f].toString()],
[_nI]: [, input[_nI]],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteJobExecutionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/things/{thingName}/jobs/{jobId}/executionNumber/{executionNumber}");
b.p("jobId", () => input.jobId, "{jobId}", false);
b.p("thingName", () => input.thingName, "{thingName}", false);
b.p("executionNumber", () => input.executionNumber.toString(), "{executionNumber}", false);
const query = map({
[_f]: [() => input.force !== void 0, () => input[_f].toString()],
[_nI]: [, input[_nI]],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteJobTemplateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/job-templates/{jobTemplateId}");
b.p("jobTemplateId", () => input.jobTemplateId, "{jobTemplateId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteMitigationActionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/mitigationactions/actions/{actionName}");
b.p("actionName", () => input.actionName, "{actionName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteOTAUpdateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/otaUpdates/{otaUpdateId}");
b.p("otaUpdateId", () => input.otaUpdateId, "{otaUpdateId}", false);
const query = map({
[_dS]: [() => input.deleteStream !== void 0, () => input[_dS].toString()],
[_fDAWSJ]: [() => input.forceDeleteAWSJob !== void 0, () => input[_fDAWSJ].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeletePackageCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/packages/{packageName}");
b.p("packageName", () => input.packageName, "{packageName}", false);
const query = map({
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeletePackageVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/packages/{packageName}/versions/{versionName}");
b.p("packageName", () => input.packageName, "{packageName}", false);
b.p("versionName", () => input.versionName, "{versionName}", false);
const query = map({
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeletePolicyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/policies/{policyName}");
b.p("policyName", () => input.policyName, "{policyName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeletePolicyVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/policies/{policyName}/version/{policyVersionId}");
b.p("policyName", () => input.policyName, "{policyName}", false);
b.p("policyVersionId", () => input.policyVersionId, "{policyVersionId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteProvisioningTemplateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/provisioning-templates/{templateName}");
b.p("templateName", () => input.templateName, "{templateName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteProvisioningTemplateVersionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/provisioning-templates/{templateName}/versions/{versionId}");
b.p("templateName", () => input.templateName, "{templateName}", false);
b.p("versionId", () => input.versionId.toString(), "{versionId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteRegistrationCodeCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/registrationcode");
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteRoleAliasCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/role-aliases/{roleAlias}");
b.p("roleAlias", () => input.roleAlias, "{roleAlias}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteScheduledAuditCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/scheduledaudits/{scheduledAuditName}");
b.p("scheduledAuditName", () => input.scheduledAuditName, "{scheduledAuditName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteSecurityProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/security-profiles/{securityProfileName}");
b.p("securityProfileName", () => input.securityProfileName, "{securityProfileName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteStreamCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/streams/{streamId}");
b.p("streamId", () => input.streamId, "{streamId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteThingCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/things/{thingName}");
b.p("thingName", () => input.thingName, "{thingName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteThingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/thing-groups/{thingGroupName}");
b.p("thingGroupName", () => input.thingGroupName, "{thingGroupName}", false);
const query = map({
[_eV]: [() => input.expectedVersion !== void 0, () => input[_eV].toString()],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteThingTypeCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/thing-types/{thingTypeName}");
b.p("thingTypeName", () => input.thingTypeName, "{thingTypeName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteTopicRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/rules/{ruleName}");
b.p("ruleName", () => input.ruleName, "{ruleName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteTopicRuleDestinationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/destinations/{arn+}");
b.p("arn", () => input.arn, "{arn+}", true);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteV2LoggingLevelCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/v2LoggingLevel");
const query = map({
[_tT]: [, __expectNonNull(input[_tT], `targetType`)],
[_tN]: [, __expectNonNull(input[_tN], `targetName`)],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};
export const se_DeprecateThingTypeCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/thing-types/{thingTypeName}/deprecate");
b.p("thingTypeName", () => input.thingTypeName, "{thingTypeName}", false);
let body;
body = JSON.stringify(take(input, {
undoDeprecate: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_DescribeAccountAuditConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/configuration");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeAuditFindingCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/findings/{findingId}");
b.p("findingId", () => input.findingId, "{findingId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeAuditMitigationActionsTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/mitigationactions/tasks/{taskId}");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeAuditSuppressionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/audit/suppressions/describe");
let body;
body = JSON.stringify(take(input, {
checkName: [],
resourceIdentifier: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_DescribeAuditTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/audit/tasks/{taskId}");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeAuthorizerCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/authorizer/{authorizerName}");
b.p("authorizerName", () => input.authorizerName, "{authorizerName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeBillingGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/billing-groups/{billingGroupName}");
b.p("billingGroupName", () => input.billingGroupName, "{billingGroupName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeCACertificateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/cacertificate/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeCertificateCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/certificates/{certificateId}");
b.p("certificateId", () => input.certificateId, "{certificateId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeCertificateProviderCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/certificate-providers/{certificateProviderName}");
b.p("certificateProviderName", () => input.certificateProviderName, "{certificateProviderName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeCustomMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/custom-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeDefaultAuthorizerCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/default-authorizer");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeDetectMitigationActionsTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/detect/mitigationactions/tasks/{taskId}");
b.p("taskId", () => input.taskId, "{taskId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeDimensionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/dimensions/{name}");
b.p("name", () => input.name, "{name}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeDomainConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/domainConfigurations/{domainConfigurationName}");
b.p("domainConfigurationName", () => input.domainConfigurationName, "{domainConfigurationName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeEndpointCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/endpoint");
const query = map({
[_eT]: [, input[_eT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_DescribeEventConfigurationsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/event-configurations");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeFleetMetricCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/fleet-metric/{metricName}");
b.p("metricName", () => input.metricName, "{metricName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeIndexCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/indices/{indexName}");
b.p("indexName", () => input.indexName, "{indexName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_DescribeJobCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/jobs/{jobId}");
b.p("jobId", () => input.jobId, "{jobId}", false);
const query = map({
[_bS]: [() => input.beforeSubstitution !== void 0, () => input[_bS].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_DescribeJobExecutionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/things/{thingName}/jobs/{jobId}");
b.p("jobId", () => input.jobId, "{jobId}", fals