Skip to content

Commit 40db0f5

Browse files
author
awstools
committed
feat(client-support-app): This release adds the RegisterSlackWorkspaceForOrganization API. You can use the API to register a Slack workspace for an AWS account that is part of an organization.
1 parent 6a91fad commit 40db0f5

23 files changed

+1424
-221
lines changed

clients/client-support-app/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ documentation in the <i>Amazon Web Services Support User Guide</i>:</p>
5353
<p>You can also use the Amazon Web Services Management Console instead of the Amazon Web Services Support App API to manage your Slack
5454
configurations. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html">Authorize a
5555
Slack workspace to enable the Amazon Web Services Support App</a>.</p>
56-
5756
<note>
5857
<ul>
5958
<li>

clients/client-support-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@aws-sdk/hash-node": "*",
2727
"@aws-sdk/invalid-dependency": "*",
2828
"@aws-sdk/middleware-content-length": "*",
29+
"@aws-sdk/middleware-endpoint": "*",
2930
"@aws-sdk/middleware-host-header": "*",
3031
"@aws-sdk/middleware-logger": "*",
3132
"@aws-sdk/middleware-recursion-detection": "*",

clients/client-support-app/src/SupportApp.ts

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ import {
4141
PutAccountAliasCommandInput,
4242
PutAccountAliasCommandOutput,
4343
} from "./commands/PutAccountAliasCommand";
44+
import {
45+
RegisterSlackWorkspaceForOrganizationCommand,
46+
RegisterSlackWorkspaceForOrganizationCommandInput,
47+
RegisterSlackWorkspaceForOrganizationCommandOutput,
48+
} from "./commands/RegisterSlackWorkspaceForOrganizationCommand";
4449
import {
4550
UpdateSlackChannelConfigurationCommand,
4651
UpdateSlackChannelConfigurationCommandInput,
@@ -92,7 +97,6 @@ import { SupportAppClient } from "./SupportAppClient";
9297
* <p>You can also use the Amazon Web Services Management Console instead of the Amazon Web Services Support App API to manage your Slack
9398
* configurations. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html">Authorize a
9499
* Slack workspace to enable the Amazon Web Services Support App</a>.</p>
95-
*
96100
* <note>
97101
* <ul>
98102
* <li>
@@ -388,6 +392,69 @@ export class SupportApp extends SupportAppClient {
388392
}
389393
}
390394

395+
/**
396+
* <p>Registers a Slack workspace for your Amazon Web Services account. To call this API, your account must be
397+
* part of an organization in Organizations.</p>
398+
* <p>If you're the <i>management account</i> and you want to register Slack
399+
* workspaces for your organization, you must complete the following tasks:</p>
400+
* <ol>
401+
* <li>
402+
* <p>Sign in to the <a href="https://console.aws.amazon.com/support/app">Amazon Web Services Support Center</a> and
403+
* authorize the Slack workspaces where you want your organization to have access to. See
404+
* <a href="https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html">Authorize a Slack workspace</a> in the <i>Amazon Web Services Support User
405+
* Guide</i>.</p>
406+
* </li>
407+
* <li>
408+
* <p>Call the <code>RegisterSlackWorkspaceForOrganization</code> API to authorize each
409+
* Slack workspace for the organization.</p>
410+
* </li>
411+
* </ol>
412+
* <p>After the management account authorizes the Slack workspace, member accounts can call this
413+
* API to authorize the same Slack workspace for their individual accounts. Member accounts don't
414+
* need to authorize the Slack workspace manually through the <a href="https://console.aws.amazon.com/support/app">Amazon Web Services Support Center</a>.</p>
415+
* <p>To use the Amazon Web Services Support App, each account must then complete the following tasks:</p>
416+
* <ul>
417+
* <li>
418+
* <p>Create an Identity and Access Management (IAM) role with the required permission. For more information,
419+
* see <a href="https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html">Managing access to the Amazon Web Services Support App</a>.</p>
420+
* </li>
421+
* <li>
422+
* <p>Configure a Slack channel to use the Amazon Web Services Support App for support cases for that account. For
423+
* more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/add-your-slack-channel.html">Configuring a Slack channel</a>.</p>
424+
* </li>
425+
* </ul>
426+
*/
427+
public registerSlackWorkspaceForOrganization(
428+
args: RegisterSlackWorkspaceForOrganizationCommandInput,
429+
options?: __HttpHandlerOptions
430+
): Promise<RegisterSlackWorkspaceForOrganizationCommandOutput>;
431+
public registerSlackWorkspaceForOrganization(
432+
args: RegisterSlackWorkspaceForOrganizationCommandInput,
433+
cb: (err: any, data?: RegisterSlackWorkspaceForOrganizationCommandOutput) => void
434+
): void;
435+
public registerSlackWorkspaceForOrganization(
436+
args: RegisterSlackWorkspaceForOrganizationCommandInput,
437+
options: __HttpHandlerOptions,
438+
cb: (err: any, data?: RegisterSlackWorkspaceForOrganizationCommandOutput) => void
439+
): void;
440+
public registerSlackWorkspaceForOrganization(
441+
args: RegisterSlackWorkspaceForOrganizationCommandInput,
442+
optionsOrCb?:
443+
| __HttpHandlerOptions
444+
| ((err: any, data?: RegisterSlackWorkspaceForOrganizationCommandOutput) => void),
445+
cb?: (err: any, data?: RegisterSlackWorkspaceForOrganizationCommandOutput) => void
446+
): Promise<RegisterSlackWorkspaceForOrganizationCommandOutput> | void {
447+
const command = new RegisterSlackWorkspaceForOrganizationCommand(args);
448+
if (typeof optionsOrCb === "function") {
449+
this.send(command, optionsOrCb);
450+
} else if (typeof cb === "function") {
451+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
452+
this.send(command, optionsOrCb || {}, cb);
453+
} else {
454+
return this.send(command, optionsOrCb);
455+
}
456+
}
457+
391458
/**
392459
* <p>Updates the configuration for a Slack channel, such as case update notifications.</p>
393460
*/

clients/client-support-app/src/SupportAppClient.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// smithy-typescript generated code
2-
import {
3-
EndpointsInputConfig,
4-
EndpointsResolvedConfig,
5-
RegionInputConfig,
6-
RegionResolvedConfig,
7-
resolveEndpointsConfig,
8-
resolveRegionConfig,
9-
} from "@aws-sdk/config-resolver";
2+
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver";
103
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4+
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint";
115
import {
126
getHostHeaderPlugin,
137
HostHeaderInputConfig,
@@ -41,13 +35,13 @@ import {
4135
Credentials as __Credentials,
4236
Decoder as __Decoder,
4337
Encoder as __Encoder,
38+
EndpointV2 as __EndpointV2,
4439
Hash as __Hash,
4540
HashConstructor as __HashConstructor,
4641
HttpHandlerOptions as __HttpHandlerOptions,
4742
Logger as __Logger,
4843
Provider as __Provider,
4944
Provider,
50-
RegionInfoProvider,
5145
StreamCollector as __StreamCollector,
5246
UrlParser as __UrlParser,
5347
UserAgent as __UserAgent,
@@ -76,10 +70,20 @@ import {
7670
ListSlackWorkspaceConfigurationsCommandOutput,
7771
} from "./commands/ListSlackWorkspaceConfigurationsCommand";
7872
import { PutAccountAliasCommandInput, PutAccountAliasCommandOutput } from "./commands/PutAccountAliasCommand";
73+
import {
74+
RegisterSlackWorkspaceForOrganizationCommandInput,
75+
RegisterSlackWorkspaceForOrganizationCommandOutput,
76+
} from "./commands/RegisterSlackWorkspaceForOrganizationCommand";
7977
import {
8078
UpdateSlackChannelConfigurationCommandInput,
8179
UpdateSlackChannelConfigurationCommandOutput,
8280
} from "./commands/UpdateSlackChannelConfigurationCommand";
81+
import {
82+
ClientInputEndpointParameters,
83+
ClientResolvedEndpointParameters,
84+
EndpointParameters,
85+
resolveClientEndpointParameters,
86+
} from "./endpoint/EndpointParameters";
8387
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
8488

8589
export type ServiceInputTypes =
@@ -91,6 +95,7 @@ export type ServiceInputTypes =
9195
| ListSlackChannelConfigurationsCommandInput
9296
| ListSlackWorkspaceConfigurationsCommandInput
9397
| PutAccountAliasCommandInput
98+
| RegisterSlackWorkspaceForOrganizationCommandInput
9499
| UpdateSlackChannelConfigurationCommandInput;
95100

96101
export type ServiceOutputTypes =
@@ -102,6 +107,7 @@ export type ServiceOutputTypes =
102107
| ListSlackChannelConfigurationsCommandOutput
103108
| ListSlackWorkspaceConfigurationsCommandOutput
104109
| PutAccountAliasCommandOutput
110+
| RegisterSlackWorkspaceForOrganizationCommandOutput
105111
| UpdateSlackChannelConfigurationCommandOutput;
106112

107113
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
@@ -213,12 +219,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
213219
*/
214220
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
215221

216-
/**
217-
* Fetch related hostname, signing name or signing region with given region.
218-
* @internal
219-
*/
220-
regionInfoProvider?: RegionInfoProvider;
221-
222222
/**
223223
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
224224
* @internal
@@ -234,11 +234,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
234234
type SupportAppClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
235235
ClientDefaults &
236236
RegionInputConfig &
237-
EndpointsInputConfig &
237+
EndpointInputConfig<EndpointParameters> &
238238
RetryInputConfig &
239239
HostHeaderInputConfig &
240240
AwsAuthInputConfig &
241-
UserAgentInputConfig;
241+
UserAgentInputConfig &
242+
ClientInputEndpointParameters;
242243
/**
243244
* The configuration interface of SupportAppClient class constructor that set the region, credentials and other options.
244245
*/
@@ -247,11 +248,12 @@ export interface SupportAppClientConfig extends SupportAppClientConfigType {}
247248
type SupportAppClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
248249
Required<ClientDefaults> &
249250
RegionResolvedConfig &
250-
EndpointsResolvedConfig &
251+
EndpointResolvedConfig<EndpointParameters> &
251252
RetryResolvedConfig &
252253
HostHeaderResolvedConfig &
253254
AwsAuthResolvedConfig &
254-
UserAgentResolvedConfig;
255+
UserAgentResolvedConfig &
256+
ClientResolvedEndpointParameters;
255257
/**
256258
* The resolved configuration interface of SupportAppClient class. This is resolved and normalized from the {@link SupportAppClientConfig | constructor configuration interface}.
257259
*/
@@ -301,7 +303,6 @@ export interface SupportAppClientResolvedConfig extends SupportAppClientResolved
301303
* <p>You can also use the Amazon Web Services Management Console instead of the Amazon Web Services Support App API to manage your Slack
302304
* configurations. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html">Authorize a
303305
* Slack workspace to enable the Amazon Web Services Support App</a>.</p>
304-
*
305306
* <note>
306307
* <ul>
307308
* <li>
@@ -327,14 +328,15 @@ export class SupportAppClient extends __Client<
327328

328329
constructor(configuration: SupportAppClientConfig) {
329330
const _config_0 = __getRuntimeConfig(configuration);
330-
const _config_1 = resolveRegionConfig(_config_0);
331-
const _config_2 = resolveEndpointsConfig(_config_1);
332-
const _config_3 = resolveRetryConfig(_config_2);
333-
const _config_4 = resolveHostHeaderConfig(_config_3);
334-
const _config_5 = resolveAwsAuthConfig(_config_4);
335-
const _config_6 = resolveUserAgentConfig(_config_5);
336-
super(_config_6);
337-
this.config = _config_6;
331+
const _config_1 = resolveClientEndpointParameters(_config_0);
332+
const _config_2 = resolveRegionConfig(_config_1);
333+
const _config_3 = resolveEndpointConfig(_config_2);
334+
const _config_4 = resolveRetryConfig(_config_3);
335+
const _config_5 = resolveHostHeaderConfig(_config_4);
336+
const _config_6 = resolveAwsAuthConfig(_config_5);
337+
const _config_7 = resolveUserAgentConfig(_config_6);
338+
super(_config_7);
339+
this.config = _config_7;
338340
this.middlewareStack.use(getRetryPlugin(this.config));
339341
this.middlewareStack.use(getContentLengthPlugin(this.config));
340342
this.middlewareStack.use(getHostHeaderPlugin(this.config));

clients/client-support-app/src/commands/CreateSlackChannelConfigurationCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -74,6 +75,15 @@ export class CreateSlackChannelConfigurationCommand extends $Command<
7475
// Start section: command_properties
7576
// End section: command_properties
7677

78+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
79+
return {
80+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
81+
Endpoint: { type: "builtInParams", name: "endpoint" },
82+
Region: { type: "builtInParams", name: "region" },
83+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
84+
};
85+
}
86+
7787
constructor(readonly input: CreateSlackChannelConfigurationCommandInput) {
7888
// Start section: command_constructor
7989
super();
@@ -89,6 +99,9 @@ export class CreateSlackChannelConfigurationCommand extends $Command<
8999
options?: __HttpHandlerOptions
90100
): Handler<CreateSlackChannelConfigurationCommandInput, CreateSlackChannelConfigurationCommandOutput> {
91101
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
102+
this.middlewareStack.use(
103+
getEndpointPlugin(configuration, CreateSlackChannelConfigurationCommand.getEndpointParameterInstructions())
104+
);
92105

93106
const stack = clientStack.concat(this.middlewareStack);
94107

clients/client-support-app/src/commands/DeleteAccountAliasCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -53,6 +54,15 @@ export class DeleteAccountAliasCommand extends $Command<
5354
// Start section: command_properties
5455
// End section: command_properties
5556

57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
5666
constructor(readonly input: DeleteAccountAliasCommandInput) {
5767
// Start section: command_constructor
5868
super();
@@ -68,6 +78,9 @@ export class DeleteAccountAliasCommand extends $Command<
6878
options?: __HttpHandlerOptions
6979
): Handler<DeleteAccountAliasCommandInput, DeleteAccountAliasCommandOutput> {
7080
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, DeleteAccountAliasCommand.getEndpointParameterInstructions())
83+
);
7184

7285
const stack = clientStack.concat(this.middlewareStack);
7386

clients/client-support-app/src/commands/DeleteSlackChannelConfigurationCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -55,6 +56,15 @@ export class DeleteSlackChannelConfigurationCommand extends $Command<
5556
// Start section: command_properties
5657
// End section: command_properties
5758

59+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
60+
return {
61+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
62+
Endpoint: { type: "builtInParams", name: "endpoint" },
63+
Region: { type: "builtInParams", name: "region" },
64+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
65+
};
66+
}
67+
5868
constructor(readonly input: DeleteSlackChannelConfigurationCommandInput) {
5969
// Start section: command_constructor
6070
super();
@@ -70,6 +80,9 @@ export class DeleteSlackChannelConfigurationCommand extends $Command<
7080
options?: __HttpHandlerOptions
7181
): Handler<DeleteSlackChannelConfigurationCommandInput, DeleteSlackChannelConfigurationCommandOutput> {
7282
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
83+
this.middlewareStack.use(
84+
getEndpointPlugin(configuration, DeleteSlackChannelConfigurationCommand.getEndpointParameterInstructions())
85+
);
7386

7487
const stack = clientStack.concat(this.middlewareStack);
7588

clients/client-support-app/src/commands/DeleteSlackWorkspaceConfigurationCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -55,6 +56,15 @@ export class DeleteSlackWorkspaceConfigurationCommand extends $Command<
5556
// Start section: command_properties
5657
// End section: command_properties
5758

59+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
60+
return {
61+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
62+
Endpoint: { type: "builtInParams", name: "endpoint" },
63+
Region: { type: "builtInParams", name: "region" },
64+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
65+
};
66+
}
67+
5868
constructor(readonly input: DeleteSlackWorkspaceConfigurationCommandInput) {
5969
// Start section: command_constructor
6070
super();
@@ -70,6 +80,9 @@ export class DeleteSlackWorkspaceConfigurationCommand extends $Command<
7080
options?: __HttpHandlerOptions
7181
): Handler<DeleteSlackWorkspaceConfigurationCommandInput, DeleteSlackWorkspaceConfigurationCommandOutput> {
7282
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
83+
this.middlewareStack.use(
84+
getEndpointPlugin(configuration, DeleteSlackWorkspaceConfigurationCommand.getEndpointParameterInstructions())
85+
);
7386

7487
const stack = clientStack.concat(this.middlewareStack);
7588

0 commit comments

Comments
 (0)