Skip to content

Commit

Permalink
feat(client-cleanroomsml): The release includes a public SDK for AWS …
Browse files Browse the repository at this point in the history
…Clean Rooms ML APIs, making them globally available to developers worldwide.
  • Loading branch information
awstools committed Apr 3, 2024
1 parent 2cc8c1c commit 46ea196
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface CreateAudienceModelCommandOutput extends CreateAudienceModelRes
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export interface CreateConfiguredAudienceModelCommandOutput
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface CreateTrainingDatasetCommandInput extends CreateTrainingDataset
export interface CreateTrainingDatasetCommandOutput extends CreateTrainingDatasetResponse, __MetadataBearer {}

/**
* <p>Defines the information necessary to create a training dataset, or seed audience. In Clean Rooms ML, the <code>TrainingDataset</code> is metadata that points to a Glue table, which is read only during <code>AudienceModel</code> creation.</p>
* <p>Defines the information necessary to create a training dataset. In Clean Rooms ML, the <code>TrainingDataset</code> is metadata that points to a Glue table, which is read only during <code>AudienceModel</code> creation.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface CreateTrainingDatasetCommandOutput extends CreateTrainingDatase
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The request parameters for this request are incorrect.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface DeleteAudienceGenerationJobCommandOutput extends __MetadataBear
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface DeleteAudienceModelCommandOutput extends __MetadataBearer {}
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface DeleteConfiguredAudienceModelCommandOutput extends __MetadataBe
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface DeleteTrainingDatasetCommandOutput extends __MetadataBearer {}
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface GetAudienceGenerationJobCommandOutput extends GetAudienceGenera
* // score: Number("double"),
* // },
* // ],
* // recallMetric: Number("double"),
* // },
* // startedBy: "STRING_VALUE",
* // tags: { // TagMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ export interface GetAudienceModelCommandOutput extends GetAudienceModelResponse,
* // statusCode: "STRING_VALUE",
* // message: "STRING_VALUE",
* // },
* // metrics: [ // AudienceModelMetrics
* // { // AudienceModelMetric
* // type: "NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN" || "MEAN_RECIPROCAL_RANK" || "PRECISION" || "RECALL", // required
* // forTopKItemPredictions: Number("int"), // required
* // value: Number("double"), // required
* // },
* // ],
* // kmsKeyArn: "STRING_VALUE",
* // tags: { // TagMap
* // "<keys>": "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface StartAudienceExportJobCommandOutput extends __MetadataBearer {}
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface StartAudienceGenerationJobCommandOutput extends StartAudienceGe
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface UpdateConfiguredAudienceModelCommandOutput
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource you are requesting does not exist.</p>
Expand Down
80 changes: 25 additions & 55 deletions clients/client-cleanroomsml/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class ValidationException extends __BaseException {
}

/**
* <p>A resource with that name already exists in this region.</p>
* <p>You can't complete this action because another resource depends on this resource.</p>
* @public
*/
export class ConflictException extends __BaseException {
Expand Down Expand Up @@ -374,15 +374,31 @@ export interface AudienceQualityMetrics {
* @public
*/
relevanceMetrics: RelevanceMetric[] | undefined;

/**
* <p>The recall score of the generated audience. Recall is the percentage of the most similar users (by default, the most similar 20%) from a sample of the training data that are included in the seed audience by the audience generation job. Values range from 0-1, larger values indicate a better audience. A recall value approximately equal to the maximum bin size indicates that the audience model is equivalent to random selection.
* </p>
* @public
*/
recallMetric?: number;
}

/**
* <p>Defines the Amazon S3 bucket where the training data for the configured audience is stored.</p>
* <p>Defines the Amazon S3 bucket where the seed audience for the generating audience is stored.</p>
* @public
*/
export interface AudienceGenerationJobDataSource {
/**
* <p>The Amazon S3 bucket where the training data for the configured audience is stored.</p>
* <p>Defines the Amazon S3 bucket where the seed audience for the generating audience is stored. A valid data source is a JSON line file in the following format:</p>
* <p>
* <code>\{"user_id": "111111"\}</code>
* </p>
* <p>
* <code>\{"user_id": "222222"\}</code>
* </p>
* <p>
* <code>...</code>
* </p>
* @public
*/
dataSource: S3ConfigMap | undefined;
Expand Down Expand Up @@ -485,7 +501,7 @@ export interface GetAudienceGenerationJobResponse {
collaborationId?: string;

/**
* <p>The relevance scores for different audience sizes. </p>
* <p>The relevance scores for different audience sizes and the recall score of the generated audience. </p>
* @public
*/
metrics?: AudienceQualityMetrics;
Expand Down Expand Up @@ -672,7 +688,7 @@ export interface StartAudienceGenerationJobRequest {
* <p>Tag keys and values are case sensitive.</p>
* </li>
* <li>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* </li>
* </ul>
* @public
Expand Down Expand Up @@ -748,7 +764,7 @@ export interface CreateAudienceModelRequest {
* <p>Tag keys and values are case sensitive.</p>
* </li>
* <li>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* </li>
* </ul>
* @public
Expand Down Expand Up @@ -795,46 +811,6 @@ export interface GetAudienceModelRequest {
audienceModelArn: string | undefined;
}

/**
* @public
* @enum
*/
export const AudienceModelMetricType = {
MEAN_RECIPROCAL_RANK: "MEAN_RECIPROCAL_RANK",
NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN: "NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN",
PRECISION: "PRECISION",
RECALL: "RECALL",
} as const;

/**
* @public
*/
export type AudienceModelMetricType = (typeof AudienceModelMetricType)[keyof typeof AudienceModelMetricType];

/**
* <p>The audience model metrics.</p>
* @public
*/
export interface AudienceModelMetric {
/**
* <p>The audience model metric.</p>
* @public
*/
type: AudienceModelMetricType | undefined;

/**
* <p>The number of users that were used to generate these model metrics.</p>
* @public
*/
forTopKItemPredictions: number | undefined;

/**
* <p>The value of the audience model metric</p>
* @public
*/
value: number | undefined;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -912,12 +888,6 @@ export interface GetAudienceModelResponse {
*/
statusDetails?: StatusDetails;

/**
* <p>Accuracy metrics for the model.</p>
* @public
*/
metrics?: AudienceModelMetric[];

/**
* <p>The KMS key ARN used for the audience model.</p>
* @public
Expand Down Expand Up @@ -1120,7 +1090,7 @@ export interface CreateConfiguredAudienceModelRequest {
sharedAudienceMetrics: SharedAudienceMetrics[] | undefined;

/**
* <p>The minimum number of users from the seed audience that must match with users in the training data of the audience model.</p>
* <p>The minimum number of users from the seed audience that must match with users in the training data of the audience model. The default value is 500.</p>
* @public
*/
minMatchingSeedSize?: number;
Expand Down Expand Up @@ -1156,7 +1126,7 @@ export interface CreateConfiguredAudienceModelRequest {
* <p>Tag keys and values are case sensitive.</p>
* </li>
* <li>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* </li>
* </ul>
* @public
Expand Down Expand Up @@ -1609,7 +1579,7 @@ export interface TagResourceRequest {
* <p>Tag keys and values are case sensitive.</p>
* </li>
* <li>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p>
* </li>
* </ul>
* @public
Expand Down
26 changes: 1 addition & 25 deletions clients/client-cleanroomsml/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ import {
AudienceExportJobSummary,
AudienceGenerationJobDataSource,
AudienceGenerationJobSummary,
AudienceModelMetric,
AudienceModelSummary,
AudienceQualityMetrics,
AudienceSize,
Expand Down Expand Up @@ -850,7 +849,6 @@ export const de_GetAudienceModelCommand = async (
createTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
description: __expectString,
kmsKeyArn: __expectString,
metrics: (_) => de_AudienceModelMetrics(_, context),
name: __expectString,
status: __expectString,
statusDetails: _json,
Expand Down Expand Up @@ -1433,29 +1431,6 @@ const de_AudienceModelList = (output: any, context: __SerdeContext): AudienceMod
return retVal;
};

/**
* deserializeAws_restJson1AudienceModelMetric
*/
const de_AudienceModelMetric = (output: any, context: __SerdeContext): AudienceModelMetric => {
return take(output, {
forTopKItemPredictions: __expectInt32,
type: __expectString,
value: __limitedParseDouble,
}) as any;
};

/**
* deserializeAws_restJson1AudienceModelMetrics
*/
const de_AudienceModelMetrics = (output: any, context: __SerdeContext): AudienceModelMetric[] => {
const retVal = (output || [])
.filter((e: any) => e != null)
.map((entry: any) => {
return de_AudienceModelMetric(entry, context);
});
return retVal;
};

/**
* deserializeAws_restJson1AudienceModelSummary
*/
Expand All @@ -1476,6 +1451,7 @@ const de_AudienceModelSummary = (output: any, context: __SerdeContext): Audience
*/
const de_AudienceQualityMetrics = (output: any, context: __SerdeContext): AudienceQualityMetrics => {
return take(output, {
recallMetric: __limitedParseDouble,
relevanceMetrics: (_: any) => de_RelevanceMetrics(_, context),
}) as any;
};
Expand Down
Loading

0 comments on commit 46ea196

Please sign in to comment.