FraudDetector

Table of Contents

Client

class FraudDetector.Client

A low-level client representing Amazon Fraud Detector:

client = session.create_client('frauddetector')

These are the available methods:

batch_create_variable(**kwargs)

Creates a batch of variables.

See also: AWS API Documentation

Request Syntax

response = client.batch_create_variable(
    variableEntries=[
        {
            'name': 'string',
            'dataType': 'string',
            'dataSource': 'string',
            'defaultValue': 'string',
            'description': 'string',
            'variableType': 'string'
        },
    ]
)
Parameters
variableEntries (list) --

[REQUIRED]

The list of variables for the batch create variable request.

  • (dict) --

    The variable entry in a list.

    • name (string) --

      The name of the variable entry.

    • dataType (string) --

      The data type of the variable entry.

    • dataSource (string) --

      The data source of the variable entry.

    • defaultValue (string) --

      The default value of the variable entry.

    • description (string) --

      The description of the variable entry.

    • variableType (string) --

      The type of the variable entry.

Return type
dict
Returns
Response Syntax
{
    'errors': [
        {
            'name': 'string',
            'code': 123,
            'message': 'string'
        },
    ]
}

Response Structure

  • (dict) --
    • errors (list) --

      Provides the errors for the BatchCreateVariable request.

      • (dict) --

        Provides the error of the batch create variable API.

        • name (string) --

          The name.

        • code (integer) --

          The error code.

        • message (string) --

          The error message.

batch_get_variable(**kwargs)

Gets a batch of variables.

See also: AWS API Documentation

Request Syntax

response = client.batch_get_variable(
    names=[
        'string',
    ]
)
Parameters
names (list) --

[REQUIRED]

The list of variable names to get.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'variables': [
        {
            'name': 'string',
            'dataType': 'STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
            'dataSource': 'EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
            'defaultValue': 'string',
            'description': 'string',
            'variableType': 'string',
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'errors': [
        {
            'name': 'string',
            'code': 123,
            'message': 'string'
        },
    ]
}

Response Structure

  • (dict) --
    • variables (list) --

      The returned variables.

      • (dict) --

        The variable.

        • name (string) --

          The name of the variable.

        • dataType (string) --

          The data type of the variable.

        • dataSource (string) --

          The data source of the variable.

        • defaultValue (string) --

          The default value of the variable.

        • description (string) --

          The description of the variable.

        • variableType (string) --

          The variable type of the variable.

        • lastUpdatedTime (string) --

          The time when variable was last updated.

        • createdTime (string) --

          The time when the variable was created.

    • errors (list) --

      The errors from the request.

      • (dict) --

        Provides the error of the batch get variable API.

        • name (string) --

          The error name.

        • code (integer) --

          The error code.

        • message (string) --

          The error message.

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_detector_version(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.create_detector_version(
    detectorId='string',
    description='string',
    externalModelEndpoints=[
        'string',
    ],
    rules=[
        {
            'detectorId': 'string',
            'ruleId': 'string',
            'ruleVersion': 'string'
        },
    ],
    modelVersions=[
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS',
            'modelVersionNumber': 'string'
        },
    ]
)
Parameters
  • detectorId (string) --

    [REQUIRED]

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

  • description (string) -- The description of the detector version.
  • externalModelEndpoints (list) --

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

    • (string) --
  • rules (list) --

    [REQUIRED]

    The rules to include in the detector version.

    • (dict) --

      A rule.

      • detectorId (string) -- [REQUIRED]

        The detector for which the rule is associated.

      • ruleId (string) -- [REQUIRED]

        The rule ID.

      • ruleVersion (string) -- [REQUIRED]

        The rule version.

  • modelVersions (list) --

    The model versions to include in the detector version.

    • (dict) --

      The model version.

      • modelId (string) -- [REQUIRED]

        The parent model ID.

      • modelType (string) -- [REQUIRED]

        The model type.

      • modelVersionNumber (string) -- [REQUIRED]

        The model version.

Return type

dict

Returns

Response Syntax

{
    'detectorId': 'string',
    'detectorVersionId': 'string',
    'status': 'DRAFT'|'ACTIVE'|'INACTIVE'
}

Response Structure

  • (dict) --

    • detectorId (string) --

      The ID for the created version's parent detector.

    • detectorVersionId (string) --

      The ID for the created detector.

    • status (string) --

      The status of the detector version.

create_model_version(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.create_model_version(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    description='string'
)
Parameters
  • modelId (string) --

    [REQUIRED]

    The model ID.

  • modelType (string) --

    [REQUIRED]

    The model type.

  • description (string) -- The model version description.
Return type

dict

Returns

Response Syntax

{
    'modelId': 'string',
    'modelType': 'ONLINE_FRAUD_INSIGHTS',
    'modelVersionNumber': 'string',
    'status': 'string'
}

Response Structure

  • (dict) --

    • modelId (string) --

      The model ID.

    • modelType (string) --

      The model type.

    • modelVersionNumber (string) --

      The version of the model.

    • status (string) --

      The model version status.

create_rule(**kwargs)

Creates a rule for use with the specified detector.

See also: AWS API Documentation

Request Syntax

response = client.create_rule(
    ruleId='string',
    detectorId='string',
    description='string',
    expression='string',
    language='DETECTORPL',
    outcomes=[
        'string',
    ]
)
Parameters
  • ruleId (string) --

    [REQUIRED]

    The rule ID.

  • detectorId (string) --

    [REQUIRED]

    The detector ID for the rule's parent detector.

  • description (string) -- The rule description.
  • expression (string) --

    [REQUIRED]

    The rule expression.

  • language (string) --

    [REQUIRED]

    The language of the rule.

  • outcomes (list) --

    [REQUIRED]

    The outcome or outcomes returned when the rule expression matches.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'rule': {
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    }
}

Response Structure

  • (dict) --

    • rule (dict) --

      The created rule.

      • detectorId (string) --

        The detector for which the rule is associated.

      • ruleId (string) --

        The rule ID.

      • ruleVersion (string) --

        The rule version.

create_variable(**kwargs)

Creates a variable.

See also: AWS API Documentation

Request Syntax

response = client.create_variable(
    name='string',
    dataType='STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
    dataSource='EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
    defaultValue='string',
    description='string',
    variableType='string'
)
Parameters
  • name (string) --

    [REQUIRED]

    The name of the variable.

  • dataType (string) --

    [REQUIRED]

    The data type.

  • dataSource (string) --

    [REQUIRED]

    The source of the data.

  • defaultValue (string) --

    [REQUIRED]

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

  • description (string) -- The description.
  • variableType (string) -- The variable type.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

delete_detector_version(**kwargs)

Deletes the detector version.

See also: AWS API Documentation

Request Syntax

response = client.delete_detector_version(
    detectorId='string',
    detectorVersionId='string'
)
Parameters
  • detectorId (string) --

    [REQUIRED]

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

  • detectorVersionId (string) --

    [REQUIRED]

    The ID of the detector version to delete.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

delete_event(**kwargs)

Deletes the specified event.

See also: AWS API Documentation

Request Syntax

response = client.delete_event(
    eventId='string'
)
Parameters
eventId (string) --

[REQUIRED]

The ID of the event to delete.

Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) --
describe_detector(**kwargs)

Gets all versions for a specified detector.

See also: AWS API Documentation

Request Syntax

response = client.describe_detector(
    detectorId='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • nextToken (string) -- The next token from the previous response.
  • maxResults (integer) -- The maximum number of results to return for the request.
Return type

dict

Returns

Response Syntax

{
    'detectorId': 'string',
    'detectorVersionSummaries': [
        {
            'detectorVersionId': 'string',
            'status': 'DRAFT'|'ACTIVE'|'INACTIVE',
            'description': 'string',
            'lastUpdatedTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • detectorId (string) --

      The detector ID.

    • detectorVersionSummaries (list) --

      The status and description for each detector version.

      • (dict) --

        The summary of the detector version.

        • detectorVersionId (string) --

          The detector version ID.

        • status (string) --

          The detector version status.

        • description (string) --

          The detector version description.

        • lastUpdatedTime (string) --

          Timestamp of when the detector version was last updated.

    • nextToken (string) --

      The next token to be used for subsequent requests.

describe_model_versions(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.describe_model_versions(
    modelId='string',
    modelVersionNumber='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    nextToken='string',
    maxResults=123
)
Parameters
  • modelId (string) -- The model ID.
  • modelVersionNumber (string) -- The model version.
  • modelType (string) -- The model type.
  • nextToken (string) -- The next token from the previous results.
  • maxResults (integer) -- The maximum number of results to return.
Return type

dict

Returns

Response Syntax

{
    'modelVersionDetails': [
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS',
            'modelVersionNumber': 'string',
            'description': 'string',
            'status': 'string',
            'trainingDataSource': {
                'dataLocation': 'string',
                'dataAccessRoleArn': 'string'
            },
            'modelVariables': [
                {
                    'name': 'string',
                    'index': 123
                },
            ],
            'labelSchema': {
                'labelKey': 'string',
                'labelMapper': {
                    'string': [
                        'string',
                    ]
                }
            },
            'validationMetrics': {
                'string': 'string'
            },
            'trainingMetrics': {
                'string': 'string'
            },
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • modelVersionDetails (list) --

      The model version details.

      • (dict) --

        Provides the model version details.

        • modelId (string) --

          The model ID.

        • modelType (string) --

          The model type.

        • modelVersionNumber (string) --

          The model version.

        • description (string) --

          The model description.

        • status (string) --

          The model status.

        • trainingDataSource (dict) --

          The model training data source.

          • dataLocation (string) --

            The data location of the training data source.

          • dataAccessRoleArn (string) --

            The data access role ARN for the training data source.

        • modelVariables (list) --

          The model variables.

          • (dict) --

            The model variable.>

            • name (string) --

              The model variable's name.>

            • index (integer) --

              The model variable's index.>

        • labelSchema (dict) --

          The model label schema.

          • labelKey (string) --

            The label key.

          • labelMapper (dict) --

            The label mapper maps the Amazon Fraud Detector supported label to the appropriate source labels. For example, if "FRAUD" and "LEGIT" are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"], "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"], "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple variants for a single Amazon Fraud Detector label.

            • (string) --
              • (list) --
                • (string) --
        • validationMetrics (dict) --

          The model validation metrics.

          • (string) --
            • (string) --
        • trainingMetrics (dict) --

          The model training metrics.

          • (string) --
            • (string) --
        • lastUpdatedTime (string) --

          The timestamp when the model was last updated.

        • createdTime (string) --

          The timestamp when the model was created.

    • nextToken (string) --

      The next token.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_detector_version(**kwargs)

Gets a particular detector version.

See also: AWS API Documentation

Request Syntax

response = client.get_detector_version(
    detectorId='string',
    detectorVersionId='string'
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • detectorVersionId (string) --

    [REQUIRED]

    The detector version ID.

Return type

dict

Returns

Response Syntax

{
    'detectorId': 'string',
    'detectorVersionId': 'string',
    'description': 'string',
    'externalModelEndpoints': [
        'string',
    ],
    'modelVersions': [
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS',
            'modelVersionNumber': 'string'
        },
    ],
    'rules': [
        {
            'detectorId': 'string',
            'ruleId': 'string',
            'ruleVersion': 'string'
        },
    ],
    'status': 'DRAFT'|'ACTIVE'|'INACTIVE',
    'lastUpdatedTime': 'string',
    'createdTime': 'string'
}

Response Structure

  • (dict) --

    • detectorId (string) --

      The detector ID.

    • detectorVersionId (string) --

      The detector version ID.

    • description (string) --

      The detector version description.

    • externalModelEndpoints (list) --

      The Amazon SageMaker model endpoints included in the detector version.

      • (string) --
    • modelVersions (list) --

      The model versions included in the detector version.

      • (dict) --

        The model version.

        • modelId (string) --

          The parent model ID.

        • modelType (string) --

          The model type.

        • modelVersionNumber (string) --

          The model version.

    • rules (list) --

      The rules included in the detector version.

      • (dict) --

        A rule.

        • detectorId (string) --

          The detector for which the rule is associated.

        • ruleId (string) --

          The rule ID.

        • ruleVersion (string) --

          The rule version.

    • status (string) --

      The status of the detector version.

    • lastUpdatedTime (string) --

      The timestamp when the detector version was last updated.

    • createdTime (string) --

      The timestamp when the detector version was created.

get_detectors(**kwargs)

Gets all of detectors. This is a paginated API. If you provide a null maxSizePerPage , this actions retrieves a maximum of 10 records per page. If you provide a maxSizePerPage , 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.

See also: AWS API Documentation

Request Syntax

response = client.get_detectors(
    detectorId='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • detectorId (string) -- The detector ID.
  • nextToken (string) -- The next token for the subsequent request.
  • maxResults (integer) -- The maximum number of objects to return for the request.
Return type

dict

Returns

Response Syntax

{
    'detectors': [
        {
            'detectorId': 'string',
            'description': 'string',
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • detectors (list) --

      The detectors.

      • (dict) --

        The detector.

        • detectorId (string) --

          The detector ID.

        • description (string) --

          The detector description.

        • lastUpdatedTime (string) --

          Timestamp of when the detector was last updated.

        • createdTime (string) --

          Timestamp of when the detector was created.

    • nextToken (string) --

      The next page token.

get_external_models(**kwargs)

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 maxSizePerPage , this actions retrieves a maximum of 10 records per page. If you provide a maxSizePerPage , 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.

See also: AWS API Documentation

Request Syntax

response = client.get_external_models(
    modelEndpoint='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • modelEndpoint (string) -- The Amazon SageMaker model endpoint.
  • nextToken (string) -- The next page token for the request.
  • maxResults (integer) -- The maximum number of objects to return for the request.
Return type

dict

Returns

Response Syntax

{
    'externalModels': [
        {
            'modelEndpoint': 'string',
            'modelSource': 'SAGEMAKER',
            'role': {
                'arn': 'string',
                'name': 'string'
            },
            'inputConfiguration': {
                'format': 'TEXT_CSV'|'APPLICATION_JSON',
                'isOpaque': True|False,
                'jsonInputTemplate': 'string',
                'csvInputTemplate': 'string'
            },
            'outputConfiguration': {
                'format': 'TEXT_CSV'|'APPLICATION_JSONLINES',
                'jsonKeyToVariableMap': {
                    'string': 'string'
                },
                'csvIndexToVariableMap': {
                    'string': 'string'
                }
            },
            'modelEndpointStatus': 'ASSOCIATED'|'DISSOCIATED',
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • externalModels (list) --

      Gets the Amazon SageMaker models.

      • (dict) --

        The Amazon SageMaker model.

        • modelEndpoint (string) --

          The Amazon SageMaker model endpoints.

        • modelSource (string) --

          The source of the model.

        • role (dict) --

          The role used to invoke the model.

          • arn (string) --

            The role ARN.

          • name (string) --

            The role name.

        • inputConfiguration (dict) --

          The input configuration.

          • format (string) --

            The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector.

          • isOpaque (boolean) --

            For an opaque-model, the input to the model will be a ByteBuffer blob provided in the getPrediction request, and will be passed to SageMaker as-is. For non-opaque models, the input will be constructed by Amazon Fraud Detector based on the model-configuration.

          • jsonInputTemplate (string) --

            Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker.

          • csvInputTemplate (string) --

            Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker.

        • outputConfiguration (dict) --

          The output configuration.

          • format (string) --

            The format of the model output configuration.

          • jsonKeyToVariableMap (dict) --

            A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables.

            • (string) --
              • (string) --
          • csvIndexToVariableMap (dict) --

            A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables.

            • (string) --
              • (string) --
        • modelEndpointStatus (string) --

          The Amazon Fraud Detector status for the external model endpoint

        • lastUpdatedTime (string) --

          Timestamp of when the model was last updated.

        • createdTime (string) --

          Timestamp of when the model was last created.

    • nextToken (string) --

      The next page token to be used in subsequent requests.

get_model_version(**kwargs)

Gets a model version.

See also: AWS API Documentation

Request Syntax

response = client.get_model_version(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    modelVersionNumber='string'
)
Parameters
  • modelId (string) --

    [REQUIRED]

    The model ID.

  • modelType (string) --

    [REQUIRED]

    The model type.

  • modelVersionNumber (string) --

    [REQUIRED]

    The model version.

Return type

dict

Returns

Response Syntax

{
    'modelId': 'string',
    'modelType': 'ONLINE_FRAUD_INSIGHTS',
    'modelVersionNumber': 'string',
    'description': 'string',
    'status': 'string'
}

Response Structure

  • (dict) --

    • modelId (string) --

      The model ID.

    • modelType (string) --

      The model type.

    • modelVersionNumber (string) --

      The model version.

    • description (string) --

      The model version description.

    • status (string) --

      The model version status.

get_models(**kwargs)

Gets all of the models for the AWS account, or the specified model type, or gets a single model for the specified model type, model ID combination.

See also: AWS API Documentation

Request Syntax

response = client.get_models(
    modelType='ONLINE_FRAUD_INSIGHTS',
    modelId='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • modelType (string) -- The model type.
  • modelId (string) -- The model ID.
  • nextToken (string) -- The next token for the request.
  • maxResults (integer) -- The maximum results to return for the request.
Return type

dict

Returns

Response Syntax

{
    'nextToken': 'string',
    'models': [
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS',
            'description': 'string',
            'trainingDataSource': {
                'dataLocation': 'string',
                'dataAccessRoleArn': 'string'
            },
            'modelVariables': [
                {
                    'name': 'string',
                    'index': 123
                },
            ],
            'labelSchema': {
                'labelKey': 'string',
                'labelMapper': {
                    'string': [
                        'string',
                    ]
                }
            },
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      The next token for subsequent requests.

    • models (list) --

      The returned models.

      • (dict) --

        The model.

        • modelId (string) --

          The model ID.

        • modelType (string) --

          The model type.

        • description (string) --

          The model description.

        • trainingDataSource (dict) --

          The model training data source in Amazon S3.

          • dataLocation (string) --

            The data location of the training data source.

          • dataAccessRoleArn (string) --

            The data access role ARN for the training data source.

        • modelVariables (list) --

          The model input variables.

          • (dict) --

            The model variable.>

            • name (string) --

              The model variable's name.>

            • index (integer) --

              The model variable's index.>

        • labelSchema (dict) --

          The model label schema.

          • labelKey (string) --

            The label key.

          • labelMapper (dict) --

            The label mapper maps the Amazon Fraud Detector supported label to the appropriate source labels. For example, if "FRAUD" and "LEGIT" are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"], "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"], "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple variants for a single Amazon Fraud Detector label.

            • (string) --
              • (list) --
                • (string) --
        • lastUpdatedTime (string) --

          Timestamp of last time the model was updated.

        • createdTime (string) --

          Timestamp of when the model was created.

get_outcomes(**kwargs)

Gets one or more outcomes. This is a paginated API. If you provide a null maxSizePerPage , this actions retrieves a maximum of 10 records per page. If you provide a maxSizePerPage , 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.

See also: AWS API Documentation

Request Syntax

response = client.get_outcomes(
    name='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • name (string) -- The name of the outcome or outcomes to get.
  • nextToken (string) -- The next page token for the request.
  • maxResults (integer) -- The maximum number of objects to return for the request.
Return type

dict

Returns

Response Syntax

{
    'outcomes': [
        {
            'name': 'string',
            'description': 'string',
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • outcomes (list) --

      The outcomes.

      • (dict) --

        The outcome.

        • name (string) --

          The outcome name.

        • description (string) --

          The outcome description.

        • lastUpdatedTime (string) --

          The timestamp when the outcome was last updated.

        • createdTime (string) --

          The timestamp when the outcome was created.

    • nextToken (string) --

      The next page token for subsequent requests.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_prediction(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.get_prediction(
    detectorId='string',
    detectorVersionId='string',
    eventId='string',
    eventAttributes={
        'string': 'string'
    },
    externalModelEndpointDataBlobs={
        'string': {
            'byteBuffer': b'bytes',
            'contentType': 'string'
        }
    }
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • detectorVersionId (string) -- The detector version ID.
  • eventId (string) --

    [REQUIRED]

    The unique ID used to identify the event.

  • eventAttributes (dict) --

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

    • (string) --
      • (string) --
  • externalModelEndpointDataBlobs (dict) --

    The Amazon SageMaker model endpoint input data blobs.

    • (string) --
      • (dict) --

        A pre-formed Amazon SageMaker model input you can include if your detector version includes an imported Amazon SageMaker model endpoint with pass-through input configuration.

        • byteBuffer (bytes) --

          The byte buffer of the Amazon SageMaker model endpoint input data blob.

        • contentType (string) --

          The content type of the Amazon SageMaker model endpoint input data blob.

Return type

dict

Returns

Response Syntax

{
    'outcomes': [
        'string',
    ],
    'modelScores': [
        {
            'modelVersion': {
                'modelId': 'string',
                'modelType': 'ONLINE_FRAUD_INSIGHTS',
                'modelVersionNumber': 'string'
            },
            'scores': {
                'string': ...
            }
        },
    ]
}

Response Structure

  • (dict) --

    • outcomes (list) --

      The prediction outcomes.

      • (string) --
    • modelScores (list) --

      The model scores for models used in the detector version.

      • (dict) --

        The fraud prediction scores.

        • modelVersion (dict) --

          The model version.

          • modelId (string) --

            The parent model ID.

          • modelType (string) --

            The model type.

          • modelVersionNumber (string) --

            The model version.

        • scores (dict) --

          The model's fraud prediction scores.

          • (string) --
            • (float) --

get_rules(**kwargs)

Gets all rules available for the specified detector.

See also: AWS API Documentation

Request Syntax

response = client.get_rules(
    ruleId='string',
    detectorId='string',
    ruleVersion='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • ruleId (string) -- The rule ID.
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • ruleVersion (string) -- The rule version.
  • nextToken (string) -- The next page token.
  • maxResults (integer) -- The maximum number of rules to return for the request.
Return type

dict

Returns

Response Syntax

{
    'ruleDetails': [
        {
            'ruleId': 'string',
            'description': 'string',
            'detectorId': 'string',
            'ruleVersion': 'string',
            'expression': 'string',
            'language': 'DETECTORPL',
            'outcomes': [
                'string',
            ],
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • ruleDetails (list) --

      The details of the requested rule.

      • (dict) --

        The details of the rule.

        • ruleId (string) --

          The rule ID.

        • description (string) --

          The rule description.

        • detectorId (string) --

          The detector for which the rule is associated.

        • ruleVersion (string) --

          The rule version.

        • expression (string) --

          The rule expression.

        • language (string) --

          The rule language.

        • outcomes (list) --

          The rule outcomes.

          • (string) --
        • lastUpdatedTime (string) --

          Timestamp of the last time the rule was updated.

        • createdTime (string) --

          The timestamp of when the rule was created.

    • nextToken (string) --

      The next page token to be used in subsequent requests.

get_variables(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.get_variables(
    name='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • name (string) -- The name of the variable.
  • nextToken (string) -- The next page token of the get variable request.
  • maxResults (integer) -- The max size per page determined for the get variable request.
Return type

dict

Returns

Response Syntax

{
    'variables': [
        {
            'name': 'string',
            'dataType': 'STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
            'dataSource': 'EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
            'defaultValue': 'string',
            'description': 'string',
            'variableType': 'string',
            'lastUpdatedTime': 'string',
            'createdTime': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • variables (list) --

      The names of the variables returned.

      • (dict) --

        The variable.

        • name (string) --

          The name of the variable.

        • dataType (string) --

          The data type of the variable.

        • dataSource (string) --

          The data source of the variable.

        • defaultValue (string) --

          The default value of the variable.

        • description (string) --

          The description of the variable.

        • variableType (string) --

          The variable type of the variable.

        • lastUpdatedTime (string) --

          The time when variable was last updated.

        • createdTime (string) --

          The time when the variable was created.

    • nextToken (string) --

      The next page token to be used in subsequent requests.

get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
put_detector(**kwargs)

Creates or updates a detector.

See also: AWS API Documentation

Request Syntax

response = client.put_detector(
    detectorId='string',
    description='string'
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • description (string) -- The description of the detector.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

put_external_model(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.put_external_model(
    modelEndpoint='string',
    modelSource='SAGEMAKER',
    role={
        'arn': 'string',
        'name': 'string'
    },
    inputConfiguration={
        'format': 'TEXT_CSV'|'APPLICATION_JSON',
        'isOpaque': True|False,
        'jsonInputTemplate': 'string',
        'csvInputTemplate': 'string'
    },
    outputConfiguration={
        'format': 'TEXT_CSV'|'APPLICATION_JSONLINES',
        'jsonKeyToVariableMap': {
            'string': 'string'
        },
        'csvIndexToVariableMap': {
            'string': 'string'
        }
    },
    modelEndpointStatus='ASSOCIATED'|'DISSOCIATED'
)
Parameters
  • modelEndpoint (string) --

    [REQUIRED]

    The model endpoints name.

  • modelSource (string) --

    [REQUIRED]

    The source of the model.

  • role (dict) --

    [REQUIRED]

    The IAM role used to invoke the model endpoint.

    • arn (string) -- [REQUIRED]

      The role ARN.

    • name (string) -- [REQUIRED]

      The role name.

  • inputConfiguration (dict) --

    [REQUIRED]

    The model endpoint input configuration.

    • format (string) --

      The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector.

    • isOpaque (boolean) -- [REQUIRED]

      For an opaque-model, the input to the model will be a ByteBuffer blob provided in the getPrediction request, and will be passed to SageMaker as-is. For non-opaque models, the input will be constructed by Amazon Fraud Detector based on the model-configuration.

    • jsonInputTemplate (string) --

      Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker.

    • csvInputTemplate (string) --

      Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker.

  • outputConfiguration (dict) --

    [REQUIRED]

    The model endpoint output configuration.

    • format (string) -- [REQUIRED]

      The format of the model output configuration.

    • jsonKeyToVariableMap (dict) --

      A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables.

      • (string) --
        • (string) --
    • csvIndexToVariableMap (dict) --

      A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables.

      • (string) --
        • (string) --
  • modelEndpointStatus (string) --

    [REQUIRED]

    The model endpoint’s status in Amazon Fraud Detector.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

put_model(**kwargs)

Creates or updates a model.

See also: AWS API Documentation

Request Syntax

response = client.put_model(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    description='string',
    trainingDataSource={
        'dataLocation': 'string',
        'dataAccessRoleArn': 'string'
    },
    modelVariables=[
        {
            'name': 'string',
            'index': 123
        },
    ],
    labelSchema={
        'labelKey': 'string',
        'labelMapper': {
            'string': [
                'string',
            ]
        }
    }
)
Parameters
  • modelId (string) --

    [REQUIRED]

    The model ID.

  • modelType (string) --

    [REQUIRED]

    The model type.

  • description (string) -- The model description.
  • trainingDataSource (dict) --

    [REQUIRED]

    The training data source location in Amazon S3.

    • dataLocation (string) -- [REQUIRED]

      The data location of the training data source.

    • dataAccessRoleArn (string) -- [REQUIRED]

      The data access role ARN for the training data source.

  • modelVariables (list) --

    [REQUIRED]

    The model input variables.

    • (dict) --

      The model variable.>

      • name (string) -- [REQUIRED]

        The model variable's name.>

      • index (integer) --

        The model variable's index.>

  • labelSchema (dict) --

    [REQUIRED]

    The label schema.

    • labelKey (string) -- [REQUIRED]

      The label key.

    • labelMapper (dict) -- [REQUIRED]

      The label mapper maps the Amazon Fraud Detector supported label to the appropriate source labels. For example, if "FRAUD" and "LEGIT" are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"], "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"], "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple variants for a single Amazon Fraud Detector label.

      • (string) --
        • (list) --
          • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

put_outcome(**kwargs)

Creates or updates an outcome.

See also: AWS API Documentation

Request Syntax

response = client.put_outcome(
    name='string',
    description='string'
)
Parameters
  • name (string) --

    [REQUIRED]

    The name of the outcome.

  • description (string) -- The outcome description.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_detector_version(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.update_detector_version(
    detectorId='string',
    detectorVersionId='string',
    externalModelEndpoints=[
        'string',
    ],
    rules=[
        {
            'detectorId': 'string',
            'ruleId': 'string',
            'ruleVersion': 'string'
        },
    ],
    description='string',
    modelVersions=[
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS',
            'modelVersionNumber': 'string'
        },
    ]
)
Parameters
  • detectorId (string) --

    [REQUIRED]

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

  • detectorVersionId (string) --

    [REQUIRED]

    The detector version ID.

  • externalModelEndpoints (list) --

    [REQUIRED]

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

    • (string) --
  • rules (list) --

    [REQUIRED]

    The rules to include in the detector version.

    • (dict) --

      A rule.

      • detectorId (string) -- [REQUIRED]

        The detector for which the rule is associated.

      • ruleId (string) -- [REQUIRED]

        The rule ID.

      • ruleVersion (string) -- [REQUIRED]

        The rule version.

  • description (string) -- The detector version description.
  • modelVersions (list) --

    The model versions to include in the detector version.

    • (dict) --

      The model version.

      • modelId (string) -- [REQUIRED]

        The parent model ID.

      • modelType (string) -- [REQUIRED]

        The model type.

      • modelVersionNumber (string) -- [REQUIRED]

        The model version.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_detector_version_metadata(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.update_detector_version_metadata(
    detectorId='string',
    detectorVersionId='string',
    description='string'
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • detectorVersionId (string) --

    [REQUIRED]

    The detector version ID.

  • description (string) --

    [REQUIRED]

    The description.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_detector_version_status(**kwargs)

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 .

See also: AWS API Documentation

Request Syntax

response = client.update_detector_version_status(
    detectorId='string',
    detectorVersionId='string',
    status='DRAFT'|'ACTIVE'|'INACTIVE'
)
Parameters
  • detectorId (string) --

    [REQUIRED]

    The detector ID.

  • detectorVersionId (string) --

    [REQUIRED]

    The detector version ID.

  • status (string) --

    [REQUIRED]

    The new status.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_model_version(**kwargs)

Updates a model version. You can update the description and status attributes using this action. You can perform the following status updates:

  • Change the TRAINING_COMPLETE status to ACTIVE
  • Change ACTIVE back to TRAINING_COMPLETE

See also: AWS API Documentation

Request Syntax

response = client.update_model_version(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    modelVersionNumber='string',
    description='string',
    status='TRAINING_IN_PROGRESS'|'TRAINING_COMPLETE'|'ACTIVATE_REQUESTED'|'ACTIVATE_IN_PROGRESS'|'ACTIVE'|'INACTIVATE_IN_PROGRESS'|'INACTIVE'|'ERROR'
)
Parameters
  • modelId (string) --

    [REQUIRED]

    The model ID.

  • modelType (string) --

    [REQUIRED]

    The model type.

  • modelVersionNumber (string) --

    [REQUIRED]

    The model version.

  • description (string) --

    [REQUIRED]

    The model description.

  • status (string) --

    [REQUIRED]

    The new model status.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_rule_metadata(**kwargs)

Updates a rule's metadata.

See also: AWS API Documentation

Request Syntax

response = client.update_rule_metadata(
    rule={
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    },
    description='string'
)
Parameters
  • rule (dict) --

    [REQUIRED]

    The rule to update.

    • detectorId (string) -- [REQUIRED]

      The detector for which the rule is associated.

    • ruleId (string) -- [REQUIRED]

      The rule ID.

    • ruleVersion (string) -- [REQUIRED]

      The rule version.

  • description (string) --

    [REQUIRED]

    The rule description.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_rule_version(**kwargs)

Updates a rule version resulting in a new rule version.

See also: AWS API Documentation

Request Syntax

response = client.update_rule_version(
    rule={
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    },
    description='string',
    expression='string',
    language='DETECTORPL',
    outcomes=[
        'string',
    ]
)
Parameters
  • rule (dict) --

    [REQUIRED]

    The rule to update.

    • detectorId (string) -- [REQUIRED]

      The detector for which the rule is associated.

    • ruleId (string) -- [REQUIRED]

      The rule ID.

    • ruleVersion (string) -- [REQUIRED]

      The rule version.

  • description (string) -- The description.
  • expression (string) --

    [REQUIRED]

    The rule expression.

  • language (string) --

    [REQUIRED]

    The language.

  • outcomes (list) --

    [REQUIRED]

    The outcomes.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'rule': {
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    }
}

Response Structure

  • (dict) --

    • rule (dict) --

      The new rule version that was created.

      • detectorId (string) --

        The detector for which the rule is associated.

      • ruleId (string) --

        The rule ID.

      • ruleVersion (string) --

        The rule version.

update_variable(**kwargs)

Updates a variable.

See also: AWS API Documentation

Request Syntax

response = client.update_variable(
    name='string',
    defaultValue='string',
    description='string',
    variableType='string'
)
Parameters
  • name (string) --

    [REQUIRED]

    The name of the variable.

  • defaultValue (string) -- The new default value of the variable.
  • description (string) -- The new description.
  • variableType (string) -- The variable type.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Paginators

The available paginators are: