You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::FraudDetector::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon Fraud Detector. To construct a client, you need to configure a :region and :credentials.

frauddetector = Aws::FraudDetector::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::FraudDetector::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::FraudDetector::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#batch_create_variable(options = {}) ⇒ Types::BatchCreateVariableResult

Creates a batch of variables.

Examples:

Request syntax with placeholder values


resp = client.batch_create_variable({
  variable_entries: [ # required
    {
      name: "string",
      data_type: "string",
      data_source: "string",
      default_value: "string",
      description: "string",
      variable_type: "string",
    },
  ],
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.errors #=> Array
resp.errors[0].name #=> String
resp.errors[0].code #=> Integer
resp.errors[0].message #=> String

Options Hash (options):

  • :variable_entries (required, Array<Types::VariableEntry>)

    The list of variables for the batch create variable request.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

See Also:

#batch_get_variable(options = {}) ⇒ Types::BatchGetVariableResult

Gets a batch of variables.

Examples:

Request syntax with placeholder values


resp = client.batch_get_variable({
  names: ["string"], # required
})

Response structure


resp.variables #=> Array
resp.variables[0].name #=> String
resp.variables[0].data_type #=> String, one of "STRING", "INTEGER", "FLOAT", "BOOLEAN"
resp.variables[0].data_source #=> String, one of "EVENT", "MODEL_SCORE", "EXTERNAL_MODEL_SCORE"
resp.variables[0].default_value #=> String
resp.variables[0].description #=> String
resp.variables[0].variable_type #=> String
resp.variables[0].last_updated_time #=> String
resp.variables[0].created_time #=> String
resp.variables[0].arn #=> String
resp.errors #=> Array
resp.errors[0].name #=> String
resp.errors[0].code #=> Integer
resp.errors[0].message #=> String

Options Hash (options):

  • :names (required, Array<String>)

    The list of variable names to get.

Returns:

See Also:

#create_detector_version(options = {}) ⇒ Types::CreateDetectorVersionResult

Creates a detector version. The detector version starts in a DRAFT status.

Examples:

Request syntax with placeholder values


resp = client.create_detector_version({
  detector_id: "identifier", # required
  description: "description",
  external_model_endpoints: ["string"],
  rules: [ # required
    {
      detector_id: "identifier", # required
      rule_id: "identifier", # required
      rule_version: "wholeNumberVersionString", # required
    },
  ],
  model_versions: [
    {
      model_id: "modelIdentifier", # required
      model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
      model_version_number: "nonEmptyString", # required
      arn: "fraudDetectorArn",
    },
  ],
  rule_execution_mode: "ALL_MATCHED", # accepts ALL_MATCHED, FIRST_MATCHED
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.detector_id #=> String
resp.detector_version_id #=> String
resp.status #=> String, one of "DRAFT", "ACTIVE", "INACTIVE"

Options Hash (options):

  • :detector_id (required, String)

    The ID of the detector under which you want to create a new version.

  • :description (String)

    The description of the detector version.

  • :external_model_endpoints (Array<String>)

    The Amazon Sagemaker model endpoints to include in the detector version.

  • :rules (required, Array<Types::Rule>)

    The rules to include in the detector version.

  • :model_versions (Array<Types::ModelVersion>)

    The model versions to include in the detector version.

  • :rule_execution_mode (String)

    The rule execution mode for the rules included in the detector version.

    You can define and edit the rule mode at the detector version level, when it is in draft status.

    If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.

    If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules.

    The default behavior is FIRST_MATCHED.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

See Also:

#create_model(options = {}) ⇒ Struct

Creates a model using the specified model type.

Examples:

Request syntax with placeholder values


resp = client.create_model({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  description: "description",
  event_type_name: "string", # required
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :model_id (required, String)

    The model ID.

  • :model_type (required, String)

    The model type.

  • :description (String)

    The model description.

  • :event_type_name (required, String)

    The name of the event type.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_model_version(options = {}) ⇒ Types::CreateModelVersionResult

Creates a version of the model using the specified model type and model id.

Examples:

Request syntax with placeholder values


resp = client.create_model_version({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  training_data_source: "EXTERNAL_EVENTS", # required, accepts EXTERNAL_EVENTS
  training_data_schema: { # required
    model_variables: ["string"], # required
    label_schema: { # required
      label_mapper: { # required
        "string" => ["string"],
      },
    },
  },
  external_events_detail: {
    data_location: "s3BucketLocation", # required
    data_access_role_arn: "iamRoleArn", # required
  },
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.model_id #=> String
resp.model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_version_number #=> String
resp.status #=> String

Options Hash (options):

  • :model_id (required, String)

    The model ID.

  • :model_type (required, String)

    The model type.

  • :training_data_source (required, String)

    The training data source location in Amazon S3.

  • :training_data_schema (required, Types::TrainingDataSchema)

    The training data schema.

  • :external_events_detail (Types::ExternalEventsDetail)

    Details for the external events data used for model version training. Required if trainingDataSource is EXTERNAL_EVENTS.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

See Also:

#create_rule(options = {}) ⇒ Types::CreateRuleResult

Creates a rule for use with the specified detector.

Examples:

Request syntax with placeholder values


resp = client.create_rule({
  rule_id: "identifier", # required
  detector_id: "identifier", # required
  description: "description",
  expression: "ruleExpression", # required
  language: "DETECTORPL", # required, accepts DETECTORPL
  outcomes: ["string"], # required
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.rule.detector_id #=> String
resp.rule.rule_id #=> String
resp.rule.rule_version #=> String

Options Hash (options):

  • :rule_id (required, String)

    The rule ID.

  • :detector_id (required, String)

    The detector ID for the rule\'s parent detector.

  • :description (String)

    The rule description.

  • :expression (required, String)

    The rule expression.

  • :language (required, String)

    The language of the rule.

  • :outcomes (required, Array<String>)

    The outcome or outcomes returned when the rule expression matches.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

See Also:

#create_variable(options = {}) ⇒ Struct

Creates a variable.

Examples:

Request syntax with placeholder values


resp = client.create_variable({
  name: "string", # required
  data_type: "STRING", # required, accepts STRING, INTEGER, FLOAT, BOOLEAN
  data_source: "EVENT", # required, accepts EVENT, MODEL_SCORE, EXTERNAL_MODEL_SCORE
  default_value: "string", # required
  description: "string",
  variable_type: "string",
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :name (required, String)

    The name of the variable.

  • :data_type (required, String)

    The data type.

  • :data_source (required, String)

    The source of the data.

  • :default_value (required, String)

    The default value for the variable when no value is received.

  • :description (String)

    The description.

  • :variable_type (String)

    The variable type. For more information see Variable types.

    Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_detector(options = {}) ⇒ Struct

Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.

When you delete a detector, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_detector({
  detector_id: "identifier", # required
})

Options Hash (options):

  • :detector_id (required, String)

    The ID of the detector to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_detector_version(options = {}) ⇒ Struct

Deletes the detector version. You cannot delete detector versions that are in ACTIVE status.

When you delete a detector version, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_detector_version({
  detector_id: "identifier", # required
  detector_version_id: "wholeNumberVersionString", # required
})

Options Hash (options):

  • :detector_id (required, String)

    The ID of the parent detector for the detector version to delete.

  • :detector_version_id (required, String)

    The ID of the detector version to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_entity_type(options = {}) ⇒ Struct

Deletes an entity type.

You cannot delete an entity type that is included in an event type.

When you delete an entity type, Amazon Fraud Detector permanently deletes that entity type from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_entity_type({
  name: "identifier", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the entity type to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_event(options = {}) ⇒ Struct

Deletes the specified event.

When you delete an event, Amazon Fraud Detector permanently deletes that event from the evaluation history, and the event data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_event({
  event_id: "identifier", # required
  event_type_name: "identifier", # required
})

Options Hash (options):

  • :event_id (required, String)

    The ID of the event to delete.

  • :event_type_name (required, String)

    The name of the event type.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_event_type(options = {}) ⇒ Struct

Deletes an event type.

You cannot delete an event type that is used in a detector or a model.

When you delete an entity type, Amazon Fraud Detector permanently deletes that entity type from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_event_type({
  name: "identifier", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the event type to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_external_model(options = {}) ⇒ Struct

Removes a SageMaker model from Amazon Fraud Detector.

You can remove an Amazon SageMaker model if it is not associated with a detector version. Removing a SageMaker model disconnects it from Amazon Fraud Detector, but the model remains available in SageMaker.

Examples:

Request syntax with placeholder values


resp = client.delete_external_model({
  model_endpoint: "sageMakerEndpointIdentifier", # required
})

Options Hash (options):

  • :model_endpoint (required, String)

    The endpoint of the Amazon Sagemaker model to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_label(options = {}) ⇒ Struct

Deletes a label.

You cannot delete labels that are included in an event type in Amazon Fraud Detector.

You cannot delete a label assigned to an event ID. You must first delete the relevant event ID.

When you delete a label, Amazon Fraud Detector permanently deletes that label from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_label({
  name: "identifier", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the label to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_model(options = {}) ⇒ Struct

Deletes a model.

You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.

When you delete a model, Amazon Fraud Detector permanently deletes that model from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_model({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
})

Options Hash (options):

  • :model_id (required, String)

    The model ID of the model to delete.

  • :model_type (required, String)

    The model type of the model to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_model_version(options = {}) ⇒ Struct

Deletes a model version.

You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.

When you delete a model version, Amazon Fraud Detector permanently deletes that model version from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_model_version({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  model_version_number: "floatVersionString", # required
})

Options Hash (options):

  • :model_id (required, String)

    The model ID of the model version to delete.

  • :model_type (required, String)

    The model type of the model version to delete.

  • :model_version_number (required, String)

    The model version number of the model version to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_outcome(options = {}) ⇒ Struct

Deletes an outcome.

You cannot delete an outcome that is used in a rule version.

When you delete an outcome, Amazon Fraud Detector permanently deletes that outcome from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_outcome({
  name: "identifier", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the outcome to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_rule(options = {}) ⇒ Struct

Deletes the rule. You cannot delete a rule if it is used by an ACTIVE or INACTIVE detector version.

When you delete a rule, Amazon Fraud Detector permanently deletes that rule from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_rule({
  rule: { # required
    detector_id: "identifier", # required
    rule_id: "identifier", # required
    rule_version: "wholeNumberVersionString", # required
  },
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_variable(options = {}) ⇒ Struct

Deletes a variable.

You can't delete variables that are included in an event type in Amazon Fraud Detector.

Amazon Fraud Detector automatically deletes model output variables and SageMaker model output variables when you delete the model. You can't delete these variables manually.

When you delete a variable, Amazon Fraud Detector permanently deletes that variable from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.delete_variable({
  name: "string", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the variable to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_detector(options = {}) ⇒ Types::DescribeDetectorResult

Gets all versions for a specified detector.

Examples:

Request syntax with placeholder values


resp = client.describe_detector({
  detector_id: "identifier", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.detector_id #=> String
resp.detector_version_summaries #=> Array
resp.detector_version_summaries[0].detector_version_id #=> String
resp.detector_version_summaries[0].status #=> String, one of "DRAFT", "ACTIVE", "INACTIVE"
resp.detector_version_summaries[0].description #=> String
resp.detector_version_summaries[0].last_updated_time #=> String
resp.next_token #=> String
resp.arn #=> String

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :next_token (String)

    The next token from the previous response.

  • :max_results (Integer)

    The maximum number of results to return for the request.

Returns:

See Also:

#describe_model_versions(options = {}) ⇒ Types::DescribeModelVersionsResult

Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version.

Examples:

Request syntax with placeholder values


resp = client.describe_model_versions({
  model_id: "modelIdentifier",
  model_version_number: "floatVersionString",
  model_type: "ONLINE_FRAUD_INSIGHTS", # accepts ONLINE_FRAUD_INSIGHTS
  next_token: "string",
  max_results: 1,
})

Response structure


resp.model_version_details #=> Array
resp.model_version_details[0].model_id #=> String
resp.model_version_details[0].model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_version_details[0].model_version_number #=> String
resp.model_version_details[0].status #=> String
resp.model_version_details[0].training_data_source #=> String, one of "EXTERNAL_EVENTS"
resp.model_version_details[0].training_data_schema.model_variables #=> Array
resp.model_version_details[0].training_data_schema.model_variables[0] #=> String
resp.model_version_details[0].training_data_schema.label_schema.label_mapper #=> Hash
resp.model_version_details[0].training_data_schema.label_schema.label_mapper["string"] #=> Array
resp.model_version_details[0].training_data_schema.label_schema.label_mapper["string"][0] #=> String
resp.model_version_details[0].external_events_detail.data_location #=> String
resp.model_version_details[0].external_events_detail.data_access_role_arn #=> String
resp.model_version_details[0].training_result.data_validation_metrics.file_level_messages #=> Array
resp.model_version_details[0].training_result.data_validation_metrics.file_level_messages[0].title #=> String
resp.model_version_details[0].training_result.data_validation_metrics.file_level_messages[0].content #=> String
resp.model_version_details[0].training_result.data_validation_metrics.file_level_messages[0].type #=> String
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages #=> Array
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages[0].field_name #=> String
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages[0].identifier #=> String
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages[0].title #=> String
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages[0].content #=> String
resp.model_version_details[0].training_result.data_validation_metrics.field_level_messages[0].type #=> String
resp.model_version_details[0].training_result.training_metrics.auc #=> Float
resp.model_version_details[0].training_result.training_metrics.metric_data_points #=> Array
resp.model_version_details[0].training_result.training_metrics.metric_data_points[0].fpr #=> Float
resp.model_version_details[0].training_result.training_metrics.metric_data_points[0].precision #=> Float
resp.model_version_details[0].training_result.training_metrics.metric_data_points[0].tpr #=> Float
resp.model_version_details[0].training_result.training_metrics.metric_data_points[0].threshold #=> Float
resp.model_version_details[0].last_updated_time #=> String
resp.model_version_details[0].created_time #=> String
resp.model_version_details[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :model_id (String)

    The model ID.

  • :model_version_number (String)

    The model version number.

  • :model_type (String)

    The model type.

  • :next_token (String)

    The next token from the previous results.

  • :max_results (Integer)

    The maximum number of results to return.

Returns:

See Also:

#get_detector_version(options = {}) ⇒ Types::GetDetectorVersionResult

Gets a particular detector version.

Examples:

Request syntax with placeholder values


resp = client.get_detector_version({
  detector_id: "identifier", # required
  detector_version_id: "wholeNumberVersionString", # required
})

Response structure


resp.detector_id #=> String
resp.detector_version_id #=> String
resp.description #=> String
resp.external_model_endpoints #=> Array
resp.external_model_endpoints[0] #=> String
resp.model_versions #=> Array
resp.model_versions[0].model_id #=> String
resp.model_versions[0].model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_versions[0].model_version_number #=> String
resp.model_versions[0].arn #=> String
resp.rules #=> Array
resp.rules[0].detector_id #=> String
resp.rules[0].rule_id #=> String
resp.rules[0].rule_version #=> String
resp.status #=> String, one of "DRAFT", "ACTIVE", "INACTIVE"
resp.last_updated_time #=> String
resp.created_time #=> String
resp.rule_execution_mode #=> String, one of "ALL_MATCHED", "FIRST_MATCHED"
resp.arn #=> String

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :detector_version_id (required, String)

    The detector version ID.

Returns:

See Also:

#get_detectors(options = {}) ⇒ Types::GetDetectorsResult

Gets all detectors or a single detector if a detectorId is specified. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetDetectorsResponse as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_detectors({
  detector_id: "identifier",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.detectors #=> Array
resp.detectors[0].detector_id #=> String
resp.detectors[0].description #=> String
resp.detectors[0].event_type_name #=> String
resp.detectors[0].last_updated_time #=> String
resp.detectors[0].created_time #=> String
resp.detectors[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :detector_id (String)

    The detector ID.

  • :next_token (String)

    The next token for the subsequent request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_entity_types(options = {}) ⇒ Types::GetEntityTypesResult

Gets all entity types or a specific entity type if a name is specified. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEntityTypesResponse as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_entity_types({
  name: "identifier",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.entity_types #=> Array
resp.entity_types[0].name #=> String
resp.entity_types[0].description #=> String
resp.entity_types[0].last_updated_time #=> String
resp.entity_types[0].created_time #=> String
resp.entity_types[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (String)

    The name.

  • :next_token (String)

    The next token for the subsequent request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_event_prediction(options = {}) ⇒ Types::GetEventPredictionResult

Evaluates an event against a detector version. If a version ID is not provided, the detector’s (ACTIVE) version is used.

Examples:

Request syntax with placeholder values


resp = client.get_event_prediction({
  detector_id: "string", # required
  detector_version_id: "wholeNumberVersionString",
  event_id: "string", # required
  event_type_name: "string", # required
  entities: [ # required
    {
      entity_type: "string", # required
      entity_id: "identifier", # required
    },
  ],
  event_timestamp: "string", # required
  event_variables: { # required
    "variableName" => "variableValue",
  },
  external_model_endpoint_data_blobs: {
    "string" => {
      byte_buffer: "data",
      content_type: "contentType",
    },
  },
})

Response structure


resp.model_scores #=> Array
resp.model_scores[0].model_version.model_id #=> String
resp.model_scores[0].model_version.model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_scores[0].model_version.model_version_number #=> String
resp.model_scores[0].model_version.arn #=> String
resp.model_scores[0].scores #=> Hash
resp.model_scores[0].scores["string"] #=> Float
resp.rule_results #=> Array
resp.rule_results[0].rule_id #=> String
resp.rule_results[0].outcomes #=> Array
resp.rule_results[0].outcomes[0] #=> String

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :detector_version_id (String)

    The detector version ID.

  • :event_id (required, String)

    The unique ID used to identify the event.

  • :event_type_name (required, String)

    The event type associated with the detector specified for the prediction.

  • :entities (required, Array<Types::Entity>)

    The entity type (associated with the detector\'s event type) and specific entity ID representing who performed the event. If an entity id is not available, use \"UNKNOWN.\"

  • :event_timestamp (required, String)

    Timestamp that defines when the event under evaluation occurred.

  • :event_variables (required, Hash<String,String>)

    Names of the event type\'s variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.

  • :external_model_endpoint_data_blobs (Hash<String,Types::ModelEndpointDataBlob>)

    The Amazon SageMaker model endpoint input data blobs.

Returns:

See Also:

#get_event_types(options = {}) ⇒ Types::GetEventTypesResult

Gets all event types or a specific event type if name is provided. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEventTypesResponse as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_event_types({
  name: "identifier",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.event_types #=> Array
resp.event_types[0].name #=> String
resp.event_types[0].description #=> String
resp.event_types[0].event_variables #=> Array
resp.event_types[0].event_variables[0] #=> String
resp.event_types[0].labels #=> Array
resp.event_types[0].labels[0] #=> String
resp.event_types[0].entity_types #=> Array
resp.event_types[0].entity_types[0] #=> String
resp.event_types[0].last_updated_time #=> String
resp.event_types[0].created_time #=> String
resp.event_types[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (String)

    The name.

  • :next_token (String)

    The next token for the subsequent request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_external_models(options = {}) ⇒ Types::GetExternalModelsResult

Gets the details for one or more Amazon SageMaker models that have been imported into the service. This is a paginated API. If you provide a null maxResults, this actions retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetExternalModelsResult as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_external_models({
  model_endpoint: "string",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.external_models #=> Array
resp.external_models[0].model_endpoint #=> String
resp.external_models[0].model_source #=> String, one of "SAGEMAKER"
resp.external_models[0].invoke_model_endpoint_role_arn #=> String
resp.external_models[0].input_configuration.event_type_name #=> String
resp.external_models[0].input_configuration.format #=> String, one of "TEXT_CSV", "APPLICATION_JSON"
resp.external_models[0].input_configuration.use_event_variables #=> true/false
resp.external_models[0].input_configuration.json_input_template #=> String
resp.external_models[0].input_configuration.csv_input_template #=> String
resp.external_models[0].output_configuration.format #=> String, one of "TEXT_CSV", "APPLICATION_JSONLINES"
resp.external_models[0].output_configuration.json_key_to_variable_map #=> Hash
resp.external_models[0].output_configuration.json_key_to_variable_map["string"] #=> String
resp.external_models[0].output_configuration.csv_index_to_variable_map #=> Hash
resp.external_models[0].output_configuration.csv_index_to_variable_map["string"] #=> String
resp.external_models[0].model_endpoint_status #=> String, one of "ASSOCIATED", "DISSOCIATED"
resp.external_models[0].last_updated_time #=> String
resp.external_models[0].created_time #=> String
resp.external_models[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :model_endpoint (String)

    The Amazon SageMaker model endpoint.

  • :next_token (String)

    The next page token for the request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_kms_encryption_key(options = {}) ⇒ Types::GetKMSEncryptionKeyResult

Gets the encryption key if a Key Management Service (KMS) customer master key (CMK) has been specified to be used to encrypt content in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.get_kms_encryption_key()

Response structure


resp.kms_key.kms_encryption_key_arn #=> String

Returns:

See Also:

#get_labels(options = {}) ⇒ Types::GetLabelsResult

Gets all labels or a specific label if name is provided. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 50 records per page. If you provide a maxResults, the value must be between 10 and 50. To get the next page results, provide the pagination token from the GetGetLabelsResponse as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_labels({
  name: "identifier",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.labels #=> Array
resp.labels[0].name #=> String
resp.labels[0].description #=> String
resp.labels[0].last_updated_time #=> String
resp.labels[0].created_time #=> String
resp.labels[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (String)

    The name of the label or labels to get.

  • :next_token (String)

    The next token for the subsequent request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_model_version(options = {}) ⇒ Types::GetModelVersionResult

Gets the details of the specified model version.

Examples:

Request syntax with placeholder values


resp = client.get_model_version({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  model_version_number: "floatVersionString", # required
})

Response structure


resp.model_id #=> String
resp.model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_version_number #=> String
resp.training_data_source #=> String, one of "EXTERNAL_EVENTS"
resp.training_data_schema.model_variables #=> Array
resp.training_data_schema.model_variables[0] #=> String
resp.training_data_schema.label_schema.label_mapper #=> Hash
resp.training_data_schema.label_schema.label_mapper["string"] #=> Array
resp.training_data_schema.label_schema.label_mapper["string"][0] #=> String
resp.external_events_detail.data_location #=> String
resp.external_events_detail.data_access_role_arn #=> String
resp.status #=> String
resp.arn #=> String

Options Hash (options):

  • :model_id (required, String)

    The model ID.

  • :model_type (required, String)

    The model type.

  • :model_version_number (required, String)

    The model version number.

Returns:

See Also:

#get_models(options = {}) ⇒ Types::GetModelsResult

Gets one or more models. Gets all models for the AWS account if no model type and no model id provided. Gets all models for the AWS account and model type, if the model type is specified but model id is not provided. Gets a specific model if (model type, model id) tuple is specified.

This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 1 and 10. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_models({
  model_id: "modelIdentifier",
  model_type: "ONLINE_FRAUD_INSIGHTS", # accepts ONLINE_FRAUD_INSIGHTS
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.models #=> Array
resp.models[0].model_id #=> String
resp.models[0].model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.models[0].description #=> String
resp.models[0].event_type_name #=> String
resp.models[0].created_time #=> String
resp.models[0].last_updated_time #=> String
resp.models[0].arn #=> String

Options Hash (options):

  • :model_id (String)

    The model ID.

  • :model_type (String)

    The model type.

  • :next_token (String)

    The next token for the subsequent request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_outcomes(options = {}) ⇒ Types::GetOutcomesResult

Gets one or more outcomes. This is a paginated API. If you provide a null maxResults, this actions retrieves a maximum of 100 records per page. If you provide a maxResults, the value must be between 50 and 100. To get the next page results, provide the pagination token from the GetOutcomesResult as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_outcomes({
  name: "identifier",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.outcomes #=> Array
resp.outcomes[0].name #=> String
resp.outcomes[0].description #=> String
resp.outcomes[0].last_updated_time #=> String
resp.outcomes[0].created_time #=> String
resp.outcomes[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (String)

    The name of the outcome or outcomes to get.

  • :next_token (String)

    The next page token for the request.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#get_rules(options = {}) ⇒ Types::GetRulesResult

Get all rules for a detector (paginated) if ruleId and ruleVersion are not specified. Gets all rules for the detector and the ruleId if present (paginated). Gets a specific rule if both the ruleId and the ruleVersion are specified.

This is a paginated API. Providing null maxResults results in retrieving maximum of 100 records per page. If you provide maxResults the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetRulesResult as part of your request. Null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_rules({
  rule_id: "identifier",
  detector_id: "identifier", # required
  rule_version: "wholeNumberVersionString",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.rule_details #=> Array
resp.rule_details[0].rule_id #=> String
resp.rule_details[0].description #=> String
resp.rule_details[0].detector_id #=> String
resp.rule_details[0].rule_version #=> String
resp.rule_details[0].expression #=> String
resp.rule_details[0].language #=> String, one of "DETECTORPL"
resp.rule_details[0].outcomes #=> Array
resp.rule_details[0].outcomes[0] #=> String
resp.rule_details[0].last_updated_time #=> String
resp.rule_details[0].created_time #=> String
resp.rule_details[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :rule_id (String)

    The rule ID.

  • :detector_id (required, String)

    The detector ID.

  • :rule_version (String)

    The rule version.

  • :next_token (String)

    The next page token.

  • :max_results (Integer)

    The maximum number of rules to return for the request.

Returns:

See Also:

#get_variables(options = {}) ⇒ Types::GetVariablesResult

Gets all of the variables or the specific variable. This is a paginated API. Providing null maxSizePerPage results in retrieving maximum of 100 records per page. If you provide maxSizePerPage the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetVariablesResult as part of your request. Null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.get_variables({
  name: "string",
  next_token: "string",
  max_results: 1,
})

Response structure


resp.variables #=> Array
resp.variables[0].name #=> String
resp.variables[0].data_type #=> String, one of "STRING", "INTEGER", "FLOAT", "BOOLEAN"
resp.variables[0].data_source #=> String, one of "EVENT", "MODEL_SCORE", "EXTERNAL_MODEL_SCORE"
resp.variables[0].default_value #=> String
resp.variables[0].description #=> String
resp.variables[0].variable_type #=> String
resp.variables[0].last_updated_time #=> String
resp.variables[0].created_time #=> String
resp.variables[0].arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (String)

    The name of the variable.

  • :next_token (String)

    The next page token of the get variable request.

  • :max_results (Integer)

    The max size per page determined for the get variable request.

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResult

Lists all tags associated with the resource. This is a paginated API. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "fraudDetectorArn", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.next_token #=> String

Options Hash (options):

  • :resource_arn (required, String)

    The ARN that specifies the resource whose tags you want to list.

  • :next_token (String)

    The next token from the previous results.

  • :max_results (Integer)

    The maximum number of objects to return for the request.

Returns:

See Also:

#put_detector(options = {}) ⇒ Struct

Creates or updates a detector.

Examples:

Request syntax with placeholder values


resp = client.put_detector({
  detector_id: "identifier", # required
  description: "description",
  event_type_name: "identifier", # required
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :description (String)

    The description of the detector.

  • :event_type_name (required, String)

    The name of the event type.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_entity_type(options = {}) ⇒ Struct

Creates or updates an entity type. An entity represents who is performing the event. As part of a fraud prediction, you pass the entity ID to indicate the specific entity who performed the event. An entity type classifies the entity. Example classifications include customer, merchant, or account.

Examples:

Request syntax with placeholder values


resp = client.put_entity_type({
  name: "identifier", # required
  description: "description",
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :name (required, String)

    The name of the entity type.

  • :description (String)

    The description.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_event_type(options = {}) ⇒ Struct

Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.

Examples:

Request syntax with placeholder values


resp = client.put_event_type({
  name: "identifier", # required
  description: "description",
  event_variables: ["string"], # required
  labels: ["string"],
  entity_types: ["string"], # required
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :name (required, String)

    The name.

  • :description (String)

    The description of the event type.

  • :event_variables (required, Array<String>)

    The event type variables.

  • :labels (Array<String>)

    The event type labels.

  • :entity_types (required, Array<String>)

    The entity type for the event type. Example entity types: customer, merchant, account.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_external_model(options = {}) ⇒ Struct

Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables.

Examples:

Request syntax with placeholder values


resp = client.put_external_model({
  model_endpoint: "sageMakerEndpointIdentifier", # required
  model_source: "SAGEMAKER", # required, accepts SAGEMAKER
  invoke_model_endpoint_role_arn: "string", # required
  input_configuration: { # required
    event_type_name: "identifier",
    format: "TEXT_CSV", # accepts TEXT_CSV, APPLICATION_JSON
    use_event_variables: false, # required
    json_input_template: "string",
    csv_input_template: "string",
  },
  output_configuration: { # required
    format: "TEXT_CSV", # required, accepts TEXT_CSV, APPLICATION_JSONLINES
    json_key_to_variable_map: {
      "string" => "string",
    },
    csv_index_to_variable_map: {
      "string" => "string",
    },
  },
  model_endpoint_status: "ASSOCIATED", # required, accepts ASSOCIATED, DISSOCIATED
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :model_endpoint (required, String)

    The model endpoints name.

  • :model_source (required, String)

    The source of the model.

  • :invoke_model_endpoint_role_arn (required, String)

    The IAM role used to invoke the model endpoint.

  • :input_configuration (required, Types::ModelInputConfiguration)

    The model endpoint input configuration.

  • :output_configuration (required, Types::ModelOutputConfiguration)

    The model endpoint output configuration.

  • :model_endpoint_status (required, String)

    The model endpoint’s status in Amazon Fraud Detector.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_kms_encryption_key(options = {}) ⇒ Struct

Specifies the Key Management Service (KMS) customer master key (CMK) to be used to encrypt content in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.put_kms_encryption_key({
  kms_encryption_key_arn: "KmsEncryptionKeyArn", # required
})

Options Hash (options):

  • :kms_encryption_key_arn (required, String)

    The KMS encryption key ARN.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_label(options = {}) ⇒ Struct

Creates or updates label. A label classifies an event as fraudulent or legitimate. Labels are associated with event types and used to train supervised machine learning models in Amazon Fraud Detector.

Examples:

Request syntax with placeholder values


resp = client.put_label({
  name: "identifier", # required
  description: "description",
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :name (required, String)

    The label name.

  • :description (String)

    The label description.

  • :tags (Array<Types::Tag>)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_outcome(options = {}) ⇒ Struct

Creates or updates an outcome.

Examples:

Request syntax with placeholder values


resp = client.put_outcome({
  name: "identifier", # required
  description: "description",
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :name (required, String)

    The name of the outcome.

  • :description (String)

    The outcome description.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#tag_resource(options = {}) ⇒ Struct

Assigns tags to a resource.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "fraudDetectorArn", # required
  tags: [ # required
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Options Hash (options):

  • :resource_arn (required, String)

    The resource ARN.

  • :tags (required, Array<Types::Tag>)

    The tags to assign to the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Removes tags from a resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "fraudDetectorArn", # required
  tag_keys: ["tagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The ARN of the resource from which to remove the tag.

  • :tag_keys (required, Array<String>)

    The resource ARN.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_detector_version(options = {}) ⇒ Struct

Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.

Examples:

Request syntax with placeholder values


resp = client.update_detector_version({
  detector_id: "identifier", # required
  detector_version_id: "wholeNumberVersionString", # required
  external_model_endpoints: ["string"], # required
  rules: [ # required
    {
      detector_id: "identifier", # required
      rule_id: "identifier", # required
      rule_version: "wholeNumberVersionString", # required
    },
  ],
  description: "description",
  model_versions: [
    {
      model_id: "modelIdentifier", # required
      model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
      model_version_number: "nonEmptyString", # required
      arn: "fraudDetectorArn",
    },
  ],
  rule_execution_mode: "ALL_MATCHED", # accepts ALL_MATCHED, FIRST_MATCHED
})

Options Hash (options):

  • :detector_id (required, String)

    The parent detector ID for the detector version you want to update.

  • :detector_version_id (required, String)

    The detector version ID.

  • :external_model_endpoints (required, Array<String>)

    The Amazon SageMaker model endpoints to include in the detector version.

  • :rules (required, Array<Types::Rule>)

    The rules to include in the detector version.

  • :description (String)

    The detector version description.

  • :model_versions (Array<Types::ModelVersion>)

    The model versions to include in the detector version.

  • :rule_execution_mode (String)

    The rule execution mode to add to the detector.

    If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.

    If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.

    The default behavior is FIRST_MATCHED.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_detector_version_metadata(options = {}) ⇒ Struct

Updates the detector version's description. You can update the metadata for any detector version (DRAFT, ACTIVE, or INACTIVE).

Examples:

Request syntax with placeholder values


resp = client.({
  detector_id: "identifier", # required
  detector_version_id: "wholeNumberVersionString", # required
  description: "description", # required
})

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :detector_version_id (required, String)

    The detector version ID.

  • :description (required, String)

    The description.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_detector_version_status(options = {}) ⇒ Struct

Updates the detector version’s status. You can perform the following promotions or demotions using UpdateDetectorVersionStatus: DRAFT to ACTIVE, ACTIVE to INACTIVE, and INACTIVE to ACTIVE.

Examples:

Request syntax with placeholder values


resp = client.update_detector_version_status({
  detector_id: "identifier", # required
  detector_version_id: "wholeNumberVersionString", # required
  status: "DRAFT", # required, accepts DRAFT, ACTIVE, INACTIVE
})

Options Hash (options):

  • :detector_id (required, String)

    The detector ID.

  • :detector_version_id (required, String)

    The detector version ID.

  • :status (required, String)

    The new status.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_model(options = {}) ⇒ Struct

Updates a model. You can update the description attribute using this action.

Examples:

Request syntax with placeholder values


resp = client.update_model({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  description: "description",
})

Options Hash (options):

  • :model_id (required, String)

    The model ID.

  • :model_type (required, String)

    The model type.

  • :description (String)

    The new model description.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_model_version(options = {}) ⇒ Types::UpdateModelVersionResult

Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03.

Examples:

Request syntax with placeholder values


resp = client.update_model_version({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  major_version_number: "wholeNumberVersionString", # required
  external_events_detail: {
    data_location: "s3BucketLocation", # required
    data_access_role_arn: "iamRoleArn", # required
  },
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.model_id #=> String
resp.model_type #=> String, one of "ONLINE_FRAUD_INSIGHTS"
resp.model_version_number #=> String
resp.status #=> String

Options Hash (options):

  • :model_id (required, String)

    The model ID.

  • :model_type (required, String)

    The model type.

  • :major_version_number (required, String)

    The major version number.

  • :external_events_detail (Types::ExternalEventsDetail)

    The event details.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs.

Returns:

See Also:

#update_model_version_status(options = {}) ⇒ Struct

Updates the status of a model version.

You can perform the following status updates:

  1. Change the TRAINING_COMPLETE status to ACTIVE.

  2. Change ACTIVEto INACTIVE.

Examples:

Request syntax with placeholder values


resp = client.update_model_version_status({
  model_id: "modelIdentifier", # required
  model_type: "ONLINE_FRAUD_INSIGHTS", # required, accepts ONLINE_FRAUD_INSIGHTS
  model_version_number: "floatVersionString", # required
  status: "ACTIVE", # required, accepts ACTIVE, INACTIVE
})

Options Hash (options):

  • :model_id (required, String)

    The model ID of the model version to update.

  • :model_type (required, String)

    The model type.

  • :model_version_number (required, String)

    The model version number.

  • :status (required, String)

    The model version status.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_rule_metadata(options = {}) ⇒ Struct

Updates a rule's metadata. The description attribute can be updated.

Examples:

Request syntax with placeholder values


resp = client.({
  rule: { # required
    detector_id: "identifier", # required
    rule_id: "identifier", # required
    rule_version: "wholeNumberVersionString", # required
  },
  description: "description", # required
})

Options Hash (options):

  • :rule (required, Types::Rule)

    The rule to update.

  • :description (required, String)

    The rule description.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_rule_version(options = {}) ⇒ Types::UpdateRuleVersionResult

Updates a rule version resulting in a new rule version. Updates a rule version resulting in a new rule version (version 1, 2, 3 ...).

Examples:

Request syntax with placeholder values


resp = client.update_rule_version({
  rule: { # required
    detector_id: "identifier", # required
    rule_id: "identifier", # required
    rule_version: "wholeNumberVersionString", # required
  },
  description: "description",
  expression: "ruleExpression", # required
  language: "DETECTORPL", # required, accepts DETECTORPL
  outcomes: ["string"], # required
  tags: [
    {
      key: "tagKey", # required
      value: "tagValue", # required
    },
  ],
})

Response structure


resp.rule.detector_id #=> String
resp.rule.rule_id #=> String
resp.rule.rule_version #=> String

Options Hash (options):

  • :rule (required, Types::Rule)

    The rule to update.

  • :description (String)

    The description.

  • :expression (required, String)

    The rule expression.

  • :language (required, String)

    The language.

  • :outcomes (required, Array<String>)

    The outcomes.

  • :tags (Array<Types::Tag>)

    The tags to assign to the rule version.

Returns:

See Also:

#update_variable(options = {}) ⇒ Struct

Updates a variable.

Examples:

Request syntax with placeholder values


resp = client.update_variable({
  name: "string", # required
  default_value: "string",
  description: "string",
  variable_type: "string",
})

Options Hash (options):

  • :name (required, String)

    The name of the variable.

  • :default_value (String)

    The new default value of the variable.

  • :description (String)

    The new description.

  • :variable_type (String)

    The variable type. For more information see Variable types.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.