From 1191ab702c4a91f255de6380ee824cd7ce07d8fd Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 15 Oct 2024 18:12:24 +0000 Subject: [PATCH] feat(client-amplify): Added sourceUrlType field to StartDeployment request --- .../src/commands/CreateDeploymentCommand.ts | 2 +- .../src/commands/DeleteJobCommand.ts | 2 + .../src/commands/GetJobCommand.ts | 2 + .../src/commands/ListJobsCommand.ts | 2 + .../src/commands/StartDeploymentCommand.ts | 5 +- .../src/commands/StartJobCommand.ts | 2 + .../src/commands/StopJobCommand.ts | 2 + clients/client-amplify/src/models/models_0.ts | 55 ++++++++++++++++--- .../src/protocols/Aws_restJson1.ts | 3 + codegen/sdk-codegen/aws-models/amplify.json | 49 ++++++++++++++--- 10 files changed, 107 insertions(+), 17 deletions(-) diff --git a/clients/client-amplify/src/commands/CreateDeploymentCommand.ts b/clients/client-amplify/src/commands/CreateDeploymentCommand.ts index 5b00fbdda2f11..89a0e3e1061b5 100644 --- a/clients/client-amplify/src/commands/CreateDeploymentCommand.ts +++ b/clients/client-amplify/src/commands/CreateDeploymentCommand.ts @@ -29,7 +29,7 @@ export interface CreateDeploymentCommandOutput extends CreateDeploymentResult, _ /** *

Creates a deployment for a manually deployed Amplify app. Manually deployed apps are - * not connected to a repository.

+ * not connected to a Git repository.

*

The maximum duration between the CreateDeployment call and the * StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 * hours, the StartDeployment call and the associated Job will diff --git a/clients/client-amplify/src/commands/DeleteJobCommand.ts b/clients/client-amplify/src/commands/DeleteJobCommand.ts index af64307cb4875..621311a554e48 100644 --- a/clients/client-amplify/src/commands/DeleteJobCommand.ts +++ b/clients/client-amplify/src/commands/DeleteJobCommand.ts @@ -53,6 +53,8 @@ export interface DeleteJobCommandOutput extends DeleteJobResult, __MetadataBeare * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // }; * diff --git a/clients/client-amplify/src/commands/GetJobCommand.ts b/clients/client-amplify/src/commands/GetJobCommand.ts index 896c0c547358c..5d63c32e10d6d 100644 --- a/clients/client-amplify/src/commands/GetJobCommand.ts +++ b/clients/client-amplify/src/commands/GetJobCommand.ts @@ -54,6 +54,8 @@ export interface GetJobCommandOutput extends GetJobResult, __MetadataBearer {} * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // steps: [ // Steps // required * // { // Step diff --git a/clients/client-amplify/src/commands/ListJobsCommand.ts b/clients/client-amplify/src/commands/ListJobsCommand.ts index d0cc3e72c0a88..bab94adb53e34 100644 --- a/clients/client-amplify/src/commands/ListJobsCommand.ts +++ b/clients/client-amplify/src/commands/ListJobsCommand.ts @@ -55,6 +55,8 @@ export interface ListJobsCommandOutput extends ListJobsResult, __MetadataBearer * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-amplify/src/commands/StartDeploymentCommand.ts b/clients/client-amplify/src/commands/StartDeploymentCommand.ts index 5e85f03b516f4..6e0fb674105fd 100644 --- a/clients/client-amplify/src/commands/StartDeploymentCommand.ts +++ b/clients/client-amplify/src/commands/StartDeploymentCommand.ts @@ -29,7 +29,7 @@ export interface StartDeploymentCommandOutput extends StartDeploymentResult, __M /** *

Starts a deployment for a manually deployed app. Manually deployed apps are not - * connected to a repository.

+ * connected to a Git repository.

*

The maximum duration between the CreateDeployment call and the * StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 * hours, the StartDeployment call and the associated Job will @@ -45,6 +45,7 @@ export interface StartDeploymentCommandOutput extends StartDeploymentResult, __M * branchName: "STRING_VALUE", // required * jobId: "STRING_VALUE", * sourceUrl: "STRING_VALUE", + * sourceUrlType: "ZIP" || "BUCKET_PREFIX", * }; * const command = new StartDeploymentCommand(input); * const response = await client.send(command); @@ -59,6 +60,8 @@ export interface StartDeploymentCommandOutput extends StartDeploymentResult, __M * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // }; * diff --git a/clients/client-amplify/src/commands/StartJobCommand.ts b/clients/client-amplify/src/commands/StartJobCommand.ts index b3a37ac755793..a8c649591849a 100644 --- a/clients/client-amplify/src/commands/StartJobCommand.ts +++ b/clients/client-amplify/src/commands/StartJobCommand.ts @@ -58,6 +58,8 @@ export interface StartJobCommandOutput extends StartJobResult, __MetadataBearer * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // }; * diff --git a/clients/client-amplify/src/commands/StopJobCommand.ts b/clients/client-amplify/src/commands/StopJobCommand.ts index d17d338eac159..81c270b5ba770 100644 --- a/clients/client-amplify/src/commands/StopJobCommand.ts +++ b/clients/client-amplify/src/commands/StopJobCommand.ts @@ -53,6 +53,8 @@ export interface StopJobCommandOutput extends StopJobResult, __MetadataBearer {} * // status: "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required * // endTime: new Date("TIMESTAMP"), * // jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required + * // sourceUrl: "STRING_VALUE", + * // sourceUrlType: "ZIP" || "BUCKET_PREFIX", * // }, * // }; * diff --git a/clients/client-amplify/src/models/models_0.ts b/clients/client-amplify/src/models/models_0.ts index 31e733166019f..6bb9dcd7bed77 100644 --- a/clients/client-amplify/src/models/models_0.ts +++ b/clients/client-amplify/src/models/models_0.ts @@ -1793,6 +1793,20 @@ export const JobType = { */ export type JobType = (typeof JobType)[keyof typeof JobType]; +/** + * @public + * @enum + */ +export const SourceUrlType = { + BUCKET_PREFIX: "BUCKET_PREFIX", + ZIP: "ZIP", +} as const; + +/** + * @public + */ +export type SourceUrlType = (typeof SourceUrlType)[keyof typeof SourceUrlType]; + /** * @public * @enum @@ -1867,13 +1881,30 @@ export interface JobSummary { /** *

The type for the job. If the value is RELEASE, the job was manually - * released from its source by using the StartJob API. If the value is - * RETRY, the job was manually retried using the StartJob + * released from its source by using the StartJob API. This value is available only for apps + * that are connected to a repository.

+ *

If the value is RETRY, the job was manually retried using the StartJob * API. If the value is WEB_HOOK, the job was automatically triggered by - * webhooks.

+ * webhooks. If the value is MANUAL, the job is for a manually deployed app. Manually deployed apps are not connected to a Git repository.

* @public */ jobType: JobType | undefined; + + /** + *

The source URL for the files to deploy. The source URL can be either an HTTP GET URL that is publicly accessible and + * downloads a single .zip file, or an Amazon S3 bucket and prefix.

+ * @public + */ + sourceUrl?: string; + + /** + *

The type of source specified by the sourceURL. + * If the value is ZIP, the source is a .zip file. + * If the value is BUCKET_PREFIX, the source is an Amazon S3 bucket and + * prefix. If no value is specified, the default is ZIP.

+ * @public + */ + sourceUrlType?: SourceUrlType; } /** @@ -2659,24 +2690,32 @@ export interface StartDeploymentRequest { appId: string | undefined; /** - *

The name of the branch to use for the job.

+ *

The name of the branch to use for the deployment job.

* @public */ branchName: string | undefined; /** - *

The job ID for this deployment, generated by the create deployment request.

+ *

The job ID for this deployment that is generated by the CreateDeployment request.

* @public */ jobId?: string; /** - *

The source URL for this deployment, used when calling start deployment without create - * deployment. The source URL can be any HTTP GET URL that is publicly accessible and - * downloads a single .zip file.

+ *

The source URL for the deployment that is used when calling StartDeployment without CreateDeployment. The source URL can be either an HTTP GET URL that is publicly accessible and + * downloads a single .zip file, or an Amazon S3 bucket and prefix.

* @public */ sourceUrl?: string; + + /** + *

The type of source specified by the sourceURL. + * If the value is ZIP, the source is a .zip file. + * If the value is BUCKET_PREFIX, the source is an Amazon S3 bucket and + * prefix. If no value is specified, the default is ZIP.

+ * @public + */ + sourceUrlType?: SourceUrlType; } /** diff --git a/clients/client-amplify/src/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts index 35f9b0b2a7bee..78b7d14d0af31 100644 --- a/clients/client-amplify/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/src/protocols/Aws_restJson1.ts @@ -713,6 +713,7 @@ export const se_StartDeploymentCommand = async ( take(input, { jobId: [], sourceUrl: [], + sourceUrlType: [], }) ); b.m("POST").h(headers).b(body); @@ -2107,6 +2108,8 @@ const de_JobSummary = (output: any, context: __SerdeContext): JobSummary => { jobArn: __expectString, jobId: __expectString, jobType: __expectString, + sourceUrl: __expectString, + sourceUrlType: __expectString, startTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), status: __expectString, }) as any; diff --git a/codegen/sdk-codegen/aws-models/amplify.json b/codegen/sdk-codegen/aws-models/amplify.json index 0a561cf8f4a41..dd89d76dac5f4 100644 --- a/codegen/sdk-codegen/aws-models/amplify.json +++ b/codegen/sdk-codegen/aws-models/amplify.json @@ -2388,7 +2388,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a deployment for a manually deployed Amplify app. Manually deployed apps are\n not connected to a repository.

\n

The maximum duration between the CreateDeployment call and the\n StartDeployment call cannot exceed 8 hours. If the duration exceeds 8\n hours, the StartDeployment call and the associated Job will\n fail.

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

Creates a deployment for a manually deployed Amplify app. Manually deployed apps are\n not connected to a Git repository.

\n

The maximum duration between the CreateDeployment call and the\n StartDeployment call cannot exceed 8 hours. If the duration exceeds 8\n hours, the StartDeployment call and the associated Job will\n fail.

", "smithy.api#http": { "method": "POST", "uri": "/apps/{appId}/branches/{branchName}/deployments", @@ -4280,9 +4280,21 @@ "jobType": { "target": "com.amazonaws.amplify#JobType", "traits": { - "smithy.api#documentation": "

The type for the job. If the value is RELEASE, the job was manually\n released from its source by using the StartJob API. If the value is\n RETRY, the job was manually retried using the StartJob\n API. If the value is WEB_HOOK, the job was automatically triggered by\n webhooks.

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

The type for the job. If the value is RELEASE, the job was manually\n released from its source by using the StartJob API. This value is available only for apps\n that are connected to a repository.

\n

If the value is RETRY, the job was manually retried using the StartJob\n API. If the value is WEB_HOOK, the job was automatically triggered by\n webhooks. If the value is MANUAL, the job is for a manually deployed app. Manually deployed apps are not connected to a Git repository.

", "smithy.api#required": {} } + }, + "sourceUrl": { + "target": "com.amazonaws.amplify#SourceUrl", + "traits": { + "smithy.api#documentation": "

The source URL for the files to deploy. The source URL can be either an HTTP GET URL that is publicly accessible and\n downloads a single .zip file, or an Amazon S3 bucket and prefix.

" + } + }, + "sourceUrlType": { + "target": "com.amazonaws.amplify#SourceUrlType", + "traits": { + "smithy.api#documentation": "

The type of source specified by the sourceURL.\n If the value is ZIP, the source is a .zip file.\n If the value is BUCKET_PREFIX, the source is an Amazon S3 bucket and\n prefix. If no value is specified, the default is ZIP.

" + } } }, "traits": { @@ -5279,7 +5291,24 @@ "min": 0, "max": 3000 }, - "smithy.api#pattern": "^(?s)" + "smithy.api#pattern": "^(s3|https|http)://" + } + }, + "com.amazonaws.amplify#SourceUrlType": { + "type": "enum", + "members": { + "ZIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZIP" + } + }, + "BUCKET_PREFIX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BUCKET_PREFIX" + } + } } }, "com.amazonaws.amplify#StackArn": { @@ -5363,7 +5392,7 @@ } ], "traits": { - "smithy.api#documentation": "

Starts a deployment for a manually deployed app. Manually deployed apps are not\n connected to a repository.

\n

The maximum duration between the CreateDeployment call and the\n StartDeployment call cannot exceed 8 hours. If the duration exceeds 8\n hours, the StartDeployment call and the associated Job will\n fail.

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

Starts a deployment for a manually deployed app. Manually deployed apps are not\n connected to a Git repository.

\n

The maximum duration between the CreateDeployment call and the\n StartDeployment call cannot exceed 8 hours. If the duration exceeds 8\n hours, the StartDeployment call and the associated Job will\n fail.

", "smithy.api#http": { "method": "POST", "uri": "/apps/{appId}/branches/{branchName}/deployments/start", @@ -5385,7 +5414,7 @@ "branchName": { "target": "com.amazonaws.amplify#BranchName", "traits": { - "smithy.api#documentation": "

The name of the branch to use for the job.

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

The name of the branch to use for the deployment job.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -5393,13 +5422,19 @@ "jobId": { "target": "com.amazonaws.amplify#JobId", "traits": { - "smithy.api#documentation": "

The job ID for this deployment, generated by the create deployment request.

" + "smithy.api#documentation": "

The job ID for this deployment that is generated by the CreateDeployment request.

" } }, "sourceUrl": { "target": "com.amazonaws.amplify#SourceUrl", "traits": { - "smithy.api#documentation": "

The source URL for this deployment, used when calling start deployment without create\n deployment. The source URL can be any HTTP GET URL that is publicly accessible and\n downloads a single .zip file.

" + "smithy.api#documentation": "

The source URL for the deployment that is used when calling StartDeployment without CreateDeployment. The source URL can be either an HTTP GET URL that is publicly accessible and\n downloads a single .zip file, or an Amazon S3 bucket and prefix.

" + } + }, + "sourceUrlType": { + "target": "com.amazonaws.amplify#SourceUrlType", + "traits": { + "smithy.api#documentation": "

The type of source specified by the sourceURL.\n If the value is ZIP, the source is a .zip file.\n If the value is BUCKET_PREFIX, the source is an Amazon S3 bucket and\n prefix. If no value is specified, the default is ZIP.

" } } },