@aws-sdk/client-connectcampaigns 3.113.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/CHANGELOG.md +11 -0
- package/LICENSE +201 -0
- package/README.md +205 -0
- package/dist-cjs/ConnectCampaigns.js +337 -0
- package/dist-cjs/ConnectCampaignsClient.js +37 -0
- package/dist-cjs/commands/CreateCampaignCommand.js +36 -0
- package/dist-cjs/commands/DeleteCampaignCommand.js +36 -0
- package/dist-cjs/commands/DeleteConnectInstanceConfigCommand.js +36 -0
- package/dist-cjs/commands/DeleteInstanceOnboardingJobCommand.js +36 -0
- package/dist-cjs/commands/DescribeCampaignCommand.js +36 -0
- package/dist-cjs/commands/GetCampaignStateBatchCommand.js +36 -0
- package/dist-cjs/commands/GetCampaignStateCommand.js +36 -0
- package/dist-cjs/commands/GetConnectInstanceConfigCommand.js +36 -0
- package/dist-cjs/commands/GetInstanceOnboardingJobStatusCommand.js +36 -0
- package/dist-cjs/commands/ListCampaignsCommand.js +36 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
- package/dist-cjs/commands/PauseCampaignCommand.js +36 -0
- package/dist-cjs/commands/PutDialRequestBatchCommand.js +36 -0
- package/dist-cjs/commands/ResumeCampaignCommand.js +36 -0
- package/dist-cjs/commands/StartCampaignCommand.js +36 -0
- package/dist-cjs/commands/StartInstanceOnboardingJobCommand.js +36 -0
- package/dist-cjs/commands/StopCampaignCommand.js +36 -0
- package/dist-cjs/commands/TagResourceCommand.js +36 -0
- package/dist-cjs/commands/UntagResourceCommand.js +36 -0
- package/dist-cjs/commands/UpdateCampaignDialerConfigCommand.js +36 -0
- package/dist-cjs/commands/UpdateCampaignNameCommand.js +36 -0
- package/dist-cjs/commands/UpdateCampaignOutboundCallConfigCommand.js +36 -0
- package/dist-cjs/commands/index.js +25 -0
- package/dist-cjs/endpoints.js +131 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/ConnectCampaignsServiceException.js +11 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +490 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListCampaignsPaginator.js +36 -0
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2174 -0
- package/dist-cjs/runtimeConfig.browser.js +45 -0
- package/dist-cjs/runtimeConfig.js +52 -0
- package/dist-cjs/runtimeConfig.native.js +16 -0
- package/dist-cjs/runtimeConfig.shared.js +17 -0
- package/dist-es/ConnectCampaigns.js +340 -0
- package/dist-es/ConnectCampaignsClient.js +39 -0
- package/dist-es/commands/CreateCampaignCommand.js +39 -0
- package/dist-es/commands/DeleteCampaignCommand.js +39 -0
- package/dist-es/commands/DeleteConnectInstanceConfigCommand.js +39 -0
- package/dist-es/commands/DeleteInstanceOnboardingJobCommand.js +39 -0
- package/dist-es/commands/DescribeCampaignCommand.js +39 -0
- package/dist-es/commands/GetCampaignStateBatchCommand.js +39 -0
- package/dist-es/commands/GetCampaignStateCommand.js +39 -0
- package/dist-es/commands/GetConnectInstanceConfigCommand.js +39 -0
- package/dist-es/commands/GetInstanceOnboardingJobStatusCommand.js +39 -0
- package/dist-es/commands/ListCampaignsCommand.js +39 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
- package/dist-es/commands/PauseCampaignCommand.js +39 -0
- package/dist-es/commands/PutDialRequestBatchCommand.js +39 -0
- package/dist-es/commands/ResumeCampaignCommand.js +39 -0
- package/dist-es/commands/StartCampaignCommand.js +39 -0
- package/dist-es/commands/StartInstanceOnboardingJobCommand.js +39 -0
- package/dist-es/commands/StopCampaignCommand.js +39 -0
- package/dist-es/commands/TagResourceCommand.js +39 -0
- package/dist-es/commands/UntagResourceCommand.js +39 -0
- package/dist-es/commands/UpdateCampaignDialerConfigCommand.js +39 -0
- package/dist-es/commands/UpdateCampaignNameCommand.js +39 -0
- package/dist-es/commands/UpdateCampaignOutboundCallConfigCommand.js +39 -0
- package/dist-es/commands/index.js +22 -0
- package/dist-es/endpoints.js +127 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/ConnectCampaignsServiceException.js +12 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +376 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListCampaignsPaginator.js +75 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +2718 -0
- package/dist-es/runtimeConfig.browser.js +26 -0
- package/dist-es/runtimeConfig.js +30 -0
- package/dist-es/runtimeConfig.native.js +8 -0
- package/dist-es/runtimeConfig.shared.js +13 -0
- package/dist-types/ConnectCampaigns.d.ts +161 -0
- package/dist-types/ConnectCampaignsClient.d.ts +166 -0
- package/dist-types/commands/CreateCampaignCommand.d.ts +35 -0
- package/dist-types/commands/DeleteCampaignCommand.d.ts +35 -0
- package/dist-types/commands/DeleteConnectInstanceConfigCommand.d.ts +35 -0
- package/dist-types/commands/DeleteInstanceOnboardingJobCommand.d.ts +35 -0
- package/dist-types/commands/DescribeCampaignCommand.d.ts +35 -0
- package/dist-types/commands/GetCampaignStateBatchCommand.d.ts +35 -0
- package/dist-types/commands/GetCampaignStateCommand.d.ts +35 -0
- package/dist-types/commands/GetConnectInstanceConfigCommand.d.ts +35 -0
- package/dist-types/commands/GetInstanceOnboardingJobStatusCommand.d.ts +35 -0
- package/dist-types/commands/ListCampaignsCommand.d.ts +35 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
- package/dist-types/commands/PauseCampaignCommand.d.ts +35 -0
- package/dist-types/commands/PutDialRequestBatchCommand.d.ts +35 -0
- package/dist-types/commands/ResumeCampaignCommand.d.ts +35 -0
- package/dist-types/commands/StartCampaignCommand.d.ts +35 -0
- package/dist-types/commands/StartInstanceOnboardingJobCommand.d.ts +35 -0
- package/dist-types/commands/StopCampaignCommand.d.ts +35 -0
- package/dist-types/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UpdateCampaignDialerConfigCommand.d.ts +35 -0
- package/dist-types/commands/UpdateCampaignNameCommand.d.ts +35 -0
- package/dist-types/commands/UpdateCampaignOutboundCallConfigCommand.d.ts +35 -0
- package/dist-types/commands/index.d.ts +22 -0
- package/dist-types/endpoints.d.ts +2 -0
- package/dist-types/index.d.ts +6 -0
- package/dist-types/models/ConnectCampaignsServiceException.d.ts +10 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1165 -0
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListCampaignsPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +68 -0
- package/dist-types/runtimeConfig.browser.d.ts +40 -0
- package/dist-types/runtimeConfig.d.ts +40 -0
- package/dist-types/runtimeConfig.native.d.ts +39 -0
- package/dist-types/runtimeConfig.shared.d.ts +13 -0
- package/dist-types/ts3.4/ConnectCampaigns.d.ts +115 -0
- package/dist-types/ts3.4/ConnectCampaignsClient.d.ts +95 -0
- package/dist-types/ts3.4/commands/CreateCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteConnectInstanceConfigCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteInstanceOnboardingJobCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DescribeCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetCampaignStateBatchCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetCampaignStateCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetConnectInstanceConfigCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetInstanceOnboardingJobStatusCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListCampaignsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/PauseCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/PutDialRequestBatchCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ResumeCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StartCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StartInstanceOnboardingJobCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StopCampaignCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateCampaignDialerConfigCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateCampaignNameCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateCampaignOutboundCallConfigCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +22 -0
- package/dist-types/ts3.4/endpoints.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +6 -0
- package/dist-types/ts3.4/models/ConnectCampaignsServiceException.d.ts +6 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +691 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListCampaignsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +68 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
- package/package.json +94 -0
|
@@ -0,0 +1,2174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = exports.deserializeAws_restJson1UpdateCampaignNameCommand = exports.deserializeAws_restJson1UpdateCampaignDialerConfigCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StopCampaignCommand = exports.deserializeAws_restJson1StartInstanceOnboardingJobCommand = exports.deserializeAws_restJson1StartCampaignCommand = exports.deserializeAws_restJson1ResumeCampaignCommand = exports.deserializeAws_restJson1PutDialRequestBatchCommand = exports.deserializeAws_restJson1PauseCampaignCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListCampaignsCommand = exports.deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand = exports.deserializeAws_restJson1GetConnectInstanceConfigCommand = exports.deserializeAws_restJson1GetCampaignStateBatchCommand = exports.deserializeAws_restJson1GetCampaignStateCommand = exports.deserializeAws_restJson1DescribeCampaignCommand = exports.deserializeAws_restJson1DeleteInstanceOnboardingJobCommand = exports.deserializeAws_restJson1DeleteConnectInstanceConfigCommand = exports.deserializeAws_restJson1DeleteCampaignCommand = exports.deserializeAws_restJson1CreateCampaignCommand = exports.serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = exports.serializeAws_restJson1UpdateCampaignNameCommand = exports.serializeAws_restJson1UpdateCampaignDialerConfigCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StopCampaignCommand = exports.serializeAws_restJson1StartInstanceOnboardingJobCommand = exports.serializeAws_restJson1StartCampaignCommand = exports.serializeAws_restJson1ResumeCampaignCommand = exports.serializeAws_restJson1PutDialRequestBatchCommand = exports.serializeAws_restJson1PauseCampaignCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListCampaignsCommand = exports.serializeAws_restJson1GetInstanceOnboardingJobStatusCommand = exports.serializeAws_restJson1GetConnectInstanceConfigCommand = exports.serializeAws_restJson1GetCampaignStateBatchCommand = exports.serializeAws_restJson1GetCampaignStateCommand = exports.serializeAws_restJson1DescribeCampaignCommand = exports.serializeAws_restJson1DeleteInstanceOnboardingJobCommand = exports.serializeAws_restJson1DeleteConnectInstanceConfigCommand = exports.serializeAws_restJson1DeleteCampaignCommand = exports.serializeAws_restJson1CreateCampaignCommand = void 0;
|
|
4
|
+
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
|
+
const ConnectCampaignsServiceException_1 = require("../models/ConnectCampaignsServiceException");
|
|
7
|
+
const models_0_1 = require("../models/models_0");
|
|
8
|
+
const serializeAws_restJson1CreateCampaignCommand = async (input, context) => {
|
|
9
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
|
+
const headers = {
|
|
11
|
+
"content-type": "application/json",
|
|
12
|
+
};
|
|
13
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns";
|
|
14
|
+
let body;
|
|
15
|
+
body = JSON.stringify({
|
|
16
|
+
...(input.connectInstanceId !== undefined &&
|
|
17
|
+
input.connectInstanceId !== null && { connectInstanceId: input.connectInstanceId }),
|
|
18
|
+
...(input.dialerConfig !== undefined &&
|
|
19
|
+
input.dialerConfig !== null && { dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context) }),
|
|
20
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
21
|
+
...(input.outboundCallConfig !== undefined &&
|
|
22
|
+
input.outboundCallConfig !== null && {
|
|
23
|
+
outboundCallConfig: serializeAws_restJson1OutboundCallConfig(input.outboundCallConfig, context),
|
|
24
|
+
}),
|
|
25
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
26
|
+
});
|
|
27
|
+
return new protocol_http_1.HttpRequest({
|
|
28
|
+
protocol,
|
|
29
|
+
hostname,
|
|
30
|
+
port,
|
|
31
|
+
method: "PUT",
|
|
32
|
+
headers,
|
|
33
|
+
path: resolvedPath,
|
|
34
|
+
body,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.serializeAws_restJson1CreateCampaignCommand = serializeAws_restJson1CreateCampaignCommand;
|
|
38
|
+
const serializeAws_restJson1DeleteCampaignCommand = async (input, context) => {
|
|
39
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
40
|
+
const headers = {};
|
|
41
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}";
|
|
42
|
+
if (input.id !== undefined) {
|
|
43
|
+
const labelValue = input.id;
|
|
44
|
+
if (labelValue.length <= 0) {
|
|
45
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
46
|
+
}
|
|
47
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
51
|
+
}
|
|
52
|
+
let body;
|
|
53
|
+
return new protocol_http_1.HttpRequest({
|
|
54
|
+
protocol,
|
|
55
|
+
hostname,
|
|
56
|
+
port,
|
|
57
|
+
method: "DELETE",
|
|
58
|
+
headers,
|
|
59
|
+
path: resolvedPath,
|
|
60
|
+
body,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
exports.serializeAws_restJson1DeleteCampaignCommand = serializeAws_restJson1DeleteCampaignCommand;
|
|
64
|
+
const serializeAws_restJson1DeleteConnectInstanceConfigCommand = async (input, context) => {
|
|
65
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
66
|
+
const headers = {};
|
|
67
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
68
|
+
"/connect-instance/{connectInstanceId}/config";
|
|
69
|
+
if (input.connectInstanceId !== undefined) {
|
|
70
|
+
const labelValue = input.connectInstanceId;
|
|
71
|
+
if (labelValue.length <= 0) {
|
|
72
|
+
throw new Error("Empty value provided for input HTTP label: connectInstanceId.");
|
|
73
|
+
}
|
|
74
|
+
resolvedPath = resolvedPath.replace("{connectInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new Error("No value provided for input HTTP label: connectInstanceId.");
|
|
78
|
+
}
|
|
79
|
+
let body;
|
|
80
|
+
return new protocol_http_1.HttpRequest({
|
|
81
|
+
protocol,
|
|
82
|
+
hostname,
|
|
83
|
+
port,
|
|
84
|
+
method: "DELETE",
|
|
85
|
+
headers,
|
|
86
|
+
path: resolvedPath,
|
|
87
|
+
body,
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
exports.serializeAws_restJson1DeleteConnectInstanceConfigCommand = serializeAws_restJson1DeleteConnectInstanceConfigCommand;
|
|
91
|
+
const serializeAws_restJson1DeleteInstanceOnboardingJobCommand = async (input, context) => {
|
|
92
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
93
|
+
const headers = {};
|
|
94
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
95
|
+
"/connect-instance/{connectInstanceId}/onboarding";
|
|
96
|
+
if (input.connectInstanceId !== undefined) {
|
|
97
|
+
const labelValue = input.connectInstanceId;
|
|
98
|
+
if (labelValue.length <= 0) {
|
|
99
|
+
throw new Error("Empty value provided for input HTTP label: connectInstanceId.");
|
|
100
|
+
}
|
|
101
|
+
resolvedPath = resolvedPath.replace("{connectInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
throw new Error("No value provided for input HTTP label: connectInstanceId.");
|
|
105
|
+
}
|
|
106
|
+
let body;
|
|
107
|
+
return new protocol_http_1.HttpRequest({
|
|
108
|
+
protocol,
|
|
109
|
+
hostname,
|
|
110
|
+
port,
|
|
111
|
+
method: "DELETE",
|
|
112
|
+
headers,
|
|
113
|
+
path: resolvedPath,
|
|
114
|
+
body,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
exports.serializeAws_restJson1DeleteInstanceOnboardingJobCommand = serializeAws_restJson1DeleteInstanceOnboardingJobCommand;
|
|
118
|
+
const serializeAws_restJson1DescribeCampaignCommand = async (input, context) => {
|
|
119
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
120
|
+
const headers = {};
|
|
121
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}";
|
|
122
|
+
if (input.id !== undefined) {
|
|
123
|
+
const labelValue = input.id;
|
|
124
|
+
if (labelValue.length <= 0) {
|
|
125
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
126
|
+
}
|
|
127
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
131
|
+
}
|
|
132
|
+
let body;
|
|
133
|
+
return new protocol_http_1.HttpRequest({
|
|
134
|
+
protocol,
|
|
135
|
+
hostname,
|
|
136
|
+
port,
|
|
137
|
+
method: "GET",
|
|
138
|
+
headers,
|
|
139
|
+
path: resolvedPath,
|
|
140
|
+
body,
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
exports.serializeAws_restJson1DescribeCampaignCommand = serializeAws_restJson1DescribeCampaignCommand;
|
|
144
|
+
const serializeAws_restJson1GetCampaignStateCommand = async (input, context) => {
|
|
145
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
146
|
+
const headers = {};
|
|
147
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/state";
|
|
148
|
+
if (input.id !== undefined) {
|
|
149
|
+
const labelValue = input.id;
|
|
150
|
+
if (labelValue.length <= 0) {
|
|
151
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
152
|
+
}
|
|
153
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
157
|
+
}
|
|
158
|
+
let body;
|
|
159
|
+
return new protocol_http_1.HttpRequest({
|
|
160
|
+
protocol,
|
|
161
|
+
hostname,
|
|
162
|
+
port,
|
|
163
|
+
method: "GET",
|
|
164
|
+
headers,
|
|
165
|
+
path: resolvedPath,
|
|
166
|
+
body,
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
exports.serializeAws_restJson1GetCampaignStateCommand = serializeAws_restJson1GetCampaignStateCommand;
|
|
170
|
+
const serializeAws_restJson1GetCampaignStateBatchCommand = async (input, context) => {
|
|
171
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
172
|
+
const headers = {
|
|
173
|
+
"content-type": "application/json",
|
|
174
|
+
};
|
|
175
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns-state";
|
|
176
|
+
let body;
|
|
177
|
+
body = JSON.stringify({
|
|
178
|
+
...(input.campaignIds !== undefined &&
|
|
179
|
+
input.campaignIds !== null && { campaignIds: serializeAws_restJson1CampaignIdList(input.campaignIds, context) }),
|
|
180
|
+
});
|
|
181
|
+
return new protocol_http_1.HttpRequest({
|
|
182
|
+
protocol,
|
|
183
|
+
hostname,
|
|
184
|
+
port,
|
|
185
|
+
method: "POST",
|
|
186
|
+
headers,
|
|
187
|
+
path: resolvedPath,
|
|
188
|
+
body,
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
exports.serializeAws_restJson1GetCampaignStateBatchCommand = serializeAws_restJson1GetCampaignStateBatchCommand;
|
|
192
|
+
const serializeAws_restJson1GetConnectInstanceConfigCommand = async (input, context) => {
|
|
193
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
194
|
+
const headers = {};
|
|
195
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
196
|
+
"/connect-instance/{connectInstanceId}/config";
|
|
197
|
+
if (input.connectInstanceId !== undefined) {
|
|
198
|
+
const labelValue = input.connectInstanceId;
|
|
199
|
+
if (labelValue.length <= 0) {
|
|
200
|
+
throw new Error("Empty value provided for input HTTP label: connectInstanceId.");
|
|
201
|
+
}
|
|
202
|
+
resolvedPath = resolvedPath.replace("{connectInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
throw new Error("No value provided for input HTTP label: connectInstanceId.");
|
|
206
|
+
}
|
|
207
|
+
let body;
|
|
208
|
+
return new protocol_http_1.HttpRequest({
|
|
209
|
+
protocol,
|
|
210
|
+
hostname,
|
|
211
|
+
port,
|
|
212
|
+
method: "GET",
|
|
213
|
+
headers,
|
|
214
|
+
path: resolvedPath,
|
|
215
|
+
body,
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
exports.serializeAws_restJson1GetConnectInstanceConfigCommand = serializeAws_restJson1GetConnectInstanceConfigCommand;
|
|
219
|
+
const serializeAws_restJson1GetInstanceOnboardingJobStatusCommand = async (input, context) => {
|
|
220
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
221
|
+
const headers = {};
|
|
222
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
223
|
+
"/connect-instance/{connectInstanceId}/onboarding";
|
|
224
|
+
if (input.connectInstanceId !== undefined) {
|
|
225
|
+
const labelValue = input.connectInstanceId;
|
|
226
|
+
if (labelValue.length <= 0) {
|
|
227
|
+
throw new Error("Empty value provided for input HTTP label: connectInstanceId.");
|
|
228
|
+
}
|
|
229
|
+
resolvedPath = resolvedPath.replace("{connectInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
throw new Error("No value provided for input HTTP label: connectInstanceId.");
|
|
233
|
+
}
|
|
234
|
+
let body;
|
|
235
|
+
return new protocol_http_1.HttpRequest({
|
|
236
|
+
protocol,
|
|
237
|
+
hostname,
|
|
238
|
+
port,
|
|
239
|
+
method: "GET",
|
|
240
|
+
headers,
|
|
241
|
+
path: resolvedPath,
|
|
242
|
+
body,
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
exports.serializeAws_restJson1GetInstanceOnboardingJobStatusCommand = serializeAws_restJson1GetInstanceOnboardingJobStatusCommand;
|
|
246
|
+
const serializeAws_restJson1ListCampaignsCommand = async (input, context) => {
|
|
247
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
248
|
+
const headers = {
|
|
249
|
+
"content-type": "application/json",
|
|
250
|
+
};
|
|
251
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns-summary";
|
|
252
|
+
let body;
|
|
253
|
+
body = JSON.stringify({
|
|
254
|
+
...(input.filters !== undefined &&
|
|
255
|
+
input.filters !== null && { filters: serializeAws_restJson1CampaignFilters(input.filters, context) }),
|
|
256
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
257
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
258
|
+
});
|
|
259
|
+
return new protocol_http_1.HttpRequest({
|
|
260
|
+
protocol,
|
|
261
|
+
hostname,
|
|
262
|
+
port,
|
|
263
|
+
method: "POST",
|
|
264
|
+
headers,
|
|
265
|
+
path: resolvedPath,
|
|
266
|
+
body,
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
exports.serializeAws_restJson1ListCampaignsCommand = serializeAws_restJson1ListCampaignsCommand;
|
|
270
|
+
const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
271
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
272
|
+
const headers = {};
|
|
273
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
274
|
+
if (input.arn !== undefined) {
|
|
275
|
+
const labelValue = input.arn;
|
|
276
|
+
if (labelValue.length <= 0) {
|
|
277
|
+
throw new Error("Empty value provided for input HTTP label: arn.");
|
|
278
|
+
}
|
|
279
|
+
resolvedPath = resolvedPath.replace("{arn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
throw new Error("No value provided for input HTTP label: arn.");
|
|
283
|
+
}
|
|
284
|
+
let body;
|
|
285
|
+
return new protocol_http_1.HttpRequest({
|
|
286
|
+
protocol,
|
|
287
|
+
hostname,
|
|
288
|
+
port,
|
|
289
|
+
method: "GET",
|
|
290
|
+
headers,
|
|
291
|
+
path: resolvedPath,
|
|
292
|
+
body,
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
|
|
296
|
+
const serializeAws_restJson1PauseCampaignCommand = async (input, context) => {
|
|
297
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
298
|
+
const headers = {};
|
|
299
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/pause";
|
|
300
|
+
if (input.id !== undefined) {
|
|
301
|
+
const labelValue = input.id;
|
|
302
|
+
if (labelValue.length <= 0) {
|
|
303
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
304
|
+
}
|
|
305
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
309
|
+
}
|
|
310
|
+
let body;
|
|
311
|
+
return new protocol_http_1.HttpRequest({
|
|
312
|
+
protocol,
|
|
313
|
+
hostname,
|
|
314
|
+
port,
|
|
315
|
+
method: "POST",
|
|
316
|
+
headers,
|
|
317
|
+
path: resolvedPath,
|
|
318
|
+
body,
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
exports.serializeAws_restJson1PauseCampaignCommand = serializeAws_restJson1PauseCampaignCommand;
|
|
322
|
+
const serializeAws_restJson1PutDialRequestBatchCommand = async (input, context) => {
|
|
323
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
324
|
+
const headers = {
|
|
325
|
+
"content-type": "application/json",
|
|
326
|
+
};
|
|
327
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/dial-requests";
|
|
328
|
+
if (input.id !== undefined) {
|
|
329
|
+
const labelValue = input.id;
|
|
330
|
+
if (labelValue.length <= 0) {
|
|
331
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
332
|
+
}
|
|
333
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
337
|
+
}
|
|
338
|
+
let body;
|
|
339
|
+
body = JSON.stringify({
|
|
340
|
+
...(input.dialRequests !== undefined &&
|
|
341
|
+
input.dialRequests !== null && {
|
|
342
|
+
dialRequests: serializeAws_restJson1DialRequestList(input.dialRequests, context),
|
|
343
|
+
}),
|
|
344
|
+
});
|
|
345
|
+
return new protocol_http_1.HttpRequest({
|
|
346
|
+
protocol,
|
|
347
|
+
hostname,
|
|
348
|
+
port,
|
|
349
|
+
method: "PUT",
|
|
350
|
+
headers,
|
|
351
|
+
path: resolvedPath,
|
|
352
|
+
body,
|
|
353
|
+
});
|
|
354
|
+
};
|
|
355
|
+
exports.serializeAws_restJson1PutDialRequestBatchCommand = serializeAws_restJson1PutDialRequestBatchCommand;
|
|
356
|
+
const serializeAws_restJson1ResumeCampaignCommand = async (input, context) => {
|
|
357
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
358
|
+
const headers = {};
|
|
359
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/resume";
|
|
360
|
+
if (input.id !== undefined) {
|
|
361
|
+
const labelValue = input.id;
|
|
362
|
+
if (labelValue.length <= 0) {
|
|
363
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
364
|
+
}
|
|
365
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
369
|
+
}
|
|
370
|
+
let body;
|
|
371
|
+
return new protocol_http_1.HttpRequest({
|
|
372
|
+
protocol,
|
|
373
|
+
hostname,
|
|
374
|
+
port,
|
|
375
|
+
method: "POST",
|
|
376
|
+
headers,
|
|
377
|
+
path: resolvedPath,
|
|
378
|
+
body,
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
exports.serializeAws_restJson1ResumeCampaignCommand = serializeAws_restJson1ResumeCampaignCommand;
|
|
382
|
+
const serializeAws_restJson1StartCampaignCommand = async (input, context) => {
|
|
383
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
384
|
+
const headers = {};
|
|
385
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/start";
|
|
386
|
+
if (input.id !== undefined) {
|
|
387
|
+
const labelValue = input.id;
|
|
388
|
+
if (labelValue.length <= 0) {
|
|
389
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
390
|
+
}
|
|
391
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
395
|
+
}
|
|
396
|
+
let body;
|
|
397
|
+
return new protocol_http_1.HttpRequest({
|
|
398
|
+
protocol,
|
|
399
|
+
hostname,
|
|
400
|
+
port,
|
|
401
|
+
method: "POST",
|
|
402
|
+
headers,
|
|
403
|
+
path: resolvedPath,
|
|
404
|
+
body,
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
exports.serializeAws_restJson1StartCampaignCommand = serializeAws_restJson1StartCampaignCommand;
|
|
408
|
+
const serializeAws_restJson1StartInstanceOnboardingJobCommand = async (input, context) => {
|
|
409
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
410
|
+
const headers = {
|
|
411
|
+
"content-type": "application/json",
|
|
412
|
+
};
|
|
413
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
414
|
+
"/connect-instance/{connectInstanceId}/onboarding";
|
|
415
|
+
if (input.connectInstanceId !== undefined) {
|
|
416
|
+
const labelValue = input.connectInstanceId;
|
|
417
|
+
if (labelValue.length <= 0) {
|
|
418
|
+
throw new Error("Empty value provided for input HTTP label: connectInstanceId.");
|
|
419
|
+
}
|
|
420
|
+
resolvedPath = resolvedPath.replace("{connectInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
throw new Error("No value provided for input HTTP label: connectInstanceId.");
|
|
424
|
+
}
|
|
425
|
+
let body;
|
|
426
|
+
body = JSON.stringify({
|
|
427
|
+
...(input.encryptionConfig !== undefined &&
|
|
428
|
+
input.encryptionConfig !== null && {
|
|
429
|
+
encryptionConfig: serializeAws_restJson1EncryptionConfig(input.encryptionConfig, context),
|
|
430
|
+
}),
|
|
431
|
+
});
|
|
432
|
+
return new protocol_http_1.HttpRequest({
|
|
433
|
+
protocol,
|
|
434
|
+
hostname,
|
|
435
|
+
port,
|
|
436
|
+
method: "PUT",
|
|
437
|
+
headers,
|
|
438
|
+
path: resolvedPath,
|
|
439
|
+
body,
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
exports.serializeAws_restJson1StartInstanceOnboardingJobCommand = serializeAws_restJson1StartInstanceOnboardingJobCommand;
|
|
443
|
+
const serializeAws_restJson1StopCampaignCommand = async (input, context) => {
|
|
444
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
445
|
+
const headers = {};
|
|
446
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/stop";
|
|
447
|
+
if (input.id !== undefined) {
|
|
448
|
+
const labelValue = input.id;
|
|
449
|
+
if (labelValue.length <= 0) {
|
|
450
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
451
|
+
}
|
|
452
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
456
|
+
}
|
|
457
|
+
let body;
|
|
458
|
+
return new protocol_http_1.HttpRequest({
|
|
459
|
+
protocol,
|
|
460
|
+
hostname,
|
|
461
|
+
port,
|
|
462
|
+
method: "POST",
|
|
463
|
+
headers,
|
|
464
|
+
path: resolvedPath,
|
|
465
|
+
body,
|
|
466
|
+
});
|
|
467
|
+
};
|
|
468
|
+
exports.serializeAws_restJson1StopCampaignCommand = serializeAws_restJson1StopCampaignCommand;
|
|
469
|
+
const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
470
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
471
|
+
const headers = {
|
|
472
|
+
"content-type": "application/json",
|
|
473
|
+
};
|
|
474
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
475
|
+
if (input.arn !== undefined) {
|
|
476
|
+
const labelValue = input.arn;
|
|
477
|
+
if (labelValue.length <= 0) {
|
|
478
|
+
throw new Error("Empty value provided for input HTTP label: arn.");
|
|
479
|
+
}
|
|
480
|
+
resolvedPath = resolvedPath.replace("{arn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
throw new Error("No value provided for input HTTP label: arn.");
|
|
484
|
+
}
|
|
485
|
+
let body;
|
|
486
|
+
body = JSON.stringify({
|
|
487
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
488
|
+
});
|
|
489
|
+
return new protocol_http_1.HttpRequest({
|
|
490
|
+
protocol,
|
|
491
|
+
hostname,
|
|
492
|
+
port,
|
|
493
|
+
method: "POST",
|
|
494
|
+
headers,
|
|
495
|
+
path: resolvedPath,
|
|
496
|
+
body,
|
|
497
|
+
});
|
|
498
|
+
};
|
|
499
|
+
exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
|
|
500
|
+
const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
501
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
502
|
+
const headers = {};
|
|
503
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
504
|
+
if (input.arn !== undefined) {
|
|
505
|
+
const labelValue = input.arn;
|
|
506
|
+
if (labelValue.length <= 0) {
|
|
507
|
+
throw new Error("Empty value provided for input HTTP label: arn.");
|
|
508
|
+
}
|
|
509
|
+
resolvedPath = resolvedPath.replace("{arn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
throw new Error("No value provided for input HTTP label: arn.");
|
|
513
|
+
}
|
|
514
|
+
const query = {
|
|
515
|
+
...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
|
|
516
|
+
};
|
|
517
|
+
let body;
|
|
518
|
+
return new protocol_http_1.HttpRequest({
|
|
519
|
+
protocol,
|
|
520
|
+
hostname,
|
|
521
|
+
port,
|
|
522
|
+
method: "DELETE",
|
|
523
|
+
headers,
|
|
524
|
+
path: resolvedPath,
|
|
525
|
+
query,
|
|
526
|
+
body,
|
|
527
|
+
});
|
|
528
|
+
};
|
|
529
|
+
exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
|
|
530
|
+
const serializeAws_restJson1UpdateCampaignDialerConfigCommand = async (input, context) => {
|
|
531
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
532
|
+
const headers = {
|
|
533
|
+
"content-type": "application/json",
|
|
534
|
+
};
|
|
535
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/dialer-config";
|
|
536
|
+
if (input.id !== undefined) {
|
|
537
|
+
const labelValue = input.id;
|
|
538
|
+
if (labelValue.length <= 0) {
|
|
539
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
540
|
+
}
|
|
541
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
545
|
+
}
|
|
546
|
+
let body;
|
|
547
|
+
body = JSON.stringify({
|
|
548
|
+
...(input.dialerConfig !== undefined &&
|
|
549
|
+
input.dialerConfig !== null && { dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context) }),
|
|
550
|
+
});
|
|
551
|
+
return new protocol_http_1.HttpRequest({
|
|
552
|
+
protocol,
|
|
553
|
+
hostname,
|
|
554
|
+
port,
|
|
555
|
+
method: "POST",
|
|
556
|
+
headers,
|
|
557
|
+
path: resolvedPath,
|
|
558
|
+
body,
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
exports.serializeAws_restJson1UpdateCampaignDialerConfigCommand = serializeAws_restJson1UpdateCampaignDialerConfigCommand;
|
|
562
|
+
const serializeAws_restJson1UpdateCampaignNameCommand = async (input, context) => {
|
|
563
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
564
|
+
const headers = {
|
|
565
|
+
"content-type": "application/json",
|
|
566
|
+
};
|
|
567
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/name";
|
|
568
|
+
if (input.id !== undefined) {
|
|
569
|
+
const labelValue = input.id;
|
|
570
|
+
if (labelValue.length <= 0) {
|
|
571
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
572
|
+
}
|
|
573
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
577
|
+
}
|
|
578
|
+
let body;
|
|
579
|
+
body = JSON.stringify({
|
|
580
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
581
|
+
});
|
|
582
|
+
return new protocol_http_1.HttpRequest({
|
|
583
|
+
protocol,
|
|
584
|
+
hostname,
|
|
585
|
+
port,
|
|
586
|
+
method: "POST",
|
|
587
|
+
headers,
|
|
588
|
+
path: resolvedPath,
|
|
589
|
+
body,
|
|
590
|
+
});
|
|
591
|
+
};
|
|
592
|
+
exports.serializeAws_restJson1UpdateCampaignNameCommand = serializeAws_restJson1UpdateCampaignNameCommand;
|
|
593
|
+
const serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = async (input, context) => {
|
|
594
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
595
|
+
const headers = {
|
|
596
|
+
"content-type": "application/json",
|
|
597
|
+
};
|
|
598
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/outbound-call-config";
|
|
599
|
+
if (input.id !== undefined) {
|
|
600
|
+
const labelValue = input.id;
|
|
601
|
+
if (labelValue.length <= 0) {
|
|
602
|
+
throw new Error("Empty value provided for input HTTP label: id.");
|
|
603
|
+
}
|
|
604
|
+
resolvedPath = resolvedPath.replace("{id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
throw new Error("No value provided for input HTTP label: id.");
|
|
608
|
+
}
|
|
609
|
+
let body;
|
|
610
|
+
body = JSON.stringify({
|
|
611
|
+
...(input.answerMachineDetectionConfig !== undefined &&
|
|
612
|
+
input.answerMachineDetectionConfig !== null && {
|
|
613
|
+
answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
|
|
614
|
+
}),
|
|
615
|
+
...(input.connectContactFlowId !== undefined &&
|
|
616
|
+
input.connectContactFlowId !== null && { connectContactFlowId: input.connectContactFlowId }),
|
|
617
|
+
...(input.connectSourcePhoneNumber !== undefined &&
|
|
618
|
+
input.connectSourcePhoneNumber !== null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber }),
|
|
619
|
+
});
|
|
620
|
+
return new protocol_http_1.HttpRequest({
|
|
621
|
+
protocol,
|
|
622
|
+
hostname,
|
|
623
|
+
port,
|
|
624
|
+
method: "POST",
|
|
625
|
+
headers,
|
|
626
|
+
path: resolvedPath,
|
|
627
|
+
body,
|
|
628
|
+
});
|
|
629
|
+
};
|
|
630
|
+
exports.serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand;
|
|
631
|
+
const deserializeAws_restJson1CreateCampaignCommand = async (output, context) => {
|
|
632
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
633
|
+
return deserializeAws_restJson1CreateCampaignCommandError(output, context);
|
|
634
|
+
}
|
|
635
|
+
const contents = {
|
|
636
|
+
$metadata: deserializeMetadata(output),
|
|
637
|
+
arn: undefined,
|
|
638
|
+
id: undefined,
|
|
639
|
+
tags: undefined,
|
|
640
|
+
};
|
|
641
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
642
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
643
|
+
contents.arn = (0, smithy_client_1.expectString)(data.arn);
|
|
644
|
+
}
|
|
645
|
+
if (data.id !== undefined && data.id !== null) {
|
|
646
|
+
contents.id = (0, smithy_client_1.expectString)(data.id);
|
|
647
|
+
}
|
|
648
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
649
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
650
|
+
}
|
|
651
|
+
return Promise.resolve(contents);
|
|
652
|
+
};
|
|
653
|
+
exports.deserializeAws_restJson1CreateCampaignCommand = deserializeAws_restJson1CreateCampaignCommand;
|
|
654
|
+
const deserializeAws_restJson1CreateCampaignCommandError = async (output, context) => {
|
|
655
|
+
const parsedOutput = {
|
|
656
|
+
...output,
|
|
657
|
+
body: await parseBody(output.body, context),
|
|
658
|
+
};
|
|
659
|
+
let response;
|
|
660
|
+
let errorCode = "UnknownError";
|
|
661
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
662
|
+
switch (errorCode) {
|
|
663
|
+
case "AccessDeniedException":
|
|
664
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
665
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
666
|
+
case "ConflictException":
|
|
667
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
668
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
669
|
+
case "InternalServerException":
|
|
670
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
671
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
672
|
+
case "ResourceNotFoundException":
|
|
673
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
674
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
675
|
+
case "ServiceQuotaExceededException":
|
|
676
|
+
case "com.amazonaws.connectcampaigns#ServiceQuotaExceededException":
|
|
677
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
678
|
+
case "ThrottlingException":
|
|
679
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
680
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
681
|
+
case "ValidationException":
|
|
682
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
683
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
684
|
+
default:
|
|
685
|
+
const parsedBody = parsedOutput.body;
|
|
686
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
687
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
688
|
+
$fault: "client",
|
|
689
|
+
$metadata: deserializeMetadata(output),
|
|
690
|
+
});
|
|
691
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
const deserializeAws_restJson1DeleteCampaignCommand = async (output, context) => {
|
|
695
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
696
|
+
return deserializeAws_restJson1DeleteCampaignCommandError(output, context);
|
|
697
|
+
}
|
|
698
|
+
const contents = {
|
|
699
|
+
$metadata: deserializeMetadata(output),
|
|
700
|
+
};
|
|
701
|
+
await collectBody(output.body, context);
|
|
702
|
+
return Promise.resolve(contents);
|
|
703
|
+
};
|
|
704
|
+
exports.deserializeAws_restJson1DeleteCampaignCommand = deserializeAws_restJson1DeleteCampaignCommand;
|
|
705
|
+
const deserializeAws_restJson1DeleteCampaignCommandError = async (output, context) => {
|
|
706
|
+
const parsedOutput = {
|
|
707
|
+
...output,
|
|
708
|
+
body: await parseBody(output.body, context),
|
|
709
|
+
};
|
|
710
|
+
let response;
|
|
711
|
+
let errorCode = "UnknownError";
|
|
712
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
713
|
+
switch (errorCode) {
|
|
714
|
+
case "AccessDeniedException":
|
|
715
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
716
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
717
|
+
case "InternalServerException":
|
|
718
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
719
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
720
|
+
case "ResourceNotFoundException":
|
|
721
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
722
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
723
|
+
case "ValidationException":
|
|
724
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
725
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
726
|
+
default:
|
|
727
|
+
const parsedBody = parsedOutput.body;
|
|
728
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
729
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
730
|
+
$fault: "client",
|
|
731
|
+
$metadata: deserializeMetadata(output),
|
|
732
|
+
});
|
|
733
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
const deserializeAws_restJson1DeleteConnectInstanceConfigCommand = async (output, context) => {
|
|
737
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
738
|
+
return deserializeAws_restJson1DeleteConnectInstanceConfigCommandError(output, context);
|
|
739
|
+
}
|
|
740
|
+
const contents = {
|
|
741
|
+
$metadata: deserializeMetadata(output),
|
|
742
|
+
};
|
|
743
|
+
await collectBody(output.body, context);
|
|
744
|
+
return Promise.resolve(contents);
|
|
745
|
+
};
|
|
746
|
+
exports.deserializeAws_restJson1DeleteConnectInstanceConfigCommand = deserializeAws_restJson1DeleteConnectInstanceConfigCommand;
|
|
747
|
+
const deserializeAws_restJson1DeleteConnectInstanceConfigCommandError = async (output, context) => {
|
|
748
|
+
const parsedOutput = {
|
|
749
|
+
...output,
|
|
750
|
+
body: await parseBody(output.body, context),
|
|
751
|
+
};
|
|
752
|
+
let response;
|
|
753
|
+
let errorCode = "UnknownError";
|
|
754
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
755
|
+
switch (errorCode) {
|
|
756
|
+
case "AccessDeniedException":
|
|
757
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
758
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
759
|
+
case "InternalServerException":
|
|
760
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
761
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
762
|
+
case "InvalidStateException":
|
|
763
|
+
case "com.amazonaws.connectcampaigns#InvalidStateException":
|
|
764
|
+
throw await deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context);
|
|
765
|
+
case "ResourceNotFoundException":
|
|
766
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
767
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
768
|
+
case "ThrottlingException":
|
|
769
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
770
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
771
|
+
case "ValidationException":
|
|
772
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
773
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
774
|
+
default:
|
|
775
|
+
const parsedBody = parsedOutput.body;
|
|
776
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
777
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
778
|
+
$fault: "client",
|
|
779
|
+
$metadata: deserializeMetadata(output),
|
|
780
|
+
});
|
|
781
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
const deserializeAws_restJson1DeleteInstanceOnboardingJobCommand = async (output, context) => {
|
|
785
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
786
|
+
return deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError(output, context);
|
|
787
|
+
}
|
|
788
|
+
const contents = {
|
|
789
|
+
$metadata: deserializeMetadata(output),
|
|
790
|
+
};
|
|
791
|
+
await collectBody(output.body, context);
|
|
792
|
+
return Promise.resolve(contents);
|
|
793
|
+
};
|
|
794
|
+
exports.deserializeAws_restJson1DeleteInstanceOnboardingJobCommand = deserializeAws_restJson1DeleteInstanceOnboardingJobCommand;
|
|
795
|
+
const deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError = async (output, context) => {
|
|
796
|
+
const parsedOutput = {
|
|
797
|
+
...output,
|
|
798
|
+
body: await parseBody(output.body, context),
|
|
799
|
+
};
|
|
800
|
+
let response;
|
|
801
|
+
let errorCode = "UnknownError";
|
|
802
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
803
|
+
switch (errorCode) {
|
|
804
|
+
case "AccessDeniedException":
|
|
805
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
806
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
807
|
+
case "InternalServerException":
|
|
808
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
809
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
810
|
+
case "InvalidStateException":
|
|
811
|
+
case "com.amazonaws.connectcampaigns#InvalidStateException":
|
|
812
|
+
throw await deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context);
|
|
813
|
+
case "ResourceNotFoundException":
|
|
814
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
815
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
816
|
+
case "ValidationException":
|
|
817
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
818
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
819
|
+
default:
|
|
820
|
+
const parsedBody = parsedOutput.body;
|
|
821
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
822
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
823
|
+
$fault: "client",
|
|
824
|
+
$metadata: deserializeMetadata(output),
|
|
825
|
+
});
|
|
826
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
const deserializeAws_restJson1DescribeCampaignCommand = async (output, context) => {
|
|
830
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
831
|
+
return deserializeAws_restJson1DescribeCampaignCommandError(output, context);
|
|
832
|
+
}
|
|
833
|
+
const contents = {
|
|
834
|
+
$metadata: deserializeMetadata(output),
|
|
835
|
+
campaign: undefined,
|
|
836
|
+
};
|
|
837
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
838
|
+
if (data.campaign !== undefined && data.campaign !== null) {
|
|
839
|
+
contents.campaign = deserializeAws_restJson1Campaign(data.campaign, context);
|
|
840
|
+
}
|
|
841
|
+
return Promise.resolve(contents);
|
|
842
|
+
};
|
|
843
|
+
exports.deserializeAws_restJson1DescribeCampaignCommand = deserializeAws_restJson1DescribeCampaignCommand;
|
|
844
|
+
const deserializeAws_restJson1DescribeCampaignCommandError = async (output, context) => {
|
|
845
|
+
const parsedOutput = {
|
|
846
|
+
...output,
|
|
847
|
+
body: await parseBody(output.body, context),
|
|
848
|
+
};
|
|
849
|
+
let response;
|
|
850
|
+
let errorCode = "UnknownError";
|
|
851
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
852
|
+
switch (errorCode) {
|
|
853
|
+
case "AccessDeniedException":
|
|
854
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
855
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
856
|
+
case "InternalServerException":
|
|
857
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
858
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
859
|
+
case "ResourceNotFoundException":
|
|
860
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
861
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
862
|
+
case "ValidationException":
|
|
863
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
864
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
865
|
+
default:
|
|
866
|
+
const parsedBody = parsedOutput.body;
|
|
867
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
868
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
869
|
+
$fault: "client",
|
|
870
|
+
$metadata: deserializeMetadata(output),
|
|
871
|
+
});
|
|
872
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
const deserializeAws_restJson1GetCampaignStateCommand = async (output, context) => {
|
|
876
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
877
|
+
return deserializeAws_restJson1GetCampaignStateCommandError(output, context);
|
|
878
|
+
}
|
|
879
|
+
const contents = {
|
|
880
|
+
$metadata: deserializeMetadata(output),
|
|
881
|
+
state: undefined,
|
|
882
|
+
};
|
|
883
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
884
|
+
if (data.state !== undefined && data.state !== null) {
|
|
885
|
+
contents.state = (0, smithy_client_1.expectString)(data.state);
|
|
886
|
+
}
|
|
887
|
+
return Promise.resolve(contents);
|
|
888
|
+
};
|
|
889
|
+
exports.deserializeAws_restJson1GetCampaignStateCommand = deserializeAws_restJson1GetCampaignStateCommand;
|
|
890
|
+
const deserializeAws_restJson1GetCampaignStateCommandError = async (output, context) => {
|
|
891
|
+
const parsedOutput = {
|
|
892
|
+
...output,
|
|
893
|
+
body: await parseBody(output.body, context),
|
|
894
|
+
};
|
|
895
|
+
let response;
|
|
896
|
+
let errorCode = "UnknownError";
|
|
897
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
898
|
+
switch (errorCode) {
|
|
899
|
+
case "AccessDeniedException":
|
|
900
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
901
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
902
|
+
case "InternalServerException":
|
|
903
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
904
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
905
|
+
case "ResourceNotFoundException":
|
|
906
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
907
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
908
|
+
case "ThrottlingException":
|
|
909
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
910
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
911
|
+
default:
|
|
912
|
+
const parsedBody = parsedOutput.body;
|
|
913
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
914
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
915
|
+
$fault: "client",
|
|
916
|
+
$metadata: deserializeMetadata(output),
|
|
917
|
+
});
|
|
918
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
const deserializeAws_restJson1GetCampaignStateBatchCommand = async (output, context) => {
|
|
922
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
923
|
+
return deserializeAws_restJson1GetCampaignStateBatchCommandError(output, context);
|
|
924
|
+
}
|
|
925
|
+
const contents = {
|
|
926
|
+
$metadata: deserializeMetadata(output),
|
|
927
|
+
failedRequests: undefined,
|
|
928
|
+
successfulRequests: undefined,
|
|
929
|
+
};
|
|
930
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
931
|
+
if (data.failedRequests !== undefined && data.failedRequests !== null) {
|
|
932
|
+
contents.failedRequests = deserializeAws_restJson1FailedCampaignStateResponseList(data.failedRequests, context);
|
|
933
|
+
}
|
|
934
|
+
if (data.successfulRequests !== undefined && data.successfulRequests !== null) {
|
|
935
|
+
contents.successfulRequests = deserializeAws_restJson1SuccessfulCampaignStateResponseList(data.successfulRequests, context);
|
|
936
|
+
}
|
|
937
|
+
return Promise.resolve(contents);
|
|
938
|
+
};
|
|
939
|
+
exports.deserializeAws_restJson1GetCampaignStateBatchCommand = deserializeAws_restJson1GetCampaignStateBatchCommand;
|
|
940
|
+
const deserializeAws_restJson1GetCampaignStateBatchCommandError = async (output, context) => {
|
|
941
|
+
const parsedOutput = {
|
|
942
|
+
...output,
|
|
943
|
+
body: await parseBody(output.body, context),
|
|
944
|
+
};
|
|
945
|
+
let response;
|
|
946
|
+
let errorCode = "UnknownError";
|
|
947
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
948
|
+
switch (errorCode) {
|
|
949
|
+
case "AccessDeniedException":
|
|
950
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
951
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
952
|
+
case "InternalServerException":
|
|
953
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
954
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
955
|
+
case "ThrottlingException":
|
|
956
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
957
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
958
|
+
case "ValidationException":
|
|
959
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
960
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
961
|
+
default:
|
|
962
|
+
const parsedBody = parsedOutput.body;
|
|
963
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
964
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
965
|
+
$fault: "client",
|
|
966
|
+
$metadata: deserializeMetadata(output),
|
|
967
|
+
});
|
|
968
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
const deserializeAws_restJson1GetConnectInstanceConfigCommand = async (output, context) => {
|
|
972
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
973
|
+
return deserializeAws_restJson1GetConnectInstanceConfigCommandError(output, context);
|
|
974
|
+
}
|
|
975
|
+
const contents = {
|
|
976
|
+
$metadata: deserializeMetadata(output),
|
|
977
|
+
connectInstanceConfig: undefined,
|
|
978
|
+
};
|
|
979
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
980
|
+
if (data.connectInstanceConfig !== undefined && data.connectInstanceConfig !== null) {
|
|
981
|
+
contents.connectInstanceConfig = deserializeAws_restJson1InstanceConfig(data.connectInstanceConfig, context);
|
|
982
|
+
}
|
|
983
|
+
return Promise.resolve(contents);
|
|
984
|
+
};
|
|
985
|
+
exports.deserializeAws_restJson1GetConnectInstanceConfigCommand = deserializeAws_restJson1GetConnectInstanceConfigCommand;
|
|
986
|
+
const deserializeAws_restJson1GetConnectInstanceConfigCommandError = async (output, context) => {
|
|
987
|
+
const parsedOutput = {
|
|
988
|
+
...output,
|
|
989
|
+
body: await parseBody(output.body, context),
|
|
990
|
+
};
|
|
991
|
+
let response;
|
|
992
|
+
let errorCode = "UnknownError";
|
|
993
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
994
|
+
switch (errorCode) {
|
|
995
|
+
case "AccessDeniedException":
|
|
996
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
997
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
998
|
+
case "InternalServerException":
|
|
999
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1000
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1001
|
+
case "ResourceNotFoundException":
|
|
1002
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1003
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1004
|
+
case "ValidationException":
|
|
1005
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1006
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1007
|
+
default:
|
|
1008
|
+
const parsedBody = parsedOutput.body;
|
|
1009
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1010
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1011
|
+
$fault: "client",
|
|
1012
|
+
$metadata: deserializeMetadata(output),
|
|
1013
|
+
});
|
|
1014
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
const deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand = async (output, context) => {
|
|
1018
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1019
|
+
return deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError(output, context);
|
|
1020
|
+
}
|
|
1021
|
+
const contents = {
|
|
1022
|
+
$metadata: deserializeMetadata(output),
|
|
1023
|
+
connectInstanceOnboardingJobStatus: undefined,
|
|
1024
|
+
};
|
|
1025
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1026
|
+
if (data.connectInstanceOnboardingJobStatus !== undefined && data.connectInstanceOnboardingJobStatus !== null) {
|
|
1027
|
+
contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
|
|
1028
|
+
}
|
|
1029
|
+
return Promise.resolve(contents);
|
|
1030
|
+
};
|
|
1031
|
+
exports.deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand = deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand;
|
|
1032
|
+
const deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError = async (output, context) => {
|
|
1033
|
+
const parsedOutput = {
|
|
1034
|
+
...output,
|
|
1035
|
+
body: await parseBody(output.body, context),
|
|
1036
|
+
};
|
|
1037
|
+
let response;
|
|
1038
|
+
let errorCode = "UnknownError";
|
|
1039
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1040
|
+
switch (errorCode) {
|
|
1041
|
+
case "AccessDeniedException":
|
|
1042
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1043
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1044
|
+
case "InternalServerException":
|
|
1045
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1046
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1047
|
+
case "ResourceNotFoundException":
|
|
1048
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1049
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1050
|
+
case "ValidationException":
|
|
1051
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1052
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1053
|
+
default:
|
|
1054
|
+
const parsedBody = parsedOutput.body;
|
|
1055
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1056
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1057
|
+
$fault: "client",
|
|
1058
|
+
$metadata: deserializeMetadata(output),
|
|
1059
|
+
});
|
|
1060
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
const deserializeAws_restJson1ListCampaignsCommand = async (output, context) => {
|
|
1064
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1065
|
+
return deserializeAws_restJson1ListCampaignsCommandError(output, context);
|
|
1066
|
+
}
|
|
1067
|
+
const contents = {
|
|
1068
|
+
$metadata: deserializeMetadata(output),
|
|
1069
|
+
campaignSummaryList: undefined,
|
|
1070
|
+
nextToken: undefined,
|
|
1071
|
+
};
|
|
1072
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1073
|
+
if (data.campaignSummaryList !== undefined && data.campaignSummaryList !== null) {
|
|
1074
|
+
contents.campaignSummaryList = deserializeAws_restJson1CampaignSummaryList(data.campaignSummaryList, context);
|
|
1075
|
+
}
|
|
1076
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
1077
|
+
contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
|
|
1078
|
+
}
|
|
1079
|
+
return Promise.resolve(contents);
|
|
1080
|
+
};
|
|
1081
|
+
exports.deserializeAws_restJson1ListCampaignsCommand = deserializeAws_restJson1ListCampaignsCommand;
|
|
1082
|
+
const deserializeAws_restJson1ListCampaignsCommandError = async (output, context) => {
|
|
1083
|
+
const parsedOutput = {
|
|
1084
|
+
...output,
|
|
1085
|
+
body: await parseBody(output.body, context),
|
|
1086
|
+
};
|
|
1087
|
+
let response;
|
|
1088
|
+
let errorCode = "UnknownError";
|
|
1089
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1090
|
+
switch (errorCode) {
|
|
1091
|
+
case "AccessDeniedException":
|
|
1092
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1093
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1094
|
+
case "InternalServerException":
|
|
1095
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1096
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1097
|
+
case "ValidationException":
|
|
1098
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1099
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1100
|
+
default:
|
|
1101
|
+
const parsedBody = parsedOutput.body;
|
|
1102
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1103
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1104
|
+
$fault: "client",
|
|
1105
|
+
$metadata: deserializeMetadata(output),
|
|
1106
|
+
});
|
|
1107
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
1111
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1112
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
1113
|
+
}
|
|
1114
|
+
const contents = {
|
|
1115
|
+
$metadata: deserializeMetadata(output),
|
|
1116
|
+
tags: undefined,
|
|
1117
|
+
};
|
|
1118
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1119
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
1120
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
1121
|
+
}
|
|
1122
|
+
return Promise.resolve(contents);
|
|
1123
|
+
};
|
|
1124
|
+
exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
|
|
1125
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
1126
|
+
const parsedOutput = {
|
|
1127
|
+
...output,
|
|
1128
|
+
body: await parseBody(output.body, context),
|
|
1129
|
+
};
|
|
1130
|
+
let response;
|
|
1131
|
+
let errorCode = "UnknownError";
|
|
1132
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1133
|
+
switch (errorCode) {
|
|
1134
|
+
case "AccessDeniedException":
|
|
1135
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1136
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1137
|
+
case "InternalServerException":
|
|
1138
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1139
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1140
|
+
case "ResourceNotFoundException":
|
|
1141
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1142
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1143
|
+
case "ThrottlingException":
|
|
1144
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1145
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1146
|
+
case "ValidationException":
|
|
1147
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1148
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1149
|
+
default:
|
|
1150
|
+
const parsedBody = parsedOutput.body;
|
|
1151
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1152
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1153
|
+
$fault: "client",
|
|
1154
|
+
$metadata: deserializeMetadata(output),
|
|
1155
|
+
});
|
|
1156
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
const deserializeAws_restJson1PauseCampaignCommand = async (output, context) => {
|
|
1160
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1161
|
+
return deserializeAws_restJson1PauseCampaignCommandError(output, context);
|
|
1162
|
+
}
|
|
1163
|
+
const contents = {
|
|
1164
|
+
$metadata: deserializeMetadata(output),
|
|
1165
|
+
};
|
|
1166
|
+
await collectBody(output.body, context);
|
|
1167
|
+
return Promise.resolve(contents);
|
|
1168
|
+
};
|
|
1169
|
+
exports.deserializeAws_restJson1PauseCampaignCommand = deserializeAws_restJson1PauseCampaignCommand;
|
|
1170
|
+
const deserializeAws_restJson1PauseCampaignCommandError = async (output, context) => {
|
|
1171
|
+
const parsedOutput = {
|
|
1172
|
+
...output,
|
|
1173
|
+
body: await parseBody(output.body, context),
|
|
1174
|
+
};
|
|
1175
|
+
let response;
|
|
1176
|
+
let errorCode = "UnknownError";
|
|
1177
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1178
|
+
switch (errorCode) {
|
|
1179
|
+
case "AccessDeniedException":
|
|
1180
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1181
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1182
|
+
case "ConflictException":
|
|
1183
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1184
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1185
|
+
case "InternalServerException":
|
|
1186
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1187
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1188
|
+
case "InvalidCampaignStateException":
|
|
1189
|
+
case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
|
|
1190
|
+
throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
|
|
1191
|
+
case "ResourceNotFoundException":
|
|
1192
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1193
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1194
|
+
case "ThrottlingException":
|
|
1195
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1196
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1197
|
+
default:
|
|
1198
|
+
const parsedBody = parsedOutput.body;
|
|
1199
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1200
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1201
|
+
$fault: "client",
|
|
1202
|
+
$metadata: deserializeMetadata(output),
|
|
1203
|
+
});
|
|
1204
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
const deserializeAws_restJson1PutDialRequestBatchCommand = async (output, context) => {
|
|
1208
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1209
|
+
return deserializeAws_restJson1PutDialRequestBatchCommandError(output, context);
|
|
1210
|
+
}
|
|
1211
|
+
const contents = {
|
|
1212
|
+
$metadata: deserializeMetadata(output),
|
|
1213
|
+
failedRequests: undefined,
|
|
1214
|
+
successfulRequests: undefined,
|
|
1215
|
+
};
|
|
1216
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1217
|
+
if (data.failedRequests !== undefined && data.failedRequests !== null) {
|
|
1218
|
+
contents.failedRequests = deserializeAws_restJson1FailedRequestList(data.failedRequests, context);
|
|
1219
|
+
}
|
|
1220
|
+
if (data.successfulRequests !== undefined && data.successfulRequests !== null) {
|
|
1221
|
+
contents.successfulRequests = deserializeAws_restJson1SuccessfulRequestList(data.successfulRequests, context);
|
|
1222
|
+
}
|
|
1223
|
+
return Promise.resolve(contents);
|
|
1224
|
+
};
|
|
1225
|
+
exports.deserializeAws_restJson1PutDialRequestBatchCommand = deserializeAws_restJson1PutDialRequestBatchCommand;
|
|
1226
|
+
const deserializeAws_restJson1PutDialRequestBatchCommandError = async (output, context) => {
|
|
1227
|
+
const parsedOutput = {
|
|
1228
|
+
...output,
|
|
1229
|
+
body: await parseBody(output.body, context),
|
|
1230
|
+
};
|
|
1231
|
+
let response;
|
|
1232
|
+
let errorCode = "UnknownError";
|
|
1233
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1234
|
+
switch (errorCode) {
|
|
1235
|
+
case "AccessDeniedException":
|
|
1236
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1237
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1238
|
+
case "ConflictException":
|
|
1239
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1240
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1241
|
+
case "InternalServerException":
|
|
1242
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1243
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1244
|
+
case "InvalidCampaignStateException":
|
|
1245
|
+
case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
|
|
1246
|
+
throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
|
|
1247
|
+
case "ResourceNotFoundException":
|
|
1248
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1249
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1250
|
+
case "ThrottlingException":
|
|
1251
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1252
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1253
|
+
case "ValidationException":
|
|
1254
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1255
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1256
|
+
default:
|
|
1257
|
+
const parsedBody = parsedOutput.body;
|
|
1258
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1259
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1260
|
+
$fault: "client",
|
|
1261
|
+
$metadata: deserializeMetadata(output),
|
|
1262
|
+
});
|
|
1263
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
const deserializeAws_restJson1ResumeCampaignCommand = async (output, context) => {
|
|
1267
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1268
|
+
return deserializeAws_restJson1ResumeCampaignCommandError(output, context);
|
|
1269
|
+
}
|
|
1270
|
+
const contents = {
|
|
1271
|
+
$metadata: deserializeMetadata(output),
|
|
1272
|
+
};
|
|
1273
|
+
await collectBody(output.body, context);
|
|
1274
|
+
return Promise.resolve(contents);
|
|
1275
|
+
};
|
|
1276
|
+
exports.deserializeAws_restJson1ResumeCampaignCommand = deserializeAws_restJson1ResumeCampaignCommand;
|
|
1277
|
+
const deserializeAws_restJson1ResumeCampaignCommandError = async (output, context) => {
|
|
1278
|
+
const parsedOutput = {
|
|
1279
|
+
...output,
|
|
1280
|
+
body: await parseBody(output.body, context),
|
|
1281
|
+
};
|
|
1282
|
+
let response;
|
|
1283
|
+
let errorCode = "UnknownError";
|
|
1284
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1285
|
+
switch (errorCode) {
|
|
1286
|
+
case "AccessDeniedException":
|
|
1287
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1288
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1289
|
+
case "ConflictException":
|
|
1290
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1291
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1292
|
+
case "InternalServerException":
|
|
1293
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1294
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1295
|
+
case "InvalidCampaignStateException":
|
|
1296
|
+
case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
|
|
1297
|
+
throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
|
|
1298
|
+
case "ResourceNotFoundException":
|
|
1299
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1300
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1301
|
+
case "ThrottlingException":
|
|
1302
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1303
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1304
|
+
default:
|
|
1305
|
+
const parsedBody = parsedOutput.body;
|
|
1306
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1307
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1308
|
+
$fault: "client",
|
|
1309
|
+
$metadata: deserializeMetadata(output),
|
|
1310
|
+
});
|
|
1311
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
const deserializeAws_restJson1StartCampaignCommand = async (output, context) => {
|
|
1315
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1316
|
+
return deserializeAws_restJson1StartCampaignCommandError(output, context);
|
|
1317
|
+
}
|
|
1318
|
+
const contents = {
|
|
1319
|
+
$metadata: deserializeMetadata(output),
|
|
1320
|
+
};
|
|
1321
|
+
await collectBody(output.body, context);
|
|
1322
|
+
return Promise.resolve(contents);
|
|
1323
|
+
};
|
|
1324
|
+
exports.deserializeAws_restJson1StartCampaignCommand = deserializeAws_restJson1StartCampaignCommand;
|
|
1325
|
+
const deserializeAws_restJson1StartCampaignCommandError = async (output, context) => {
|
|
1326
|
+
const parsedOutput = {
|
|
1327
|
+
...output,
|
|
1328
|
+
body: await parseBody(output.body, context),
|
|
1329
|
+
};
|
|
1330
|
+
let response;
|
|
1331
|
+
let errorCode = "UnknownError";
|
|
1332
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1333
|
+
switch (errorCode) {
|
|
1334
|
+
case "AccessDeniedException":
|
|
1335
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1336
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1337
|
+
case "ConflictException":
|
|
1338
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1339
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1340
|
+
case "InternalServerException":
|
|
1341
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1342
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1343
|
+
case "InvalidCampaignStateException":
|
|
1344
|
+
case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
|
|
1345
|
+
throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
|
|
1346
|
+
case "ResourceNotFoundException":
|
|
1347
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1348
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1349
|
+
case "ThrottlingException":
|
|
1350
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1351
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1352
|
+
default:
|
|
1353
|
+
const parsedBody = parsedOutput.body;
|
|
1354
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1355
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1356
|
+
$fault: "client",
|
|
1357
|
+
$metadata: deserializeMetadata(output),
|
|
1358
|
+
});
|
|
1359
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
const deserializeAws_restJson1StartInstanceOnboardingJobCommand = async (output, context) => {
|
|
1363
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1364
|
+
return deserializeAws_restJson1StartInstanceOnboardingJobCommandError(output, context);
|
|
1365
|
+
}
|
|
1366
|
+
const contents = {
|
|
1367
|
+
$metadata: deserializeMetadata(output),
|
|
1368
|
+
connectInstanceOnboardingJobStatus: undefined,
|
|
1369
|
+
};
|
|
1370
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1371
|
+
if (data.connectInstanceOnboardingJobStatus !== undefined && data.connectInstanceOnboardingJobStatus !== null) {
|
|
1372
|
+
contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
|
|
1373
|
+
}
|
|
1374
|
+
return Promise.resolve(contents);
|
|
1375
|
+
};
|
|
1376
|
+
exports.deserializeAws_restJson1StartInstanceOnboardingJobCommand = deserializeAws_restJson1StartInstanceOnboardingJobCommand;
|
|
1377
|
+
const deserializeAws_restJson1StartInstanceOnboardingJobCommandError = async (output, context) => {
|
|
1378
|
+
const parsedOutput = {
|
|
1379
|
+
...output,
|
|
1380
|
+
body: await parseBody(output.body, context),
|
|
1381
|
+
};
|
|
1382
|
+
let response;
|
|
1383
|
+
let errorCode = "UnknownError";
|
|
1384
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1385
|
+
switch (errorCode) {
|
|
1386
|
+
case "AccessDeniedException":
|
|
1387
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1388
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1389
|
+
case "ConflictException":
|
|
1390
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1391
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1392
|
+
case "InternalServerException":
|
|
1393
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1394
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1395
|
+
case "ResourceNotFoundException":
|
|
1396
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1397
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1398
|
+
case "ThrottlingException":
|
|
1399
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1400
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1401
|
+
case "ValidationException":
|
|
1402
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1403
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1404
|
+
default:
|
|
1405
|
+
const parsedBody = parsedOutput.body;
|
|
1406
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1407
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1408
|
+
$fault: "client",
|
|
1409
|
+
$metadata: deserializeMetadata(output),
|
|
1410
|
+
});
|
|
1411
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
const deserializeAws_restJson1StopCampaignCommand = async (output, context) => {
|
|
1415
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1416
|
+
return deserializeAws_restJson1StopCampaignCommandError(output, context);
|
|
1417
|
+
}
|
|
1418
|
+
const contents = {
|
|
1419
|
+
$metadata: deserializeMetadata(output),
|
|
1420
|
+
};
|
|
1421
|
+
await collectBody(output.body, context);
|
|
1422
|
+
return Promise.resolve(contents);
|
|
1423
|
+
};
|
|
1424
|
+
exports.deserializeAws_restJson1StopCampaignCommand = deserializeAws_restJson1StopCampaignCommand;
|
|
1425
|
+
const deserializeAws_restJson1StopCampaignCommandError = async (output, context) => {
|
|
1426
|
+
const parsedOutput = {
|
|
1427
|
+
...output,
|
|
1428
|
+
body: await parseBody(output.body, context),
|
|
1429
|
+
};
|
|
1430
|
+
let response;
|
|
1431
|
+
let errorCode = "UnknownError";
|
|
1432
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1433
|
+
switch (errorCode) {
|
|
1434
|
+
case "AccessDeniedException":
|
|
1435
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1436
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1437
|
+
case "ConflictException":
|
|
1438
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1439
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1440
|
+
case "InternalServerException":
|
|
1441
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1442
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1443
|
+
case "InvalidCampaignStateException":
|
|
1444
|
+
case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
|
|
1445
|
+
throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
|
|
1446
|
+
case "ResourceNotFoundException":
|
|
1447
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1448
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1449
|
+
case "ThrottlingException":
|
|
1450
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1451
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1452
|
+
default:
|
|
1453
|
+
const parsedBody = parsedOutput.body;
|
|
1454
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1455
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1456
|
+
$fault: "client",
|
|
1457
|
+
$metadata: deserializeMetadata(output),
|
|
1458
|
+
});
|
|
1459
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
1463
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1464
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
1465
|
+
}
|
|
1466
|
+
const contents = {
|
|
1467
|
+
$metadata: deserializeMetadata(output),
|
|
1468
|
+
};
|
|
1469
|
+
await collectBody(output.body, context);
|
|
1470
|
+
return Promise.resolve(contents);
|
|
1471
|
+
};
|
|
1472
|
+
exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
|
|
1473
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
1474
|
+
const parsedOutput = {
|
|
1475
|
+
...output,
|
|
1476
|
+
body: await parseBody(output.body, context),
|
|
1477
|
+
};
|
|
1478
|
+
let response;
|
|
1479
|
+
let errorCode = "UnknownError";
|
|
1480
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1481
|
+
switch (errorCode) {
|
|
1482
|
+
case "AccessDeniedException":
|
|
1483
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1484
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1485
|
+
case "InternalServerException":
|
|
1486
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1487
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1488
|
+
case "ResourceNotFoundException":
|
|
1489
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1490
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1491
|
+
case "ThrottlingException":
|
|
1492
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1493
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1494
|
+
case "ValidationException":
|
|
1495
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1496
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1497
|
+
default:
|
|
1498
|
+
const parsedBody = parsedOutput.body;
|
|
1499
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1500
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1501
|
+
$fault: "client",
|
|
1502
|
+
$metadata: deserializeMetadata(output),
|
|
1503
|
+
});
|
|
1504
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
1508
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1509
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
1510
|
+
}
|
|
1511
|
+
const contents = {
|
|
1512
|
+
$metadata: deserializeMetadata(output),
|
|
1513
|
+
};
|
|
1514
|
+
await collectBody(output.body, context);
|
|
1515
|
+
return Promise.resolve(contents);
|
|
1516
|
+
};
|
|
1517
|
+
exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
|
|
1518
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
1519
|
+
const parsedOutput = {
|
|
1520
|
+
...output,
|
|
1521
|
+
body: await parseBody(output.body, context),
|
|
1522
|
+
};
|
|
1523
|
+
let response;
|
|
1524
|
+
let errorCode = "UnknownError";
|
|
1525
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1526
|
+
switch (errorCode) {
|
|
1527
|
+
case "AccessDeniedException":
|
|
1528
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1529
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1530
|
+
case "InternalServerException":
|
|
1531
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1532
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1533
|
+
case "ResourceNotFoundException":
|
|
1534
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1535
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1536
|
+
case "ThrottlingException":
|
|
1537
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1538
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1539
|
+
case "ValidationException":
|
|
1540
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1541
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1542
|
+
default:
|
|
1543
|
+
const parsedBody = parsedOutput.body;
|
|
1544
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1545
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1546
|
+
$fault: "client",
|
|
1547
|
+
$metadata: deserializeMetadata(output),
|
|
1548
|
+
});
|
|
1549
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
const deserializeAws_restJson1UpdateCampaignDialerConfigCommand = async (output, context) => {
|
|
1553
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1554
|
+
return deserializeAws_restJson1UpdateCampaignDialerConfigCommandError(output, context);
|
|
1555
|
+
}
|
|
1556
|
+
const contents = {
|
|
1557
|
+
$metadata: deserializeMetadata(output),
|
|
1558
|
+
};
|
|
1559
|
+
await collectBody(output.body, context);
|
|
1560
|
+
return Promise.resolve(contents);
|
|
1561
|
+
};
|
|
1562
|
+
exports.deserializeAws_restJson1UpdateCampaignDialerConfigCommand = deserializeAws_restJson1UpdateCampaignDialerConfigCommand;
|
|
1563
|
+
const deserializeAws_restJson1UpdateCampaignDialerConfigCommandError = async (output, context) => {
|
|
1564
|
+
const parsedOutput = {
|
|
1565
|
+
...output,
|
|
1566
|
+
body: await parseBody(output.body, context),
|
|
1567
|
+
};
|
|
1568
|
+
let response;
|
|
1569
|
+
let errorCode = "UnknownError";
|
|
1570
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1571
|
+
switch (errorCode) {
|
|
1572
|
+
case "AccessDeniedException":
|
|
1573
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1574
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1575
|
+
case "ConflictException":
|
|
1576
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1577
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1578
|
+
case "InternalServerException":
|
|
1579
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1580
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1581
|
+
case "ResourceNotFoundException":
|
|
1582
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1583
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1584
|
+
case "ValidationException":
|
|
1585
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1586
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1587
|
+
default:
|
|
1588
|
+
const parsedBody = parsedOutput.body;
|
|
1589
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1590
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1591
|
+
$fault: "client",
|
|
1592
|
+
$metadata: deserializeMetadata(output),
|
|
1593
|
+
});
|
|
1594
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
const deserializeAws_restJson1UpdateCampaignNameCommand = async (output, context) => {
|
|
1598
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1599
|
+
return deserializeAws_restJson1UpdateCampaignNameCommandError(output, context);
|
|
1600
|
+
}
|
|
1601
|
+
const contents = {
|
|
1602
|
+
$metadata: deserializeMetadata(output),
|
|
1603
|
+
};
|
|
1604
|
+
await collectBody(output.body, context);
|
|
1605
|
+
return Promise.resolve(contents);
|
|
1606
|
+
};
|
|
1607
|
+
exports.deserializeAws_restJson1UpdateCampaignNameCommand = deserializeAws_restJson1UpdateCampaignNameCommand;
|
|
1608
|
+
const deserializeAws_restJson1UpdateCampaignNameCommandError = async (output, context) => {
|
|
1609
|
+
const parsedOutput = {
|
|
1610
|
+
...output,
|
|
1611
|
+
body: await parseBody(output.body, context),
|
|
1612
|
+
};
|
|
1613
|
+
let response;
|
|
1614
|
+
let errorCode = "UnknownError";
|
|
1615
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1616
|
+
switch (errorCode) {
|
|
1617
|
+
case "AccessDeniedException":
|
|
1618
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1619
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1620
|
+
case "ConflictException":
|
|
1621
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1622
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1623
|
+
case "InternalServerException":
|
|
1624
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1625
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1626
|
+
case "ResourceNotFoundException":
|
|
1627
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1628
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1629
|
+
case "ValidationException":
|
|
1630
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1631
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1632
|
+
default:
|
|
1633
|
+
const parsedBody = parsedOutput.body;
|
|
1634
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1635
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1636
|
+
$fault: "client",
|
|
1637
|
+
$metadata: deserializeMetadata(output),
|
|
1638
|
+
});
|
|
1639
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1640
|
+
}
|
|
1641
|
+
};
|
|
1642
|
+
const deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = async (output, context) => {
|
|
1643
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1644
|
+
return deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError(output, context);
|
|
1645
|
+
}
|
|
1646
|
+
const contents = {
|
|
1647
|
+
$metadata: deserializeMetadata(output),
|
|
1648
|
+
};
|
|
1649
|
+
await collectBody(output.body, context);
|
|
1650
|
+
return Promise.resolve(contents);
|
|
1651
|
+
};
|
|
1652
|
+
exports.deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand;
|
|
1653
|
+
const deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError = async (output, context) => {
|
|
1654
|
+
const parsedOutput = {
|
|
1655
|
+
...output,
|
|
1656
|
+
body: await parseBody(output.body, context),
|
|
1657
|
+
};
|
|
1658
|
+
let response;
|
|
1659
|
+
let errorCode = "UnknownError";
|
|
1660
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1661
|
+
switch (errorCode) {
|
|
1662
|
+
case "AccessDeniedException":
|
|
1663
|
+
case "com.amazonaws.connectcampaigns#AccessDeniedException":
|
|
1664
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1665
|
+
case "ConflictException":
|
|
1666
|
+
case "com.amazonaws.connectcampaigns#ConflictException":
|
|
1667
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1668
|
+
case "InternalServerException":
|
|
1669
|
+
case "com.amazonaws.connectcampaigns#InternalServerException":
|
|
1670
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1671
|
+
case "ResourceNotFoundException":
|
|
1672
|
+
case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
|
|
1673
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1674
|
+
case "ThrottlingException":
|
|
1675
|
+
case "com.amazonaws.connectcampaigns#ThrottlingException":
|
|
1676
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1677
|
+
case "ValidationException":
|
|
1678
|
+
case "com.amazonaws.connectcampaigns#ValidationException":
|
|
1679
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1680
|
+
default:
|
|
1681
|
+
const parsedBody = parsedOutput.body;
|
|
1682
|
+
response = new ConnectCampaignsServiceException_1.ConnectCampaignsServiceException({
|
|
1683
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
1684
|
+
$fault: "client",
|
|
1685
|
+
$metadata: deserializeMetadata(output),
|
|
1686
|
+
});
|
|
1687
|
+
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
1691
|
+
const contents = {};
|
|
1692
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1693
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1694
|
+
}
|
|
1695
|
+
const data = parsedOutput.body;
|
|
1696
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1697
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1698
|
+
}
|
|
1699
|
+
const exception = new models_0_1.AccessDeniedException({
|
|
1700
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1701
|
+
...contents,
|
|
1702
|
+
});
|
|
1703
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1704
|
+
};
|
|
1705
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
1706
|
+
const contents = {};
|
|
1707
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1708
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1709
|
+
}
|
|
1710
|
+
const data = parsedOutput.body;
|
|
1711
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1712
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1713
|
+
}
|
|
1714
|
+
const exception = new models_0_1.ConflictException({
|
|
1715
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1716
|
+
...contents,
|
|
1717
|
+
});
|
|
1718
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1719
|
+
};
|
|
1720
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
1721
|
+
const contents = {};
|
|
1722
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1723
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1724
|
+
}
|
|
1725
|
+
const data = parsedOutput.body;
|
|
1726
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1727
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1728
|
+
}
|
|
1729
|
+
const exception = new models_0_1.InternalServerException({
|
|
1730
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1731
|
+
...contents,
|
|
1732
|
+
});
|
|
1733
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1734
|
+
};
|
|
1735
|
+
const deserializeAws_restJson1InvalidCampaignStateExceptionResponse = async (parsedOutput, context) => {
|
|
1736
|
+
const contents = {};
|
|
1737
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1738
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1739
|
+
}
|
|
1740
|
+
const data = parsedOutput.body;
|
|
1741
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1742
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1743
|
+
}
|
|
1744
|
+
if (data.state !== undefined && data.state !== null) {
|
|
1745
|
+
contents.state = (0, smithy_client_1.expectString)(data.state);
|
|
1746
|
+
}
|
|
1747
|
+
const exception = new models_0_1.InvalidCampaignStateException({
|
|
1748
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1749
|
+
...contents,
|
|
1750
|
+
});
|
|
1751
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1752
|
+
};
|
|
1753
|
+
const deserializeAws_restJson1InvalidStateExceptionResponse = async (parsedOutput, context) => {
|
|
1754
|
+
const contents = {};
|
|
1755
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1756
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1757
|
+
}
|
|
1758
|
+
const data = parsedOutput.body;
|
|
1759
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1760
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1761
|
+
}
|
|
1762
|
+
const exception = new models_0_1.InvalidStateException({
|
|
1763
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1764
|
+
...contents,
|
|
1765
|
+
});
|
|
1766
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1767
|
+
};
|
|
1768
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
1769
|
+
const contents = {};
|
|
1770
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1771
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1772
|
+
}
|
|
1773
|
+
const data = parsedOutput.body;
|
|
1774
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1775
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1776
|
+
}
|
|
1777
|
+
const exception = new models_0_1.ResourceNotFoundException({
|
|
1778
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1779
|
+
...contents,
|
|
1780
|
+
});
|
|
1781
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1782
|
+
};
|
|
1783
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
1784
|
+
const contents = {};
|
|
1785
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1786
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1787
|
+
}
|
|
1788
|
+
const data = parsedOutput.body;
|
|
1789
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1790
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1791
|
+
}
|
|
1792
|
+
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
1793
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1794
|
+
...contents,
|
|
1795
|
+
});
|
|
1796
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1797
|
+
};
|
|
1798
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
1799
|
+
const contents = {};
|
|
1800
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1801
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1802
|
+
}
|
|
1803
|
+
const data = parsedOutput.body;
|
|
1804
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1805
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1806
|
+
}
|
|
1807
|
+
const exception = new models_0_1.ThrottlingException({
|
|
1808
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1809
|
+
...contents,
|
|
1810
|
+
});
|
|
1811
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1812
|
+
};
|
|
1813
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
1814
|
+
const contents = {};
|
|
1815
|
+
if (parsedOutput.headers["x-amzn-errortype"] !== undefined) {
|
|
1816
|
+
contents.xAmzErrorType = parsedOutput.headers["x-amzn-errortype"];
|
|
1817
|
+
}
|
|
1818
|
+
const data = parsedOutput.body;
|
|
1819
|
+
if (data.message !== undefined && data.message !== null) {
|
|
1820
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
1821
|
+
}
|
|
1822
|
+
const exception = new models_0_1.ValidationException({
|
|
1823
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1824
|
+
...contents,
|
|
1825
|
+
});
|
|
1826
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1827
|
+
};
|
|
1828
|
+
const serializeAws_restJson1AnswerMachineDetectionConfig = (input, context) => {
|
|
1829
|
+
return {
|
|
1830
|
+
...(input.enableAnswerMachineDetection !== undefined &&
|
|
1831
|
+
input.enableAnswerMachineDetection !== null && {
|
|
1832
|
+
enableAnswerMachineDetection: input.enableAnswerMachineDetection,
|
|
1833
|
+
}),
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
const serializeAws_restJson1Attributes = (input, context) => {
|
|
1837
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1838
|
+
if (value === null) {
|
|
1839
|
+
return acc;
|
|
1840
|
+
}
|
|
1841
|
+
return {
|
|
1842
|
+
...acc,
|
|
1843
|
+
[key]: value,
|
|
1844
|
+
};
|
|
1845
|
+
}, {});
|
|
1846
|
+
};
|
|
1847
|
+
const serializeAws_restJson1CampaignFilters = (input, context) => {
|
|
1848
|
+
return {
|
|
1849
|
+
...(input.instanceIdFilter !== undefined &&
|
|
1850
|
+
input.instanceIdFilter !== null && {
|
|
1851
|
+
instanceIdFilter: serializeAws_restJson1InstanceIdFilter(input.instanceIdFilter, context),
|
|
1852
|
+
}),
|
|
1853
|
+
};
|
|
1854
|
+
};
|
|
1855
|
+
const serializeAws_restJson1CampaignIdList = (input, context) => {
|
|
1856
|
+
return input
|
|
1857
|
+
.filter((e) => e != null)
|
|
1858
|
+
.map((entry) => {
|
|
1859
|
+
if (entry === null) {
|
|
1860
|
+
return null;
|
|
1861
|
+
}
|
|
1862
|
+
return entry;
|
|
1863
|
+
});
|
|
1864
|
+
};
|
|
1865
|
+
const serializeAws_restJson1DialerConfig = (input, context) => {
|
|
1866
|
+
return models_0_1.DialerConfig.visit(input, {
|
|
1867
|
+
predictiveDialerConfig: (value) => ({
|
|
1868
|
+
predictiveDialerConfig: serializeAws_restJson1PredictiveDialerConfig(value, context),
|
|
1869
|
+
}),
|
|
1870
|
+
progressiveDialerConfig: (value) => ({
|
|
1871
|
+
progressiveDialerConfig: serializeAws_restJson1ProgressiveDialerConfig(value, context),
|
|
1872
|
+
}),
|
|
1873
|
+
_: (name, value) => ({ name: value }),
|
|
1874
|
+
});
|
|
1875
|
+
};
|
|
1876
|
+
const serializeAws_restJson1DialRequest = (input, context) => {
|
|
1877
|
+
return {
|
|
1878
|
+
...(input.attributes !== undefined &&
|
|
1879
|
+
input.attributes !== null && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }),
|
|
1880
|
+
...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }),
|
|
1881
|
+
...(input.expirationTime !== undefined &&
|
|
1882
|
+
input.expirationTime !== null && { expirationTime: input.expirationTime.toISOString().split(".")[0] + "Z" }),
|
|
1883
|
+
...(input.phoneNumber !== undefined && input.phoneNumber !== null && { phoneNumber: input.phoneNumber }),
|
|
1884
|
+
};
|
|
1885
|
+
};
|
|
1886
|
+
const serializeAws_restJson1DialRequestList = (input, context) => {
|
|
1887
|
+
return input
|
|
1888
|
+
.filter((e) => e != null)
|
|
1889
|
+
.map((entry) => {
|
|
1890
|
+
if (entry === null) {
|
|
1891
|
+
return null;
|
|
1892
|
+
}
|
|
1893
|
+
return serializeAws_restJson1DialRequest(entry, context);
|
|
1894
|
+
});
|
|
1895
|
+
};
|
|
1896
|
+
const serializeAws_restJson1EncryptionConfig = (input, context) => {
|
|
1897
|
+
return {
|
|
1898
|
+
...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }),
|
|
1899
|
+
...(input.encryptionType !== undefined &&
|
|
1900
|
+
input.encryptionType !== null && { encryptionType: input.encryptionType }),
|
|
1901
|
+
...(input.keyArn !== undefined && input.keyArn !== null && { keyArn: input.keyArn }),
|
|
1902
|
+
};
|
|
1903
|
+
};
|
|
1904
|
+
const serializeAws_restJson1InstanceIdFilter = (input, context) => {
|
|
1905
|
+
return {
|
|
1906
|
+
...(input.operator !== undefined && input.operator !== null && { operator: input.operator }),
|
|
1907
|
+
...(input.value !== undefined && input.value !== null && { value: input.value }),
|
|
1908
|
+
};
|
|
1909
|
+
};
|
|
1910
|
+
const serializeAws_restJson1OutboundCallConfig = (input, context) => {
|
|
1911
|
+
return {
|
|
1912
|
+
...(input.answerMachineDetectionConfig !== undefined &&
|
|
1913
|
+
input.answerMachineDetectionConfig !== null && {
|
|
1914
|
+
answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
|
|
1915
|
+
}),
|
|
1916
|
+
...(input.connectContactFlowId !== undefined &&
|
|
1917
|
+
input.connectContactFlowId !== null && { connectContactFlowId: input.connectContactFlowId }),
|
|
1918
|
+
...(input.connectQueueId !== undefined &&
|
|
1919
|
+
input.connectQueueId !== null && { connectQueueId: input.connectQueueId }),
|
|
1920
|
+
...(input.connectSourcePhoneNumber !== undefined &&
|
|
1921
|
+
input.connectSourcePhoneNumber !== null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber }),
|
|
1922
|
+
};
|
|
1923
|
+
};
|
|
1924
|
+
const serializeAws_restJson1PredictiveDialerConfig = (input, context) => {
|
|
1925
|
+
return {
|
|
1926
|
+
...(input.bandwidthAllocation !== undefined &&
|
|
1927
|
+
input.bandwidthAllocation !== null && { bandwidthAllocation: (0, smithy_client_1.serializeFloat)(input.bandwidthAllocation) }),
|
|
1928
|
+
};
|
|
1929
|
+
};
|
|
1930
|
+
const serializeAws_restJson1ProgressiveDialerConfig = (input, context) => {
|
|
1931
|
+
return {
|
|
1932
|
+
...(input.bandwidthAllocation !== undefined &&
|
|
1933
|
+
input.bandwidthAllocation !== null && { bandwidthAllocation: (0, smithy_client_1.serializeFloat)(input.bandwidthAllocation) }),
|
|
1934
|
+
};
|
|
1935
|
+
};
|
|
1936
|
+
const serializeAws_restJson1TagMap = (input, context) => {
|
|
1937
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1938
|
+
if (value === null) {
|
|
1939
|
+
return acc;
|
|
1940
|
+
}
|
|
1941
|
+
return {
|
|
1942
|
+
...acc,
|
|
1943
|
+
[key]: value,
|
|
1944
|
+
};
|
|
1945
|
+
}, {});
|
|
1946
|
+
};
|
|
1947
|
+
const deserializeAws_restJson1AnswerMachineDetectionConfig = (output, context) => {
|
|
1948
|
+
return {
|
|
1949
|
+
enableAnswerMachineDetection: (0, smithy_client_1.expectBoolean)(output.enableAnswerMachineDetection),
|
|
1950
|
+
};
|
|
1951
|
+
};
|
|
1952
|
+
const deserializeAws_restJson1Campaign = (output, context) => {
|
|
1953
|
+
return {
|
|
1954
|
+
arn: (0, smithy_client_1.expectString)(output.arn),
|
|
1955
|
+
connectInstanceId: (0, smithy_client_1.expectString)(output.connectInstanceId),
|
|
1956
|
+
dialerConfig: output.dialerConfig !== undefined && output.dialerConfig !== null
|
|
1957
|
+
? deserializeAws_restJson1DialerConfig((0, smithy_client_1.expectUnion)(output.dialerConfig), context)
|
|
1958
|
+
: undefined,
|
|
1959
|
+
id: (0, smithy_client_1.expectString)(output.id),
|
|
1960
|
+
name: (0, smithy_client_1.expectString)(output.name),
|
|
1961
|
+
outboundCallConfig: output.outboundCallConfig !== undefined && output.outboundCallConfig !== null
|
|
1962
|
+
? deserializeAws_restJson1OutboundCallConfig(output.outboundCallConfig, context)
|
|
1963
|
+
: undefined,
|
|
1964
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
1965
|
+
? deserializeAws_restJson1TagMap(output.tags, context)
|
|
1966
|
+
: undefined,
|
|
1967
|
+
};
|
|
1968
|
+
};
|
|
1969
|
+
const deserializeAws_restJson1CampaignSummary = (output, context) => {
|
|
1970
|
+
return {
|
|
1971
|
+
arn: (0, smithy_client_1.expectString)(output.arn),
|
|
1972
|
+
connectInstanceId: (0, smithy_client_1.expectString)(output.connectInstanceId),
|
|
1973
|
+
id: (0, smithy_client_1.expectString)(output.id),
|
|
1974
|
+
name: (0, smithy_client_1.expectString)(output.name),
|
|
1975
|
+
};
|
|
1976
|
+
};
|
|
1977
|
+
const deserializeAws_restJson1CampaignSummaryList = (output, context) => {
|
|
1978
|
+
const retVal = (output || [])
|
|
1979
|
+
.filter((e) => e != null)
|
|
1980
|
+
.map((entry) => {
|
|
1981
|
+
if (entry === null) {
|
|
1982
|
+
return null;
|
|
1983
|
+
}
|
|
1984
|
+
return deserializeAws_restJson1CampaignSummary(entry, context);
|
|
1985
|
+
});
|
|
1986
|
+
return retVal;
|
|
1987
|
+
};
|
|
1988
|
+
const deserializeAws_restJson1DialerConfig = (output, context) => {
|
|
1989
|
+
if (output.predictiveDialerConfig !== undefined && output.predictiveDialerConfig !== null) {
|
|
1990
|
+
return {
|
|
1991
|
+
predictiveDialerConfig: deserializeAws_restJson1PredictiveDialerConfig(output.predictiveDialerConfig, context),
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
if (output.progressiveDialerConfig !== undefined && output.progressiveDialerConfig !== null) {
|
|
1995
|
+
return {
|
|
1996
|
+
progressiveDialerConfig: deserializeAws_restJson1ProgressiveDialerConfig(output.progressiveDialerConfig, context),
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2000
|
+
};
|
|
2001
|
+
const deserializeAws_restJson1EncryptionConfig = (output, context) => {
|
|
2002
|
+
return {
|
|
2003
|
+
enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
|
|
2004
|
+
encryptionType: (0, smithy_client_1.expectString)(output.encryptionType),
|
|
2005
|
+
keyArn: (0, smithy_client_1.expectString)(output.keyArn),
|
|
2006
|
+
};
|
|
2007
|
+
};
|
|
2008
|
+
const deserializeAws_restJson1FailedCampaignStateResponse = (output, context) => {
|
|
2009
|
+
return {
|
|
2010
|
+
campaignId: (0, smithy_client_1.expectString)(output.campaignId),
|
|
2011
|
+
failureCode: (0, smithy_client_1.expectString)(output.failureCode),
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
2014
|
+
const deserializeAws_restJson1FailedCampaignStateResponseList = (output, context) => {
|
|
2015
|
+
const retVal = (output || [])
|
|
2016
|
+
.filter((e) => e != null)
|
|
2017
|
+
.map((entry) => {
|
|
2018
|
+
if (entry === null) {
|
|
2019
|
+
return null;
|
|
2020
|
+
}
|
|
2021
|
+
return deserializeAws_restJson1FailedCampaignStateResponse(entry, context);
|
|
2022
|
+
});
|
|
2023
|
+
return retVal;
|
|
2024
|
+
};
|
|
2025
|
+
const deserializeAws_restJson1FailedRequest = (output, context) => {
|
|
2026
|
+
return {
|
|
2027
|
+
clientToken: (0, smithy_client_1.expectString)(output.clientToken),
|
|
2028
|
+
failureCode: (0, smithy_client_1.expectString)(output.failureCode),
|
|
2029
|
+
id: (0, smithy_client_1.expectString)(output.id),
|
|
2030
|
+
};
|
|
2031
|
+
};
|
|
2032
|
+
const deserializeAws_restJson1FailedRequestList = (output, context) => {
|
|
2033
|
+
const retVal = (output || [])
|
|
2034
|
+
.filter((e) => e != null)
|
|
2035
|
+
.map((entry) => {
|
|
2036
|
+
if (entry === null) {
|
|
2037
|
+
return null;
|
|
2038
|
+
}
|
|
2039
|
+
return deserializeAws_restJson1FailedRequest(entry, context);
|
|
2040
|
+
});
|
|
2041
|
+
return retVal;
|
|
2042
|
+
};
|
|
2043
|
+
const deserializeAws_restJson1InstanceConfig = (output, context) => {
|
|
2044
|
+
return {
|
|
2045
|
+
connectInstanceId: (0, smithy_client_1.expectString)(output.connectInstanceId),
|
|
2046
|
+
encryptionConfig: output.encryptionConfig !== undefined && output.encryptionConfig !== null
|
|
2047
|
+
? deserializeAws_restJson1EncryptionConfig(output.encryptionConfig, context)
|
|
2048
|
+
: undefined,
|
|
2049
|
+
serviceLinkedRoleArn: (0, smithy_client_1.expectString)(output.serviceLinkedRoleArn),
|
|
2050
|
+
};
|
|
2051
|
+
};
|
|
2052
|
+
const deserializeAws_restJson1InstanceOnboardingJobStatus = (output, context) => {
|
|
2053
|
+
return {
|
|
2054
|
+
connectInstanceId: (0, smithy_client_1.expectString)(output.connectInstanceId),
|
|
2055
|
+
failureCode: (0, smithy_client_1.expectString)(output.failureCode),
|
|
2056
|
+
status: (0, smithy_client_1.expectString)(output.status),
|
|
2057
|
+
};
|
|
2058
|
+
};
|
|
2059
|
+
const deserializeAws_restJson1OutboundCallConfig = (output, context) => {
|
|
2060
|
+
return {
|
|
2061
|
+
answerMachineDetectionConfig: output.answerMachineDetectionConfig !== undefined && output.answerMachineDetectionConfig !== null
|
|
2062
|
+
? deserializeAws_restJson1AnswerMachineDetectionConfig(output.answerMachineDetectionConfig, context)
|
|
2063
|
+
: undefined,
|
|
2064
|
+
connectContactFlowId: (0, smithy_client_1.expectString)(output.connectContactFlowId),
|
|
2065
|
+
connectQueueId: (0, smithy_client_1.expectString)(output.connectQueueId),
|
|
2066
|
+
connectSourcePhoneNumber: (0, smithy_client_1.expectString)(output.connectSourcePhoneNumber),
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
2069
|
+
const deserializeAws_restJson1PredictiveDialerConfig = (output, context) => {
|
|
2070
|
+
return {
|
|
2071
|
+
bandwidthAllocation: (0, smithy_client_1.limitedParseDouble)(output.bandwidthAllocation),
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
const deserializeAws_restJson1ProgressiveDialerConfig = (output, context) => {
|
|
2075
|
+
return {
|
|
2076
|
+
bandwidthAllocation: (0, smithy_client_1.limitedParseDouble)(output.bandwidthAllocation),
|
|
2077
|
+
};
|
|
2078
|
+
};
|
|
2079
|
+
const deserializeAws_restJson1SuccessfulCampaignStateResponse = (output, context) => {
|
|
2080
|
+
return {
|
|
2081
|
+
campaignId: (0, smithy_client_1.expectString)(output.campaignId),
|
|
2082
|
+
state: (0, smithy_client_1.expectString)(output.state),
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
const deserializeAws_restJson1SuccessfulCampaignStateResponseList = (output, context) => {
|
|
2086
|
+
const retVal = (output || [])
|
|
2087
|
+
.filter((e) => e != null)
|
|
2088
|
+
.map((entry) => {
|
|
2089
|
+
if (entry === null) {
|
|
2090
|
+
return null;
|
|
2091
|
+
}
|
|
2092
|
+
return deserializeAws_restJson1SuccessfulCampaignStateResponse(entry, context);
|
|
2093
|
+
});
|
|
2094
|
+
return retVal;
|
|
2095
|
+
};
|
|
2096
|
+
const deserializeAws_restJson1SuccessfulRequest = (output, context) => {
|
|
2097
|
+
return {
|
|
2098
|
+
clientToken: (0, smithy_client_1.expectString)(output.clientToken),
|
|
2099
|
+
id: (0, smithy_client_1.expectString)(output.id),
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
const deserializeAws_restJson1SuccessfulRequestList = (output, context) => {
|
|
2103
|
+
const retVal = (output || [])
|
|
2104
|
+
.filter((e) => e != null)
|
|
2105
|
+
.map((entry) => {
|
|
2106
|
+
if (entry === null) {
|
|
2107
|
+
return null;
|
|
2108
|
+
}
|
|
2109
|
+
return deserializeAws_restJson1SuccessfulRequest(entry, context);
|
|
2110
|
+
});
|
|
2111
|
+
return retVal;
|
|
2112
|
+
};
|
|
2113
|
+
const deserializeAws_restJson1TagMap = (output, context) => {
|
|
2114
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
2115
|
+
if (value === null) {
|
|
2116
|
+
return acc;
|
|
2117
|
+
}
|
|
2118
|
+
return {
|
|
2119
|
+
...acc,
|
|
2120
|
+
[key]: (0, smithy_client_1.expectString)(value),
|
|
2121
|
+
};
|
|
2122
|
+
}, {});
|
|
2123
|
+
};
|
|
2124
|
+
const deserializeMetadata = (output) => {
|
|
2125
|
+
var _a;
|
|
2126
|
+
return ({
|
|
2127
|
+
httpStatusCode: output.statusCode,
|
|
2128
|
+
requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
|
|
2129
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
2130
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
2131
|
+
});
|
|
2132
|
+
};
|
|
2133
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
2134
|
+
if (streamBody instanceof Uint8Array) {
|
|
2135
|
+
return Promise.resolve(streamBody);
|
|
2136
|
+
}
|
|
2137
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
2138
|
+
};
|
|
2139
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
2140
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
2141
|
+
value !== null &&
|
|
2142
|
+
value !== "" &&
|
|
2143
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
2144
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
2145
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
2146
|
+
if (encoded.length) {
|
|
2147
|
+
return JSON.parse(encoded);
|
|
2148
|
+
}
|
|
2149
|
+
return {};
|
|
2150
|
+
});
|
|
2151
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
2152
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
2153
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
2154
|
+
let cleanValue = rawValue;
|
|
2155
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
2156
|
+
cleanValue = cleanValue.split(":")[0];
|
|
2157
|
+
}
|
|
2158
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
2159
|
+
cleanValue = cleanValue.split("#")[1];
|
|
2160
|
+
}
|
|
2161
|
+
return cleanValue;
|
|
2162
|
+
};
|
|
2163
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2164
|
+
if (headerKey !== undefined) {
|
|
2165
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2166
|
+
}
|
|
2167
|
+
if (data.code !== undefined) {
|
|
2168
|
+
return sanitizeErrorCode(data.code);
|
|
2169
|
+
}
|
|
2170
|
+
if (data["__type"] !== undefined) {
|
|
2171
|
+
return sanitizeErrorCode(data["__type"]);
|
|
2172
|
+
}
|
|
2173
|
+
return "";
|
|
2174
|
+
};
|