@aws-sdk/client-apigatewaymanagementapi 3.35.0 → 3.36.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 +13 -0
- package/dist-cjs/ApiGatewayManagementApi.js +0 -1
- package/dist-cjs/ApiGatewayManagementApiClient.js +0 -1
- package/dist-cjs/commands/DeleteConnectionCommand.js +0 -1
- package/dist-cjs/commands/GetConnectionCommand.js +0 -1
- package/dist-cjs/commands/PostToConnectionCommand.js +0 -1
- package/dist-cjs/endpoints.js +0 -1
- package/dist-cjs/index.js +0 -1
- package/dist-cjs/models/index.js +0 -1
- package/dist-cjs/models/models_0.js +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js +0 -1
- package/dist-cjs/runtimeConfig.browser.js +2 -3
- package/dist-cjs/runtimeConfig.js +3 -4
- package/dist-cjs/runtimeConfig.native.js +0 -1
- package/dist-cjs/runtimeConfig.shared.js +0 -1
- package/dist-es/ApiGatewayManagementApi.js +0 -1
- package/dist-es/ApiGatewayManagementApiClient.js +0 -1
- package/dist-es/commands/DeleteConnectionCommand.js +0 -1
- package/dist-es/commands/GetConnectionCommand.js +0 -1
- package/dist-es/commands/PostToConnectionCommand.js +0 -1
- package/dist-es/endpoints.js +0 -1
- package/dist-es/index.js +0 -1
- package/dist-es/models/index.js +0 -1
- package/dist-es/models/models_0.js +0 -1
- package/dist-es/protocols/Aws_restJson1.js +0 -1
- package/dist-es/runtimeConfig.browser.js +1 -2
- package/dist-es/runtimeConfig.js +2 -3
- package/dist-es/runtimeConfig.native.js +0 -1
- package/dist-es/runtimeConfig.shared.js +0 -1
- package/dist-types/runtimeConfig.browser.d.ts +3 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -0
- package/package.json +33 -30
- package/dist-cjs/ApiGatewayManagementApi.js.map +0 -1
- package/dist-cjs/ApiGatewayManagementApiClient.js.map +0 -1
- package/dist-cjs/commands/DeleteConnectionCommand.js.map +0 -1
- package/dist-cjs/commands/GetConnectionCommand.js.map +0 -1
- package/dist-cjs/commands/PostToConnectionCommand.js.map +0 -1
- package/dist-cjs/endpoints.js.map +0 -1
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/models/index.js.map +0 -1
- package/dist-cjs/models/models_0.js.map +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist-cjs/runtimeConfig.browser.js.map +0 -1
- package/dist-cjs/runtimeConfig.js.map +0 -1
- package/dist-cjs/runtimeConfig.native.js.map +0 -1
- package/dist-cjs/runtimeConfig.shared.js.map +0 -1
- package/dist-es/ApiGatewayManagementApi.js.map +0 -1
- package/dist-es/ApiGatewayManagementApiClient.js.map +0 -1
- package/dist-es/commands/DeleteConnectionCommand.js.map +0 -1
- package/dist-es/commands/GetConnectionCommand.js.map +0 -1
- package/dist-es/commands/PostToConnectionCommand.js.map +0 -1
- package/dist-es/endpoints.js.map +0 -1
- package/dist-es/index.js.map +0 -1
- package/dist-es/models/index.js.map +0 -1
- package/dist-es/models/models_0.js.map +0 -1
- package/dist-es/protocols/Aws_restJson1.js.map +0 -1
- package/dist-es/runtimeConfig.browser.js.map +0 -1
- package/dist-es/runtimeConfig.js.map +0 -1
- package/dist-es/runtimeConfig.native.js.map +0 -1
- package/dist-es/runtimeConfig.shared.js.map +0 -1
- package/jest.config.js +0 -4
- package/src/ApiGatewayManagementApi.ts +0 -119
- package/src/ApiGatewayManagementApiClient.ts +0 -242
- package/src/commands/DeleteConnectionCommand.ts +0 -99
- package/src/commands/GetConnectionCommand.ts +0 -99
- package/src/commands/PostToConnectionCommand.ts +0 -99
- package/src/endpoints.ts +0 -57
- package/src/index.ts +0 -6
- package/src/models/index.ts +0 -1
- package/src/models/models_0.ts +0 -160
- package/src/protocols/Aws_restJson1.ts +0 -469
- package/src/runtimeConfig.browser.ts +0 -41
- package/src/runtimeConfig.native.ts +0 -17
- package/src/runtimeConfig.shared.ts +0 -17
- package/src/runtimeConfig.ts +0 -46
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -33
- package/tsconfig.types.json +0 -9
package/src/endpoints.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { getRegionInfo, PartitionHash, RegionHash } from "@aws-sdk/config-resolver";
|
|
2
|
-
import { RegionInfoProvider } from "@aws-sdk/types";
|
|
3
|
-
|
|
4
|
-
const regionHash: RegionHash = {};
|
|
5
|
-
|
|
6
|
-
const partitionHash: PartitionHash = {
|
|
7
|
-
aws: {
|
|
8
|
-
regions: [
|
|
9
|
-
"af-south-1",
|
|
10
|
-
"ap-east-1",
|
|
11
|
-
"ap-northeast-1",
|
|
12
|
-
"ap-northeast-2",
|
|
13
|
-
"ap-northeast-3",
|
|
14
|
-
"ap-south-1",
|
|
15
|
-
"ap-southeast-1",
|
|
16
|
-
"ap-southeast-2",
|
|
17
|
-
"ca-central-1",
|
|
18
|
-
"eu-central-1",
|
|
19
|
-
"eu-north-1",
|
|
20
|
-
"eu-south-1",
|
|
21
|
-
"eu-west-1",
|
|
22
|
-
"eu-west-2",
|
|
23
|
-
"eu-west-3",
|
|
24
|
-
"me-south-1",
|
|
25
|
-
"sa-east-1",
|
|
26
|
-
"us-east-1",
|
|
27
|
-
"us-east-2",
|
|
28
|
-
"us-west-1",
|
|
29
|
-
"us-west-2",
|
|
30
|
-
],
|
|
31
|
-
hostname: "execute-api.{region}.amazonaws.com",
|
|
32
|
-
},
|
|
33
|
-
"aws-cn": {
|
|
34
|
-
regions: ["cn-north-1", "cn-northwest-1"],
|
|
35
|
-
hostname: "execute-api.{region}.amazonaws.com.cn",
|
|
36
|
-
},
|
|
37
|
-
"aws-iso": {
|
|
38
|
-
regions: ["us-iso-east-1"],
|
|
39
|
-
hostname: "execute-api.{region}.c2s.ic.gov",
|
|
40
|
-
},
|
|
41
|
-
"aws-iso-b": {
|
|
42
|
-
regions: ["us-isob-east-1"],
|
|
43
|
-
hostname: "execute-api.{region}.sc2s.sgov.gov",
|
|
44
|
-
},
|
|
45
|
-
"aws-us-gov": {
|
|
46
|
-
regions: ["us-gov-east-1", "us-gov-west-1"],
|
|
47
|
-
hostname: "execute-api.{region}.amazonaws.com",
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const defaultRegionInfoProvider: RegionInfoProvider = async (region: string, options?: any) =>
|
|
52
|
-
getRegionInfo(region, {
|
|
53
|
-
...options,
|
|
54
|
-
signingService: "execute-api",
|
|
55
|
-
regionHash,
|
|
56
|
-
partitionHash,
|
|
57
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from "./ApiGatewayManagementApiClient";
|
|
2
|
-
export * from "./ApiGatewayManagementApi";
|
|
3
|
-
export * from "./commands/DeleteConnectionCommand";
|
|
4
|
-
export * from "./commands/GetConnectionCommand";
|
|
5
|
-
export * from "./commands/PostToConnectionCommand";
|
|
6
|
-
export * from "./models/index";
|
package/src/models/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./models_0";
|
package/src/models/models_0.ts
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
|
|
2
|
-
|
|
3
|
-
export interface DeleteConnectionRequest {
|
|
4
|
-
ConnectionId: string | undefined;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export namespace DeleteConnectionRequest {
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export const filterSensitiveLog = (obj: DeleteConnectionRequest): any => ({
|
|
12
|
-
...obj,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* <p>The caller is not authorized to invoke this operation.</p>
|
|
18
|
-
*/
|
|
19
|
-
export interface ForbiddenException extends __SmithyException, $MetadataBearer {
|
|
20
|
-
name: "ForbiddenException";
|
|
21
|
-
$fault: "client";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export namespace ForbiddenException {
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export const filterSensitiveLog = (obj: ForbiddenException): any => ({
|
|
29
|
-
...obj,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* <p>The connection with the provided id no longer exists.</p>
|
|
35
|
-
*/
|
|
36
|
-
export interface GoneException extends __SmithyException, $MetadataBearer {
|
|
37
|
-
name: "GoneException";
|
|
38
|
-
$fault: "client";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export namespace GoneException {
|
|
42
|
-
/**
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export const filterSensitiveLog = (obj: GoneException): any => ({
|
|
46
|
-
...obj,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* <p>The client is sending more than the allowed number of requests per unit of time or the WebSocket client side buffer is full.</p>
|
|
52
|
-
*/
|
|
53
|
-
export interface LimitExceededException extends __SmithyException, $MetadataBearer {
|
|
54
|
-
name: "LimitExceededException";
|
|
55
|
-
$fault: "client";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export namespace LimitExceededException {
|
|
59
|
-
/**
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
export const filterSensitiveLog = (obj: LimitExceededException): any => ({
|
|
63
|
-
...obj,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface GetConnectionRequest {
|
|
68
|
-
ConnectionId: string | undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export namespace GetConnectionRequest {
|
|
72
|
-
/**
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
export const filterSensitiveLog = (obj: GetConnectionRequest): any => ({
|
|
76
|
-
...obj,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface Identity {
|
|
81
|
-
/**
|
|
82
|
-
* <p>The source IP address of the TCP connection making the request to API Gateway.</p>
|
|
83
|
-
*/
|
|
84
|
-
SourceIp: string | undefined;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* <p>The User Agent of the API caller.</p>
|
|
88
|
-
*/
|
|
89
|
-
UserAgent: string | undefined;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export namespace Identity {
|
|
93
|
-
/**
|
|
94
|
-
* @internal
|
|
95
|
-
*/
|
|
96
|
-
export const filterSensitiveLog = (obj: Identity): any => ({
|
|
97
|
-
...obj,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface GetConnectionResponse {
|
|
102
|
-
/**
|
|
103
|
-
* <p>The time in ISO 8601 format for when the connection was established.</p>
|
|
104
|
-
*/
|
|
105
|
-
ConnectedAt?: Date;
|
|
106
|
-
|
|
107
|
-
Identity?: Identity;
|
|
108
|
-
/**
|
|
109
|
-
* <p>The time in ISO 8601 format for when the connection was last active.</p>
|
|
110
|
-
*/
|
|
111
|
-
LastActiveAt?: Date;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export namespace GetConnectionResponse {
|
|
115
|
-
/**
|
|
116
|
-
* @internal
|
|
117
|
-
*/
|
|
118
|
-
export const filterSensitiveLog = (obj: GetConnectionResponse): any => ({
|
|
119
|
-
...obj,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* <p>The data has exceeded the maximum size allowed.</p>
|
|
125
|
-
*/
|
|
126
|
-
export interface PayloadTooLargeException extends __SmithyException, $MetadataBearer {
|
|
127
|
-
name: "PayloadTooLargeException";
|
|
128
|
-
$fault: "client";
|
|
129
|
-
Message?: string;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export namespace PayloadTooLargeException {
|
|
133
|
-
/**
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
export const filterSensitiveLog = (obj: PayloadTooLargeException): any => ({
|
|
137
|
-
...obj,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface PostToConnectionRequest {
|
|
142
|
-
/**
|
|
143
|
-
* <p>The data to be sent to the client specified by its connection id.</p>
|
|
144
|
-
*/
|
|
145
|
-
Data: Uint8Array | undefined;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* <p>The identifier of the connection that a specific client is using.</p>
|
|
149
|
-
*/
|
|
150
|
-
ConnectionId: string | undefined;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export namespace PostToConnectionRequest {
|
|
154
|
-
/**
|
|
155
|
-
* @internal
|
|
156
|
-
*/
|
|
157
|
-
export const filterSensitiveLog = (obj: PostToConnectionRequest): any => ({
|
|
158
|
-
...obj,
|
|
159
|
-
});
|
|
160
|
-
}
|
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
2
|
-
import {
|
|
3
|
-
expectNonNull as __expectNonNull,
|
|
4
|
-
expectObject as __expectObject,
|
|
5
|
-
expectString as __expectString,
|
|
6
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
7
|
-
parseRfc3339DateTime as __parseRfc3339DateTime,
|
|
8
|
-
} from "@aws-sdk/smithy-client";
|
|
9
|
-
import {
|
|
10
|
-
Endpoint as __Endpoint,
|
|
11
|
-
MetadataBearer as __MetadataBearer,
|
|
12
|
-
ResponseMetadata as __ResponseMetadata,
|
|
13
|
-
SerdeContext as __SerdeContext,
|
|
14
|
-
SmithyException as __SmithyException,
|
|
15
|
-
} from "@aws-sdk/types";
|
|
16
|
-
|
|
17
|
-
import { DeleteConnectionCommandInput, DeleteConnectionCommandOutput } from "../commands/DeleteConnectionCommand";
|
|
18
|
-
import { GetConnectionCommandInput, GetConnectionCommandOutput } from "../commands/GetConnectionCommand";
|
|
19
|
-
import { PostToConnectionCommandInput, PostToConnectionCommandOutput } from "../commands/PostToConnectionCommand";
|
|
20
|
-
import {
|
|
21
|
-
ForbiddenException,
|
|
22
|
-
GoneException,
|
|
23
|
-
Identity,
|
|
24
|
-
LimitExceededException,
|
|
25
|
-
PayloadTooLargeException,
|
|
26
|
-
} from "../models/models_0";
|
|
27
|
-
|
|
28
|
-
export const serializeAws_restJson1DeleteConnectionCommand = async (
|
|
29
|
-
input: DeleteConnectionCommandInput,
|
|
30
|
-
context: __SerdeContext
|
|
31
|
-
): Promise<__HttpRequest> => {
|
|
32
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
33
|
-
const headers: any = {};
|
|
34
|
-
let resolvedPath =
|
|
35
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
36
|
-
if (input.ConnectionId !== undefined) {
|
|
37
|
-
const labelValue: string = input.ConnectionId;
|
|
38
|
-
if (labelValue.length <= 0) {
|
|
39
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
40
|
-
}
|
|
41
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
42
|
-
} else {
|
|
43
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
44
|
-
}
|
|
45
|
-
let body: any;
|
|
46
|
-
return new __HttpRequest({
|
|
47
|
-
protocol,
|
|
48
|
-
hostname,
|
|
49
|
-
port,
|
|
50
|
-
method: "DELETE",
|
|
51
|
-
headers,
|
|
52
|
-
path: resolvedPath,
|
|
53
|
-
body,
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const serializeAws_restJson1GetConnectionCommand = async (
|
|
58
|
-
input: GetConnectionCommandInput,
|
|
59
|
-
context: __SerdeContext
|
|
60
|
-
): Promise<__HttpRequest> => {
|
|
61
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
62
|
-
const headers: any = {};
|
|
63
|
-
let resolvedPath =
|
|
64
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
65
|
-
if (input.ConnectionId !== undefined) {
|
|
66
|
-
const labelValue: string = input.ConnectionId;
|
|
67
|
-
if (labelValue.length <= 0) {
|
|
68
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
69
|
-
}
|
|
70
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
71
|
-
} else {
|
|
72
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
73
|
-
}
|
|
74
|
-
let body: any;
|
|
75
|
-
return new __HttpRequest({
|
|
76
|
-
protocol,
|
|
77
|
-
hostname,
|
|
78
|
-
port,
|
|
79
|
-
method: "GET",
|
|
80
|
-
headers,
|
|
81
|
-
path: resolvedPath,
|
|
82
|
-
body,
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const serializeAws_restJson1PostToConnectionCommand = async (
|
|
87
|
-
input: PostToConnectionCommandInput,
|
|
88
|
-
context: __SerdeContext
|
|
89
|
-
): Promise<__HttpRequest> => {
|
|
90
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
91
|
-
const headers: any = {
|
|
92
|
-
"content-type": "application/octet-stream",
|
|
93
|
-
};
|
|
94
|
-
let resolvedPath =
|
|
95
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
96
|
-
if (input.ConnectionId !== undefined) {
|
|
97
|
-
const labelValue: string = input.ConnectionId;
|
|
98
|
-
if (labelValue.length <= 0) {
|
|
99
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
100
|
-
}
|
|
101
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
102
|
-
} else {
|
|
103
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
104
|
-
}
|
|
105
|
-
let body: any;
|
|
106
|
-
if (input.Data !== undefined) {
|
|
107
|
-
body = input.Data;
|
|
108
|
-
}
|
|
109
|
-
return new __HttpRequest({
|
|
110
|
-
protocol,
|
|
111
|
-
hostname,
|
|
112
|
-
port,
|
|
113
|
-
method: "POST",
|
|
114
|
-
headers,
|
|
115
|
-
path: resolvedPath,
|
|
116
|
-
body,
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const deserializeAws_restJson1DeleteConnectionCommand = async (
|
|
121
|
-
output: __HttpResponse,
|
|
122
|
-
context: __SerdeContext
|
|
123
|
-
): Promise<DeleteConnectionCommandOutput> => {
|
|
124
|
-
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
125
|
-
return deserializeAws_restJson1DeleteConnectionCommandError(output, context);
|
|
126
|
-
}
|
|
127
|
-
const contents: DeleteConnectionCommandOutput = {
|
|
128
|
-
$metadata: deserializeMetadata(output),
|
|
129
|
-
};
|
|
130
|
-
await collectBody(output.body, context);
|
|
131
|
-
return Promise.resolve(contents);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const deserializeAws_restJson1DeleteConnectionCommandError = async (
|
|
135
|
-
output: __HttpResponse,
|
|
136
|
-
context: __SerdeContext
|
|
137
|
-
): Promise<DeleteConnectionCommandOutput> => {
|
|
138
|
-
const parsedOutput: any = {
|
|
139
|
-
...output,
|
|
140
|
-
body: await parseBody(output.body, context),
|
|
141
|
-
};
|
|
142
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
143
|
-
let errorCode = "UnknownError";
|
|
144
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
145
|
-
switch (errorCode) {
|
|
146
|
-
case "ForbiddenException":
|
|
147
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
148
|
-
response = {
|
|
149
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
150
|
-
name: errorCode,
|
|
151
|
-
$metadata: deserializeMetadata(output),
|
|
152
|
-
};
|
|
153
|
-
break;
|
|
154
|
-
case "GoneException":
|
|
155
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
156
|
-
response = {
|
|
157
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
158
|
-
name: errorCode,
|
|
159
|
-
$metadata: deserializeMetadata(output),
|
|
160
|
-
};
|
|
161
|
-
break;
|
|
162
|
-
case "LimitExceededException":
|
|
163
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
164
|
-
response = {
|
|
165
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
166
|
-
name: errorCode,
|
|
167
|
-
$metadata: deserializeMetadata(output),
|
|
168
|
-
};
|
|
169
|
-
break;
|
|
170
|
-
default:
|
|
171
|
-
const parsedBody = parsedOutput.body;
|
|
172
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
173
|
-
response = {
|
|
174
|
-
...parsedBody,
|
|
175
|
-
name: `${errorCode}`,
|
|
176
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
177
|
-
$fault: "client",
|
|
178
|
-
$metadata: deserializeMetadata(output),
|
|
179
|
-
} as any;
|
|
180
|
-
}
|
|
181
|
-
const message = response.message || response.Message || errorCode;
|
|
182
|
-
response.message = message;
|
|
183
|
-
delete response.Message;
|
|
184
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export const deserializeAws_restJson1GetConnectionCommand = async (
|
|
188
|
-
output: __HttpResponse,
|
|
189
|
-
context: __SerdeContext
|
|
190
|
-
): Promise<GetConnectionCommandOutput> => {
|
|
191
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
192
|
-
return deserializeAws_restJson1GetConnectionCommandError(output, context);
|
|
193
|
-
}
|
|
194
|
-
const contents: GetConnectionCommandOutput = {
|
|
195
|
-
$metadata: deserializeMetadata(output),
|
|
196
|
-
ConnectedAt: undefined,
|
|
197
|
-
Identity: undefined,
|
|
198
|
-
LastActiveAt: undefined,
|
|
199
|
-
};
|
|
200
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
201
|
-
if (data.connectedAt !== undefined && data.connectedAt !== null) {
|
|
202
|
-
contents.ConnectedAt = __expectNonNull(__parseRfc3339DateTime(data.connectedAt));
|
|
203
|
-
}
|
|
204
|
-
if (data.identity !== undefined && data.identity !== null) {
|
|
205
|
-
contents.Identity = deserializeAws_restJson1Identity(data.identity, context);
|
|
206
|
-
}
|
|
207
|
-
if (data.lastActiveAt !== undefined && data.lastActiveAt !== null) {
|
|
208
|
-
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTime(data.lastActiveAt));
|
|
209
|
-
}
|
|
210
|
-
return Promise.resolve(contents);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const deserializeAws_restJson1GetConnectionCommandError = async (
|
|
214
|
-
output: __HttpResponse,
|
|
215
|
-
context: __SerdeContext
|
|
216
|
-
): Promise<GetConnectionCommandOutput> => {
|
|
217
|
-
const parsedOutput: any = {
|
|
218
|
-
...output,
|
|
219
|
-
body: await parseBody(output.body, context),
|
|
220
|
-
};
|
|
221
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
222
|
-
let errorCode = "UnknownError";
|
|
223
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
224
|
-
switch (errorCode) {
|
|
225
|
-
case "ForbiddenException":
|
|
226
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
227
|
-
response = {
|
|
228
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
229
|
-
name: errorCode,
|
|
230
|
-
$metadata: deserializeMetadata(output),
|
|
231
|
-
};
|
|
232
|
-
break;
|
|
233
|
-
case "GoneException":
|
|
234
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
235
|
-
response = {
|
|
236
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
237
|
-
name: errorCode,
|
|
238
|
-
$metadata: deserializeMetadata(output),
|
|
239
|
-
};
|
|
240
|
-
break;
|
|
241
|
-
case "LimitExceededException":
|
|
242
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
243
|
-
response = {
|
|
244
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
245
|
-
name: errorCode,
|
|
246
|
-
$metadata: deserializeMetadata(output),
|
|
247
|
-
};
|
|
248
|
-
break;
|
|
249
|
-
default:
|
|
250
|
-
const parsedBody = parsedOutput.body;
|
|
251
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
252
|
-
response = {
|
|
253
|
-
...parsedBody,
|
|
254
|
-
name: `${errorCode}`,
|
|
255
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
256
|
-
$fault: "client",
|
|
257
|
-
$metadata: deserializeMetadata(output),
|
|
258
|
-
} as any;
|
|
259
|
-
}
|
|
260
|
-
const message = response.message || response.Message || errorCode;
|
|
261
|
-
response.message = message;
|
|
262
|
-
delete response.Message;
|
|
263
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
export const deserializeAws_restJson1PostToConnectionCommand = async (
|
|
267
|
-
output: __HttpResponse,
|
|
268
|
-
context: __SerdeContext
|
|
269
|
-
): Promise<PostToConnectionCommandOutput> => {
|
|
270
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
271
|
-
return deserializeAws_restJson1PostToConnectionCommandError(output, context);
|
|
272
|
-
}
|
|
273
|
-
const contents: PostToConnectionCommandOutput = {
|
|
274
|
-
$metadata: deserializeMetadata(output),
|
|
275
|
-
};
|
|
276
|
-
await collectBody(output.body, context);
|
|
277
|
-
return Promise.resolve(contents);
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
const deserializeAws_restJson1PostToConnectionCommandError = async (
|
|
281
|
-
output: __HttpResponse,
|
|
282
|
-
context: __SerdeContext
|
|
283
|
-
): Promise<PostToConnectionCommandOutput> => {
|
|
284
|
-
const parsedOutput: any = {
|
|
285
|
-
...output,
|
|
286
|
-
body: await parseBody(output.body, context),
|
|
287
|
-
};
|
|
288
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
289
|
-
let errorCode = "UnknownError";
|
|
290
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
291
|
-
switch (errorCode) {
|
|
292
|
-
case "ForbiddenException":
|
|
293
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
294
|
-
response = {
|
|
295
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
296
|
-
name: errorCode,
|
|
297
|
-
$metadata: deserializeMetadata(output),
|
|
298
|
-
};
|
|
299
|
-
break;
|
|
300
|
-
case "GoneException":
|
|
301
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
302
|
-
response = {
|
|
303
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
304
|
-
name: errorCode,
|
|
305
|
-
$metadata: deserializeMetadata(output),
|
|
306
|
-
};
|
|
307
|
-
break;
|
|
308
|
-
case "LimitExceededException":
|
|
309
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
310
|
-
response = {
|
|
311
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
312
|
-
name: errorCode,
|
|
313
|
-
$metadata: deserializeMetadata(output),
|
|
314
|
-
};
|
|
315
|
-
break;
|
|
316
|
-
case "PayloadTooLargeException":
|
|
317
|
-
case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
|
|
318
|
-
response = {
|
|
319
|
-
...(await deserializeAws_restJson1PayloadTooLargeExceptionResponse(parsedOutput, context)),
|
|
320
|
-
name: errorCode,
|
|
321
|
-
$metadata: deserializeMetadata(output),
|
|
322
|
-
};
|
|
323
|
-
break;
|
|
324
|
-
default:
|
|
325
|
-
const parsedBody = parsedOutput.body;
|
|
326
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
327
|
-
response = {
|
|
328
|
-
...parsedBody,
|
|
329
|
-
name: `${errorCode}`,
|
|
330
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
331
|
-
$fault: "client",
|
|
332
|
-
$metadata: deserializeMetadata(output),
|
|
333
|
-
} as any;
|
|
334
|
-
}
|
|
335
|
-
const message = response.message || response.Message || errorCode;
|
|
336
|
-
response.message = message;
|
|
337
|
-
delete response.Message;
|
|
338
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
const deserializeAws_restJson1ForbiddenExceptionResponse = async (
|
|
342
|
-
parsedOutput: any,
|
|
343
|
-
context: __SerdeContext
|
|
344
|
-
): Promise<ForbiddenException> => {
|
|
345
|
-
const contents: ForbiddenException = {
|
|
346
|
-
name: "ForbiddenException",
|
|
347
|
-
$fault: "client",
|
|
348
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
349
|
-
};
|
|
350
|
-
const data: any = parsedOutput.body;
|
|
351
|
-
return contents;
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
const deserializeAws_restJson1GoneExceptionResponse = async (
|
|
355
|
-
parsedOutput: any,
|
|
356
|
-
context: __SerdeContext
|
|
357
|
-
): Promise<GoneException> => {
|
|
358
|
-
const contents: GoneException = {
|
|
359
|
-
name: "GoneException",
|
|
360
|
-
$fault: "client",
|
|
361
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
362
|
-
};
|
|
363
|
-
const data: any = parsedOutput.body;
|
|
364
|
-
return contents;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
const deserializeAws_restJson1LimitExceededExceptionResponse = async (
|
|
368
|
-
parsedOutput: any,
|
|
369
|
-
context: __SerdeContext
|
|
370
|
-
): Promise<LimitExceededException> => {
|
|
371
|
-
const contents: LimitExceededException = {
|
|
372
|
-
name: "LimitExceededException",
|
|
373
|
-
$fault: "client",
|
|
374
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
375
|
-
};
|
|
376
|
-
const data: any = parsedOutput.body;
|
|
377
|
-
return contents;
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
const deserializeAws_restJson1PayloadTooLargeExceptionResponse = async (
|
|
381
|
-
parsedOutput: any,
|
|
382
|
-
context: __SerdeContext
|
|
383
|
-
): Promise<PayloadTooLargeException> => {
|
|
384
|
-
const contents: PayloadTooLargeException = {
|
|
385
|
-
name: "PayloadTooLargeException",
|
|
386
|
-
$fault: "client",
|
|
387
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
388
|
-
Message: undefined,
|
|
389
|
-
};
|
|
390
|
-
const data: any = parsedOutput.body;
|
|
391
|
-
if (data.message !== undefined && data.message !== null) {
|
|
392
|
-
contents.Message = __expectString(data.message);
|
|
393
|
-
}
|
|
394
|
-
return contents;
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
const deserializeAws_restJson1Identity = (output: any, context: __SerdeContext): Identity => {
|
|
398
|
-
return {
|
|
399
|
-
SourceIp: __expectString(output.sourceIp),
|
|
400
|
-
UserAgent: __expectString(output.userAgent),
|
|
401
|
-
} as any;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
405
|
-
httpStatusCode: output.statusCode,
|
|
406
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
407
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
408
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
// Collect low-level response body stream to Uint8Array.
|
|
412
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
413
|
-
if (streamBody instanceof Uint8Array) {
|
|
414
|
-
return Promise.resolve(streamBody);
|
|
415
|
-
}
|
|
416
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
// Encode Uint8Array data into string with utf-8.
|
|
420
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
421
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
422
|
-
|
|
423
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
424
|
-
value !== undefined &&
|
|
425
|
-
value !== null &&
|
|
426
|
-
value !== "" &&
|
|
427
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
428
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
429
|
-
|
|
430
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
431
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
432
|
-
if (encoded.length) {
|
|
433
|
-
return JSON.parse(encoded);
|
|
434
|
-
}
|
|
435
|
-
return {};
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
440
|
-
*/
|
|
441
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
442
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
443
|
-
|
|
444
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
445
|
-
let cleanValue = rawValue;
|
|
446
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
447
|
-
cleanValue = cleanValue.split(":")[0];
|
|
448
|
-
}
|
|
449
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
450
|
-
cleanValue = cleanValue.split("#")[1];
|
|
451
|
-
}
|
|
452
|
-
return cleanValue;
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
456
|
-
if (headerKey !== undefined) {
|
|
457
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (data.code !== undefined) {
|
|
461
|
-
return sanitizeErrorCode(data.code);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
if (data["__type"] !== undefined) {
|
|
465
|
-
return sanitizeErrorCode(data["__type"]);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
return "";
|
|
469
|
-
};
|