Skip to content

Commit 6581c52

Browse files
author
awstools
committed
feat(client-appsync): Support for environment variables in AppSync GraphQL APIs
1 parent f1513dc commit 6581c52

File tree

9 files changed

+687
-0
lines changed

9 files changed

+687
-0
lines changed

clients/client-appsync/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,14 @@ GetGraphqlApi
459459

460460
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/GetGraphqlApiCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetGraphqlApiCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetGraphqlApiCommandOutput/)
461461

462+
</details>
463+
<details>
464+
<summary>
465+
GetGraphqlApiEnvironmentVariables
466+
</summary>
467+
468+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/GetGraphqlApiEnvironmentVariablesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetGraphqlApiEnvironmentVariablesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetGraphqlApiEnvironmentVariablesCommandOutput/)
469+
462470
</details>
463471
<details>
464472
<summary>
@@ -587,6 +595,14 @@ ListTypesByAssociation
587595

588596
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/ListTypesByAssociationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/ListTypesByAssociationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/ListTypesByAssociationCommandOutput/)
589597

598+
</details>
599+
<details>
600+
<summary>
601+
PutGraphqlApiEnvironmentVariables
602+
</summary>
603+
604+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/PutGraphqlApiEnvironmentVariablesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/PutGraphqlApiEnvironmentVariablesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/PutGraphqlApiEnvironmentVariablesCommandOutput/)
605+
590606
</details>
591607
<details>
592608
<summary>

clients/client-appsync/src/AppSync.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ import {
147147
GetGraphqlApiCommandInput,
148148
GetGraphqlApiCommandOutput,
149149
} from "./commands/GetGraphqlApiCommand";
150+
import {
151+
GetGraphqlApiEnvironmentVariablesCommand,
152+
GetGraphqlApiEnvironmentVariablesCommandInput,
153+
GetGraphqlApiEnvironmentVariablesCommandOutput,
154+
} from "./commands/GetGraphqlApiEnvironmentVariablesCommand";
150155
import {
151156
GetIntrospectionSchemaCommand,
152157
GetIntrospectionSchemaCommandInput,
@@ -211,6 +216,11 @@ import {
211216
ListTypesByAssociationCommandOutput,
212217
} from "./commands/ListTypesByAssociationCommand";
213218
import { ListTypesCommand, ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTypesCommand";
219+
import {
220+
PutGraphqlApiEnvironmentVariablesCommand,
221+
PutGraphqlApiEnvironmentVariablesCommandInput,
222+
PutGraphqlApiEnvironmentVariablesCommandOutput,
223+
} from "./commands/PutGraphqlApiEnvironmentVariablesCommand";
214224
import {
215225
StartDataSourceIntrospectionCommand,
216226
StartDataSourceIntrospectionCommandInput,
@@ -307,6 +317,7 @@ const commands = {
307317
GetDomainNameCommand,
308318
GetFunctionCommand,
309319
GetGraphqlApiCommand,
320+
GetGraphqlApiEnvironmentVariablesCommand,
310321
GetIntrospectionSchemaCommand,
311322
GetResolverCommand,
312323
GetSchemaCreationStatusCommand,
@@ -323,6 +334,7 @@ const commands = {
323334
ListTagsForResourceCommand,
324335
ListTypesCommand,
325336
ListTypesByAssociationCommand,
337+
PutGraphqlApiEnvironmentVariablesCommand,
326338
StartDataSourceIntrospectionCommand,
327339
StartSchemaCreationCommand,
328340
StartSchemaMergeCommand,
@@ -791,6 +803,23 @@ export interface AppSync {
791803
cb: (err: any, data?: GetGraphqlApiCommandOutput) => void
792804
): void;
793805

806+
/**
807+
* @see {@link GetGraphqlApiEnvironmentVariablesCommand}
808+
*/
809+
getGraphqlApiEnvironmentVariables(
810+
args: GetGraphqlApiEnvironmentVariablesCommandInput,
811+
options?: __HttpHandlerOptions
812+
): Promise<GetGraphqlApiEnvironmentVariablesCommandOutput>;
813+
getGraphqlApiEnvironmentVariables(
814+
args: GetGraphqlApiEnvironmentVariablesCommandInput,
815+
cb: (err: any, data?: GetGraphqlApiEnvironmentVariablesCommandOutput) => void
816+
): void;
817+
getGraphqlApiEnvironmentVariables(
818+
args: GetGraphqlApiEnvironmentVariablesCommandInput,
819+
options: __HttpHandlerOptions,
820+
cb: (err: any, data?: GetGraphqlApiEnvironmentVariablesCommandOutput) => void
821+
): void;
822+
794823
/**
795824
* @see {@link GetIntrospectionSchemaCommand}
796825
*/
@@ -1018,6 +1047,23 @@ export interface AppSync {
10181047
cb: (err: any, data?: ListTypesByAssociationCommandOutput) => void
10191048
): void;
10201049

1050+
/**
1051+
* @see {@link PutGraphqlApiEnvironmentVariablesCommand}
1052+
*/
1053+
putGraphqlApiEnvironmentVariables(
1054+
args: PutGraphqlApiEnvironmentVariablesCommandInput,
1055+
options?: __HttpHandlerOptions
1056+
): Promise<PutGraphqlApiEnvironmentVariablesCommandOutput>;
1057+
putGraphqlApiEnvironmentVariables(
1058+
args: PutGraphqlApiEnvironmentVariablesCommandInput,
1059+
cb: (err: any, data?: PutGraphqlApiEnvironmentVariablesCommandOutput) => void
1060+
): void;
1061+
putGraphqlApiEnvironmentVariables(
1062+
args: PutGraphqlApiEnvironmentVariablesCommandInput,
1063+
options: __HttpHandlerOptions,
1064+
cb: (err: any, data?: PutGraphqlApiEnvironmentVariablesCommandOutput) => void
1065+
): void;
1066+
10211067
/**
10221068
* @see {@link StartDataSourceIntrospectionCommand}
10231069
*/

clients/client-appsync/src/AppSyncClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ import {
9898
import { GetDomainNameCommandInput, GetDomainNameCommandOutput } from "./commands/GetDomainNameCommand";
9999
import { GetFunctionCommandInput, GetFunctionCommandOutput } from "./commands/GetFunctionCommand";
100100
import { GetGraphqlApiCommandInput, GetGraphqlApiCommandOutput } from "./commands/GetGraphqlApiCommand";
101+
import {
102+
GetGraphqlApiEnvironmentVariablesCommandInput,
103+
GetGraphqlApiEnvironmentVariablesCommandOutput,
104+
} from "./commands/GetGraphqlApiEnvironmentVariablesCommand";
101105
import {
102106
GetIntrospectionSchemaCommandInput,
103107
GetIntrospectionSchemaCommandOutput,
@@ -135,6 +139,10 @@ import {
135139
ListTypesByAssociationCommandOutput,
136140
} from "./commands/ListTypesByAssociationCommand";
137141
import { ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTypesCommand";
142+
import {
143+
PutGraphqlApiEnvironmentVariablesCommandInput,
144+
PutGraphqlApiEnvironmentVariablesCommandOutput,
145+
} from "./commands/PutGraphqlApiEnvironmentVariablesCommand";
138146
import {
139147
StartDataSourceIntrospectionCommandInput,
140148
StartDataSourceIntrospectionCommandOutput,
@@ -205,6 +213,7 @@ export type ServiceInputTypes =
205213
| GetDomainNameCommandInput
206214
| GetFunctionCommandInput
207215
| GetGraphqlApiCommandInput
216+
| GetGraphqlApiEnvironmentVariablesCommandInput
208217
| GetIntrospectionSchemaCommandInput
209218
| GetResolverCommandInput
210219
| GetSchemaCreationStatusCommandInput
@@ -221,6 +230,7 @@ export type ServiceInputTypes =
221230
| ListTagsForResourceCommandInput
222231
| ListTypesByAssociationCommandInput
223232
| ListTypesCommandInput
233+
| PutGraphqlApiEnvironmentVariablesCommandInput
224234
| StartDataSourceIntrospectionCommandInput
225235
| StartSchemaCreationCommandInput
226236
| StartSchemaMergeCommandInput
@@ -272,6 +282,7 @@ export type ServiceOutputTypes =
272282
| GetDomainNameCommandOutput
273283
| GetFunctionCommandOutput
274284
| GetGraphqlApiCommandOutput
285+
| GetGraphqlApiEnvironmentVariablesCommandOutput
275286
| GetIntrospectionSchemaCommandOutput
276287
| GetResolverCommandOutput
277288
| GetSchemaCreationStatusCommandOutput
@@ -288,6 +299,7 @@ export type ServiceOutputTypes =
288299
| ListTagsForResourceCommandOutput
289300
| ListTypesByAssociationCommandOutput
290301
| ListTypesCommandOutput
302+
| PutGraphqlApiEnvironmentVariablesCommandOutput
291303
| StartDataSourceIntrospectionCommandOutput
292304
| StartSchemaCreationCommandOutput
293305
| StartSchemaMergeCommandOutput
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { AppSyncClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AppSyncClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
GetGraphqlApiEnvironmentVariablesRequest,
11+
GetGraphqlApiEnvironmentVariablesResponse,
12+
} from "../models/models_0";
13+
import {
14+
de_GetGraphqlApiEnvironmentVariablesCommand,
15+
se_GetGraphqlApiEnvironmentVariablesCommand,
16+
} from "../protocols/Aws_restJson1";
17+
18+
/**
19+
* @public
20+
*/
21+
export { __MetadataBearer, $Command };
22+
/**
23+
* @public
24+
*
25+
* The input for {@link GetGraphqlApiEnvironmentVariablesCommand}.
26+
*/
27+
export interface GetGraphqlApiEnvironmentVariablesCommandInput extends GetGraphqlApiEnvironmentVariablesRequest {}
28+
/**
29+
* @public
30+
*
31+
* The output of {@link GetGraphqlApiEnvironmentVariablesCommand}.
32+
*/
33+
export interface GetGraphqlApiEnvironmentVariablesCommandOutput
34+
extends GetGraphqlApiEnvironmentVariablesResponse,
35+
__MetadataBearer {}
36+
37+
/**
38+
* @public
39+
* <p>Retrieves the list of environmental variable key-value pairs associated with an API by its ID value.</p>
40+
* @example
41+
* Use a bare-bones client and the command you need to make an API call.
42+
* ```javascript
43+
* import { AppSyncClient, GetGraphqlApiEnvironmentVariablesCommand } from "@aws-sdk/client-appsync"; // ES Modules import
44+
* // const { AppSyncClient, GetGraphqlApiEnvironmentVariablesCommand } = require("@aws-sdk/client-appsync"); // CommonJS import
45+
* const client = new AppSyncClient(config);
46+
* const input = { // GetGraphqlApiEnvironmentVariablesRequest
47+
* apiId: "STRING_VALUE", // required
48+
* };
49+
* const command = new GetGraphqlApiEnvironmentVariablesCommand(input);
50+
* const response = await client.send(command);
51+
* // { // GetGraphqlApiEnvironmentVariablesResponse
52+
* // environmentVariables: { // EnvironmentVariableMap
53+
* // "<keys>": "STRING_VALUE",
54+
* // },
55+
* // };
56+
*
57+
* ```
58+
*
59+
* @param GetGraphqlApiEnvironmentVariablesCommandInput - {@link GetGraphqlApiEnvironmentVariablesCommandInput}
60+
* @returns {@link GetGraphqlApiEnvironmentVariablesCommandOutput}
61+
* @see {@link GetGraphqlApiEnvironmentVariablesCommandInput} for command's `input` shape.
62+
* @see {@link GetGraphqlApiEnvironmentVariablesCommandOutput} for command's `response` shape.
63+
* @see {@link AppSyncClientResolvedConfig | config} for AppSyncClient's `config` shape.
64+
*
65+
* @throws {@link AccessDeniedException} (client fault)
66+
* <p>You don't have access to perform this operation on this resource.</p>
67+
*
68+
* @throws {@link BadRequestException} (client fault)
69+
* <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the
70+
* field values, and then try again.</p>
71+
*
72+
* @throws {@link InternalFailureException} (server fault)
73+
* <p>An internal AppSync error occurred. Try your request again.</p>
74+
*
75+
* @throws {@link NotFoundException} (client fault)
76+
* <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
77+
*
78+
* @throws {@link UnauthorizedException} (client fault)
79+
* <p>You aren't authorized to perform this operation.</p>
80+
*
81+
* @throws {@link AppSyncServiceException}
82+
* <p>Base exception class for all service exceptions from AppSync service.</p>
83+
*
84+
*/
85+
export class GetGraphqlApiEnvironmentVariablesCommand extends $Command
86+
.classBuilder<
87+
GetGraphqlApiEnvironmentVariablesCommandInput,
88+
GetGraphqlApiEnvironmentVariablesCommandOutput,
89+
AppSyncClientResolvedConfig,
90+
ServiceInputTypes,
91+
ServiceOutputTypes
92+
>()
93+
.ep({
94+
...commonParams,
95+
})
96+
.m(function (this: any, Command: any, cs: any, config: AppSyncClientResolvedConfig, o: any) {
97+
return [
98+
getSerdePlugin(config, this.serialize, this.deserialize),
99+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
100+
];
101+
})
102+
.s("AWSDeepdishControlPlaneService", "GetGraphqlApiEnvironmentVariables", {})
103+
.n("AppSyncClient", "GetGraphqlApiEnvironmentVariablesCommand")
104+
.f(void 0, void 0)
105+
.ser(se_GetGraphqlApiEnvironmentVariablesCommand)
106+
.de(de_GetGraphqlApiEnvironmentVariablesCommand)
107+
.build() {}

0 commit comments

Comments
 (0)