Skip to content

Commit 5d6f4e6

Browse files
author
awstools
committed
feat(client-wellarchitected): Added support for UpdateGlobalSettings API. Added status filter to ListWorkloadShares and ListLensShares.
1 parent 5232298 commit 5d6f4e6

File tree

7 files changed

+378
-0
lines changed

7 files changed

+378
-0
lines changed

clients/client-wellarchitected/src/WellArchitected.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ import {
135135
UpdateAnswerCommandInput,
136136
UpdateAnswerCommandOutput,
137137
} from "./commands/UpdateAnswerCommand";
138+
import {
139+
UpdateGlobalSettingsCommand,
140+
UpdateGlobalSettingsCommandInput,
141+
UpdateGlobalSettingsCommandOutput,
142+
} from "./commands/UpdateGlobalSettingsCommand";
138143
import {
139144
UpdateLensReviewCommand,
140145
UpdateLensReviewCommandInput,
@@ -1314,6 +1319,38 @@ export class WellArchitected extends WellArchitectedClient {
13141319
}
13151320
}
13161321

1322+
/**
1323+
* <p>Updates whether the Amazon Web Services account is opted into organization sharing features.</p>
1324+
*/
1325+
public updateGlobalSettings(
1326+
args: UpdateGlobalSettingsCommandInput,
1327+
options?: __HttpHandlerOptions
1328+
): Promise<UpdateGlobalSettingsCommandOutput>;
1329+
public updateGlobalSettings(
1330+
args: UpdateGlobalSettingsCommandInput,
1331+
cb: (err: any, data?: UpdateGlobalSettingsCommandOutput) => void
1332+
): void;
1333+
public updateGlobalSettings(
1334+
args: UpdateGlobalSettingsCommandInput,
1335+
options: __HttpHandlerOptions,
1336+
cb: (err: any, data?: UpdateGlobalSettingsCommandOutput) => void
1337+
): void;
1338+
public updateGlobalSettings(
1339+
args: UpdateGlobalSettingsCommandInput,
1340+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateGlobalSettingsCommandOutput) => void),
1341+
cb?: (err: any, data?: UpdateGlobalSettingsCommandOutput) => void
1342+
): Promise<UpdateGlobalSettingsCommandOutput> | void {
1343+
const command = new UpdateGlobalSettingsCommand(args);
1344+
if (typeof optionsOrCb === "function") {
1345+
this.send(command, optionsOrCb);
1346+
} else if (typeof cb === "function") {
1347+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1348+
this.send(command, optionsOrCb || {}, cb);
1349+
} else {
1350+
return this.send(command, optionsOrCb);
1351+
}
1352+
}
1353+
13171354
/**
13181355
* <p>Update lens review.</p>
13191356
*/

clients/client-wellarchitected/src/WellArchitectedClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ import { ListWorkloadSharesCommandInput, ListWorkloadSharesCommandOutput } from
108108
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
109109
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
110110
import { UpdateAnswerCommandInput, UpdateAnswerCommandOutput } from "./commands/UpdateAnswerCommand";
111+
import {
112+
UpdateGlobalSettingsCommandInput,
113+
UpdateGlobalSettingsCommandOutput,
114+
} from "./commands/UpdateGlobalSettingsCommand";
111115
import { UpdateLensReviewCommandInput, UpdateLensReviewCommandOutput } from "./commands/UpdateLensReviewCommand";
112116
import {
113117
UpdateShareInvitationCommandInput,
@@ -156,6 +160,7 @@ export type ServiceInputTypes =
156160
| TagResourceCommandInput
157161
| UntagResourceCommandInput
158162
| UpdateAnswerCommandInput
163+
| UpdateGlobalSettingsCommandInput
159164
| UpdateLensReviewCommandInput
160165
| UpdateShareInvitationCommandInput
161166
| UpdateWorkloadCommandInput
@@ -197,6 +202,7 @@ export type ServiceOutputTypes =
197202
| TagResourceCommandOutput
198203
| UntagResourceCommandOutput
199204
| UpdateAnswerCommandOutput
205+
| UpdateGlobalSettingsCommandOutput
200206
| UpdateLensReviewCommandOutput
201207
| UpdateShareInvitationCommandOutput
202208
| UpdateWorkloadCommandOutput
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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 { UpdateGlobalSettingsInput } from "../models/models_0";
16+
import {
17+
deserializeAws_restJson1UpdateGlobalSettingsCommand,
18+
serializeAws_restJson1UpdateGlobalSettingsCommand,
19+
} from "../protocols/Aws_restJson1";
20+
import { ServiceInputTypes, ServiceOutputTypes, WellArchitectedClientResolvedConfig } from "../WellArchitectedClient";
21+
22+
export interface UpdateGlobalSettingsCommandInput extends UpdateGlobalSettingsInput {}
23+
export interface UpdateGlobalSettingsCommandOutput extends __MetadataBearer {}
24+
25+
/**
26+
* <p>Updates whether the Amazon Web Services account is opted into organization sharing features.</p>
27+
* @example
28+
* Use a bare-bones client and the command you need to make an API call.
29+
* ```javascript
30+
* import { WellArchitectedClient, UpdateGlobalSettingsCommand } from "@aws-sdk/client-wellarchitected"; // ES Modules import
31+
* // const { WellArchitectedClient, UpdateGlobalSettingsCommand } = require("@aws-sdk/client-wellarchitected"); // CommonJS import
32+
* const client = new WellArchitectedClient(config);
33+
* const command = new UpdateGlobalSettingsCommand(input);
34+
* const response = await client.send(command);
35+
* ```
36+
*
37+
* @see {@link UpdateGlobalSettingsCommandInput} for command's `input` shape.
38+
* @see {@link UpdateGlobalSettingsCommandOutput} for command's `response` shape.
39+
* @see {@link WellArchitectedClientResolvedConfig | config} for WellArchitectedClient's `config` shape.
40+
*
41+
*/
42+
export class UpdateGlobalSettingsCommand extends $Command<
43+
UpdateGlobalSettingsCommandInput,
44+
UpdateGlobalSettingsCommandOutput,
45+
WellArchitectedClientResolvedConfig
46+
> {
47+
// Start section: command_properties
48+
// End section: command_properties
49+
50+
constructor(readonly input: UpdateGlobalSettingsCommandInput) {
51+
// Start section: command_constructor
52+
super();
53+
// End section: command_constructor
54+
}
55+
56+
/**
57+
* @internal
58+
*/
59+
resolveMiddleware(
60+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
61+
configuration: WellArchitectedClientResolvedConfig,
62+
options?: __HttpHandlerOptions
63+
): Handler<UpdateGlobalSettingsCommandInput, UpdateGlobalSettingsCommandOutput> {
64+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
65+
66+
const stack = clientStack.concat(this.middlewareStack);
67+
68+
const { logger } = configuration;
69+
const clientName = "WellArchitectedClient";
70+
const commandName = "UpdateGlobalSettingsCommand";
71+
const handlerExecutionContext: HandlerExecutionContext = {
72+
logger,
73+
clientName,
74+
commandName,
75+
inputFilterSensitiveLog: UpdateGlobalSettingsInput.filterSensitiveLog,
76+
outputFilterSensitiveLog: (output: any) => output,
77+
};
78+
const { requestHandler } = configuration;
79+
return stack.resolve(
80+
(request: FinalizeHandlerArguments<any>) =>
81+
requestHandler.handle(request.request as __HttpRequest, options || {}),
82+
handlerExecutionContext
83+
);
84+
}
85+
86+
private serialize(input: UpdateGlobalSettingsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
87+
return serializeAws_restJson1UpdateGlobalSettingsCommand(input, context);
88+
}
89+
90+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateGlobalSettingsCommandOutput> {
91+
return deserializeAws_restJson1UpdateGlobalSettingsCommand(output, context);
92+
}
93+
94+
// Start section: command_body_extra
95+
// End section: command_body_extra
96+
}

clients/client-wellarchitected/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export * from "./ListWorkloadsCommand";
3333
export * from "./TagResourceCommand";
3434
export * from "./UntagResourceCommand";
3535
export * from "./UpdateAnswerCommand";
36+
export * from "./UpdateGlobalSettingsCommand";
3637
export * from "./UpdateLensReviewCommand";
3738
export * from "./UpdateShareInvitationCommand";
3839
export * from "./UpdateWorkloadCommand";

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,7 +2633,10 @@ export namespace LensReviewSummary {
26332633

26342634
export enum ShareStatus {
26352635
ACCEPTED = "ACCEPTED",
2636+
ASSOCIATED = "ASSOCIATED",
2637+
ASSOCIATING = "ASSOCIATING",
26362638
EXPIRED = "EXPIRED",
2639+
FAILED = "FAILED",
26372640
PENDING = "PENDING",
26382641
REJECTED = "REJECTED",
26392642
REVOKED = "REVOKED",
@@ -2657,6 +2660,11 @@ export interface LensShareSummary {
26572660
* <p>The status of a workload share.</p>
26582661
*/
26592662
Status?: ShareStatus | string;
2663+
2664+
/**
2665+
* <p>Optional message to compliment the Status field.</p>
2666+
*/
2667+
StatusMessage?: string;
26602668
}
26612669

26622670
export namespace LensShareSummary {
@@ -3147,6 +3155,11 @@ export interface ListLensSharesInput {
31473155
* <p>The maximum number of results to return for this request.</p>
31483156
*/
31493157
MaxResults?: number;
3158+
3159+
/**
3160+
* <p>The status of a workload share.</p>
3161+
*/
3162+
Status?: ShareStatus | string;
31503163
}
31513164

31523165
export namespace ListLensSharesInput {
@@ -3644,6 +3657,11 @@ export interface ListWorkloadSharesInput {
36443657
* <p>The maximum number of results to return for this request.</p>
36453658
*/
36463659
MaxResults?: number;
3660+
3661+
/**
3662+
* <p>The status of a workload share.</p>
3663+
*/
3664+
Status?: ShareStatus | string;
36473665
}
36483666

36493667
export namespace ListWorkloadSharesInput {
@@ -3678,6 +3696,11 @@ export interface WorkloadShareSummary {
36783696
* <p>The status of a workload share.</p>
36793697
*/
36803698
Status?: ShareStatus | string;
3699+
3700+
/**
3701+
* <p>Optional message to compliment the Status field.</p>
3702+
*/
3703+
StatusMessage?: string;
36813704
}
36823705

36833706
export namespace WorkloadShareSummary {
@@ -3718,6 +3741,11 @@ export namespace ListWorkloadSharesOutput {
37183741
});
37193742
}
37203743

3744+
export enum OrganizationSharingStatus {
3745+
DISABLED = "DISABLED",
3746+
ENABLED = "ENABLED",
3747+
}
3748+
37213749
/**
37223750
* <p>The share invitation.</p>
37233751
*/
@@ -3929,6 +3957,22 @@ export namespace UpdateAnswerOutput {
39293957
});
39303958
}
39313959

3960+
export interface UpdateGlobalSettingsInput {
3961+
/**
3962+
* <p>The status of organization sharing settings.</p>
3963+
*/
3964+
OrganizationSharingStatus?: OrganizationSharingStatus | string;
3965+
}
3966+
3967+
export namespace UpdateGlobalSettingsInput {
3968+
/**
3969+
* @internal
3970+
*/
3971+
export const filterSensitiveLog = (obj: UpdateGlobalSettingsInput): any => ({
3972+
...obj,
3973+
});
3974+
}
3975+
39323976
/**
39333977
* <p>Input for update lens review.</p>
39343978
*/

0 commit comments

Comments
 (0)