The AWS SDK for JavaScript v2 has reached end-of-support.
We recommend that you migrate to AWS SDK for JavaScript v3. For additional details and information on how to migrate, please refer to the announcement.

Class: AWS.CleanRoomsML

Inherits:
AWS.Service show all
Identifier:
cleanroomsml
API Version:
2023-09-06
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Welcome to the Amazon Web Services Clean Rooms ML API Reference.

Amazon Web Services Clean Rooms ML provides a privacy-enhancing method for two parties to identify similar users in their data without the need to share their data with each other. The first party brings the training data to Clean Rooms so that they can create and configure an audience model (lookalike model) and associate it with a collaboration. The second party then brings their seed data to Clean Rooms and generates an audience (lookalike segment) that resembles the training data.

To learn more about Amazon Web Services Clean Rooms ML concepts, procedures, and best practices, see the Clean Rooms User Guide.

To learn more about SQL commands, functions, and conditions supported in Clean Rooms, see the Clean Rooms SQL Reference.

Sending a Request Using CleanRoomsML

var cleanroomsml = new AWS.CleanRoomsML();
cleanroomsml.createAudienceModel(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the CleanRoomsML object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var cleanroomsml = new AWS.CleanRoomsML({apiVersion: '2023-09-06'});

You can also set the API version globally in AWS.config.apiVersions using the cleanroomsml service identifier:

AWS.config.apiVersions = {
  cleanroomsml: '2023-09-06',
  // other service API versions
};

var cleanroomsml = new AWS.CleanRoomsML();

Version:

  • 2023-09-06

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService

Constructor Details

new AWS.CleanRoomsML(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a CleanRoomsML object

var cleanroomsml = new AWS.CleanRoomsML({apiVersion: '2023-09-06'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.CleanRoomsML.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.CleanRoomsML.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.CleanRoomsML.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createAudienceModel(params = {}, callback) ⇒ AWS.Request

Defines the information necessary to create an audience model. An audience model is a machine learning model that Clean Rooms ML trains to measure similarity between users. Clean Rooms ML manages training and storing the audience model. The audience model can be used in multiple calls to the StartAudienceGenerationJob API.

Service Reference:

Examples:

Calling the createAudienceModel operation

var params = {
  name: 'STRING_VALUE', /* required */
  trainingDatasetArn: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  kmsKeyArn: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  },
  trainingDataEndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  trainingDataStartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
};
cleanroomsml.createAudienceModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • trainingDataStartTime — (Date)

      The start date and time of the training window.

    • trainingDataEndTime — (Date)

      The end date and time of the training window.

    • name — (String)

      The name of the audience model resource.

    • trainingDatasetArn — (String)

      The Amazon Resource Name (ARN) of the training dataset for this audience model.

    • kmsKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt and decrypt customer-owned data in the trained ML model and the associated data.

    • tags — (map<String>)

      The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.

      The following basic restrictions apply to tags:

      • Maximum number of tags per resource - 50.

      • For each resource, each tag key must be unique, and each tag key can have only one value.

      • Maximum key length - 128 Unicode characters in UTF-8.

      • Maximum value length - 256 Unicode characters in UTF-8.

      • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.

      • Tag keys and values are case sensitive.

      • 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.

    • description — (String)

      The description of the audience model.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • audienceModelArn — (String)

        The Amazon Resource Name (ARN) of the audience model.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createConfiguredAudienceModel(params = {}, callback) ⇒ AWS.Request

Defines the information necessary to create a configured audience model.

Service Reference:

Examples:

Calling the createConfiguredAudienceModel operation

var params = {
  audienceModelArn: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  outputConfig: { /* required */
    destination: { /* required */
      s3Destination: { /* required */
        s3Uri: 'STRING_VALUE' /* required */
      }
    },
    roleArn: 'STRING_VALUE' /* required */
  },
  sharedAudienceMetrics: [ /* required */
    ALL | NONE,
    /* more items */
  ],
  audienceSizeConfig: {
    audienceSizeBins: [ /* required */
      'NUMBER_VALUE',
      /* more items */
    ],
    audienceSizeType: ABSOLUTE | PERCENTAGE /* required */
  },
  childResourceTagOnCreatePolicy: FROM_PARENT_RESOURCE | NONE,
  description: 'STRING_VALUE',
  minMatchingSeedSize: 'NUMBER_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
cleanroomsml.createConfiguredAudienceModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name of the configured audience model.

    • audienceModelArn — (String)

      The Amazon Resource Name (ARN) of the audience model to use for the configured audience model.

    • outputConfig — (map)

      Configure the Amazon S3 location and IAM Role for audiences created using this configured audience model. Each audience will have a unique location. The IAM Role must have s3:PutObject permission on the destination Amazon S3 location. If the destination is protected with Amazon S3 KMS-SSE, then the Role must also have the required KMS permissions.

      • destinationrequired — (map)

        Defines the Amazon S3 bucket where the configured audience is stored.

        • s3Destinationrequired — (map)

          The Amazon S3 bucket and path for the configured audience.

          • s3Urirequired — (String)

            The Amazon S3 location URI.

      • roleArnrequired — (String)

        The ARN of the IAM role that can write the Amazon S3 bucket.

    • description — (String)

      The description of the configured audience model.

    • sharedAudienceMetrics — (Array<String>)

      Whether audience metrics are shared.

    • minMatchingSeedSize — (Integer)

      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.

    • audienceSizeConfig — (map)

      Configure the list of output sizes of audiences that can be created using this configured audience model. A request to StartAudienceGenerationJob that uses this configured audience model must have an audienceSize selected from this list. You can use the ABSOLUTE AudienceSize to configure out audience sizes using the count of identifiers in the output. You can use the Percentage AudienceSize to configure sizes in the range 1-100 percent.

      • audienceSizeTyperequired — (String)

        Whether the audience output sizes are defined as an absolute number or a percentage.

        Possible values include:
        • "ABSOLUTE"
        • "PERCENTAGE"
      • audienceSizeBinsrequired — (Array<Integer>)

        An array of the different audience output sizes.

    • tags — (map<String>)

      The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.

      The following basic restrictions apply to tags:

      • Maximum number of tags per resource - 50.

      • For each resource, each tag key must be unique, and each tag key can have only one value.

      • Maximum key length - 128 Unicode characters in UTF-8.

      • Maximum value length - 256 Unicode characters in UTF-8.

      • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.

      • Tag keys and values are case sensitive.

      • 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.

    • childResourceTagOnCreatePolicy — (String)

      Configure how the service tags audience generation jobs created using this configured audience model. If you specify NONE, the tags from the StartAudienceGenerationJob request determine the tags of the audience generation job. If you specify FROM_PARENT_RESOURCE, the audience generation job inherits the tags from the configured audience model, by default. Tags in the StartAudienceGenerationJob will override the default.

      When the client is in a different account than the configured audience model, the tags from the client are never applied to a resource in the caller's account.

      Possible values include:
      • "FROM_PARENT_RESOURCE"
      • "NONE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • configuredAudienceModelArn — (String)

        The Amazon Resource Name (ARN) of the configured audience model.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTrainingDataset(params = {}, callback) ⇒ AWS.Request

Defines the information necessary to create a training dataset. In Clean Rooms ML, the TrainingDataset is metadata that points to a Glue table, which is read only during AudienceModel creation.

Service Reference:

Examples:

Calling the createTrainingDataset operation

var params = {
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  trainingData: [ /* required */
    {
      inputConfig: { /* required */
        dataSource: { /* required */
          glueDataSource: { /* required */
            databaseName: 'STRING_VALUE', /* required */
            tableName: 'STRING_VALUE', /* required */
            catalogId: 'STRING_VALUE'
          }
        },
        schema: [ /* required */
          {
            columnName: 'STRING_VALUE', /* required */
            columnTypes: [ /* required */
              USER_ID | ITEM_ID | TIMESTAMP | CATEGORICAL_FEATURE | NUMERICAL_FEATURE,
              /* more items */
            ]
          },
          /* more items */
        ]
      },
      type: INTERACTIONS /* required */
    },
    /* more items */
  ],
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
cleanroomsml.createTrainingDataset(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name of the training dataset. This name must be unique in your account and region.

    • roleArn — (String)

      The ARN of the IAM role that Clean Rooms ML can assume to read the data referred to in the dataSource field of each dataset.

      Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an AccessDeniedException error.

    • trainingData — (Array<map>)

      An array of information that lists the Dataset objects, which specifies the dataset type and details on its location and schema. You must provide a role that has read access to these tables.

      • typerequired — (String)

        What type of information is found in the dataset.

        Possible values include:
        • "INTERACTIONS"
      • inputConfigrequired — (map)

        A DatasetInputConfig object that defines the data source and schema mapping.

        • schemarequired — (Array<map>)

          The schema information for the training data.

          • columnNamerequired — (String)

            The name of a column.

          • columnTypesrequired — (Array<String>)

            The data type of column.

        • dataSourcerequired — (map)

          A DataSource object that specifies the Glue data source for the training data.

          • glueDataSourcerequired — (map)

            A GlueDataSource object that defines the catalog ID, database name, and table name for the training data.

            • tableNamerequired — (String)

              The Glue table that contains the training data.

            • databaseNamerequired — (String)

              The Glue database that contains the training data.

            • catalogId — (String)

              The Glue catalog that contains the training data.