diff --git a/clients/client-cleanrooms/README.md b/clients/client-cleanrooms/README.md index 761a2c921ff1..d21caf6a5569 100644 --- a/clients/client-cleanrooms/README.md +++ b/clients/client-cleanrooms/README.md @@ -226,6 +226,14 @@ BatchGetSchema [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cleanrooms/command/BatchGetSchemaCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cleanrooms/Interface/BatchGetSchemaCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cleanrooms/Interface/BatchGetSchemaCommandOutput/) + +
+ +BatchGetSchemaAnalysisRule + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cleanrooms/command/BatchGetSchemaAnalysisRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cleanrooms/Interface/BatchGetSchemaAnalysisRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cleanrooms/Interface/BatchGetSchemaAnalysisRuleCommandOutput/) +
diff --git a/clients/client-cleanrooms/src/CleanRooms.ts b/clients/client-cleanrooms/src/CleanRooms.ts index f42cb56d58ae..622e637be6bd 100644 --- a/clients/client-cleanrooms/src/CleanRooms.ts +++ b/clients/client-cleanrooms/src/CleanRooms.ts @@ -8,6 +8,11 @@ import { BatchGetCollaborationAnalysisTemplateCommandInput, BatchGetCollaborationAnalysisTemplateCommandOutput, } from "./commands/BatchGetCollaborationAnalysisTemplateCommand"; +import { + BatchGetSchemaAnalysisRuleCommand, + BatchGetSchemaAnalysisRuleCommandInput, + BatchGetSchemaAnalysisRuleCommandOutput, +} from "./commands/BatchGetSchemaAnalysisRuleCommand"; import { BatchGetSchemaCommand, BatchGetSchemaCommandInput, @@ -301,6 +306,7 @@ import { const commands = { BatchGetCollaborationAnalysisTemplateCommand, BatchGetSchemaCommand, + BatchGetSchemaAnalysisRuleCommand, CreateAnalysisTemplateCommand, CreateCollaborationCommand, CreateConfiguredAudienceModelAssociationCommand, @@ -395,6 +401,23 @@ export interface CleanRooms { cb: (err: any, data?: BatchGetSchemaCommandOutput) => void ): void; + /** + * @see {@link BatchGetSchemaAnalysisRuleCommand} + */ + batchGetSchemaAnalysisRule( + args: BatchGetSchemaAnalysisRuleCommandInput, + options?: __HttpHandlerOptions + ): Promise; + batchGetSchemaAnalysisRule( + args: BatchGetSchemaAnalysisRuleCommandInput, + cb: (err: any, data?: BatchGetSchemaAnalysisRuleCommandOutput) => void + ): void; + batchGetSchemaAnalysisRule( + args: BatchGetSchemaAnalysisRuleCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchGetSchemaAnalysisRuleCommandOutput) => void + ): void; + /** * @see {@link CreateAnalysisTemplateCommand} */ diff --git a/clients/client-cleanrooms/src/CleanRoomsClient.ts b/clients/client-cleanrooms/src/CleanRoomsClient.ts index a086f6cb1eee..7dcbce114ab1 100644 --- a/clients/client-cleanrooms/src/CleanRoomsClient.ts +++ b/clients/client-cleanrooms/src/CleanRoomsClient.ts @@ -57,6 +57,10 @@ import { BatchGetCollaborationAnalysisTemplateCommandInput, BatchGetCollaborationAnalysisTemplateCommandOutput, } from "./commands/BatchGetCollaborationAnalysisTemplateCommand"; +import { + BatchGetSchemaAnalysisRuleCommandInput, + BatchGetSchemaAnalysisRuleCommandOutput, +} from "./commands/BatchGetSchemaAnalysisRuleCommand"; import { BatchGetSchemaCommandInput, BatchGetSchemaCommandOutput } from "./commands/BatchGetSchemaCommand"; import { CreateAnalysisTemplateCommandInput, @@ -266,6 +270,7 @@ export { __Client }; */ export type ServiceInputTypes = | BatchGetCollaborationAnalysisTemplateCommandInput + | BatchGetSchemaAnalysisRuleCommandInput | BatchGetSchemaCommandInput | CreateAnalysisTemplateCommandInput | CreateCollaborationCommandInput @@ -333,6 +338,7 @@ export type ServiceInputTypes = */ export type ServiceOutputTypes = | BatchGetCollaborationAnalysisTemplateCommandOutput + | BatchGetSchemaAnalysisRuleCommandOutput | BatchGetSchemaCommandOutput | CreateAnalysisTemplateCommandOutput | CreateCollaborationCommandOutput diff --git a/clients/client-cleanrooms/src/commands/BatchGetSchemaAnalysisRuleCommand.ts b/clients/client-cleanrooms/src/commands/BatchGetSchemaAnalysisRuleCommand.ts new file mode 100644 index 000000000000..05ebfd106354 --- /dev/null +++ b/clients/client-cleanrooms/src/commands/BatchGetSchemaAnalysisRuleCommand.ts @@ -0,0 +1,178 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { CleanRoomsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CleanRoomsClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { BatchGetSchemaAnalysisRuleInput, BatchGetSchemaAnalysisRuleOutput } from "../models/models_0"; +import { de_BatchGetSchemaAnalysisRuleCommand, se_BatchGetSchemaAnalysisRuleCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link BatchGetSchemaAnalysisRuleCommand}. + */ +export interface BatchGetSchemaAnalysisRuleCommandInput extends BatchGetSchemaAnalysisRuleInput {} +/** + * @public + * + * The output of {@link BatchGetSchemaAnalysisRuleCommand}. + */ +export interface BatchGetSchemaAnalysisRuleCommandOutput extends BatchGetSchemaAnalysisRuleOutput, __MetadataBearer {} + +/** + *

Retrieves multiple analysis rule schemas.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CleanRoomsClient, BatchGetSchemaAnalysisRuleCommand } from "@aws-sdk/client-cleanrooms"; // ES Modules import + * // const { CleanRoomsClient, BatchGetSchemaAnalysisRuleCommand } = require("@aws-sdk/client-cleanrooms"); // CommonJS import + * const client = new CleanRoomsClient(config); + * const input = { // BatchGetSchemaAnalysisRuleInput + * collaborationIdentifier: "STRING_VALUE", // required + * schemaAnalysisRuleRequests: [ // SchemaAnalysisRuleRequestList // required + * { // SchemaAnalysisRuleRequest + * name: "STRING_VALUE", // required + * type: "AGGREGATION" || "LIST" || "CUSTOM", // required + * }, + * ], + * }; + * const command = new BatchGetSchemaAnalysisRuleCommand(input); + * const response = await client.send(command); + * // { // BatchGetSchemaAnalysisRuleOutput + * // analysisRules: [ // SchemaAnalysisRuleList // required + * // { // AnalysisRule + * // collaborationId: "STRING_VALUE", // required + * // type: "AGGREGATION" || "LIST" || "CUSTOM", // required + * // name: "STRING_VALUE", // required + * // createTime: new Date("TIMESTAMP"), // required + * // updateTime: new Date("TIMESTAMP"), // required + * // policy: { // AnalysisRulePolicy Union: only one key present + * // v1: { // AnalysisRulePolicyV1 Union: only one key present + * // list: { // AnalysisRuleList + * // joinColumns: [ // AnalysisRuleColumnList // required + * // "STRING_VALUE", + * // ], + * // allowedJoinOperators: [ // JoinOperatorsList + * // "STRING_VALUE", + * // ], + * // listColumns: [ // required + * // "STRING_VALUE", + * // ], + * // }, + * // aggregation: { // AnalysisRuleAggregation + * // aggregateColumns: [ // AggregateColumnList // required + * // { // AggregateColumn + * // columnNames: [ // AnalysisRuleColumnNameList // required + * // "STRING_VALUE", + * // ], + * // function: "STRING_VALUE", // required + * // }, + * // ], + * // joinColumns: [ // required + * // "STRING_VALUE", + * // ], + * // joinRequired: "STRING_VALUE", + * // allowedJoinOperators: [ + * // "STRING_VALUE", + * // ], + * // dimensionColumns: [ // required + * // "STRING_VALUE", + * // ], + * // scalarFunctions: [ // ScalarFunctionsList // required + * // "STRING_VALUE", + * // ], + * // outputConstraints: [ // AggregationConstraints // required + * // { // AggregationConstraint + * // columnName: "STRING_VALUE", // required + * // minimum: Number("int"), // required + * // type: "STRING_VALUE", // required + * // }, + * // ], + * // }, + * // custom: { // AnalysisRuleCustom + * // allowedAnalyses: [ // AllowedAnalysesList // required + * // "STRING_VALUE", + * // ], + * // allowedAnalysisProviders: [ // AllowedAnalysisProviderList + * // "STRING_VALUE", + * // ], + * // differentialPrivacy: { // DifferentialPrivacyConfiguration + * // columns: [ // DifferentialPrivacyColumnList // required + * // { // DifferentialPrivacyColumn + * // name: "STRING_VALUE", // required + * // }, + * // ], + * // }, + * // }, + * // }, + * // }, + * // }, + * // ], + * // errors: [ // BatchGetSchemaAnalysisRuleErrorList // required + * // { // BatchGetSchemaAnalysisRuleError + * // name: "STRING_VALUE", // required + * // type: "AGGREGATION" || "LIST" || "CUSTOM", // required + * // code: "STRING_VALUE", // required + * // message: "STRING_VALUE", // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param BatchGetSchemaAnalysisRuleCommandInput - {@link BatchGetSchemaAnalysisRuleCommandInput} + * @returns {@link BatchGetSchemaAnalysisRuleCommandOutput} + * @see {@link BatchGetSchemaAnalysisRuleCommandInput} for command's `input` shape. + * @see {@link BatchGetSchemaAnalysisRuleCommandOutput} for command's `response` shape. + * @see {@link CleanRoomsClientResolvedConfig | config} for CleanRoomsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Caller does not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Request references a resource which does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

Request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the specified constraints.

+ * + * @throws {@link CleanRoomsServiceException} + *

Base exception class for all service exceptions from CleanRooms service.

+ * + * @public + */ +export class BatchGetSchemaAnalysisRuleCommand extends $Command + .classBuilder< + BatchGetSchemaAnalysisRuleCommandInput, + BatchGetSchemaAnalysisRuleCommandOutput, + CleanRoomsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: CleanRoomsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBastionControlPlaneServiceLambda", "BatchGetSchemaAnalysisRule", {}) + .n("CleanRoomsClient", "BatchGetSchemaAnalysisRuleCommand") + .f(void 0, void 0) + .ser(se_BatchGetSchemaAnalysisRuleCommand) + .de(de_BatchGetSchemaAnalysisRuleCommand) + .build() {} diff --git a/clients/client-cleanrooms/src/commands/BatchGetSchemaCommand.ts b/clients/client-cleanrooms/src/commands/BatchGetSchemaCommand.ts index 38f37606208f..04ead28bf5c0 100644 --- a/clients/client-cleanrooms/src/commands/BatchGetSchemaCommand.ts +++ b/clients/client-cleanrooms/src/commands/BatchGetSchemaCommand.ts @@ -69,6 +69,21 @@ export interface BatchGetSchemaCommandOutput extends BatchGetSchemaOutput, __Met * // createTime: new Date("TIMESTAMP"), // required * // updateTime: new Date("TIMESTAMP"), // required * // type: "TABLE", // required + * // schemaStatusDetails: [ // SchemaStatusDetailList // required + * // { // SchemaStatusDetail + * // status: "READY" || "NOT_READY", // required + * // reasons: [ // SchemaStatusReasonList + * // { // SchemaStatusReason + * // code: "ANALYSIS_RULE_MISSING" || "ANALYSIS_TEMPLATES_NOT_CONFIGURED" || "ANALYSIS_PROVIDERS_NOT_CONFIGURED" || "DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED", // required + * // message: "STRING_VALUE", // required + * // }, + * // ], + * // analysisRuleType: "AGGREGATION" || "LIST" || "CUSTOM", + * // configurations: [ // SchemaConfigurationList + * // "DIFFERENTIAL_PRIVACY", + * // ], + * // }, + * // ], * // }, * // ], * // errors: [ // BatchGetSchemaErrorList // required diff --git a/clients/client-cleanrooms/src/commands/GetSchemaCommand.ts b/clients/client-cleanrooms/src/commands/GetSchemaCommand.ts index 660558d87561..da0ffad0dcaf 100644 --- a/clients/client-cleanrooms/src/commands/GetSchemaCommand.ts +++ b/clients/client-cleanrooms/src/commands/GetSchemaCommand.ts @@ -66,6 +66,21 @@ export interface GetSchemaCommandOutput extends GetSchemaOutput, __MetadataBeare * // createTime: new Date("TIMESTAMP"), // required * // updateTime: new Date("TIMESTAMP"), // required * // type: "TABLE", // required + * // schemaStatusDetails: [ // SchemaStatusDetailList // required + * // { // SchemaStatusDetail + * // status: "READY" || "NOT_READY", // required + * // reasons: [ // SchemaStatusReasonList + * // { // SchemaStatusReason + * // code: "ANALYSIS_RULE_MISSING" || "ANALYSIS_TEMPLATES_NOT_CONFIGURED" || "ANALYSIS_PROVIDERS_NOT_CONFIGURED" || "DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED", // required + * // message: "STRING_VALUE", // required + * // }, + * // ], + * // analysisRuleType: "AGGREGATION" || "LIST" || "CUSTOM", + * // configurations: [ // SchemaConfigurationList + * // "DIFFERENTIAL_PRIVACY", + * // ], + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-cleanrooms/src/commands/index.ts b/clients/client-cleanrooms/src/commands/index.ts index 8e5ac2a411a2..bbc331131723 100644 --- a/clients/client-cleanrooms/src/commands/index.ts +++ b/clients/client-cleanrooms/src/commands/index.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code export * from "./BatchGetCollaborationAnalysisTemplateCommand"; +export * from "./BatchGetSchemaAnalysisRuleCommand"; export * from "./BatchGetSchemaCommand"; export * from "./CreateAnalysisTemplateCommand"; export * from "./CreateCollaborationCommand"; diff --git a/clients/client-cleanrooms/src/models/models_0.ts b/clients/client-cleanrooms/src/models/models_0.ts index e1894e63ce1b..2e0e5cc90afc 100644 --- a/clients/client-cleanrooms/src/models/models_0.ts +++ b/clients/client-cleanrooms/src/models/models_0.ts @@ -237,13 +237,24 @@ export const ScalarFunctions = { CAST: "CAST", CEILING: "CEILING", COALESCE: "COALESCE", + CONVERT: "CONVERT", + CURRENT_DATE: "CURRENT_DATE", + DATEADD: "DATEADD", + EXTRACT: "EXTRACT", FLOOR: "FLOOR", + GETDATE: "GETDATE", LN: "LN", LOG: "LOG", LOWER: "LOWER", ROUND: "ROUND", RTRIM: "RTRIM", SQRT: "SQRT", + SUBSTRING: "SUBSTRING", + TO_CHAR: "TO_CHAR", + TO_DATE: "TO_DATE", + TO_NUMBER: "TO_NUMBER", + TO_TIMESTAMP: "TO_TIMESTAMP", + TRIM: "TRIM", TRUNC: "TRUNC", UPPER: "UPPER", } as const; @@ -338,13 +349,13 @@ export interface DifferentialPrivacyConfiguration { */ export interface AnalysisRuleCustom { /** - *

The analysis templates that are allowed by the custom analysis rule.

+ *

The ARN of the analysis templates that are allowed by the custom analysis rule.

* @public */ allowedAnalyses: string[] | undefined; /** - *

The Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when + *

The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when * allowedAnalyses is ANY_QUERY.

* @public */ @@ -1354,7 +1365,8 @@ export interface BatchGetSchemaInput { collaborationIdentifier: string | undefined; /** - *

The names for the schema objects to retrieve.>

+ *

The names for the schema objects to + * retrieve.

* @public */ names: string[] | undefined; @@ -1403,6 +1415,98 @@ export interface Column { type: string | undefined; } +/** + * @public + * @enum + */ +export const SchemaConfiguration = { + DIFFERENTIAL_PRIVACY: "DIFFERENTIAL_PRIVACY", +} as const; + +/** + * @public + */ +export type SchemaConfiguration = (typeof SchemaConfiguration)[keyof typeof SchemaConfiguration]; + +/** + * @public + * @enum + */ +export const SchemaStatusReasonCode = { + ANALYSIS_PROVIDERS_NOT_CONFIGURED: "ANALYSIS_PROVIDERS_NOT_CONFIGURED", + ANALYSIS_RULE_MISSING: "ANALYSIS_RULE_MISSING", + ANALYSIS_TEMPLATES_NOT_CONFIGURED: "ANALYSIS_TEMPLATES_NOT_CONFIGURED", + DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED: "DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED", +} as const; + +/** + * @public + */ +export type SchemaStatusReasonCode = (typeof SchemaStatusReasonCode)[keyof typeof SchemaStatusReasonCode]; + +/** + *

A reason why the schema status is set to its current value.

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

The schema status reason code.

+ * @public + */ + code: SchemaStatusReasonCode | undefined; + + /** + *

An explanation of the schema status reason code.

+ * @public + */ + message: string | undefined; +} + +/** + * @public + * @enum + */ +export const SchemaStatus = { + NOT_READY: "NOT_READY", + READY: "READY", +} as const; + +/** + * @public + */ +export type SchemaStatus = (typeof SchemaStatus)[keyof typeof SchemaStatus]; + +/** + *

Information about the schema status.

+ *

A status of READY means that based on the schema analysis rule, queries of the given analysis rule type are properly configured to run queries on this schema.

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

The status of the schema.

+ * @public + */ + status: SchemaStatus | undefined; + + /** + *

The reasons why the schema status is set to its current state.

+ * @public + */ + reasons?: SchemaStatusReason[]; + + /** + *

The analysis rule type for which the schema status has been evaluated.

+ * @public + */ + analysisRuleType?: AnalysisRuleType; + + /** + *

The configuration details of the schema analysis rule for the given type.

+ * @public + */ + configurations?: SchemaConfiguration[]; +} + /** * @public * @enum @@ -1495,6 +1599,12 @@ export interface Schema { * @public */ type: SchemaType | undefined; + + /** + *

Details about the status of the schema. Currently, only one entry is present.

+ * @public + */ + schemaStatusDetails: SchemaStatusDetail[] | undefined; } /** @@ -1515,6 +1625,88 @@ export interface BatchGetSchemaOutput { errors: BatchGetSchemaError[] | undefined; } +/** + *

Defines the information that's necessary to retrieve an analysis rule schema. Schema analysis rules are uniquely identified by a combination of the schema name and the analysis rule type for a given collaboration.

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

The name of the analysis rule schema that you are requesting.

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

The type of analysis rule schema that you are requesting.

+ * @public + */ + type: AnalysisRuleType | undefined; +} + +/** + * @public + */ +export interface BatchGetSchemaAnalysisRuleInput { + /** + *

The unique identifier of the collaboration that contains the schema analysis rule.

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

The information that's necessary to retrieve a schema analysis rule.

+ * @public + */ + schemaAnalysisRuleRequests: SchemaAnalysisRuleRequest[] | undefined; +} + +/** + *

An error that describes why a schema could not be fetched.

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

An error name for the error.

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

The analysis rule type.

+ * @public + */ + type: AnalysisRuleType | undefined; + + /** + *

An error code for the error.

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

A description of why the call failed.

+ * @public + */ + message: string | undefined; +} + +/** + * @public + */ +export interface BatchGetSchemaAnalysisRuleOutput { + /** + *

The retrieved list of analysis rules.

+ * @public + */ + analysisRules: AnalysisRule[] | undefined; + + /** + *

Error reasons for schemas that could not be retrieved. One error is returned for every schema that could not be retrieved.

+ * @public + */ + errors: BatchGetSchemaAnalysisRuleError[] | undefined; +} + /** * @public * @enum diff --git a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts index 60bda20e8c36..cd1782276563 100644 --- a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts +++ b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts @@ -36,6 +36,10 @@ import { BatchGetCollaborationAnalysisTemplateCommandInput, BatchGetCollaborationAnalysisTemplateCommandOutput, } from "../commands/BatchGetCollaborationAnalysisTemplateCommand"; +import { + BatchGetSchemaAnalysisRuleCommandInput, + BatchGetSchemaAnalysisRuleCommandOutput, +} from "../commands/BatchGetSchemaAnalysisRuleCommand"; import { BatchGetSchemaCommandInput, BatchGetSchemaCommandOutput } from "../commands/BatchGetSchemaCommand"; import { CreateAnalysisTemplateCommandInput, @@ -298,6 +302,7 @@ import { ResourceNotFoundException, ScalarFunctions, Schema, + SchemaAnalysisRuleRequest, SchemaSummary, ServiceQuotaExceededException, TableReference, @@ -351,6 +356,29 @@ export const se_BatchGetSchemaCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1BatchGetSchemaAnalysisRuleCommand + */ +export const se_BatchGetSchemaAnalysisRuleCommand = async ( + input: BatchGetSchemaAnalysisRuleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/collaborations/{collaborationIdentifier}/batch-schema-analysis-rule"); + b.p("collaborationIdentifier", () => input.collaborationIdentifier!, "{collaborationIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + schemaAnalysisRuleRequests: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1CreateAnalysisTemplateCommand */ @@ -1690,6 +1718,28 @@ export const de_BatchGetSchemaCommand = async ( return contents; }; +/** + * deserializeAws_restJson1BatchGetSchemaAnalysisRuleCommand + */ +export const de_BatchGetSchemaAnalysisRuleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analysisRules: (_) => de_SchemaAnalysisRuleList(_, context), + errors: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1CreateAnalysisTemplateCommand */ @@ -3196,6 +3246,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_ScalarFunctionsList omitted. +// se_SchemaAnalysisRuleRequest omitted. + +// se_SchemaAnalysisRuleRequestList omitted. + // se_TableAliasList omitted. // se_TableReference omitted. @@ -3310,6 +3364,10 @@ const de_AnalysisTemplateSummaryList = (output: any, context: __SerdeContext): A // de_BatchGetCollaborationAnalysisTemplateErrorList omitted. +// de_BatchGetSchemaAnalysisRuleError omitted. + +// de_BatchGetSchemaAnalysisRuleErrorList omitted. + // de_BatchGetSchemaError omitted. // de_BatchGetSchemaErrorList omitted. @@ -4100,11 +4158,26 @@ const de_Schema = (output: any, context: __SerdeContext): Schema => { description: __expectString, name: __expectString, partitionKeys: _json, + schemaStatusDetails: _json, type: __expectString, updateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), }) as any; }; +/** + * deserializeAws_restJson1SchemaAnalysisRuleList + */ +const de_SchemaAnalysisRuleList = (output: any, context: __SerdeContext): AnalysisRule[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AnalysisRule(entry, context); + }); + return retVal; +}; + +// de_SchemaConfigurationList omitted. + /** * deserializeAws_restJson1SchemaList */ @@ -4117,6 +4190,14 @@ const de_SchemaList = (output: any, context: __SerdeContext): Schema[] => { return retVal; }; +// de_SchemaStatusDetail omitted. + +// de_SchemaStatusDetailList omitted. + +// de_SchemaStatusReason omitted. + +// de_SchemaStatusReasonList omitted. + /** * deserializeAws_restJson1SchemaSummary */ diff --git a/codegen/sdk-codegen/aws-models/cleanrooms.json b/codegen/sdk-codegen/aws-models/cleanrooms.json index 21a2474a13c0..22a91b8f43a4 100644 --- a/codegen/sdk-codegen/aws-models/cleanrooms.json +++ b/codegen/sdk-codegen/aws-models/cleanrooms.json @@ -1110,7 +1110,7 @@ "allowedAnalyses": { "target": "com.amazonaws.cleanrooms#AllowedAnalysesList", "traits": { - "smithy.api#documentation": "

The analysis templates that are allowed by the custom analysis rule.

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

The ARN of the analysis templates that are allowed by the custom analysis rule.

", "smithy.api#length": { "min": 0 }, @@ -1120,7 +1120,7 @@ "allowedAnalysisProviders": { "target": "com.amazonaws.cleanrooms#AllowedAnalysisProviderList", "traits": { - "smithy.api#documentation": "

The Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when\n allowedAnalyses is ANY_QUERY.

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

The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when\n allowedAnalyses is ANY_QUERY.

", "smithy.api#length": { "min": 0 } @@ -1691,6 +1691,135 @@ "smithy.api#readonly": {} } }, + "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRule": { + "type": "operation", + "input": { + "target": "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleInput" + }, + "output": { + "target": "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cleanrooms#AccessDeniedException" + }, + { + "target": "com.amazonaws.cleanrooms#InternalServerException" + }, + { + "target": "com.amazonaws.cleanrooms#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cleanrooms#ThrottlingException" + }, + { + "target": "com.amazonaws.cleanrooms#ValidationException" + } + ], + "traits": { + "aws.iam#actionPermissionDescription": "Grants permission to view analysis rules associated with schemas", + "smithy.api#documentation": "

Retrieves multiple analysis rule schemas.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/collaborations/{collaborationIdentifier}/batch-schema-analysis-rule" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleError": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.cleanrooms#TableAlias", + "traits": { + "smithy.api#documentation": "

An error name for the error.

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.cleanrooms#AnalysisRuleType", + "traits": { + "smithy.api#documentation": "

The analysis rule type.

", + "smithy.api#required": {} + } + }, + "code": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An error code for the error.

", + "smithy.api#required": {} + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description of why the call failed.

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

An error that describes why a schema could not be fetched.

" + } + }, + "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleErrorList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleError" + }, + "traits": { + "smithy.api#length": { + "max": 25 + } + } + }, + "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleInput": { + "type": "structure", + "members": { + "collaborationIdentifier": { + "target": "com.amazonaws.cleanrooms#CollaborationIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier of the collaboration that contains the schema analysis rule.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "CollaborationId" + } + }, + "schemaAnalysisRuleRequests": { + "target": "com.amazonaws.cleanrooms#SchemaAnalysisRuleRequestList", + "traits": { + "smithy.api#documentation": "

The information that's necessary to retrieve a schema analysis rule.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleOutput": { + "type": "structure", + "members": { + "analysisRules": { + "target": "com.amazonaws.cleanrooms#SchemaAnalysisRuleList", + "traits": { + "smithy.api#documentation": "

The retrieved list of analysis rules.

", + "smithy.api#required": {} + } + }, + "errors": { + "target": "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRuleErrorList", + "traits": { + "smithy.api#documentation": "

Error reasons for schemas that could not be retrieved. One error is returned for every schema that could not be retrieved.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.cleanrooms#BatchGetSchemaError": { "type": "structure", "members": { @@ -1746,7 +1875,7 @@ "names": { "target": "com.amazonaws.cleanrooms#TableAliasList", "traits": { - "smithy.api#documentation": "

The names for the schema objects to retrieve.>

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

The names for the schema objects to\n retrieve.

", "smithy.api#required": {} } } @@ -2530,6 +2659,9 @@ { "target": "com.amazonaws.cleanrooms#BatchGetSchema" }, + { + "target": "com.amazonaws.cleanrooms#BatchGetSchemaAnalysisRule" + }, { "target": "com.amazonaws.cleanrooms#DeleteMember" }, @@ -9513,22 +9645,46 @@ "type": "string", "traits": { "smithy.api#enum": [ - { - "name": "TRUNC", - "value": "TRUNC" - }, { "name": "ABS", "value": "ABS" }, + { + "name": "CAST", + "value": "CAST" + }, { "name": "CEILING", "value": "CEILING" }, + { + "name": "COALESCE", + "value": "COALESCE" + }, + { + "name": "CONVERT", + "value": "CONVERT" + }, + { + "name": "CURRENT_DATE", + "value": "CURRENT_DATE" + }, + { + "name": "DATEADD", + "value": "DATEADD" + }, + { + "name": "EXTRACT", + "value": "EXTRACT" + }, { "name": "FLOOR", "value": "FLOOR" }, + { + "name": "GETDATE", + "value": "GETDATE" + }, { "name": "LN", "value": "LN" @@ -9537,33 +9693,53 @@ "name": "LOG", "value": "LOG" }, + { + "name": "LOWER", + "value": "LOWER" + }, { "name": "ROUND", "value": "ROUND" }, + { + "name": "RTRIM", + "value": "RTRIM" + }, { "name": "SQRT", "value": "SQRT" }, { - "name": "CAST", - "value": "CAST" + "name": "SUBSTRING", + "value": "SUBSTRING" }, { - "name": "LOWER", - "value": "LOWER" + "name": "TO_CHAR", + "value": "TO_CHAR" }, { - "name": "RTRIM", - "value": "RTRIM" + "name": "TO_DATE", + "value": "TO_DATE" }, { - "name": "UPPER", - "value": "UPPER" + "name": "TO_NUMBER", + "value": "TO_NUMBER" }, { - "name": "COALESCE", - "value": "COALESCE" + "name": "TO_TIMESTAMP", + "value": "TO_TIMESTAMP" + }, + { + "name": "TRIM", + "value": "TRIM" + }, + { + "name": "TRUNC", + "value": "TRUNC" + }, + { + "name": "UPPER", + "value": "UPPER" } ] } @@ -9659,12 +9835,82 @@ "smithy.api#documentation": "

The type of schema. The only valid value is currently `TABLE`.

", "smithy.api#required": {} } + }, + "schemaStatusDetails": { + "target": "com.amazonaws.cleanrooms#SchemaStatusDetailList", + "traits": { + "smithy.api#default": [], + "smithy.api#documentation": "

Details about the status of the schema. Currently, only one entry is present.

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

A schema is a relation within a collaboration.

" } }, + "com.amazonaws.cleanrooms#SchemaAnalysisRuleList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#AnalysisRule" + }, + "traits": { + "smithy.api#length": { + "max": 25 + } + } + }, + "com.amazonaws.cleanrooms#SchemaAnalysisRuleRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.cleanrooms#TableAlias", + "traits": { + "smithy.api#documentation": "

The name of the analysis rule schema that you are requesting.

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.cleanrooms#AnalysisRuleType", + "traits": { + "smithy.api#documentation": "

The type of analysis rule schema that you are requesting.

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

Defines the information that's necessary to retrieve an analysis rule schema. Schema analysis rules are uniquely identified by a combination of the schema name and the analysis rule type for a given collaboration.

" + } + }, + "com.amazonaws.cleanrooms#SchemaAnalysisRuleRequestList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#SchemaAnalysisRuleRequest" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.cleanrooms#SchemaConfiguration": { + "type": "enum", + "members": { + "DIFFERENTIAL_PRIVACY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIFFERENTIAL_PRIVACY" + } + } + } + }, + "com.amazonaws.cleanrooms#SchemaConfigurationList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#SchemaConfiguration" + } + }, "com.amazonaws.cleanrooms#SchemaList": { "type": "list", "member": { @@ -9676,6 +9922,119 @@ } } }, + "com.amazonaws.cleanrooms#SchemaStatus": { + "type": "enum", + "members": { + "READY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "READY" + } + }, + "NOT_READY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_READY" + } + } + } + }, + "com.amazonaws.cleanrooms#SchemaStatusDetail": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.cleanrooms#SchemaStatus", + "traits": { + "smithy.api#documentation": "

The status of the schema.

", + "smithy.api#required": {} + } + }, + "reasons": { + "target": "com.amazonaws.cleanrooms#SchemaStatusReasonList", + "traits": { + "smithy.api#documentation": "

The reasons why the schema status is set to its current state.

" + } + }, + "analysisRuleType": { + "target": "com.amazonaws.cleanrooms#AnalysisRuleType", + "traits": { + "smithy.api#documentation": "

The analysis rule type for which the schema status has been evaluated.

" + } + }, + "configurations": { + "target": "com.amazonaws.cleanrooms#SchemaConfigurationList", + "traits": { + "smithy.api#documentation": "

The configuration details of the schema analysis rule for the given type.

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

Information about the schema status.

\n

A status of READY means that based on the schema analysis rule, queries of the given analysis rule type are properly configured to run queries on this schema.

" + } + }, + "com.amazonaws.cleanrooms#SchemaStatusDetailList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#SchemaStatusDetail" + } + }, + "com.amazonaws.cleanrooms#SchemaStatusReason": { + "type": "structure", + "members": { + "code": { + "target": "com.amazonaws.cleanrooms#SchemaStatusReasonCode", + "traits": { + "smithy.api#documentation": "

The schema status reason code.

", + "smithy.api#required": {} + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An explanation of the schema status reason code.

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

A reason why the schema status is set to its current value.

" + } + }, + "com.amazonaws.cleanrooms#SchemaStatusReasonCode": { + "type": "enum", + "members": { + "ANALYSIS_RULE_MISSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANALYSIS_RULE_MISSING" + } + }, + "ANALYSIS_TEMPLATES_NOT_CONFIGURED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANALYSIS_TEMPLATES_NOT_CONFIGURED" + } + }, + "ANALYSIS_PROVIDERS_NOT_CONFIGURED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANALYSIS_PROVIDERS_NOT_CONFIGURED" + } + }, + "DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED" + } + } + } + }, + "com.amazonaws.cleanrooms#SchemaStatusReasonList": { + "type": "list", + "member": { + "target": "com.amazonaws.cleanrooms#SchemaStatusReason" + } + }, "com.amazonaws.cleanrooms#SchemaSummary": { "type": "structure", "members": {