Skip to content

Commit fd798b0

Browse files
author
awstools
committed
feat(client-proton): Add new "Components" API to enable users to Create, Delete and Update AWS Proton components.
1 parent 013e253 commit fd798b0

35 files changed

+4632
-527
lines changed

clients/client-proton/src/Proton.ts

+354-46
Large diffs are not rendered by default.

clients/client-proton/src/ProtonClient.ts

+33
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ import {
5656
AcceptEnvironmentAccountConnectionCommandInput,
5757
AcceptEnvironmentAccountConnectionCommandOutput,
5858
} from "./commands/AcceptEnvironmentAccountConnectionCommand";
59+
import {
60+
CancelComponentDeploymentCommandInput,
61+
CancelComponentDeploymentCommandOutput,
62+
} from "./commands/CancelComponentDeploymentCommand";
5963
import {
6064
CancelEnvironmentDeploymentCommandInput,
6165
CancelEnvironmentDeploymentCommandOutput,
@@ -68,6 +72,7 @@ import {
6872
CancelServicePipelineDeploymentCommandInput,
6973
CancelServicePipelineDeploymentCommandOutput,
7074
} from "./commands/CancelServicePipelineDeploymentCommand";
75+
import { CreateComponentCommandInput, CreateComponentCommandOutput } from "./commands/CreateComponentCommand";
7176
import {
7277
CreateEnvironmentAccountConnectionCommandInput,
7378
CreateEnvironmentAccountConnectionCommandOutput,
@@ -95,6 +100,7 @@ import {
95100
CreateTemplateSyncConfigCommandInput,
96101
CreateTemplateSyncConfigCommandOutput,
97102
} from "./commands/CreateTemplateSyncConfigCommand";
103+
import { DeleteComponentCommandInput, DeleteComponentCommandOutput } from "./commands/DeleteComponentCommand";
98104
import {
99105
DeleteEnvironmentAccountConnectionCommandInput,
100106
DeleteEnvironmentAccountConnectionCommandOutput,
@@ -123,6 +129,7 @@ import {
123129
DeleteTemplateSyncConfigCommandOutput,
124130
} from "./commands/DeleteTemplateSyncConfigCommand";
125131
import { GetAccountSettingsCommandInput, GetAccountSettingsCommandOutput } from "./commands/GetAccountSettingsCommand";
132+
import { GetComponentCommandInput, GetComponentCommandOutput } from "./commands/GetComponentCommand";
126133
import {
127134
GetEnvironmentAccountConnectionCommandInput,
128135
GetEnvironmentAccountConnectionCommandOutput,
@@ -156,6 +163,15 @@ import {
156163
GetTemplateSyncStatusCommandInput,
157164
GetTemplateSyncStatusCommandOutput,
158165
} from "./commands/GetTemplateSyncStatusCommand";
166+
import {
167+
ListComponentOutputsCommandInput,
168+
ListComponentOutputsCommandOutput,
169+
} from "./commands/ListComponentOutputsCommand";
170+
import {
171+
ListComponentProvisionedResourcesCommandInput,
172+
ListComponentProvisionedResourcesCommandOutput,
173+
} from "./commands/ListComponentProvisionedResourcesCommand";
174+
import { ListComponentsCommandInput, ListComponentsCommandOutput } from "./commands/ListComponentsCommand";
159175
import {
160176
ListEnvironmentAccountConnectionsCommandInput,
161177
ListEnvironmentAccountConnectionsCommandOutput,
@@ -229,6 +245,7 @@ import {
229245
UpdateAccountSettingsCommandInput,
230246
UpdateAccountSettingsCommandOutput,
231247
} from "./commands/UpdateAccountSettingsCommand";
248+
import { UpdateComponentCommandInput, UpdateComponentCommandOutput } from "./commands/UpdateComponentCommand";
232249
import {
233250
UpdateEnvironmentAccountConnectionCommandInput,
234251
UpdateEnvironmentAccountConnectionCommandOutput,
@@ -267,9 +284,11 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
267284

268285
export type ServiceInputTypes =
269286
| AcceptEnvironmentAccountConnectionCommandInput
287+
| CancelComponentDeploymentCommandInput
270288
| CancelEnvironmentDeploymentCommandInput
271289
| CancelServiceInstanceDeploymentCommandInput
272290
| CancelServicePipelineDeploymentCommandInput
291+
| CreateComponentCommandInput
273292
| CreateEnvironmentAccountConnectionCommandInput
274293
| CreateEnvironmentCommandInput
275294
| CreateEnvironmentTemplateCommandInput
@@ -279,6 +298,7 @@ export type ServiceInputTypes =
279298
| CreateServiceTemplateCommandInput
280299
| CreateServiceTemplateVersionCommandInput
281300
| CreateTemplateSyncConfigCommandInput
301+
| DeleteComponentCommandInput
282302
| DeleteEnvironmentAccountConnectionCommandInput
283303
| DeleteEnvironmentCommandInput
284304
| DeleteEnvironmentTemplateCommandInput
@@ -289,6 +309,7 @@ export type ServiceInputTypes =
289309
| DeleteServiceTemplateVersionCommandInput
290310
| DeleteTemplateSyncConfigCommandInput
291311
| GetAccountSettingsCommandInput
312+
| GetComponentCommandInput
292313
| GetEnvironmentAccountConnectionCommandInput
293314
| GetEnvironmentCommandInput
294315
| GetEnvironmentTemplateCommandInput
@@ -301,6 +322,9 @@ export type ServiceInputTypes =
301322
| GetServiceTemplateVersionCommandInput
302323
| GetTemplateSyncConfigCommandInput
303324
| GetTemplateSyncStatusCommandInput
325+
| ListComponentOutputsCommandInput
326+
| ListComponentProvisionedResourcesCommandInput
327+
| ListComponentsCommandInput
304328
| ListEnvironmentAccountConnectionsCommandInput
305329
| ListEnvironmentOutputsCommandInput
306330
| ListEnvironmentProvisionedResourcesCommandInput
@@ -323,6 +347,7 @@ export type ServiceInputTypes =
323347
| TagResourceCommandInput
324348
| UntagResourceCommandInput
325349
| UpdateAccountSettingsCommandInput
350+
| UpdateComponentCommandInput
326351
| UpdateEnvironmentAccountConnectionCommandInput
327352
| UpdateEnvironmentCommandInput
328353
| UpdateEnvironmentTemplateCommandInput
@@ -336,9 +361,11 @@ export type ServiceInputTypes =
336361

337362
export type ServiceOutputTypes =
338363
| AcceptEnvironmentAccountConnectionCommandOutput
364+
| CancelComponentDeploymentCommandOutput
339365
| CancelEnvironmentDeploymentCommandOutput
340366
| CancelServiceInstanceDeploymentCommandOutput
341367
| CancelServicePipelineDeploymentCommandOutput
368+
| CreateComponentCommandOutput
342369
| CreateEnvironmentAccountConnectionCommandOutput
343370
| CreateEnvironmentCommandOutput
344371
| CreateEnvironmentTemplateCommandOutput
@@ -348,6 +375,7 @@ export type ServiceOutputTypes =
348375
| CreateServiceTemplateCommandOutput
349376
| CreateServiceTemplateVersionCommandOutput
350377
| CreateTemplateSyncConfigCommandOutput
378+
| DeleteComponentCommandOutput
351379
| DeleteEnvironmentAccountConnectionCommandOutput
352380
| DeleteEnvironmentCommandOutput
353381
| DeleteEnvironmentTemplateCommandOutput
@@ -358,6 +386,7 @@ export type ServiceOutputTypes =
358386
| DeleteServiceTemplateVersionCommandOutput
359387
| DeleteTemplateSyncConfigCommandOutput
360388
| GetAccountSettingsCommandOutput
389+
| GetComponentCommandOutput
361390
| GetEnvironmentAccountConnectionCommandOutput
362391
| GetEnvironmentCommandOutput
363392
| GetEnvironmentTemplateCommandOutput
@@ -370,6 +399,9 @@ export type ServiceOutputTypes =
370399
| GetServiceTemplateVersionCommandOutput
371400
| GetTemplateSyncConfigCommandOutput
372401
| GetTemplateSyncStatusCommandOutput
402+
| ListComponentOutputsCommandOutput
403+
| ListComponentProvisionedResourcesCommandOutput
404+
| ListComponentsCommandOutput
373405
| ListEnvironmentAccountConnectionsCommandOutput
374406
| ListEnvironmentOutputsCommandOutput
375407
| ListEnvironmentProvisionedResourcesCommandOutput
@@ -392,6 +424,7 @@ export type ServiceOutputTypes =
392424
| TagResourceCommandOutput
393425
| UntagResourceCommandOutput
394426
| UpdateAccountSettingsCommandOutput
427+
| UpdateComponentCommandOutput
395428
| UpdateEnvironmentAccountConnectionCommandOutput
396429
| UpdateEnvironmentCommandOutput
397430
| UpdateEnvironmentTemplateCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { CancelComponentDeploymentInput, CancelComponentDeploymentOutput } from "../models/models_0";
16+
import {
17+
deserializeAws_json1_0CancelComponentDeploymentCommand,
18+
serializeAws_json1_0CancelComponentDeploymentCommand,
19+
} from "../protocols/Aws_json1_0";
20+
import { ProtonClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ProtonClient";
21+
22+
export interface CancelComponentDeploymentCommandInput extends CancelComponentDeploymentInput {}
23+
export interface CancelComponentDeploymentCommandOutput extends CancelComponentDeploymentOutput, __MetadataBearer {}
24+
25+
/**
26+
* <p>Attempts to cancel a component deployment (for a component that is in the <code>IN_PROGRESS</code> deployment status).</p>
27+
* <p>For more information about components, see
28+
* <a href="https://docs.aws.amazon.com/proton/latest/adminguide/ag-components.html">Proton components</a> in the
29+
* <i>Proton Administrator Guide</i>.</p>
30+
* @example
31+
* Use a bare-bones client and the command you need to make an API call.
32+
* ```javascript
33+
* import { ProtonClient, CancelComponentDeploymentCommand } from "@aws-sdk/client-proton"; // ES Modules import
34+
* // const { ProtonClient, CancelComponentDeploymentCommand } = require("@aws-sdk/client-proton"); // CommonJS import
35+
* const client = new ProtonClient(config);
36+
* const command = new CancelComponentDeploymentCommand(input);
37+
* const response = await client.send(command);
38+
* ```
39+
*
40+
* @see {@link CancelComponentDeploymentCommandInput} for command's `input` shape.
41+
* @see {@link CancelComponentDeploymentCommandOutput} for command's `response` shape.
42+
* @see {@link ProtonClientResolvedConfig | config} for ProtonClient's `config` shape.
43+
*
44+
*/
45+
export class CancelComponentDeploymentCommand extends $Command<
46+
CancelComponentDeploymentCommandInput,
47+
CancelComponentDeploymentCommandOutput,
48+
ProtonClientResolvedConfig
49+
> {
50+
// Start section: command_properties
51+
// End section: command_properties
52+
53+
constructor(readonly input: CancelComponentDeploymentCommandInput) {
54+
// Start section: command_constructor
55+
super();
56+
// End section: command_constructor
57+
}
58+
59+
/**
60+
* @internal
61+
*/
62+
resolveMiddleware(
63+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
64+
configuration: ProtonClientResolvedConfig,
65+
options?: __HttpHandlerOptions
66+
): Handler<CancelComponentDeploymentCommandInput, CancelComponentDeploymentCommandOutput> {
67+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
68+
69+
const stack = clientStack.concat(this.middlewareStack);
70+
71+
const { logger } = configuration;
72+
const clientName = "ProtonClient";
73+
const commandName = "CancelComponentDeploymentCommand";
74+
const handlerExecutionContext: HandlerExecutionContext = {
75+
logger,
76+
clientName,
77+
commandName,
78+
inputFilterSensitiveLog: CancelComponentDeploymentInput.filterSensitiveLog,
79+
outputFilterSensitiveLog: CancelComponentDeploymentOutput.filterSensitiveLog,
80+
};
81+
const { requestHandler } = configuration;
82+
return stack.resolve(
83+
(request: FinalizeHandlerArguments<any>) =>
84+
requestHandler.handle(request.request as __HttpRequest, options || {}),
85+
handlerExecutionContext
86+
);
87+
}
88+
89+
private serialize(input: CancelComponentDeploymentCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
90+
return serializeAws_json1_0CancelComponentDeploymentCommand(input, context);
91+
}
92+
93+
private deserialize(
94+
output: __HttpResponse,
95+
context: __SerdeContext
96+
): Promise<CancelComponentDeploymentCommandOutput> {
97+
return deserializeAws_json1_0CancelComponentDeploymentCommand(output, context);
98+
}
99+
100+
// Start section: command_body_extra
101+
// End section: command_body_extra
102+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { CreateComponentInput, CreateComponentOutput } from "../models/models_0";
16+
import {
17+
deserializeAws_json1_0CreateComponentCommand,
18+
serializeAws_json1_0CreateComponentCommand,
19+
} from "../protocols/Aws_json1_0";
20+
import { ProtonClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ProtonClient";
21+
22+
export interface CreateComponentCommandInput extends CreateComponentInput {}
23+
export interface CreateComponentCommandOutput extends CreateComponentOutput, __MetadataBearer {}
24+
25+
/**
26+
* <p>Create an Proton component. A component is an infrastructure extension for a service instance.</p>
27+
* <p>For more information about components, see
28+
* <a href="https://docs.aws.amazon.com/proton/latest/adminguide/ag-components.html">Proton components</a> in the
29+
* <i>Proton Administrator Guide</i>.</p>
30+
* @example
31+
* Use a bare-bones client and the command you need to make an API call.
32+
* ```javascript
33+
* import { ProtonClient, CreateComponentCommand } from "@aws-sdk/client-proton"; // ES Modules import
34+
* // const { ProtonClient, CreateComponentCommand } = require("@aws-sdk/client-proton"); // CommonJS import
35+
* const client = new ProtonClient(config);
36+
* const command = new CreateComponentCommand(input);
37+
* const response = await client.send(command);
38+
* ```
39+
*
40+
* @see {@link CreateComponentCommandInput} for command's `input` shape.
41+
* @see {@link CreateComponentCommandOutput} for command's `response` shape.
42+
* @see {@link ProtonClientResolvedConfig | config} for ProtonClient's `config` shape.
43+
*
44+
*/
45+
export class CreateComponentCommand extends $Command<
46+
CreateComponentCommandInput,
47+
CreateComponentCommandOutput,
48+
ProtonClientResolvedConfig
49+
> {
50+
// Start section: command_properties
51+
// End section: command_properties
52+
53+
constructor(readonly input: CreateComponentCommandInput) {
54+
// Start section: command_constructor
55+
super();
56+
// End section: command_constructor
57+
}
58+
59+
/**
60+
* @internal
61+
*/
62+
resolveMiddleware(
63+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
64+
configuration: ProtonClientResolvedConfig,
65+
options?: __HttpHandlerOptions
66+
): Handler<CreateComponentCommandInput, CreateComponentCommandOutput> {
67+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
68+
69+
const stack = clientStack.concat(this.middlewareStack);
70+
71+
const { logger } = configuration;
72+
const clientName = "ProtonClient";
73+
const commandName = "CreateComponentCommand";
74+
const handlerExecutionContext: HandlerExecutionContext = {
75+
logger,
76+
clientName,
77+
commandName,
78+
inputFilterSensitiveLog: CreateComponentInput.filterSensitiveLog,
79+
outputFilterSensitiveLog: CreateComponentOutput.filterSensitiveLog,
80+
};
81+
const { requestHandler } = configuration;
82+
return stack.resolve(
83+
(request: FinalizeHandlerArguments<any>) =>
84+
requestHandler.handle(request.request as __HttpRequest, options || {}),
85+
handlerExecutionContext
86+
);
87+
}
88+
89+
private serialize(input: CreateComponentCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
90+
return serializeAws_json1_0CreateComponentCommand(input, context);
91+
}
92+
93+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateComponentCommandOutput> {
94+
return deserializeAws_json1_0CreateComponentCommand(output, context);
95+
}
96+
97+
// Start section: command_body_extra
98+
// End section: command_body_extra
99+
}

0 commit comments

Comments
 (0)