diff --git a/clients/client-ssm-sap/src/SsmSap.ts b/clients/client-ssm-sap/src/SsmSap.ts index 7ecf4a36bcee8..5537848844c1e 100644 --- a/clients/client-ssm-sap/src/SsmSap.ts +++ b/clients/client-ssm-sap/src/SsmSap.ts @@ -47,6 +47,11 @@ import { ListDatabasesCommandInput, ListDatabasesCommandOutput, } from "./commands/ListDatabasesCommand"; +import { + ListOperationsCommand, + ListOperationsCommandInput, + ListOperationsCommandOutput, +} from "./commands/ListOperationsCommand"; import { ListTagsForResourceCommand, ListTagsForResourceCommandInput, @@ -394,6 +399,38 @@ export class SsmSap extends SsmSapClient { } } + /** + *

Lists the operations performed by AWS Systems Manager for SAP.

+ */ + public listOperations( + args: ListOperationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listOperations( + args: ListOperationsCommandInput, + cb: (err: any, data?: ListOperationsCommandOutput) => void + ): void; + public listOperations( + args: ListOperationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListOperationsCommandOutput) => void + ): void; + public listOperations( + args: ListOperationsCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListOperationsCommandOutput) => void), + cb?: (err: any, data?: ListOperationsCommandOutput) => void + ): Promise | void { + const command = new ListOperationsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Lists all tags on an SAP HANA application and/or database registered with AWS Systems * Manager for SAP.

@@ -466,8 +503,8 @@ export class SsmSap extends SsmSapClient { * on Amazon EC2.

*

AWS Systems Manager Agent must be setup on an Amazon EC2 instance along with the required * IAM permissions.

- *

Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets - * Manager to manage SAP applications and components.

+ *

Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets Manager to + * manage SAP applications and components.

*/ public registerApplication( args: RegisterApplicationCommandInput, @@ -557,7 +594,8 @@ export class SsmSap extends SsmSapClient { } /** - *

+ *

Updates the settings of an application registered with AWS Systems Manager for + * SAP.

*/ public updateApplicationSettings( args: UpdateApplicationSettingsCommandInput, diff --git a/clients/client-ssm-sap/src/SsmSapClient.ts b/clients/client-ssm-sap/src/SsmSapClient.ts index 5338812e0ecc8..a60993e11e885 100644 --- a/clients/client-ssm-sap/src/SsmSapClient.ts +++ b/clients/client-ssm-sap/src/SsmSapClient.ts @@ -68,6 +68,7 @@ import { import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand"; import { ListComponentsCommandInput, ListComponentsCommandOutput } from "./commands/ListComponentsCommand"; import { ListDatabasesCommandInput, ListDatabasesCommandOutput } from "./commands/ListDatabasesCommand"; +import { ListOperationsCommandInput, ListOperationsCommandOutput } from "./commands/ListOperationsCommand"; import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput, @@ -105,6 +106,7 @@ export type ServiceInputTypes = | ListApplicationsCommandInput | ListComponentsCommandInput | ListDatabasesCommandInput + | ListOperationsCommandInput | ListTagsForResourceCommandInput | PutResourcePermissionCommandInput | RegisterApplicationCommandInput @@ -123,6 +125,7 @@ export type ServiceOutputTypes = | ListApplicationsCommandOutput | ListComponentsCommandOutput | ListDatabasesCommandOutput + | ListOperationsCommandOutput | ListTagsForResourceCommandOutput | PutResourcePermissionCommandOutput | RegisterApplicationCommandOutput diff --git a/clients/client-ssm-sap/src/commands/ListOperationsCommand.ts b/clients/client-ssm-sap/src/commands/ListOperationsCommand.ts new file mode 100644 index 0000000000000..b9480b0b58f39 --- /dev/null +++ b/clients/client-ssm-sap/src/commands/ListOperationsCommand.ts @@ -0,0 +1,114 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { + ListOperationsInput, + ListOperationsInputFilterSensitiveLog, + ListOperationsOutput, + ListOperationsOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1ListOperationsCommand, + serializeAws_restJson1ListOperationsCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SsmSapClientResolvedConfig } from "../SsmSapClient"; + +export interface ListOperationsCommandInput extends ListOperationsInput {} +export interface ListOperationsCommandOutput extends ListOperationsOutput, __MetadataBearer {} + +/** + *

Lists the operations performed by AWS Systems Manager for SAP.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SsmSapClient, ListOperationsCommand } from "@aws-sdk/client-ssm-sap"; // ES Modules import + * // const { SsmSapClient, ListOperationsCommand } = require("@aws-sdk/client-ssm-sap"); // CommonJS import + * const client = new SsmSapClient(config); + * const command = new ListOperationsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListOperationsCommandInput} for command's `input` shape. + * @see {@link ListOperationsCommandOutput} for command's `response` shape. + * @see {@link SsmSapClientResolvedConfig | config} for SsmSapClient's `config` shape. + * + */ +export class ListOperationsCommand extends $Command< + ListOperationsCommandInput, + ListOperationsCommandOutput, + SsmSapClientResolvedConfig +> { + // 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" }, + }; + } + + constructor(readonly input: ListOperationsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SsmSapClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListOperationsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "SsmSapClient"; + const commandName = "ListOperationsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListOperationsInputFilterSensitiveLog, + outputFilterSensitiveLog: ListOperationsOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: ListOperationsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1ListOperationsCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1ListOperationsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-ssm-sap/src/commands/RegisterApplicationCommand.ts b/clients/client-ssm-sap/src/commands/RegisterApplicationCommand.ts index 73413bffd3684..034fde401f30a 100644 --- a/clients/client-ssm-sap/src/commands/RegisterApplicationCommand.ts +++ b/clients/client-ssm-sap/src/commands/RegisterApplicationCommand.ts @@ -35,8 +35,8 @@ export interface RegisterApplicationCommandOutput extends RegisterApplicationOut * on Amazon EC2.

*

AWS Systems Manager Agent must be setup on an Amazon EC2 instance along with the required * IAM permissions.

- *

Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets - * Manager to manage SAP applications and components.

+ *

Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets Manager to + * manage SAP applications and components.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-ssm-sap/src/commands/UpdateApplicationSettingsCommand.ts b/clients/client-ssm-sap/src/commands/UpdateApplicationSettingsCommand.ts index 553fdb0c3d31c..acd939bee7a19 100644 --- a/clients/client-ssm-sap/src/commands/UpdateApplicationSettingsCommand.ts +++ b/clients/client-ssm-sap/src/commands/UpdateApplicationSettingsCommand.ts @@ -29,7 +29,8 @@ export interface UpdateApplicationSettingsCommandInput extends UpdateApplication export interface UpdateApplicationSettingsCommandOutput extends UpdateApplicationSettingsOutput, __MetadataBearer {} /** - *

+ *

Updates the settings of an application registered with AWS Systems Manager for + * SAP.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-ssm-sap/src/commands/index.ts b/clients/client-ssm-sap/src/commands/index.ts index 2b6be8c41be48..8782937ffdbfa 100644 --- a/clients/client-ssm-sap/src/commands/index.ts +++ b/clients/client-ssm-sap/src/commands/index.ts @@ -9,6 +9,7 @@ export * from "./GetResourcePermissionCommand"; export * from "./ListApplicationsCommand"; export * from "./ListComponentsCommand"; export * from "./ListDatabasesCommand"; +export * from "./ListOperationsCommand"; export * from "./ListTagsForResourceCommand"; export * from "./PutResourcePermissionCommand"; export * from "./RegisterApplicationCommand"; diff --git a/clients/client-ssm-sap/src/endpoint/ruleset.ts b/clients/client-ssm-sap/src/endpoint/ruleset.ts index a669b84e72d29..72c1e706df3b1 100644 --- a/clients/client-ssm-sap/src/endpoint/ruleset.ts +++ b/clients/client-ssm-sap/src/endpoint/ruleset.ts @@ -6,9 +6,9 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints"; or see "smithy.rules#endpointRuleSet" in codegen/sdk-codegen/aws-models/ssm-sap.json */ -const r="fn", -s="argv", -t="ref"; +const q="fn", +r="argv", +s="ref"; const a=true, b=false, c="String", @@ -17,14 +17,13 @@ e="tree", f="error", g="endpoint", h={"required":true,"default":false,"type":"Boolean"}, -i={[t]:"Endpoint"}, -j={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]}, -k={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]}, +i={[s]:"Endpoint"}, +j={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]}, +k={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]}, l={}, -m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsFIPS"]}]}, -n={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsDualStack"]}]}, -o=[i], -p=[j], -q=[k]; -const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[r]:"aws.partition",[s]:[{[t]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[r]:"isSet",[s]:o},{[r]:"parseURL",[s]:o,assign:"url"}],type:e,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{endpoint:{url:"https://ssm-sap-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:p,type:e,rules:[{conditions:[m],type:e,rules:[{endpoint:{url:"https://ssm-sap-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:q,type:e,rules:[{conditions:[n],type:e,rules:[{endpoint:{url:"https://ssm-sap.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{endpoint:{url:"https://ssm-sap.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]}; +m={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsFIPS"]}]}, +n={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsDualStack"]}]}, +o=[j], +p=[k]; +const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[q]:"isSet",[r]:[i]}],type:e,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:p,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://ssm-sap-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:o,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://ssm-sap-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:p,type:e,rules:[{conditions:[n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://ssm-sap.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{type:e,rules:[{endpoint:{url:"https://ssm-sap.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]}]}; export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-ssm-sap/src/models/models_0.ts b/clients/client-ssm-sap/src/models/models_0.ts index 949c07471b1e5..884029916ad1f 100644 --- a/clients/client-ssm-sap/src/models/models_0.ts +++ b/clients/client-ssm-sap/src/models/models_0.ts @@ -19,46 +19,46 @@ export enum ApplicationType { } /** - *

+ *

An SAP application registered with AWS Systems Manager for SAP.

*/ export interface Application { /** - *

+ *

The ID of the application.

*/ Id?: string; /** - *

+ *

The type of the application.

*/ Type?: ApplicationType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the application.

*/ Arn?: string; /** - *

+ *

The Amazon Resource Name (ARN) of the Application Registry.

*/ AppRegistryArn?: string; /** - *

+ *

The status of the application.

*/ Status?: ApplicationStatus | string; /** - *

+ *

The components of the application.

*/ Components?: string[]; /** - *

+ *

The time at which the application was last updated.

*/ LastUpdated?: Date; /** - *

+ *

The status message.

*/ StatusMessage?: string; } @@ -68,46 +68,48 @@ export enum CredentialType { } /** - *

+ *

The credentials of your SAP application.

*/ export interface ApplicationCredential { /** - *

+ *

The name of the SAP HANA database.

*/ DatabaseName: string | undefined; /** - *

+ *

The type of the application credentials.

*/ CredentialType: CredentialType | string | undefined; /** - *

+ *

The secret ID created in AWS Secrets Manager to store the credentials of the SAP + * application.

*/ SecretId: string | undefined; } /** - *

+ *

The summary of the SAP application registered with AWS Systems Manager for SAP. + *

*/ export interface ApplicationSummary { /** - *

+ *

The ID of the application.

*/ Id?: string; /** - *

+ *

The type of the application.

*/ Type?: ApplicationType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the application.

*/ Arn?: string; /** - *

+ *

The tags on the application.

*/ Tags?: Record; } @@ -124,26 +126,26 @@ export enum HostRole { } /** - *

+ *

Describes the properties of the Dedicated Host.

*/ export interface Host { /** - *

+ *

The name of the Dedicated Host.

*/ HostName?: string; /** - *

+ *

The role of the Dedicated Host.

*/ HostRole?: HostRole | string; /** - *

+ *

The IP address of the Dedicated Host.

*/ HostIp?: string; /** - *

+ *

The instance ID of the instance on the Dedicated Host.

*/ InstanceId?: string; } @@ -153,77 +155,77 @@ export enum ComponentStatus { } /** - *

+ *

The SAP component of your application.

*/ export interface Component { /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The type of the component.

*/ ComponentType?: ComponentType | string; /** - *

+ *

The status of the component.

*/ Status?: ComponentStatus | string; /** - *

+ *

The SAP HANA databases of the component.

*/ Databases?: string[]; /** - *

+ *

The hosts of the component.

*/ Hosts?: Host[]; /** - *

+ *

The primary host of the component.

*/ PrimaryHost?: string; /** - *

+ *

The time at which the component was last updated.

*/ LastUpdated?: Date; } /** - *

+ *

The summary of the component.

*/ export interface ComponentSummary { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The type of the component.

*/ ComponentType?: ComponentType | string; /** - *

+ *

The tags of the component.

*/ Tags?: Record; } /** - *

+ *

A conflict has occurred.

*/ export class ConflictException extends __BaseException { readonly name: "ConflictException" = "ConflictException"; @@ -257,96 +259,97 @@ export enum DatabaseStatus { } /** - *

+ *

The SAP HANA database of the application registered with AWS Systems Manager for + * SAP.

*/ export interface Database { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The credentials of the database.

*/ Credentials?: ApplicationCredential[]; /** - *

+ *

The ID of the SAP HANA database.

*/ DatabaseId?: string; /** - *

+ *

The name of the database.

*/ DatabaseName?: string; /** - *

+ *

The type of the database.

*/ DatabaseType?: DatabaseType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the database.

*/ Arn?: string; /** - *

+ *

The status of the database.

*/ Status?: DatabaseStatus | string; /** - *

+ *

The primary host of the database.

*/ PrimaryHost?: string; /** - *

+ *

The SQL port of the database.

*/ SQLPort?: number; /** - *

+ *

The time at which the database was last updated.

*/ LastUpdated?: Date; } /** - *

+ *

The summary of the database.

*/ export interface DatabaseSummary { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The ID of the database.

*/ DatabaseId?: string; /** - *

+ *

The type of the database.

*/ DatabaseType?: DatabaseType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the database.

*/ Arn?: string; /** - *

+ *

The tags of the database.

*/ Tags?: Record; } @@ -357,30 +360,30 @@ export enum PermissionActionType { export interface DeleteResourcePermissionInput { /** - *

+ *

Delete or restore the permissions on the target database.

*/ ActionType?: PermissionActionType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the source resource.

*/ SourceResourceArn?: string; /** - *

+ *

The Amazon Resource Name (ARN) of the resource.

*/ ResourceArn: string | undefined; } export interface DeleteResourcePermissionOutput { /** - *

+ *

The policy that removes permissions on the target database.

*/ Policy?: string; } /** - *

+ *

An internal error has occurred.

*/ export class InternalServerException extends __BaseException { readonly name: "InternalServerException" = "InternalServerException"; @@ -401,7 +404,7 @@ export class InternalServerException extends __BaseException { } /** - *

+ *

The resource is not available.

*/ export class ResourceNotFoundException extends __BaseException { readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; @@ -422,7 +425,7 @@ export class ResourceNotFoundException extends __BaseException { } /** - *

+ *

The input fails to satisfy the constraints specified by an AWS service.

*/ export class ValidationException extends __BaseException { readonly name: "ValidationException" = "ValidationException"; @@ -444,93 +447,128 @@ export class ValidationException extends __BaseException { export interface DeregisterApplicationInput { /** - *

+ *

The ID of the application.

*/ ApplicationId: string | undefined; } export interface DeregisterApplicationOutput {} +export enum FilterOperator { + EQUALS = "Equals", + GREATER_THAN_OR_EQUALS = "GreaterThanOrEquals", + LESS_THAN_OR_EQUALS = "LessThanOrEquals", +} + +/** + *

A specific result obtained by specifying the name, value, and operator.

+ */ +export interface Filter { + /** + *

The name of the filter. Filter names are case-sensitive.

+ */ + Name: string | undefined; + + /** + *

The filter values. Filter values are case-sensitive. If you specify multiple values for + * a filter, the values are joined with an OR, and the request returns all results that match + * any of the specified values

+ */ + Value: string | undefined; + + /** + *

The operator for the filter.

+ */ + Operator: FilterOperator | string | undefined; +} + export interface GetApplicationInput { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The Amazon Resource Name (ARN) of the application.

*/ ApplicationArn?: string; + + /** + *

The Amazon Resource Name (ARN) of the application registry.

+ */ + AppRegistryArn?: string; } export interface GetApplicationOutput { /** - *

+ *

Returns all of the metadata of an application registered with AWS Systems Manager for + * SAP.

*/ Application?: Application; /** - *

+ *

The tags of a registered application.

*/ Tags?: Record; } export interface GetComponentInput { /** - *

+ *

The ID of the application.

*/ ApplicationId: string | undefined; /** - *

+ *

The ID of the component.

*/ ComponentId: string | undefined; } export interface GetComponentOutput { /** - *

+ *

The component of an application registered with AWS Systems Manager for SAP.

*/ Component?: Component; } export interface GetDatabaseInput { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The ID of the database.

*/ DatabaseId?: string; /** - *

+ *

The Amazon Resource Name (ARN) of the database.

*/ DatabaseArn?: string; } export interface GetDatabaseOutput { /** - *

+ *

The SAP HANA database of an application registered with AWS Systems Manager for + * SAP.

*/ Database?: Database; /** - *

+ *

The tags of a database.

*/ Tags?: Record; } export interface GetOperationInput { /** - *

+ *

The ID of the operation.

*/ OperationId: string | undefined; } @@ -542,68 +580,68 @@ export enum OperationStatus { } /** - *

+ *

The operations performed by AWS Systems Manager for SAP.

*/ export interface Operation { /** - *

+ *

The ID of the operation.

*/ Id?: string; /** - *

+ *

The type of the operation.

*/ Type?: string; /** - *

+ *

The status of the operation.

*/ Status?: OperationStatus | string; /** - *

+ *

The status message of the operation.

*/ StatusMessage?: string; /** - *

+ *

The properties of the operation.

*/ Properties?: Record; /** - *

+ *

The resource type of the operation.

*/ ResourceType?: string; /** - *

+ *

The resource ID of the operation.

*/ ResourceId?: string; /** - *

+ *

The Amazon Resource Name (ARN) of the operation.

*/ ResourceArn?: string; /** - *

+ *

The start time of the operation.

*/ StartTime?: Date; /** - *

+ *

The end time of the operation.

*/ EndTime?: Date; /** - *

+ *

The time at which the operation was last updated.

*/ LastUpdatedTime?: Date; } export interface GetOperationOutput { /** - *

+ *

Returns the details of an operation.

*/ Operation?: Operation; } @@ -615,7 +653,7 @@ export interface GetResourcePermissionInput { ActionType?: PermissionActionType | string; /** - *

+ *

The Amazon Resource Name (ARN) of the resource.

*/ ResourceArn: string | undefined; } @@ -629,94 +667,141 @@ export interface GetResourcePermissionOutput { export interface ListApplicationsInput { /** - *

+ *

The token for the next page of results.

*/ NextToken?: string; /** - *

+ *

The maximum number of results to return with a single call. To retrieve the remaining + * results, make another call with the returned nextToken value.

*/ MaxResults?: number; } export interface ListApplicationsOutput { /** - *

+ *

The applications registered with AWS Systems Manager for SAP.

*/ Applications?: ApplicationSummary[]; /** - *

+ *

The token to use to retrieve the next page of results. This value is null when there are + * no more results to return.

*/ NextToken?: string; } export interface ListComponentsInput { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The token for the next page of results.

*/ NextToken?: string; /** - *

+ *

The maximum number of results to return with a single call. To retrieve the remaining + * results, make another call with the returned nextToken value.

+ *

If you do not specify a value for MaxResults, the request returns 50 items per page by + * default.

*/ MaxResults?: number; } export interface ListComponentsOutput { /** - *

+ *

List of components registered with AWS System Manager for SAP.

*/ Components?: ComponentSummary[]; /** - *

+ *

The token to use to retrieve the next page of results. This value is null when there are + * no more results to return.

*/ NextToken?: string; } export interface ListDatabasesInput { /** - *

+ *

The ID of the application.

*/ ApplicationId?: string; /** - *

+ *

The ID of the component.

*/ ComponentId?: string; /** - *

+ *

The token for the next page of results.

*/ NextToken?: string; /** - *

+ *

The maximum number of results to return with a single call. To retrieve the remaining + * results, make another call with the returned nextToken value. If you do not specify a value + * for MaxResults, the request returns 50 items per page by default.

*/ MaxResults?: number; } export interface ListDatabasesOutput { /** - *

+ *

The SAP HANA databases of an application.

*/ Databases?: DatabaseSummary[]; /** - *

+ *

The token to use to retrieve the next page of results. This value is null when there are no more + * results to return.

+ */ + NextToken?: string; +} + +export interface ListOperationsInput { + /** + *

The ID of the application.

+ */ + ApplicationId: string | undefined; + + /** + *

The maximum number of results to return with a single call. To retrieve the remaining results, make + * another call with the returned nextToken value. + * If you do not specify a value for MaxResults, the request returns 50 items per page by default.

+ */ + MaxResults?: number; + + /** + *

The token for the next page of results. + *

+ */ + NextToken?: string; + + /** + *

The filters of an operation.

+ */ + Filters?: Filter[]; +} + +export interface ListOperationsOutput { + /** + *

List of operations performed by AWS Systems Manager for SAP.

+ */ + Operations?: Operation[]; + + /** + *

The token to use to retrieve the next page of results. This value is null when there are no more + * results to return.

*/ NextToken?: string; } export interface ListTagsForResourceRequest { /** - *

+ *

The Amazon Resource Name (ARN) of the resource.

*/ resourceArn: string | undefined; } @@ -754,61 +839,61 @@ export interface PutResourcePermissionOutput { export interface RegisterApplicationInput { /** - *

+ *

The ID of the application.

*/ ApplicationId: string | undefined; /** - *

+ *

The type of the application.

*/ ApplicationType: ApplicationType | string | undefined; /** - *

+ *

The Amazon EC2 instances on which your SAP application is running.

*/ Instances: string[] | undefined; /** - *

+ *

The SAP instance number of the application.

*/ SapInstanceNumber?: string; /** - *

+ *

The System ID of the application.

*/ Sid?: string; /** - *

+ *

The tags to be attached to the SAP application.

*/ Tags?: Record; /** - *

+ *

The credentials of the SAP application.

*/ Credentials: ApplicationCredential[] | undefined; } export interface RegisterApplicationOutput { /** - *

+ *

The application registered with AWS Systems Manager for SAP.

*/ Application?: Application; /** - *

+ *

The ID of the operation.

*/ OperationId?: string; } export interface TagResourceRequest { /** - *

+ *

The Amazon Resource Name (ARN) of the resource.

*/ resourceArn: string | undefined; /** - *

+ *

The tags on a resource.

*/ tags: Record | undefined; } @@ -817,12 +902,13 @@ export interface TagResourceResponse {} export interface UntagResourceRequest { /** - *

+ *

The Amazon Resource Name (ARN) of the resource.

*/ resourceArn: string | undefined; /** - *

Adds/updates or removes credentials for applications registered with AWS Systems Manager for SAP.

+ *

Adds/updates or removes credentials for applications registered with AWS Systems + * Manager for SAP.

*/ tagKeys: string[] | undefined; } @@ -831,29 +917,29 @@ export interface UntagResourceResponse {} export interface UpdateApplicationSettingsInput { /** - *

+ *

The ID of the application.

*/ ApplicationId: string | undefined; /** - *

+ *

The credentials to be added or updated.

*/ CredentialsToAddOrUpdate?: ApplicationCredential[]; /** - *

+ *

The credentials to be removed.

*/ CredentialsToRemove?: ApplicationCredential[]; } export interface UpdateApplicationSettingsOutput { /** - *

+ *

The update message.

*/ Message?: string; /** - *

+ *

The IDs of the operations.

*/ OperationIds?: string[]; } @@ -944,6 +1030,13 @@ export const DeregisterApplicationOutputFilterSensitiveLog = (obj: DeregisterApp ...obj, }); +/** + * @internal + */ +export const FilterFilterSensitiveLog = (obj: Filter): any => ({ + ...obj, +}); + /** * @internal */ @@ -1064,6 +1157,20 @@ export const ListDatabasesOutputFilterSensitiveLog = (obj: ListDatabasesOutput): ...obj, }); +/** + * @internal + */ +export const ListOperationsInputFilterSensitiveLog = (obj: ListOperationsInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListOperationsOutputFilterSensitiveLog = (obj: ListOperationsOutput): any => ({ + ...obj, +}); + /** * @internal */ diff --git a/clients/client-ssm-sap/src/pagination/ListOperationsPaginator.ts b/clients/client-ssm-sap/src/pagination/ListOperationsPaginator.ts new file mode 100644 index 0000000000000..b96e823d387ae --- /dev/null +++ b/clients/client-ssm-sap/src/pagination/ListOperationsPaginator.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + ListOperationsCommand, + ListOperationsCommandInput, + ListOperationsCommandOutput, +} from "../commands/ListOperationsCommand"; +import { SsmSap } from "../SsmSap"; +import { SsmSapClient } from "../SsmSapClient"; +import { SsmSapPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: SsmSapClient, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOperationsCommand(input), ...args); +}; +/** + * @private + */ +const makePagedRequest = async ( + client: SsmSap, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOperations(input, ...args); +}; +export async function* paginateListOperations( + config: SsmSapPaginationConfiguration, + input: ListOperationsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListOperationsCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SsmSap) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SsmSapClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SsmSap | SsmSapClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm-sap/src/pagination/index.ts b/clients/client-ssm-sap/src/pagination/index.ts index e5bd1f0c0c960..7c83c14526502 100644 --- a/clients/client-ssm-sap/src/pagination/index.ts +++ b/clients/client-ssm-sap/src/pagination/index.ts @@ -3,3 +3,4 @@ export * from "./Interfaces"; export * from "./ListApplicationsPaginator"; export * from "./ListComponentsPaginator"; export * from "./ListDatabasesPaginator"; +export * from "./ListOperationsPaginator"; diff --git a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts index 062592e8969ed..0569da1b6643f 100644 --- a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts @@ -38,6 +38,7 @@ import { import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "../commands/ListApplicationsCommand"; import { ListComponentsCommandInput, ListComponentsCommandOutput } from "../commands/ListComponentsCommand"; import { ListDatabasesCommandInput, ListDatabasesCommandOutput } from "../commands/ListDatabasesCommand"; +import { ListOperationsCommandInput, ListOperationsCommandOutput } from "../commands/ListOperationsCommand"; import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput, @@ -65,6 +66,7 @@ import { ConflictException, Database, DatabaseSummary, + Filter, Host, InternalServerException, Operation, @@ -136,6 +138,7 @@ export const serializeAws_restJson1GetApplicationCommand = async ( const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-application"; let body: any; body = JSON.stringify({ + ...(input.AppRegistryArn != null && { AppRegistryArn: input.AppRegistryArn }), ...(input.ApplicationArn != null && { ApplicationArn: input.ApplicationArn }), ...(input.ApplicationId != null && { ApplicationId: input.ApplicationId }), }); @@ -330,6 +333,33 @@ export const serializeAws_restJson1ListDatabasesCommand = async ( }); }; +export const serializeAws_restJson1ListOperationsCommand = async ( + input: ListOperationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-operations"; + let body: any; + body = JSON.stringify({ + ...(input.ApplicationId != null && { ApplicationId: input.ApplicationId }), + ...(input.Filters != null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }), + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext @@ -962,6 +992,53 @@ const deserializeAws_restJson1ListDatabasesCommandError = async ( } }; +export const deserializeAws_restJson1ListOperationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListOperationsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.NextToken != null) { + contents.NextToken = __expectString(data.NextToken); + } + if (data.Operations != null) { + contents.Operations = deserializeAws_restJson1OperationList(data.Operations, context); + } + return contents; +}; + +const deserializeAws_restJson1ListOperationsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssmsap#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.ssmsap#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + export const deserializeAws_restJson1ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -1328,6 +1405,22 @@ const serializeAws_restJson1ApplicationCredentialList = ( }); }; +const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { + return { + ...(input.Name != null && { Name: input.Name }), + ...(input.Operator != null && { Operator: input.Operator }), + ...(input.Value != null && { Value: input.Value }), + }; +}; + +const serializeAws_restJson1FilterList = (input: Filter[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return serializeAws_restJson1Filter(entry, context); + }); +}; + const serializeAws_restJson1InstanceList = (input: string[], context: __SerdeContext): any => { return input .filter((e: any) => e != null) @@ -1568,6 +1661,18 @@ const deserializeAws_restJson1OperationIdList = (output: any, context: __SerdeCo return retVal; }; +const deserializeAws_restJson1OperationList = (output: any, context: __SerdeContext): Operation[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Operation(entry, context); + }); + return retVal; +}; + const deserializeAws_restJson1OperationProperties = (output: any, context: __SerdeContext): Record => { return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { if (value === null) {