Skip to content

Commit adc341a

Browse files
author
awstools
committed
feat(client-apigatewayv2): Adds support to create routing rules and set the routing mode for a custom domain name.
1 parent a04fee3 commit adc341a

20 files changed

+2716
-16
lines changed

clients/client-apigatewayv2/README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ using your favorite package manager:
2323

2424
The AWS SDK is modulized by clients and commands.
2525
To send a request, you only need to import the `ApiGatewayV2Client` and
26-
the commands you need, for example `GetApisCommand`:
26+
the commands you need, for example `ListRoutingRulesCommand`:
2727

2828
```js
2929
// ES5 example
30-
const { ApiGatewayV2Client, GetApisCommand } = require("@aws-sdk/client-apigatewayv2");
30+
const { ApiGatewayV2Client, ListRoutingRulesCommand } = require("@aws-sdk/client-apigatewayv2");
3131
```
3232

3333
```ts
3434
// ES6+ example
35-
import { ApiGatewayV2Client, GetApisCommand } from "@aws-sdk/client-apigatewayv2";
35+
import { ApiGatewayV2Client, ListRoutingRulesCommand } from "@aws-sdk/client-apigatewayv2";
3636
```
3737

3838
### Usage
@@ -51,7 +51,7 @@ const client = new ApiGatewayV2Client({ region: "REGION" });
5151
const params = {
5252
/** input parameters */
5353
};
54-
const command = new GetApisCommand(params);
54+
const command = new ListRoutingRulesCommand(params);
5555
```
5656

5757
#### Async/await
@@ -130,15 +130,15 @@ const client = new AWS.ApiGatewayV2({ region: "REGION" });
130130

131131
// async/await.
132132
try {
133-
const data = await client.getApis(params);
133+
const data = await client.listRoutingRules(params);
134134
// process data.
135135
} catch (error) {
136136
// error handling.
137137
}
138138

139139
// Promises.
140140
client
141-
.getApis(params)
141+
.listRoutingRules(params)
142142
.then((data) => {
143143
// process data.
144144
})
@@ -147,7 +147,7 @@ client
147147
});
148148

149149
// callbacks.
150-
client.getApis(params, (err, data) => {
150+
client.listRoutingRules(params, (err, data) => {
151151
// process err and data.
152152
});
153153
```
@@ -282,6 +282,14 @@ CreateRouteResponse
282282

283283
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/CreateRouteResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/CreateRouteResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/CreateRouteResponseCommandOutput/)
284284

285+
</details>
286+
<details>
287+
<summary>
288+
CreateRoutingRule
289+
</summary>
290+
291+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/CreateRoutingRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/CreateRoutingRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/CreateRoutingRuleCommandOutput/)
292+
285293
</details>
286294
<details>
287295
<summary>
@@ -410,6 +418,14 @@ DeleteRouteSettings
410418

411419
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/DeleteRouteSettingsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/DeleteRouteSettingsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/DeleteRouteSettingsCommandOutput/)
412420

421+
</details>
422+
<details>
423+
<summary>
424+
DeleteRoutingRule
425+
</summary>
426+
427+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/DeleteRoutingRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/DeleteRoutingRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/DeleteRoutingRuleCommandOutput/)
428+
413429
</details>
414430
<details>
415431
<summary>
@@ -602,6 +618,14 @@ GetRoutes
602618

603619
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/GetRoutesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/GetRoutesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/GetRoutesCommandOutput/)
604620

621+
</details>
622+
<details>
623+
<summary>
624+
GetRoutingRule
625+
</summary>
626+
627+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/GetRoutingRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/GetRoutingRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/GetRoutingRuleCommandOutput/)
628+
605629
</details>
606630
<details>
607631
<summary>
@@ -650,6 +674,22 @@ ImportApi
650674

651675
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/ImportApiCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/ImportApiCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/ImportApiCommandOutput/)
652676

677+
</details>
678+
<details>
679+
<summary>
680+
ListRoutingRules
681+
</summary>
682+
683+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/ListRoutingRulesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/ListRoutingRulesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/ListRoutingRulesCommandOutput/)
684+
685+
</details>
686+
<details>
687+
<summary>
688+
PutRoutingRule
689+
</summary>
690+
691+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/apigatewayv2/command/PutRoutingRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/PutRoutingRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-apigatewayv2/Interface/PutRoutingRuleCommandOutput/)
692+
653693
</details>
654694
<details>
655695
<summary>

clients/client-apigatewayv2/src/ApiGatewayV2.ts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ import {
4141
CreateRouteResponseCommandInput,
4242
CreateRouteResponseCommandOutput,
4343
} from "./commands/CreateRouteResponseCommand";
44+
import {
45+
CreateRoutingRuleCommand,
46+
CreateRoutingRuleCommandInput,
47+
CreateRoutingRuleCommandOutput,
48+
} from "./commands/CreateRoutingRuleCommand";
4449
import { CreateStageCommand, CreateStageCommandInput, CreateStageCommandOutput } from "./commands/CreateStageCommand";
4550
import {
4651
CreateVpcLinkCommand,
@@ -105,6 +110,11 @@ import {
105110
DeleteRouteSettingsCommandInput,
106111
DeleteRouteSettingsCommandOutput,
107112
} from "./commands/DeleteRouteSettingsCommand";
113+
import {
114+
DeleteRoutingRuleCommand,
115+
DeleteRoutingRuleCommandInput,
116+
DeleteRoutingRuleCommandOutput,
117+
} from "./commands/DeleteRoutingRuleCommand";
108118
import { DeleteStageCommand, DeleteStageCommandInput, DeleteStageCommandOutput } from "./commands/DeleteStageCommand";
109119
import {
110120
DeleteVpcLinkCommand,
@@ -193,12 +203,27 @@ import {
193203
GetRouteResponsesCommandOutput,
194204
} from "./commands/GetRouteResponsesCommand";
195205
import { GetRoutesCommand, GetRoutesCommandInput, GetRoutesCommandOutput } from "./commands/GetRoutesCommand";
206+
import {
207+
GetRoutingRuleCommand,
208+
GetRoutingRuleCommandInput,
209+
GetRoutingRuleCommandOutput,
210+
} from "./commands/GetRoutingRuleCommand";
196211
import { GetStageCommand, GetStageCommandInput, GetStageCommandOutput } from "./commands/GetStageCommand";
197212
import { GetStagesCommand, GetStagesCommandInput, GetStagesCommandOutput } from "./commands/GetStagesCommand";
198213
import { GetTagsCommand, GetTagsCommandInput, GetTagsCommandOutput } from "./commands/GetTagsCommand";
199214
import { GetVpcLinkCommand, GetVpcLinkCommandInput, GetVpcLinkCommandOutput } from "./commands/GetVpcLinkCommand";
200215
import { GetVpcLinksCommand, GetVpcLinksCommandInput, GetVpcLinksCommandOutput } from "./commands/GetVpcLinksCommand";
201216
import { ImportApiCommand, ImportApiCommandInput, ImportApiCommandOutput } from "./commands/ImportApiCommand";
217+
import {
218+
ListRoutingRulesCommand,
219+
ListRoutingRulesCommandInput,
220+
ListRoutingRulesCommandOutput,
221+
} from "./commands/ListRoutingRulesCommand";
222+
import {
223+
PutRoutingRuleCommand,
224+
PutRoutingRuleCommandInput,
225+
PutRoutingRuleCommandOutput,
226+
} from "./commands/PutRoutingRuleCommand";
202227
import { ReimportApiCommand, ReimportApiCommandInput, ReimportApiCommandOutput } from "./commands/ReimportApiCommand";
203228
import {
204229
ResetAuthorizersCacheCommand,
@@ -267,6 +292,7 @@ const commands = {
267292
CreateModelCommand,
268293
CreateRouteCommand,
269294
CreateRouteResponseCommand,
295+
CreateRoutingRuleCommand,
270296
CreateStageCommand,
271297
CreateVpcLinkCommand,
272298
DeleteAccessLogSettingsCommand,
@@ -283,6 +309,7 @@ const commands = {
283309
DeleteRouteRequestParameterCommand,
284310
DeleteRouteResponseCommand,
285311
DeleteRouteSettingsCommand,
312+
DeleteRoutingRuleCommand,
286313
DeleteStageCommand,
287314
DeleteVpcLinkCommand,
288315
ExportApiCommand,
@@ -307,12 +334,15 @@ const commands = {
307334
GetRouteResponseCommand,
308335
GetRouteResponsesCommand,
309336
GetRoutesCommand,
337+
GetRoutingRuleCommand,
310338
GetStageCommand,
311339
GetStagesCommand,
312340
GetTagsCommand,
313341
GetVpcLinkCommand,
314342
GetVpcLinksCommand,
315343
ImportApiCommand,
344+
ListRoutingRulesCommand,
345+
PutRoutingRuleCommand,
316346
ReimportApiCommand,
317347
ResetAuthorizersCacheCommand,
318348
TagResourceCommand,
@@ -484,6 +514,23 @@ export interface ApiGatewayV2 {
484514
cb: (err: any, data?: CreateRouteResponseCommandOutput) => void
485515
): void;
486516

517+
/**
518+
* @see {@link CreateRoutingRuleCommand}
519+
*/
520+
createRoutingRule(
521+
args: CreateRoutingRuleCommandInput,
522+
options?: __HttpHandlerOptions
523+
): Promise<CreateRoutingRuleCommandOutput>;
524+
createRoutingRule(
525+
args: CreateRoutingRuleCommandInput,
526+
cb: (err: any, data?: CreateRoutingRuleCommandOutput) => void
527+
): void;
528+
createRoutingRule(
529+
args: CreateRoutingRuleCommandInput,
530+
options: __HttpHandlerOptions,
531+
cb: (err: any, data?: CreateRoutingRuleCommandOutput) => void
532+
): void;
533+
487534
/**
488535
* @see {@link CreateStageCommand}
489536
*/
@@ -726,6 +773,23 @@ export interface ApiGatewayV2 {
726773
cb: (err: any, data?: DeleteRouteSettingsCommandOutput) => void
727774
): void;
728775

776+
/**
777+
* @see {@link DeleteRoutingRuleCommand}
778+
*/
779+
deleteRoutingRule(
780+
args: DeleteRoutingRuleCommandInput,
781+
options?: __HttpHandlerOptions
782+
): Promise<DeleteRoutingRuleCommandOutput>;
783+
deleteRoutingRule(
784+
args: DeleteRoutingRuleCommandInput,
785+
cb: (err: any, data?: DeleteRoutingRuleCommandOutput) => void
786+
): void;
787+
deleteRoutingRule(
788+
args: DeleteRoutingRuleCommandInput,
789+
options: __HttpHandlerOptions,
790+
cb: (err: any, data?: DeleteRoutingRuleCommandOutput) => void
791+
): void;
792+
729793
/**
730794
* @see {@link DeleteStageCommand}
731795
*/
@@ -1040,6 +1104,20 @@ export interface ApiGatewayV2 {
10401104
cb: (err: any, data?: GetRoutesCommandOutput) => void
10411105
): void;
10421106

1107+
/**
1108+
* @see {@link GetRoutingRuleCommand}
1109+
*/
1110+
getRoutingRule(
1111+
args: GetRoutingRuleCommandInput,
1112+
options?: __HttpHandlerOptions
1113+
): Promise<GetRoutingRuleCommandOutput>;
1114+
getRoutingRule(args: GetRoutingRuleCommandInput, cb: (err: any, data?: GetRoutingRuleCommandOutput) => void): void;
1115+
getRoutingRule(
1116+
args: GetRoutingRuleCommandInput,
1117+
options: __HttpHandlerOptions,
1118+
cb: (err: any, data?: GetRoutingRuleCommandOutput) => void
1119+
): void;
1120+
10431121
/**
10441122
* @see {@link GetStageCommand}
10451123
*/
@@ -1107,6 +1185,37 @@ export interface ApiGatewayV2 {
11071185
cb: (err: any, data?: ImportApiCommandOutput) => void
11081186
): void;
11091187

1188+
/**
1189+
* @see {@link ListRoutingRulesCommand}
1190+
*/
1191+
listRoutingRules(
1192+
args: ListRoutingRulesCommandInput,
1193+
options?: __HttpHandlerOptions
1194+
): Promise<ListRoutingRulesCommandOutput>;
1195+
listRoutingRules(
1196+
args: ListRoutingRulesCommandInput,
1197+
cb: (err: any, data?: ListRoutingRulesCommandOutput) => void
1198+
): void;
1199+
listRoutingRules(
1200+
args: ListRoutingRulesCommandInput,
1201+
options: __HttpHandlerOptions,
1202+
cb: (err: any, data?: ListRoutingRulesCommandOutput) => void
1203+
): void;
1204+
1205+
/**
1206+
* @see {@link PutRoutingRuleCommand}
1207+
*/
1208+
putRoutingRule(
1209+
args: PutRoutingRuleCommandInput,
1210+
options?: __HttpHandlerOptions
1211+
): Promise<PutRoutingRuleCommandOutput>;
1212+
putRoutingRule(args: PutRoutingRuleCommandInput, cb: (err: any, data?: PutRoutingRuleCommandOutput) => void): void;
1213+
putRoutingRule(
1214+
args: PutRoutingRuleCommandInput,
1215+
options: __HttpHandlerOptions,
1216+
cb: (err: any, data?: PutRoutingRuleCommandOutput) => void
1217+
): void;
1218+
11101219
/**
11111220
* @see {@link ReimportApiCommand}
11121221
*/

0 commit comments

Comments
 (0)