Skip to content

Commit 62af85a

Browse files
author
awstools
committed
feat(client-appsync): Add data source support to Event APIs
1 parent 15aea07 commit 62af85a

File tree

7 files changed

+384
-0
lines changed

7 files changed

+384
-0
lines changed

clients/client-appsync/src/commands/CreateChannelNamespaceCommand.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ export interface CreateChannelNamespaceCommandOutput extends CreateChannelNamesp
5252
* tags: { // TagMap
5353
* "<keys>": "STRING_VALUE",
5454
* },
55+
* handlerConfigs: { // HandlerConfigs
56+
* onPublish: { // HandlerConfig
57+
* behavior: "CODE" || "DIRECT", // required
58+
* integration: { // Integration
59+
* dataSourceName: "STRING_VALUE", // required
60+
* lambdaConfig: { // LambdaConfig
61+
* invokeType: "REQUEST_RESPONSE" || "EVENT",
62+
* },
63+
* },
64+
* },
65+
* onSubscribe: {
66+
* behavior: "CODE" || "DIRECT", // required
67+
* integration: {
68+
* dataSourceName: "STRING_VALUE", // required
69+
* lambdaConfig: {
70+
* invokeType: "REQUEST_RESPONSE" || "EVENT",
71+
* },
72+
* },
73+
* },
74+
* },
5575
* };
5676
* const command = new CreateChannelNamespaceCommand(input);
5777
* const response = await client.send(command);
@@ -76,6 +96,26 @@ export interface CreateChannelNamespaceCommandOutput extends CreateChannelNamesp
7696
* // channelNamespaceArn: "STRING_VALUE",
7797
* // created: new Date("TIMESTAMP"),
7898
* // lastModified: new Date("TIMESTAMP"),
99+
* // handlerConfigs: { // HandlerConfigs
100+
* // onPublish: { // HandlerConfig
101+
* // behavior: "CODE" || "DIRECT", // required
102+
* // integration: { // Integration
103+
* // dataSourceName: "STRING_VALUE", // required
104+
* // lambdaConfig: { // LambdaConfig
105+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
106+
* // },
107+
* // },
108+
* // },
109+
* // onSubscribe: {
110+
* // behavior: "CODE" || "DIRECT", // required
111+
* // integration: {
112+
* // dataSourceName: "STRING_VALUE", // required
113+
* // lambdaConfig: {
114+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
115+
* // },
116+
* // },
117+
* // },
118+
* // },
79119
* // },
80120
* // };
81121
*

clients/client-appsync/src/commands/GetChannelNamespaceCommand.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ export interface GetChannelNamespaceCommandOutput extends GetChannelNamespaceRes
6262
* // channelNamespaceArn: "STRING_VALUE",
6363
* // created: new Date("TIMESTAMP"),
6464
* // lastModified: new Date("TIMESTAMP"),
65+
* // handlerConfigs: { // HandlerConfigs
66+
* // onPublish: { // HandlerConfig
67+
* // behavior: "CODE" || "DIRECT", // required
68+
* // integration: { // Integration
69+
* // dataSourceName: "STRING_VALUE", // required
70+
* // lambdaConfig: { // LambdaConfig
71+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
72+
* // },
73+
* // },
74+
* // },
75+
* // onSubscribe: {
76+
* // behavior: "CODE" || "DIRECT", // required
77+
* // integration: {
78+
* // dataSourceName: "STRING_VALUE", // required
79+
* // lambdaConfig: {
80+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
81+
* // },
82+
* // },
83+
* // },
84+
* // },
6585
* // },
6686
* // };
6787
*

clients/client-appsync/src/commands/ListChannelNamespacesCommand.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ export interface ListChannelNamespacesCommandOutput extends ListChannelNamespace
6767
* // channelNamespaceArn: "STRING_VALUE",
6868
* // created: new Date("TIMESTAMP"),
6969
* // lastModified: new Date("TIMESTAMP"),
70+
* // handlerConfigs: { // HandlerConfigs
71+
* // onPublish: { // HandlerConfig
72+
* // behavior: "CODE" || "DIRECT", // required
73+
* // integration: { // Integration
74+
* // dataSourceName: "STRING_VALUE", // required
75+
* // lambdaConfig: { // LambdaConfig
76+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
77+
* // },
78+
* // },
79+
* // },
80+
* // onSubscribe: {
81+
* // behavior: "CODE" || "DIRECT", // required
82+
* // integration: {
83+
* // dataSourceName: "STRING_VALUE", // required
84+
* // lambdaConfig: {
85+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
86+
* // },
87+
* // },
88+
* // },
89+
* // },
7090
* // },
7191
* // ],
7292
* // nextToken: "STRING_VALUE",

clients/client-appsync/src/commands/UpdateChannelNamespaceCommand.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ export interface UpdateChannelNamespaceCommandOutput extends UpdateChannelNamesp
4949
* },
5050
* ],
5151
* codeHandlers: "STRING_VALUE",
52+
* handlerConfigs: { // HandlerConfigs
53+
* onPublish: { // HandlerConfig
54+
* behavior: "CODE" || "DIRECT", // required
55+
* integration: { // Integration
56+
* dataSourceName: "STRING_VALUE", // required
57+
* lambdaConfig: { // LambdaConfig
58+
* invokeType: "REQUEST_RESPONSE" || "EVENT",
59+
* },
60+
* },
61+
* },
62+
* onSubscribe: {
63+
* behavior: "CODE" || "DIRECT", // required
64+
* integration: {
65+
* dataSourceName: "STRING_VALUE", // required
66+
* lambdaConfig: {
67+
* invokeType: "REQUEST_RESPONSE" || "EVENT",
68+
* },
69+
* },
70+
* },
71+
* },
5272
* };
5373
* const command = new UpdateChannelNamespaceCommand(input);
5474
* const response = await client.send(command);
@@ -73,6 +93,26 @@ export interface UpdateChannelNamespaceCommandOutput extends UpdateChannelNamesp
7393
* // channelNamespaceArn: "STRING_VALUE",
7494
* // created: new Date("TIMESTAMP"),
7595
* // lastModified: new Date("TIMESTAMP"),
96+
* // handlerConfigs: { // HandlerConfigs
97+
* // onPublish: { // HandlerConfig
98+
* // behavior: "CODE" || "DIRECT", // required
99+
* // integration: { // Integration
100+
* // dataSourceName: "STRING_VALUE", // required
101+
* // lambdaConfig: { // LambdaConfig
102+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
103+
* // },
104+
* // },
105+
* // },
106+
* // onSubscribe: {
107+
* // behavior: "CODE" || "DIRECT", // required
108+
* // integration: {
109+
* // dataSourceName: "STRING_VALUE", // required
110+
* // lambdaConfig: {
111+
* // invokeType: "REQUEST_RESPONSE" || "EVENT",
112+
* // },
113+
* // },
114+
* // },
115+
* // },
76116
* // },
77117
* // };
78118
*

clients/client-appsync/src/models/models_0.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,100 @@ export class ConflictException extends __BaseException {
17091709
}
17101710
}
17111711

1712+
/**
1713+
* @public
1714+
* @enum
1715+
*/
1716+
export const HandlerBehavior = {
1717+
CODE: "CODE",
1718+
DIRECT: "DIRECT",
1719+
} as const;
1720+
1721+
/**
1722+
* @public
1723+
*/
1724+
export type HandlerBehavior = (typeof HandlerBehavior)[keyof typeof HandlerBehavior];
1725+
1726+
/**
1727+
* @public
1728+
* @enum
1729+
*/
1730+
export const InvokeType = {
1731+
EVENT: "EVENT",
1732+
REQUEST_RESPONSE: "REQUEST_RESPONSE",
1733+
} as const;
1734+
1735+
/**
1736+
* @public
1737+
*/
1738+
export type InvokeType = (typeof InvokeType)[keyof typeof InvokeType];
1739+
1740+
/**
1741+
* <p>The configuration for a Lambda data source.</p>
1742+
* @public
1743+
*/
1744+
export interface LambdaConfig {
1745+
/**
1746+
* <p>The invocation type for a Lambda data source.</p>
1747+
* @public
1748+
*/
1749+
invokeType?: InvokeType | undefined;
1750+
}
1751+
1752+
/**
1753+
* <p>The integration data source configuration for the handler.</p>
1754+
* @public
1755+
*/
1756+
export interface Integration {
1757+
/**
1758+
* <p>The unique name of the data source that has been configured on the API.</p>
1759+
* @public
1760+
*/
1761+
dataSourceName: string | undefined;
1762+
1763+
/**
1764+
* <p>The configuration for a Lambda data source.</p>
1765+
* @public
1766+
*/
1767+
lambdaConfig?: LambdaConfig | undefined;
1768+
}
1769+
1770+
/**
1771+
* <p>The configuration for a handler.</p>
1772+
* @public
1773+
*/
1774+
export interface HandlerConfig {
1775+
/**
1776+
* <p>The behavior for the handler.</p>
1777+
* @public
1778+
*/
1779+
behavior: HandlerBehavior | undefined;
1780+
1781+
/**
1782+
* <p>The integration data source configuration for the handler.</p>
1783+
* @public
1784+
*/
1785+
integration: Integration | undefined;
1786+
}
1787+
1788+
/**
1789+
* <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
1790+
* @public
1791+
*/
1792+
export interface HandlerConfigs {
1793+
/**
1794+
* <p>The configuration for the <code>OnPublish</code> handler.</p>
1795+
* @public
1796+
*/
1797+
onPublish?: HandlerConfig | undefined;
1798+
1799+
/**
1800+
* <p>The configuration for the <code>OnSubscribe</code> handler.</p>
1801+
* @public
1802+
*/
1803+
onSubscribe?: HandlerConfig | undefined;
1804+
}
1805+
17121806
/**
17131807
* @public
17141808
*/
@@ -1754,6 +1848,12 @@ export interface CreateChannelNamespaceRequest {
17541848
* @public
17551849
*/
17561850
tags?: Record<string, string> | undefined;
1851+
1852+
/**
1853+
* <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
1854+
* @public
1855+
*/
1856+
handlerConfigs?: HandlerConfigs | undefined;
17571857
}
17581858

17591859
/**
@@ -1821,6 +1921,12 @@ export interface ChannelNamespace {
18211921
* @public
18221922
*/
18231923
lastModified?: Date | undefined;
1924+
1925+
/**
1926+
* <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
1927+
* @public
1928+
*/
1929+
handlerConfigs?: HandlerConfigs | undefined;
18241930
}
18251931

18261932
/**
@@ -5906,6 +6012,12 @@ export interface UpdateChannelNamespaceRequest {
59066012
* @public
59076013
*/
59086014
codeHandlers?: string | undefined;
6015+
6016+
/**
6017+
* <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
6018+
* @public
6019+
*/
6020+
handlerConfigs?: HandlerConfigs | undefined;
59096021
}
59106022

59116023
/**

clients/client-appsync/src/protocols/Aws_restJson1.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,13 @@ import {
200200
EventConfig,
201201
EventLogConfig,
202202
GraphQLSchemaException,
203+
HandlerConfig,
204+
HandlerConfigs,
203205
HttpDataSourceConfig,
206+
Integration,
204207
InternalFailureException,
205208
LambdaAuthorizerConfig,
209+
LambdaConfig,
206210
LambdaConflictHandlerConfig,
207211
LambdaDataSourceConfig,
208212
LimitExceededException,
@@ -389,6 +393,7 @@ export const se_CreateChannelNamespaceCommand = async (
389393
body = JSON.stringify(
390394
take(input, {
391395
codeHandlers: [],
396+
handlerConfigs: (_) => _json(_),
392397
name: [],
393398
publishAuthModes: (_) => _json(_),
394399
subscribeAuthModes: (_) => _json(_),
@@ -1605,6 +1610,7 @@ export const se_UpdateChannelNamespaceCommand = async (
16051610
body = JSON.stringify(
16061611
take(input, {
16071612
codeHandlers: [],
1613+
handlerConfigs: (_) => _json(_),
16081614
publishAuthModes: (_) => _json(_),
16091615
subscribeAuthModes: (_) => _json(_),
16101616
})
@@ -3702,10 +3708,18 @@ const de_UnauthorizedExceptionRes = async (
37023708

37033709
// se_FunctionsIds omitted.
37043710

3711+
// se_HandlerConfig omitted.
3712+
3713+
// se_HandlerConfigs omitted.
3714+
37053715
// se_HttpDataSourceConfig omitted.
37063716

3717+
// se_Integration omitted.
3718+
37073719
// se_LambdaAuthorizerConfig omitted.
37083720

3721+
// se_LambdaConfig omitted.
3722+
37093723
// se_LambdaConflictHandlerConfig omitted.
37103724

37113725
// se_LambdaDataSourceConfig omitted.
@@ -3803,6 +3817,7 @@ const de_ChannelNamespace = (output: any, context: __SerdeContext): ChannelNames
38033817
channelNamespaceArn: __expectString,
38043818
codeHandlers: __expectString,
38053819
created: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
3820+
handlerConfigs: _json,
38063821
lastModified: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
38073822
name: __expectString,
38083823
publishAuthModes: _json,
@@ -3958,10 +3973,18 @@ const de_DataSourceIntrospectionResult = (output: any, context: __SerdeContext):
39583973

39593974
// de_GraphqlApis omitted.
39603975

3976+
// de_HandlerConfig omitted.
3977+
3978+
// de_HandlerConfigs omitted.
3979+
39613980
// de_HttpDataSourceConfig omitted.
39623981

3982+
// de_Integration omitted.
3983+
39633984
// de_LambdaAuthorizerConfig omitted.
39643985

3986+
// de_LambdaConfig omitted.
3987+
39653988
// de_LambdaConflictHandlerConfig omitted.
39663989

39673990
// de_LambdaDataSourceConfig omitted.

0 commit comments

Comments
 (0)