From 4a6c4589eb896ff9221e68754ca49c877030f514 Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 30 Jan 2024 19:12:19 +0000 Subject: [PATCH] feat(client-datazone): Add new skipDeletionCheck to DeleteDomain. Add new skipDeletionCheck to DeleteProject which also automatically deletes dependent objects --- .../src/commands/CreateProjectCommand.ts | 7 + .../src/commands/DeleteDomainCommand.ts | 1 + .../src/commands/DeleteProjectCommand.ts | 1 + .../src/commands/GetProjectCommand.ts | 7 + .../src/commands/ListProjectsCommand.ts | 7 + .../src/commands/RejectPredictionsCommand.ts | 3 +- .../RejectSubscriptionRequestCommand.ts | 8 +- .../src/commands/UpdateProjectCommand.ts | 7 + .../client-datazone/src/models/models_0.ts | 136 +++++++++++------- .../client-datazone/src/models/models_1.ts | 69 +++++++++ .../src/protocols/Aws_restJson1.ts | 19 ++- codegen/sdk-codegen/aws-models/datazone.json | 113 +++++++++++++++ 12 files changed, 319 insertions(+), 59 deletions(-) diff --git a/clients/client-datazone/src/commands/CreateProjectCommand.ts b/clients/client-datazone/src/commands/CreateProjectCommand.ts index edff878cc7ca..469e916f439c 100644 --- a/clients/client-datazone/src/commands/CreateProjectCommand.ts +++ b/clients/client-datazone/src/commands/CreateProjectCommand.ts @@ -55,6 +55,13 @@ export interface CreateProjectCommandOutput extends CreateProjectOutput, __Metad * // id: "STRING_VALUE", // required * // name: "STRING_VALUE", // required * // description: "STRING_VALUE", + * // projectStatus: "ACTIVE" || "DELETING" || "DELETE_FAILED", + * // failureReasons: [ // FailureReasons + * // { // ProjectDeletionError + * // code: "STRING_VALUE", + * // message: "STRING_VALUE", + * // }, + * // ], * // createdBy: "STRING_VALUE", // required * // createdAt: new Date("TIMESTAMP"), * // lastUpdatedAt: new Date("TIMESTAMP"), diff --git a/clients/client-datazone/src/commands/DeleteDomainCommand.ts b/clients/client-datazone/src/commands/DeleteDomainCommand.ts index a587a5a1bc62..5653700b4b23 100644 --- a/clients/client-datazone/src/commands/DeleteDomainCommand.ts +++ b/clients/client-datazone/src/commands/DeleteDomainCommand.ts @@ -38,6 +38,7 @@ export interface DeleteDomainCommandOutput extends DeleteDomainOutput, __Metadat * const input = { // DeleteDomainInput * identifier: "STRING_VALUE", // required * clientToken: "STRING_VALUE", + * skipDeletionCheck: true || false, * }; * const command = new DeleteDomainCommand(input); * const response = await client.send(command); diff --git a/clients/client-datazone/src/commands/DeleteProjectCommand.ts b/clients/client-datazone/src/commands/DeleteProjectCommand.ts index 373e5ed47d03..51b3ae54fb68 100644 --- a/clients/client-datazone/src/commands/DeleteProjectCommand.ts +++ b/clients/client-datazone/src/commands/DeleteProjectCommand.ts @@ -38,6 +38,7 @@ export interface DeleteProjectCommandOutput extends DeleteProjectOutput, __Metad * const input = { // DeleteProjectInput * domainIdentifier: "STRING_VALUE", // required * identifier: "STRING_VALUE", // required + * skipDeletionCheck: true || false, * }; * const command = new DeleteProjectCommand(input); * const response = await client.send(command); diff --git a/clients/client-datazone/src/commands/GetProjectCommand.ts b/clients/client-datazone/src/commands/GetProjectCommand.ts index 4d8c4b666231..7494ff4263d6 100644 --- a/clients/client-datazone/src/commands/GetProjectCommand.ts +++ b/clients/client-datazone/src/commands/GetProjectCommand.ts @@ -46,6 +46,13 @@ export interface GetProjectCommandOutput extends GetProjectOutput, __MetadataBea * // id: "STRING_VALUE", // required * // name: "STRING_VALUE", // required * // description: "STRING_VALUE", + * // projectStatus: "ACTIVE" || "DELETING" || "DELETE_FAILED", + * // failureReasons: [ // FailureReasons + * // { // ProjectDeletionError + * // code: "STRING_VALUE", + * // message: "STRING_VALUE", + * // }, + * // ], * // createdBy: "STRING_VALUE", // required * // createdAt: new Date("TIMESTAMP"), * // lastUpdatedAt: new Date("TIMESTAMP"), diff --git a/clients/client-datazone/src/commands/ListProjectsCommand.ts b/clients/client-datazone/src/commands/ListProjectsCommand.ts index f933eca33af8..93e01ec792f4 100644 --- a/clients/client-datazone/src/commands/ListProjectsCommand.ts +++ b/clients/client-datazone/src/commands/ListProjectsCommand.ts @@ -57,6 +57,13 @@ export interface ListProjectsCommandOutput extends ListProjectsOutput, __Metadat * // id: "STRING_VALUE", // required * // name: "STRING_VALUE", // required * // description: "STRING_VALUE", + * // projectStatus: "ACTIVE" || "DELETING" || "DELETE_FAILED", + * // failureReasons: [ // FailureReasons + * // { // ProjectDeletionError + * // code: "STRING_VALUE", + * // message: "STRING_VALUE", + * // }, + * // ], * // createdBy: "STRING_VALUE", // required * // createdAt: new Date("TIMESTAMP"), * // updatedAt: new Date("TIMESTAMP"), diff --git a/clients/client-datazone/src/commands/RejectPredictionsCommand.ts b/clients/client-datazone/src/commands/RejectPredictionsCommand.ts index 1d79a907d693..86643db91704 100644 --- a/clients/client-datazone/src/commands/RejectPredictionsCommand.ts +++ b/clients/client-datazone/src/commands/RejectPredictionsCommand.ts @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { DataZoneClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DataZoneClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { RejectPredictionsInput, RejectPredictionsOutput } from "../models/models_0"; +import { RejectPredictionsInput } from "../models/models_0"; +import { RejectPredictionsOutput } from "../models/models_1"; import { de_RejectPredictionsCommand, se_RejectPredictionsCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-datazone/src/commands/RejectSubscriptionRequestCommand.ts b/clients/client-datazone/src/commands/RejectSubscriptionRequestCommand.ts index b7e89ac24a95..cf720849a0bf 100644 --- a/clients/client-datazone/src/commands/RejectSubscriptionRequestCommand.ts +++ b/clients/client-datazone/src/commands/RejectSubscriptionRequestCommand.ts @@ -6,8 +6,12 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { DataZoneClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DataZoneClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { RejectSubscriptionRequestInput, RejectSubscriptionRequestInputFilterSensitiveLog } from "../models/models_0"; -import { RejectSubscriptionRequestOutput, RejectSubscriptionRequestOutputFilterSensitiveLog } from "../models/models_1"; +import { + RejectSubscriptionRequestInput, + RejectSubscriptionRequestInputFilterSensitiveLog, + RejectSubscriptionRequestOutput, + RejectSubscriptionRequestOutputFilterSensitiveLog, +} from "../models/models_1"; import { de_RejectSubscriptionRequestCommand, se_RejectSubscriptionRequestCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-datazone/src/commands/UpdateProjectCommand.ts b/clients/client-datazone/src/commands/UpdateProjectCommand.ts index 9358bb76593a..e5854e5cf0bc 100644 --- a/clients/client-datazone/src/commands/UpdateProjectCommand.ts +++ b/clients/client-datazone/src/commands/UpdateProjectCommand.ts @@ -56,6 +56,13 @@ export interface UpdateProjectCommandOutput extends UpdateProjectOutput, __Metad * // id: "STRING_VALUE", // required * // name: "STRING_VALUE", // required * // description: "STRING_VALUE", + * // projectStatus: "ACTIVE" || "DELETING" || "DELETE_FAILED", + * // failureReasons: [ // FailureReasons + * // { // ProjectDeletionError + * // code: "STRING_VALUE", + * // message: "STRING_VALUE", + * // }, + * // ], * // createdBy: "STRING_VALUE", // required * // createdAt: new Date("TIMESTAMP"), * // lastUpdatedAt: new Date("TIMESTAMP"), diff --git a/clients/client-datazone/src/models/models_0.ts b/clients/client-datazone/src/models/models_0.ts index 26d69d9426bf..558791763335 100644 --- a/clients/client-datazone/src/models/models_0.ts +++ b/clients/client-datazone/src/models/models_0.ts @@ -4228,6 +4228,39 @@ export interface CreateProjectInput { glossaryTerms?: string[]; } +/** + * @public + * Error that occurred during project deletion + */ +export interface ProjectDeletionError { + /** + * @public + * Project Deletion Error Code + */ + code?: string; + + /** + * @public + * Project Deletion Error Message + */ + message?: string; +} + +/** + * @public + * @enum + */ +export const ProjectStatus = { + ACTIVE: "ACTIVE", + DELETE_FAILED: "DELETE_FAILED", + DELETING: "DELETING", +} as const; + +/** + * @public + */ +export type ProjectStatus = (typeof ProjectStatus)[keyof typeof ProjectStatus]; + /** * @public */ @@ -4256,6 +4289,18 @@ export interface CreateProjectOutput { */ description?: string; + /** + * @public + * Status of the project + */ + projectStatus?: ProjectStatus; + + /** + * @public + * Reasons for failed project deletion + */ + failureReasons?: ProjectDeletionError[]; + /** * @public *

The Amazon DataZone user who created the project.

@@ -6569,6 +6614,12 @@ export interface DeleteProjectInput { *

The identifier of the project that is to be deleted.

*/ identifier: string | undefined; + + /** + * @public + * Optional flag to asynchronously delete child entities within the project + */ + skipDeletionCheck?: boolean; } /** @@ -6749,6 +6800,12 @@ export interface DeleteDomainInput { * request.

*/ clientToken?: string; + + /** + * @public + * Optional flag to delete all child entities within the domain + */ + skipDeletionCheck?: boolean; } /** @@ -7934,6 +7991,18 @@ export interface GetProjectOutput { */ description?: string; + /** + * @public + * Status of the project + */ + projectStatus?: ProjectStatus; + + /** + * @public + * Reasons for failed project deletion + */ + failureReasons?: ProjectDeletionError[]; + /** * @public *

The Amazon DataZone user who created the project.

@@ -10104,6 +10173,18 @@ export interface ProjectSummary { */ description?: string; + /** + * @public + * Status of the project + */ + projectStatus?: ProjectStatus; + + /** + * @public + * Reasons for failed project deletion + */ + failureReasons?: ProjectDeletionError[]; + /** * @public *

The Amazon DataZone user who created the project.

@@ -10950,53 +11031,6 @@ export interface RejectPredictionsInput { clientToken?: string; } -/** - * @public - */ -export interface RejectPredictionsOutput { - /** - * @public - *

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

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

- */ - assetRevision: string | undefined; -} - -/** - * @public - */ -export interface RejectSubscriptionRequestInput { - /** - * @public - *

The identifier of the Amazon DataZone domain in which the subscription request was - * rejected.

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

The identifier of the subscription request that was rejected.

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

The decision comment of the rejected subscription request.

- */ - decisionComment?: string; -} - /** * @internal */ @@ -11980,11 +12014,3 @@ export const ListSubscriptionTargetsOutputFilterSensitiveLog = (obj: ListSubscri ...obj, ...(obj.items && { items: obj.items.map((item) => SubscriptionTargetSummaryFilterSensitiveLog(item)) }), }); - -/** - * @internal - */ -export const RejectSubscriptionRequestInputFilterSensitiveLog = (obj: RejectSubscriptionRequestInput): any => ({ - ...obj, - ...(obj.decisionComment && { decisionComment: SENSITIVE_STRING }), -}); diff --git a/clients/client-datazone/src/models/models_1.ts b/clients/client-datazone/src/models/models_1.ts index d47a4dbd0cc0..5a9d260cc056 100644 --- a/clients/client-datazone/src/models/models_1.ts +++ b/clients/client-datazone/src/models/models_1.ts @@ -26,6 +26,8 @@ import { Import, ImportFilterSensitiveLog, Model, + ProjectDeletionError, + ProjectStatus, ProvisioningProperties, Resource, SortOrder, @@ -46,6 +48,53 @@ import { UserProfileType, } from "./models_0"; +/** + * @public + */ +export interface RejectPredictionsOutput { + /** + * @public + *

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

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

+ */ + assetRevision: string | undefined; +} + +/** + * @public + */ +export interface RejectSubscriptionRequestInput { + /** + * @public + *

The identifier of the Amazon DataZone domain in which the subscription request was + * rejected.

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

The identifier of the subscription request that was rejected.

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

The decision comment of the rejected subscription request.

+ */ + decisionComment?: string; +} + /** * @public */ @@ -1502,6 +1551,18 @@ export interface UpdateProjectOutput { */ description?: string; + /** + * @public + * Status of the project + */ + projectStatus?: ProjectStatus; + + /** + * @public + * Reasons for failed project deletion + */ + failureReasons?: ProjectDeletionError[]; + /** * @public *

The Amazon DataZone user who created the project.

@@ -2260,6 +2321,14 @@ export interface SearchTypesInput { managed: boolean | undefined; } +/** + * @internal + */ +export const RejectSubscriptionRequestInputFilterSensitiveLog = (obj: RejectSubscriptionRequestInput): any => ({ + ...obj, + ...(obj.decisionComment && { decisionComment: SENSITIVE_STRING }), +}); + /** * @internal */ diff --git a/clients/client-datazone/src/protocols/Aws_restJson1.ts b/clients/client-datazone/src/protocols/Aws_restJson1.ts index fa3bfddef834..5523d8be0980 100644 --- a/clients/client-datazone/src/protocols/Aws_restJson1.ts +++ b/clients/client-datazone/src/protocols/Aws_restJson1.ts @@ -954,6 +954,7 @@ export const se_DeleteDomainCommand = async ( b.p("identifier", () => input.identifier!, "{identifier}", false); const query: any = map({ [_cT]: [, input[_cT] ?? generateIdempotencyToken()], + [_sDC]: [() => input.skipDeletionCheck !== void 0, () => input[_sDC]!.toString()], }); let body: any; b.m("DELETE").h(headers).q(query).b(body); @@ -1096,8 +1097,11 @@ export const se_DeleteProjectCommand = async ( b.bp("/v2/domains/{domainIdentifier}/projects/{identifier}"); b.p("domainIdentifier", () => input.domainIdentifier!, "{domainIdentifier}", false); b.p("identifier", () => input.identifier!, "{identifier}", false); + const query: any = map({ + [_sDC]: [() => input.skipDeletionCheck !== void 0, () => input[_sDC]!.toString()], + }); let body: any; - b.m("DELETE").h(headers).b(body); + b.m("DELETE").h(headers).q(query).b(body); return b.build(); }; @@ -3749,10 +3753,12 @@ export const de_CreateProjectCommand = async ( createdBy: __expectString, description: __expectString, domainId: __expectString, + failureReasons: _json, glossaryTerms: _json, id: __expectString, lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), name: __expectString, + projectStatus: __expectString, }); Object.assign(contents, doc); return contents; @@ -6289,10 +6295,12 @@ export const de_GetProjectCommand = async ( createdBy: __expectString, description: __expectString, domainId: __expectString, + failureReasons: _json, glossaryTerms: _json, id: __expectString, lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), name: __expectString, + projectStatus: __expectString, }); Object.assign(contents, doc); return contents; @@ -9119,10 +9127,12 @@ export const de_UpdateProjectCommand = async ( createdBy: __expectString, description: __expectString, domainId: __expectString, + failureReasons: _json, glossaryTerms: _json, id: __expectString, lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), name: __expectString, + projectStatus: __expectString, }); Object.assign(contents, doc); return contents; @@ -10195,6 +10205,8 @@ const de_EnvironmentSummary = (output: any, context: __SerdeContext): Environmen // de_FailureCause omitted. +// de_FailureReasons omitted. + // de_FilterExpression omitted. // de_FilterExpressions omitted. @@ -10338,6 +10350,8 @@ const de_NotificationsList = (output: any, context: __SerdeContext): Notificatio // de_PredictionConfiguration omitted. +// de_ProjectDeletionError omitted. + // de_ProjectMember omitted. // de_ProjectMembers omitted. @@ -10363,8 +10377,10 @@ const de_ProjectSummary = (output: any, context: __SerdeContext): ProjectSummary createdBy: __expectString, description: __expectString, domainId: __expectString, + failureReasons: _json, id: __expectString, name: __expectString, + projectStatus: __expectString, updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }) as any; }; @@ -10724,6 +10740,7 @@ const _pI = "projectIdentifier"; const _r = "revision"; const _s = "status"; const _sB = "sortBy"; +const _sDC = "skipDeletionCheck"; const _sI = "subscriptionId"; const _sLI = "subscribedListingId"; const _sO = "sortOrder"; diff --git a/codegen/sdk-codegen/aws-models/datazone.json b/codegen/sdk-codegen/aws-models/datazone.json index c0da09784163..46d5ae7b9523 100644 --- a/codegen/sdk-codegen/aws-models/datazone.json +++ b/codegen/sdk-codegen/aws-models/datazone.json @@ -3681,6 +3681,18 @@ "smithy.api#documentation": "

The description of the project.

" } }, + "projectStatus": { + "target": "com.amazonaws.datazone#ProjectStatus", + "traits": { + "smithy.api#documentation": "Status of the project" + } + }, + "failureReasons": { + "target": "com.amazonaws.datazone#FailureReasons", + "traits": { + "smithy.api#documentation": "Reasons for failed project deletion" + } + }, "createdBy": { "target": "com.amazonaws.datazone#CreatedBy", "traits": { @@ -6356,6 +6368,14 @@ "smithy.api#httpQuery": "clientToken", "smithy.api#idempotencyToken": {} } + }, + "skipDeletionCheck": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Optional flag to delete all child entities within the domain", + "smithy.api#httpQuery": "skipDeletionCheck", + "smithy.api#notProperty": {} + } } }, "traits": { @@ -6884,6 +6904,14 @@ "smithy.api#httpLabel": {}, "smithy.api#required": {} } + }, + "skipDeletionCheck": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Optional flag to asynchronously delete child entities within the project", + "smithy.api#httpQuery": "skipDeletionCheck", + "smithy.api#notProperty": {} + } } }, "traits": { @@ -8227,6 +8255,12 @@ "smithy.api#documentation": "

Specifies the error message that is returned if the operation cannot be successfully\n completed.

" } }, + "com.amazonaws.datazone#FailureReasons": { + "type": "list", + "member": { + "target": "com.amazonaws.datazone#ProjectDeletionError" + } + }, "com.amazonaws.datazone#Filter": { "type": "structure", "members": { @@ -10971,6 +11005,18 @@ "smithy.api#documentation": "

The description of the project.

" } }, + "projectStatus": { + "target": "com.amazonaws.datazone#ProjectStatus", + "traits": { + "smithy.api#documentation": "Status of the project" + } + }, + "failureReasons": { + "target": "com.amazonaws.datazone#FailureReasons", + "traits": { + "smithy.api#documentation": "Reasons for failed project deletion" + } + }, "createdBy": { "target": "com.amazonaws.datazone#CreatedBy", "traits": { @@ -14820,6 +14866,26 @@ "smithy.api#documentation": "

The configuration of the prediction.

" } }, + "com.amazonaws.datazone#ProjectDeletionError": { + "type": "structure", + "members": { + "code": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Project Deletion Error Code" + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Project Deletion Error Message" + } + } + }, + "traits": { + "smithy.api#documentation": "Error that occurred during project deletion" + } + }, "com.amazonaws.datazone#ProjectId": { "type": "string", "traits": { @@ -14865,6 +14931,29 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.datazone#ProjectStatus": { + "type": "enum", + "members": { + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "DELETE_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE_FAILED" + } + } + } + }, "com.amazonaws.datazone#ProjectSummaries": { "type": "list", "member": { @@ -14901,6 +14990,18 @@ "smithy.api#documentation": "

The description of a project.

" } }, + "projectStatus": { + "target": "com.amazonaws.datazone#ProjectStatus", + "traits": { + "smithy.api#documentation": "Status of the project" + } + }, + "failureReasons": { + "target": "com.amazonaws.datazone#FailureReasons", + "traits": { + "smithy.api#documentation": "Reasons for failed project deletion" + } + }, "createdBy": { "target": "com.amazonaws.datazone#CreatedBy", "traits": { @@ -19858,6 +19959,18 @@ "smithy.api#documentation": "

The description of the project that is to be updated.

" } }, + "projectStatus": { + "target": "com.amazonaws.datazone#ProjectStatus", + "traits": { + "smithy.api#documentation": "Status of the project" + } + }, + "failureReasons": { + "target": "com.amazonaws.datazone#FailureReasons", + "traits": { + "smithy.api#documentation": "Reasons for failed project deletion" + } + }, "createdBy": { "target": "com.amazonaws.datazone#CreatedBy", "traits": {