Skip to content

Commit 0fb710a

Browse files
author
awstools
committed
feat(client-swf): This release adds new APIs for deleting activity type and workflow type resources.
1 parent 8c9bbb1 commit 0fb710a

File tree

10 files changed

+586
-5
lines changed

10 files changed

+586
-5
lines changed

clients/client-swf/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,22 @@ CountPendingDecisionTasks
247247

248248
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/swf/command/CountPendingDecisionTasksCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/CountPendingDecisionTasksCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/CountPendingDecisionTasksCommandOutput/)
249249

250+
</details>
251+
<details>
252+
<summary>
253+
DeleteActivityType
254+
</summary>
255+
256+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/swf/command/DeleteActivityTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/DeleteActivityTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/DeleteActivityTypeCommandOutput/)
257+
258+
</details>
259+
<details>
260+
<summary>
261+
DeleteWorkflowType
262+
</summary>
263+
264+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/swf/command/DeleteWorkflowTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/DeleteWorkflowTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-swf/Interface/DeleteWorkflowTypeCommandOutput/)
265+
250266
</details>
251267
<details>
252268
<summary>

clients/client-swf/src/SWF.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ import {
2222
CountPendingDecisionTasksCommandInput,
2323
CountPendingDecisionTasksCommandOutput,
2424
} from "./commands/CountPendingDecisionTasksCommand";
25+
import {
26+
DeleteActivityTypeCommand,
27+
DeleteActivityTypeCommandInput,
28+
DeleteActivityTypeCommandOutput,
29+
} from "./commands/DeleteActivityTypeCommand";
30+
import {
31+
DeleteWorkflowTypeCommand,
32+
DeleteWorkflowTypeCommandInput,
33+
DeleteWorkflowTypeCommandOutput,
34+
} from "./commands/DeleteWorkflowTypeCommand";
2535
import {
2636
DeprecateActivityTypeCommand,
2737
DeprecateActivityTypeCommandInput,
@@ -186,6 +196,8 @@ const commands = {
186196
CountOpenWorkflowExecutionsCommand,
187197
CountPendingActivityTasksCommand,
188198
CountPendingDecisionTasksCommand,
199+
DeleteActivityTypeCommand,
200+
DeleteWorkflowTypeCommand,
189201
DeprecateActivityTypeCommand,
190202
DeprecateDomainCommand,
191203
DeprecateWorkflowTypeCommand,
@@ -290,6 +302,40 @@ export interface SWF {
290302
cb: (err: any, data?: CountPendingDecisionTasksCommandOutput) => void
291303
): void;
292304

305+
/**
306+
* @see {@link DeleteActivityTypeCommand}
307+
*/
308+
deleteActivityType(
309+
args: DeleteActivityTypeCommandInput,
310+
options?: __HttpHandlerOptions
311+
): Promise<DeleteActivityTypeCommandOutput>;
312+
deleteActivityType(
313+
args: DeleteActivityTypeCommandInput,
314+
cb: (err: any, data?: DeleteActivityTypeCommandOutput) => void
315+
): void;
316+
deleteActivityType(
317+
args: DeleteActivityTypeCommandInput,
318+
options: __HttpHandlerOptions,
319+
cb: (err: any, data?: DeleteActivityTypeCommandOutput) => void
320+
): void;
321+
322+
/**
323+
* @see {@link DeleteWorkflowTypeCommand}
324+
*/
325+
deleteWorkflowType(
326+
args: DeleteWorkflowTypeCommandInput,
327+
options?: __HttpHandlerOptions
328+
): Promise<DeleteWorkflowTypeCommandOutput>;
329+
deleteWorkflowType(
330+
args: DeleteWorkflowTypeCommandInput,
331+
cb: (err: any, data?: DeleteWorkflowTypeCommandOutput) => void
332+
): void;
333+
deleteWorkflowType(
334+
args: DeleteWorkflowTypeCommandInput,
335+
options: __HttpHandlerOptions,
336+
cb: (err: any, data?: DeleteWorkflowTypeCommandOutput) => void
337+
): void;
338+
293339
/**
294340
* @see {@link DeprecateActivityTypeCommand}
295341
*/

clients/client-swf/src/SWFClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ import {
6969
CountPendingDecisionTasksCommandInput,
7070
CountPendingDecisionTasksCommandOutput,
7171
} from "./commands/CountPendingDecisionTasksCommand";
72+
import { DeleteActivityTypeCommandInput, DeleteActivityTypeCommandOutput } from "./commands/DeleteActivityTypeCommand";
73+
import { DeleteWorkflowTypeCommandInput, DeleteWorkflowTypeCommandOutput } from "./commands/DeleteWorkflowTypeCommand";
7274
import {
7375
DeprecateActivityTypeCommandInput,
7476
DeprecateActivityTypeCommandOutput,
@@ -193,6 +195,8 @@ export type ServiceInputTypes =
193195
| CountOpenWorkflowExecutionsCommandInput
194196
| CountPendingActivityTasksCommandInput
195197
| CountPendingDecisionTasksCommandInput
198+
| DeleteActivityTypeCommandInput
199+
| DeleteWorkflowTypeCommandInput
196200
| DeprecateActivityTypeCommandInput
197201
| DeprecateDomainCommandInput
198202
| DeprecateWorkflowTypeCommandInput
@@ -235,6 +239,8 @@ export type ServiceOutputTypes =
235239
| CountOpenWorkflowExecutionsCommandOutput
236240
| CountPendingActivityTasksCommandOutput
237241
| CountPendingDecisionTasksCommandOutput
242+
| DeleteActivityTypeCommandOutput
243+
| DeleteWorkflowTypeCommandOutput
238244
| DeprecateActivityTypeCommandOutput
239245
| DeprecateDomainCommandOutput
240246
| DeprecateWorkflowTypeCommandOutput
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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 { commonParams } from "../endpoint/EndpointParameters";
8+
import { DeleteActivityTypeInput } from "../models/models_0";
9+
import { de_DeleteActivityTypeCommand, se_DeleteActivityTypeCommand } from "../protocols/Aws_json1_0";
10+
import { ServiceInputTypes, ServiceOutputTypes, SWFClientResolvedConfig } from "../SWFClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link DeleteActivityTypeCommand}.
20+
*/
21+
export interface DeleteActivityTypeCommandInput extends DeleteActivityTypeInput {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link DeleteActivityTypeCommand}.
26+
*/
27+
export interface DeleteActivityTypeCommandOutput extends __MetadataBearer {}
28+
29+
/**
30+
* <p>Deletes the specified <i>activity type</i>.</p>
31+
* <p>Note: Prior to deletion, activity types must first be <b>deprecated</b>. </p>
32+
* <p>
33+
* After an activity type has been deleted, you cannot schedule new activities of that type. Activities that started before the type was deleted will continue to run.
34+
* </p>
35+
* <p>
36+
* <b>Access Control</b>
37+
* </p>
38+
* <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
39+
* <ul>
40+
* <li>
41+
* <p>Use a <code>Resource</code> element with the domain name to limit the action to
42+
* only specified domains.</p>
43+
* </li>
44+
* <li>
45+
* <p>Use an <code>Action</code> element to allow or deny permission to call this
46+
* action.</p>
47+
* </li>
48+
* <li>
49+
* <p>Constrain the following parameters by using a <code>Condition</code> element with
50+
* the appropriate keys.</p>
51+
* <ul>
52+
* <li>
53+
* <p>
54+
* <code>activityType.name</code>: String constraint. The key is
55+
* <code>swf:activityType.name</code>.</p>
56+
* </li>
57+
* <li>
58+
* <p>
59+
* <code>activityType.version</code>: String constraint. The key is
60+
* <code>swf:activityType.version</code>.</p>
61+
* </li>
62+
* </ul>
63+
* </li>
64+
* </ul>
65+
* <p>If the caller doesn't have sufficient permissions to invoke the action, or the
66+
* parameter values fall outside the specified constraints, the action fails. The associated
67+
* event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>.
68+
* For details and example IAM policies, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF
69+
* Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>
70+
* @example
71+
* Use a bare-bones client and the command you need to make an API call.
72+
* ```javascript
73+
* import { SWFClient, DeleteActivityTypeCommand } from "@aws-sdk/client-swf"; // ES Modules import
74+
* // const { SWFClient, DeleteActivityTypeCommand } = require("@aws-sdk/client-swf"); // CommonJS import
75+
* const client = new SWFClient(config);
76+
* const input = { // DeleteActivityTypeInput
77+
* domain: "STRING_VALUE", // required
78+
* activityType: { // ActivityType
79+
* name: "STRING_VALUE", // required
80+
* version: "STRING_VALUE", // required
81+
* },
82+
* };
83+
* const command = new DeleteActivityTypeCommand(input);
84+
* const response = await client.send(command);
85+
* // {};
86+
*
87+
* ```
88+
*
89+
* @param DeleteActivityTypeCommandInput - {@link DeleteActivityTypeCommandInput}
90+
* @returns {@link DeleteActivityTypeCommandOutput}
91+
* @see {@link DeleteActivityTypeCommandInput} for command's `input` shape.
92+
* @see {@link DeleteActivityTypeCommandOutput} for command's `response` shape.
93+
* @see {@link SWFClientResolvedConfig | config} for SWFClient's `config` shape.
94+
*
95+
* @throws {@link OperationNotPermittedFault} (client fault)
96+
* <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
97+
*
98+
* @throws {@link TypeNotDeprecatedFault} (client fault)
99+
* <p>Returned when the resource type has not been deprecated.</p>
100+
*
101+
* @throws {@link UnknownResourceFault} (client fault)
102+
* <p>Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.</p>
103+
*
104+
* @throws {@link SWFServiceException}
105+
* <p>Base exception class for all service exceptions from SWF service.</p>
106+
*
107+
* @public
108+
*/
109+
export class DeleteActivityTypeCommand extends $Command
110+
.classBuilder<
111+
DeleteActivityTypeCommandInput,
112+
DeleteActivityTypeCommandOutput,
113+
SWFClientResolvedConfig,
114+
ServiceInputTypes,
115+
ServiceOutputTypes
116+
>()
117+
.ep({
118+
...commonParams,
119+
})
120+
.m(function (this: any, Command: any, cs: any, config: SWFClientResolvedConfig, o: any) {
121+
return [
122+
getSerdePlugin(config, this.serialize, this.deserialize),
123+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
124+
];
125+
})
126+
.s("SimpleWorkflowService", "DeleteActivityType", {})
127+
.n("SWFClient", "DeleteActivityTypeCommand")
128+
.f(void 0, void 0)
129+
.ser(se_DeleteActivityTypeCommand)
130+
.de(de_DeleteActivityTypeCommand)
131+
.build() {}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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 { commonParams } from "../endpoint/EndpointParameters";
8+
import { DeleteWorkflowTypeInput } from "../models/models_0";
9+
import { de_DeleteWorkflowTypeCommand, se_DeleteWorkflowTypeCommand } from "../protocols/Aws_json1_0";
10+
import { ServiceInputTypes, ServiceOutputTypes, SWFClientResolvedConfig } from "../SWFClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link DeleteWorkflowTypeCommand}.
20+
*/
21+
export interface DeleteWorkflowTypeCommandInput extends DeleteWorkflowTypeInput {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link DeleteWorkflowTypeCommand}.
26+
*/
27+
export interface DeleteWorkflowTypeCommandOutput extends __MetadataBearer {}
28+
29+
/**
30+
* <p>Deletes the specified <i>workflow type</i>.</p>
31+
* <p>Note: Prior to deletion, workflow types must first be <b>deprecated</b>.</p>
32+
* <p>
33+
* After a workflow type has been deleted, you cannot create new executions of that type. Executions that
34+
* started before the type was deleted will continue to run.
35+
* </p>
36+
* <p>
37+
* <b>Access Control</b>
38+
* </p>
39+
* <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
40+
* <ul>
41+
* <li>
42+
* <p>Use a <code>Resource</code> element with the domain name to limit the action to
43+
* only specified domains.</p>
44+
* </li>
45+
* <li>
46+
* <p>Use an <code>Action</code> element to allow or deny permission to call this
47+
* action.</p>
48+
* </li>
49+
* <li>
50+
* <p>Constrain the following parameters by using a <code>Condition</code> element with
51+
* the appropriate keys.</p>
52+
* <ul>
53+
* <li>
54+
* <p>
55+
* <code>workflowType.name</code>: String constraint. The key is
56+
* <code>swf:workflowType.name</code>.</p>
57+
* </li>
58+
* <li>
59+
* <p>
60+
* <code>workflowType.version</code>: String constraint. The key is
61+
* <code>swf:workflowType.version</code>.</p>
62+
* </li>
63+
* </ul>
64+
* </li>
65+
* </ul>
66+
* <p>If the caller doesn't have sufficient permissions to invoke the action, or the
67+
* parameter values fall outside the specified constraints, the action fails. The associated
68+
* event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>.
69+
* For details and example IAM policies, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF
70+
* Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>
71+
* @example
72+
* Use a bare-bones client and the command you need to make an API call.
73+
* ```javascript
74+
* import { SWFClient, DeleteWorkflowTypeCommand } from "@aws-sdk/client-swf"; // ES Modules import
75+
* // const { SWFClient, DeleteWorkflowTypeCommand } = require("@aws-sdk/client-swf"); // CommonJS import
76+
* const client = new SWFClient(config);
77+
* const input = { // DeleteWorkflowTypeInput
78+
* domain: "STRING_VALUE", // required
79+
* workflowType: { // WorkflowType
80+
* name: "STRING_VALUE", // required
81+
* version: "STRING_VALUE", // required
82+
* },
83+
* };
84+
* const command = new DeleteWorkflowTypeCommand(input);
85+
* const response = await client.send(command);
86+
* // {};
87+
*
88+
* ```
89+
*
90+
* @param DeleteWorkflowTypeCommandInput - {@link DeleteWorkflowTypeCommandInput}
91+
* @returns {@link DeleteWorkflowTypeCommandOutput}
92+
* @see {@link DeleteWorkflowTypeCommandInput} for command's `input` shape.
93+
* @see {@link DeleteWorkflowTypeCommandOutput} for command's `response` shape.
94+
* @see {@link SWFClientResolvedConfig | config} for SWFClient's `config` shape.
95+
*
96+
* @throws {@link OperationNotPermittedFault} (client fault)
97+
* <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
98+
*
99+
* @throws {@link TypeNotDeprecatedFault} (client fault)
100+
* <p>Returned when the resource type has not been deprecated.</p>
101+
*
102+
* @throws {@link UnknownResourceFault} (client fault)
103+
* <p>Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.</p>
104+
*
105+
* @throws {@link SWFServiceException}
106+
* <p>Base exception class for all service exceptions from SWF service.</p>
107+
*
108+
* @public
109+
*/
110+
export class DeleteWorkflowTypeCommand extends $Command
111+
.classBuilder<
112+
DeleteWorkflowTypeCommandInput,
113+
DeleteWorkflowTypeCommandOutput,
114+
SWFClientResolvedConfig,
115+
ServiceInputTypes,
116+
ServiceOutputTypes
117+
>()
118+
.ep({
119+
...commonParams,
120+
})
121+
.m(function (this: any, Command: any, cs: any, config: SWFClientResolvedConfig, o: any) {
122+
return [
123+
getSerdePlugin(config, this.serialize, this.deserialize),
124+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
125+
];
126+
})
127+
.s("SimpleWorkflowService", "DeleteWorkflowType", {})
128+
.n("SWFClient", "DeleteWorkflowTypeCommand")
129+
.f(void 0, void 0)
130+
.ser(se_DeleteWorkflowTypeCommand)
131+
.de(de_DeleteWorkflowTypeCommand)
132+
.build() {}

clients/client-swf/src/commands/DeprecateActivityTypeCommand.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ export interface DeprecateActivityTypeCommandOutput extends __MetadataBearer {}
3030
* <p>Deprecates the specified <i>activity type</i>. After an activity type has
3131
* been deprecated, you cannot create new tasks of that activity type. Tasks of this type that
3232
* were scheduled before the type was deprecated continue to run.</p>
33-
* <note>
34-
* <p>This operation is eventually consistent. The results are best effort and may not
35-
* exactly reflect recent updates and changes.</p>
36-
* </note>
3733
* <p>
3834
* <b>Access Control</b>
3935
* </p>

0 commit comments

Comments
 (0)