From 95a1b148b3d949b7f97922207e11f89081601483 Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 16 Nov 2023 19:22:00 +0000 Subject: [PATCH] feat(client-transfer): Introduced S3StorageOptions for servers to enable directory listing optimizations and added Type fields to logical directory mappings. --- .../src/commands/CreateAccessCommand.ts | 1 + .../src/commands/CreateServerCommand.ts | 3 + .../src/commands/CreateUserCommand.ts | 1 + .../src/commands/DescribeAccessCommand.ts | 1 + .../src/commands/DescribeServerCommand.ts | 3 + .../src/commands/DescribeUserCommand.ts | 1 + .../src/commands/UpdateAccessCommand.ts | 1 + .../src/commands/UpdateServerCommand.ts | 3 + .../src/commands/UpdateUserCommand.ts | 1 + .../client-transfer/src/models/models_0.ts | 80 +++++++++++++++- .../src/protocols/Aws_json1_1.ts | 5 + codegen/sdk-codegen/aws-models/transfer.json | 91 +++++++++++++++++-- 12 files changed, 182 insertions(+), 9 deletions(-) diff --git a/clients/client-transfer/src/commands/CreateAccessCommand.ts b/clients/client-transfer/src/commands/CreateAccessCommand.ts index 9840cd2b1d71..9531804c4059 100644 --- a/clients/client-transfer/src/commands/CreateAccessCommand.ts +++ b/clients/client-transfer/src/commands/CreateAccessCommand.ts @@ -56,6 +56,7 @@ export interface CreateAccessCommandOutput extends CreateAccessResponse, __Metad * { // HomeDirectoryMapEntry * Entry: "STRING_VALUE", // required * Target: "STRING_VALUE", // required + * Type: "FILE" || "DIRECTORY", * }, * ], * Policy: "STRING_VALUE", diff --git a/clients/client-transfer/src/commands/CreateServerCommand.ts b/clients/client-transfer/src/commands/CreateServerCommand.ts index 32f3ec8f9e6a..18671748a2ce 100644 --- a/clients/client-transfer/src/commands/CreateServerCommand.ts +++ b/clients/client-transfer/src/commands/CreateServerCommand.ts @@ -111,6 +111,9 @@ export interface CreateServerCommandOutput extends CreateServerResponse, __Metad * StructuredLogDestinations: [ // StructuredLogDestinations * "STRING_VALUE", * ], + * S3StorageOptions: { // S3StorageOptions + * DirectoryListingOptimization: "ENABLED" || "DISABLED", + * }, * }; * const command = new CreateServerCommand(input); * const response = await client.send(command); diff --git a/clients/client-transfer/src/commands/CreateUserCommand.ts b/clients/client-transfer/src/commands/CreateUserCommand.ts index 72b2f7b73f64..19f8c8ee44a8 100644 --- a/clients/client-transfer/src/commands/CreateUserCommand.ts +++ b/clients/client-transfer/src/commands/CreateUserCommand.ts @@ -57,6 +57,7 @@ export interface CreateUserCommandOutput extends CreateUserResponse, __MetadataB * { // HomeDirectoryMapEntry * Entry: "STRING_VALUE", // required * Target: "STRING_VALUE", // required + * Type: "FILE" || "DIRECTORY", * }, * ], * Policy: "STRING_VALUE", diff --git a/clients/client-transfer/src/commands/DescribeAccessCommand.ts b/clients/client-transfer/src/commands/DescribeAccessCommand.ts index ea8bc47e2167..e78d487900fe 100644 --- a/clients/client-transfer/src/commands/DescribeAccessCommand.ts +++ b/clients/client-transfer/src/commands/DescribeAccessCommand.ts @@ -62,6 +62,7 @@ export interface DescribeAccessCommandOutput extends DescribeAccessResponse, __M * // { // HomeDirectoryMapEntry * // Entry: "STRING_VALUE", // required * // Target: "STRING_VALUE", // required + * // Type: "FILE" || "DIRECTORY", * // }, * // ], * // HomeDirectoryType: "PATH" || "LOGICAL", diff --git a/clients/client-transfer/src/commands/DescribeServerCommand.ts b/clients/client-transfer/src/commands/DescribeServerCommand.ts index c45b45ce245a..1f77424176a2 100644 --- a/clients/client-transfer/src/commands/DescribeServerCommand.ts +++ b/clients/client-transfer/src/commands/DescribeServerCommand.ts @@ -122,6 +122,9 @@ export interface DescribeServerCommandOutput extends DescribeServerResponse, __M * // StructuredLogDestinations: [ // StructuredLogDestinations * // "STRING_VALUE", * // ], + * // S3StorageOptions: { // S3StorageOptions + * // DirectoryListingOptimization: "ENABLED" || "DISABLED", + * // }, * // }, * // }; * diff --git a/clients/client-transfer/src/commands/DescribeUserCommand.ts b/clients/client-transfer/src/commands/DescribeUserCommand.ts index 816294ba4963..c8738d2bb321 100644 --- a/clients/client-transfer/src/commands/DescribeUserCommand.ts +++ b/clients/client-transfer/src/commands/DescribeUserCommand.ts @@ -62,6 +62,7 @@ export interface DescribeUserCommandOutput extends DescribeUserResponse, __Metad * // { // HomeDirectoryMapEntry * // Entry: "STRING_VALUE", // required * // Target: "STRING_VALUE", // required + * // Type: "FILE" || "DIRECTORY", * // }, * // ], * // HomeDirectoryType: "PATH" || "LOGICAL", diff --git a/clients/client-transfer/src/commands/UpdateAccessCommand.ts b/clients/client-transfer/src/commands/UpdateAccessCommand.ts index e441e1ac161e..90aefdb81578 100644 --- a/clients/client-transfer/src/commands/UpdateAccessCommand.ts +++ b/clients/client-transfer/src/commands/UpdateAccessCommand.ts @@ -52,6 +52,7 @@ export interface UpdateAccessCommandOutput extends UpdateAccessResponse, __Metad * { // HomeDirectoryMapEntry * Entry: "STRING_VALUE", // required * Target: "STRING_VALUE", // required + * Type: "FILE" || "DIRECTORY", * }, * ], * Policy: "STRING_VALUE", diff --git a/clients/client-transfer/src/commands/UpdateServerCommand.ts b/clients/client-transfer/src/commands/UpdateServerCommand.ts index a19a4a47de84..787f7d2cbe96 100644 --- a/clients/client-transfer/src/commands/UpdateServerCommand.ts +++ b/clients/client-transfer/src/commands/UpdateServerCommand.ts @@ -104,6 +104,9 @@ export interface UpdateServerCommandOutput extends UpdateServerResponse, __Metad * StructuredLogDestinations: [ // StructuredLogDestinations * "STRING_VALUE", * ], + * S3StorageOptions: { // S3StorageOptions + * DirectoryListingOptimization: "ENABLED" || "DISABLED", + * }, * }; * const command = new UpdateServerCommand(input); * const response = await client.send(command); diff --git a/clients/client-transfer/src/commands/UpdateUserCommand.ts b/clients/client-transfer/src/commands/UpdateUserCommand.ts index 8f5a1240aa1c..b83b93f4b463 100644 --- a/clients/client-transfer/src/commands/UpdateUserCommand.ts +++ b/clients/client-transfer/src/commands/UpdateUserCommand.ts @@ -55,6 +55,7 @@ export interface UpdateUserCommandOutput extends UpdateUserResponse, __MetadataB * { // HomeDirectoryMapEntry * Entry: "STRING_VALUE", // required * Target: "STRING_VALUE", // required + * Type: "FILE" || "DIRECTORY", * }, * ], * Policy: "STRING_VALUE", diff --git a/clients/client-transfer/src/models/models_0.ts b/clients/client-transfer/src/models/models_0.ts index dd363e2df56a..eac9e42ca1f1 100644 --- a/clients/client-transfer/src/models/models_0.ts +++ b/clients/client-transfer/src/models/models_0.ts @@ -452,6 +452,20 @@ export interface CopyStepDetails { SourceFileLocation?: string; } +/** + * @public + * @enum + */ +export const MapType = { + DIRECTORY: "DIRECTORY", + FILE: "FILE", +} as const; + +/** + * @public + */ +export type MapType = (typeof MapType)[keyof typeof MapType]; + /** * @public *

Represents an object that contains entries and targets for @@ -470,9 +484,20 @@ export interface HomeDirectoryMapEntry { /** * @public - *

Represents the map target that is used in a HomeDirectorymapEntry.

+ *

Represents the map target that is used in a HomeDirectoryMapEntry.

*/ Target: string | undefined; + + /** + * @public + *

Specifies the type of mapping. Set the type to FILE if you want the mapping to point to a file, or DIRECTORY for the directory to point to a directory.

+ * + *

By default, home directory mappings have a Type of DIRECTORY when you create a Transfer Family server. You would need to explicitly + * set Type to FILE if you want a mapping to have a file + * target.

+ *
+ */ + Type?: MapType; } /** @@ -1423,6 +1448,35 @@ export const Protocol = { */ export type Protocol = (typeof Protocol)[keyof typeof Protocol]; +/** + * @public + * @enum + */ +export const DirectoryListingOptimization = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", +} as const; + +/** + * @public + */ +export type DirectoryListingOptimization = + (typeof DirectoryListingOptimization)[keyof typeof DirectoryListingOptimization]; + +/** + * @public + *

The Amazon S3 storage options that are configured for your server.

+ */ +export interface S3StorageOptions { + /** + * @public + *

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

+ *

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry + * Type to FILE if you want a mapping to have a file target.

+ */ + DirectoryListingOptimization?: DirectoryListingOptimization; +} + /** * @public *

Specifies the workflow ID for the workflow to assign and the execution role that's used for executing the workflow.

@@ -1758,6 +1812,14 @@ export interface CreateServerRequest { *

*/ StructuredLogDestinations?: string[]; + + /** + * @public + *

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

+ *

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry + * Type to FILE if you want a mapping to have a file target.

+ */ + S3StorageOptions?: S3StorageOptions; } /** @@ -3790,6 +3852,14 @@ export interface DescribedServer { *

*/ StructuredLogDestinations?: string[]; + + /** + * @public + *

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

+ *

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry + * Type to FILE if you want a mapping to have a file target.

+ */ + S3StorageOptions?: S3StorageOptions; } /** @@ -6385,6 +6455,14 @@ export interface UpdateServerRequest { *

*/ StructuredLogDestinations?: string[]; + + /** + * @public + *

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

+ *

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry + * Type to FILE if you want a mapping to have a file target.

+ */ + S3StorageOptions?: S3StorageOptions; } /** diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index 7a2bde69b915..cfcc61e2c111 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -171,6 +171,7 @@ import { ResourceExistsException, ResourceNotFoundException, S3InputFileLocation, + S3StorageOptions, S3Tag, SendWorkflowStepStateRequest, ServiceUnavailableException, @@ -4591,6 +4592,8 @@ const se_ImportCertificateRequest = (input: ImportCertificateRequest, context: _ // se_S3InputFileLocation omitted. +// se_S3StorageOptions omitted. + // se_S3Tag omitted. // se_S3Tags omitted. @@ -4995,6 +4998,8 @@ const de_ListHostKeysResponse = (output: any, context: __SerdeContext): ListHost // de_S3InputFileLocation omitted. +// de_S3StorageOptions omitted. + // de_S3Tag omitted. // de_S3Tags omitted. diff --git a/codegen/sdk-codegen/aws-models/transfer.json b/codegen/sdk-codegen/aws-models/transfer.json index a1077be2b13d..9449e9fdea89 100644 --- a/codegen/sdk-codegen/aws-models/transfer.json +++ b/codegen/sdk-codegen/aws-models/transfer.json @@ -61,7 +61,7 @@ "min": 20, "max": 1600 }, - "smithy.api#pattern": "^arn:" + "smithy.api#pattern": "^arn:\\S+$" } }, "com.amazonaws.transfer#As2ConnectorConfig": { @@ -889,6 +889,12 @@ "traits": { "smithy.api#documentation": "

Specifies the log groups to which your server logs are sent.

\n

To specify a log group, you must provide the ARN for an existing log group. In this case, the format of the log group is as follows:

\n

\n arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:*\n

\n

For example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:*\n

\n

If you have previously specified a log group for a server, you can clear it, and in effect turn off structured logging, by providing an empty\n value for this parameter in an update-server call. For example:

\n

\n update-server --server-id s-1234567890abcdef0 --structured-log-destinations\n

" } + }, + "S3StorageOptions": { + "target": "com.amazonaws.transfer#S3StorageOptions", + "traits": { + "smithy.api#documentation": "

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

\n

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry\n Type to FILE if you want a mapping to have a file target.

" + } } }, "traits": { @@ -3027,6 +3033,12 @@ "traits": { "smithy.api#documentation": "

Specifies the log groups to which your server logs are sent.

\n

To specify a log group, you must provide the ARN for an existing log group. In this case, the format of the log group is as follows:

\n

\n arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:*\n

\n

For example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:*\n

\n

If you have previously specified a log group for a server, you can clear it, and in effect turn off structured logging, by providing an empty\n value for this parameter in an update-server call. For example:

\n

\n update-server --server-id s-1234567890abcdef0 --structured-log-destinations\n

" } + }, + "S3StorageOptions": { + "target": "com.amazonaws.transfer#S3StorageOptions", + "traits": { + "smithy.api#documentation": "

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

\n

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry\n Type to FILE if you want a mapping to have a file target.

" + } } }, "traits": { @@ -3167,6 +3179,26 @@ "smithy.api#pattern": "^d-[0-9a-f]{10}$" } }, + "com.amazonaws.transfer#DirectoryListingOptimization": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates whether optimization to directory listing on S3 servers is used. Disabled by default for compatibility." + } + }, "com.amazonaws.transfer#Domain": { "type": "enum", "members": { @@ -3572,7 +3604,7 @@ "min": 0, "max": 1024 }, - "smithy.api#pattern": "^$|/" + "smithy.api#pattern": "^(|/.*)$" } }, "com.amazonaws.transfer#HomeDirectoryMapEntry": { @@ -3588,9 +3620,15 @@ "Target": { "target": "com.amazonaws.transfer#MapTarget", "traits": { - "smithy.api#documentation": "

Represents the map target that is used in a HomeDirectorymapEntry.

", + "smithy.api#documentation": "

Represents the map target that is used in a HomeDirectoryMapEntry.

", "smithy.api#required": {} } + }, + "Type": { + "target": "com.amazonaws.transfer#MapType", + "traits": { + "smithy.api#documentation": "

Specifies the type of mapping. Set the type to FILE if you want the mapping to point to a file, or DIRECTORY for the directory to point to a directory.

\n \n

By default, home directory mappings have a Type of DIRECTORY when you create a Transfer Family server. You would need to explicitly\n set Type to FILE if you want a mapping to have a file\n target.

\n
" + } } }, "traits": { @@ -3605,7 +3643,7 @@ "traits": { "smithy.api#length": { "min": 1, - "max": 50 + "max": 50000 } } }, @@ -5563,7 +5601,7 @@ "min": 0, "max": 1024 }, - "smithy.api#pattern": "^/" + "smithy.api#pattern": "^/.*$" } }, "com.amazonaws.transfer#MapTarget": { @@ -5573,7 +5611,24 @@ "min": 0, "max": 1024 }, - "smithy.api#pattern": "^/" + "smithy.api#pattern": "^/.*$" + } + }, + "com.amazonaws.transfer#MapType": { + "type": "enum", + "members": { + "FILE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FILE" + } + }, + "DIRECTORY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECTORY" + } + } } }, "com.amazonaws.transfer#MaxResults": { @@ -5672,7 +5727,7 @@ "min": 0, "max": 2048 }, - "smithy.api#pattern": "^$|arn:.*role/" + "smithy.api#pattern": "^(|arn:.*role/\\S+)$" } }, "com.amazonaws.transfer#OnPartialUploadWorkflowDetails": { @@ -5977,7 +6032,7 @@ "min": 20, "max": 2048 }, - "smithy.api#pattern": "^arn:.*role/" + "smithy.api#pattern": "^arn:.*role/\\S+$" } }, "com.amazonaws.transfer#S3Bucket": { @@ -6062,6 +6117,20 @@ "smithy.api#pattern": "^[\\P{M}\\p{M}]*$" } }, + "com.amazonaws.transfer#S3StorageOptions": { + "type": "structure", + "members": { + "DirectoryListingOptimization": { + "target": "com.amazonaws.transfer#DirectoryListingOptimization", + "traits": { + "smithy.api#documentation": "

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

\n

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry\n Type to FILE if you want a mapping to have a file target.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The Amazon S3 storage options that are configured for your server.

" + } + }, "com.amazonaws.transfer#S3Tag": { "type": "structure", "members": { @@ -9016,6 +9085,12 @@ "traits": { "smithy.api#documentation": "

Specifies the log groups to which your server logs are sent.

\n

To specify a log group, you must provide the ARN for an existing log group. In this case, the format of the log group is as follows:

\n

\n arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:*\n

\n

For example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:*\n

\n

If you have previously specified a log group for a server, you can clear it, and in effect turn off structured logging, by providing an empty\n value for this parameter in an update-server call. For example:

\n

\n update-server --server-id s-1234567890abcdef0 --structured-log-destinations\n

" } + }, + "S3StorageOptions": { + "target": "com.amazonaws.transfer#S3StorageOptions", + "traits": { + "smithy.api#documentation": "

Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default.

\n

By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry\n Type to FILE if you want a mapping to have a file target.

" + } } }, "traits": {