Skip to content

Commit

Permalink
feat(client-m2): Allows UpdateEnvironment to update the environment t…
Browse files Browse the repository at this point in the history
…o 0 host capacity. New GetSignedBluinsightsUrl API
  • Loading branch information
awstools committed Jul 18, 2023
1 parent 25ef531 commit 059361e
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 20 deletions.
8 changes: 8 additions & 0 deletions clients/client-m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ GetEnvironment

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/classes/getenvironmentcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/interfaces/getenvironmentcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/interfaces/getenvironmentcommandoutput.html)

</details>
<details>
<summary>
GetSignedBluinsightsUrl
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/classes/getsignedbluinsightsurlcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/interfaces/getsignedbluinsightsurlcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-m2/interfaces/getsignedbluinsightsurlcommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-m2/src/M2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ import {
GetEnvironmentCommandInput,
GetEnvironmentCommandOutput,
} from "./commands/GetEnvironmentCommand";
import {
GetSignedBluinsightsUrlCommand,
GetSignedBluinsightsUrlCommandInput,
GetSignedBluinsightsUrlCommandOutput,
} from "./commands/GetSignedBluinsightsUrlCommand";
import {
ListApplicationsCommand,
ListApplicationsCommandInput,
Expand Down Expand Up @@ -176,6 +181,7 @@ const commands = {
GetDataSetImportTaskCommand,
GetDeploymentCommand,
GetEnvironmentCommand,
GetSignedBluinsightsUrlCommand,
ListApplicationsCommand,
ListApplicationVersionsCommand,
ListBatchJobDefinitionsCommand,
Expand Down Expand Up @@ -439,6 +445,23 @@ export interface M2 {
cb: (err: any, data?: GetEnvironmentCommandOutput) => void
): void;

/**
* @see {@link GetSignedBluinsightsUrlCommand}
*/
getSignedBluinsightsUrl(
args: GetSignedBluinsightsUrlCommandInput,
options?: __HttpHandlerOptions
): Promise<GetSignedBluinsightsUrlCommandOutput>;
getSignedBluinsightsUrl(
args: GetSignedBluinsightsUrlCommandInput,
cb: (err: any, data?: GetSignedBluinsightsUrlCommandOutput) => void
): void;
getSignedBluinsightsUrl(
args: GetSignedBluinsightsUrlCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetSignedBluinsightsUrlCommandOutput) => void
): void;

/**
* @see {@link ListApplicationsCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-m2/src/M2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ import {
} from "./commands/GetDataSetImportTaskCommand";
import { GetDeploymentCommandInput, GetDeploymentCommandOutput } from "./commands/GetDeploymentCommand";
import { GetEnvironmentCommandInput, GetEnvironmentCommandOutput } from "./commands/GetEnvironmentCommand";
import {
GetSignedBluinsightsUrlCommandInput,
GetSignedBluinsightsUrlCommandOutput,
} from "./commands/GetSignedBluinsightsUrlCommand";
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand";
import {
ListApplicationVersionsCommandInput,
Expand Down Expand Up @@ -143,6 +147,7 @@ export type ServiceInputTypes =
| GetDataSetImportTaskCommandInput
| GetDeploymentCommandInput
| GetEnvironmentCommandInput
| GetSignedBluinsightsUrlCommandInput
| ListApplicationVersionsCommandInput
| ListApplicationsCommandInput
| ListBatchJobDefinitionsCommandInput
Expand Down Expand Up @@ -180,6 +185,7 @@ export type ServiceOutputTypes =
| GetDataSetImportTaskCommandOutput
| GetDeploymentCommandOutput
| GetEnvironmentCommandOutput
| GetSignedBluinsightsUrlCommandOutput
| ListApplicationVersionsCommandOutput
| ListApplicationsCommandOutput
| ListBatchJobDefinitionsCommandOutput
Expand Down
149 changes: 149 additions & 0 deletions clients/client-m2/src/commands/GetSignedBluinsightsUrlCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { M2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../M2Client";
import { GetSignedBluinsightsUrlResponse } from "../models/models_0";
import { de_GetSignedBluinsightsUrlCommand, se_GetSignedBluinsightsUrlCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link GetSignedBluinsightsUrlCommand}.
*/
export interface GetSignedBluinsightsUrlCommandInput {}
/**
* @public
*
* The output of {@link GetSignedBluinsightsUrlCommand}.
*/
export interface GetSignedBluinsightsUrlCommandOutput extends GetSignedBluinsightsUrlResponse, __MetadataBearer {}

/**
* @public
* <p>Gets a single sign-on URL that can be used to connect to AWS Blu Insights.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { M2Client, GetSignedBluinsightsUrlCommand } from "@aws-sdk/client-m2"; // ES Modules import
* // const { M2Client, GetSignedBluinsightsUrlCommand } = require("@aws-sdk/client-m2"); // CommonJS import
* const client = new M2Client(config);
* const input = {};
* const command = new GetSignedBluinsightsUrlCommand(input);
* const response = await client.send(command);
* // { // GetSignedBluinsightsUrlResponse
* // signedBiUrl: "STRING_VALUE", // required
* // };
*
* ```
*
* @param GetSignedBluinsightsUrlCommandInput - {@link GetSignedBluinsightsUrlCommandInput}
* @returns {@link GetSignedBluinsightsUrlCommandOutput}
* @see {@link GetSignedBluinsightsUrlCommandInput} for command's `input` shape.
* @see {@link GetSignedBluinsightsUrlCommandOutput} for command's `response` shape.
* @see {@link M2ClientResolvedConfig | config} for M2Client's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The account or role doesn't have the right permissions to make the request.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An unexpected error occurred during the processing of the request.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The number of requests made exceeds the limit.</p>
*
* @throws {@link M2ServiceException}
* <p>Base exception class for all service exceptions from M2 service.</p>
*
*/
export class GetSignedBluinsightsUrlCommand extends $Command<
GetSignedBluinsightsUrlCommandInput,
GetSignedBluinsightsUrlCommandOutput,
M2ClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: GetSignedBluinsightsUrlCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: M2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetSignedBluinsightsUrlCommandInput, GetSignedBluinsightsUrlCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, GetSignedBluinsightsUrlCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "M2Client";
const commandName = "GetSignedBluinsightsUrlCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: GetSignedBluinsightsUrlCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_GetSignedBluinsightsUrlCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetSignedBluinsightsUrlCommandOutput> {
return de_GetSignedBluinsightsUrlCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-m2/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from "./GetDataSetDetailsCommand";
export * from "./GetDataSetImportTaskCommand";
export * from "./GetDeploymentCommand";
export * from "./GetEnvironmentCommand";
export * from "./GetSignedBluinsightsUrlCommand";
export * from "./ListApplicationVersionsCommand";
export * from "./ListApplicationsCommand";
export * from "./ListBatchJobDefinitionsCommand";
Expand Down
20 changes: 16 additions & 4 deletions clients/client-m2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ export interface CreateApplicationRequest {
kmsKeyId?: string;

/**
* <p>The Amazon Resource Name (ARN) of the role associated with the application.</p>
* <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources
* that are not part of the application or are in a different Amazon Web Services account.</p>
*/
roleArn?: string;
}
Expand Down Expand Up @@ -481,7 +482,8 @@ export interface PoAttributes {
encoding?: string;

/**
* <p>An array containing one or more filename extensions, allowing you to specify which files to be included as PDS member.</p>
* <p>An array containing one or more filename extensions, allowing you to specify which files
* to be included as PDS member.</p>
*/
memberFileExtensions: string[] | undefined;
}
Expand Down Expand Up @@ -2519,7 +2521,7 @@ export interface UpdateApplicationResponse {
*/
export interface HighAvailabilityConfig {
/**
* <p>The number of instances in a high availability configuration.</p>
* <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
*/
desiredCapacity: number | undefined;
}
Expand Down Expand Up @@ -2992,7 +2994,7 @@ export interface UpdateEnvironmentRequest {
environmentId: string | undefined;

/**
* <p>The desired capacity for the runtime environment to update.</p>
* <p>The desired capacity for the runtime environment to update. The minimum possible value is 0 and the maximum is 100.</p>
*/
desiredCapacity?: number;

Expand Down Expand Up @@ -3032,6 +3034,16 @@ export interface UpdateEnvironmentResponse {
environmentId: string | undefined;
}

/**
* @public
*/
export interface GetSignedBluinsightsUrlResponse {
/**
* <p>Single sign-on AWS Blu Insights URL.</p>
*/
signedBiUrl: string | undefined;
}

/**
* @public
*/
Expand Down
Loading

0 comments on commit 059361e

Please sign in to comment.