Amazon Fraud Detector

2019/12/03 - Amazon Fraud Detector - 30 new api methods

Changes  Update frauddetector client to latest version

DeleteDetectorVersion (new) Link ¶

Deletes the detector version.

See also: AWS API Documentation

Request Syntax

client.delete_detector_version(
    detectorId='string',
    detectorVersionId='string'
)
type detectorId:

string

param detectorId:

[REQUIRED]

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

type detectorVersionId:

string

param detectorVersionId:

[REQUIRED]

The ID of the detector version to delete.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeDetector (new) Link ¶

Gets all versions for a specified detector.

See also: AWS API Documentation

Request Syntax

client.describe_detector(
    detectorId='string',
    nextToken='string',
    maxResults=123
)
type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type nextToken:

string

param nextToken:

The next token from the previous response.

type maxResults:

integer

param maxResults:

The maximum number of results to return for the request.

rtype:

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.

GetExternalModels (new) Link ¶

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

client.get_external_models(
    modelEndpoint='string',
    nextToken='string',
    maxResults=123
)
type modelEndpoint:

string

param modelEndpoint:

The Amazon SageMaker model endpoint.

type nextToken:

string

param nextToken:

The next page token for the request.

type maxResults:

integer

param maxResults:

The maximum number of objects to return for the request.

rtype:

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.

UpdateRuleVersion (new) Link ¶

Updates a rule version resulting in a new rule version.

See also: AWS API Documentation

Request Syntax

client.update_rule_version(
    rule={
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    },
    description='string',
    expression='string',
    language='DETECTORPL',
    outcomes=[
        'string',
    ]
)
type rule:

dict

param rule:

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

type description:

string

param description:

The description.

type expression:

string

param expression:

[REQUIRED]

The rule expression.

type language:

string

param language:

[REQUIRED]

The language.

type outcomes:

list

param outcomes:

[REQUIRED]

The outcomes.

  • (string) --

rtype:

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.

PutExternalModel (new) Link ¶

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

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'
)
type modelEndpoint:

string

param modelEndpoint:

[REQUIRED]

The model endpoints name.

type modelSource:

string

param modelSource:

[REQUIRED]

The source of the model.

type role:

dict

param role:

[REQUIRED]

The IAM role used to invoke the model endpoint.

  • arn (string) -- [REQUIRED]

    The role ARN.

  • name (string) -- [REQUIRED]

    The role name.

type inputConfiguration:

dict

param inputConfiguration:

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

type outputConfiguration:

dict

param outputConfiguration:

[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) --

type modelEndpointStatus:

string

param modelEndpointStatus:

[REQUIRED]

The model endpoint’s status in Amazon Fraud Detector.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

BatchCreateVariable (new) Link ¶

Creates a batch of variables.

See also: AWS API Documentation

Request Syntax

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

list

param variableEntries:

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

rtype:

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.

CreateModelVersion (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_model_version(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    description='string'
)
type modelId:

string

param modelId:

[REQUIRED]

The model ID.

type modelType:

string

param modelType:

[REQUIRED]

The model type.

type description:

string

param description:

The model version description.

rtype:

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.

GetDetectorVersion (new) Link ¶

Gets a particular detector version.

See also: AWS API Documentation

Request Syntax

client.get_detector_version(
    detectorId='string',
    detectorVersionId='string'
)
type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type detectorVersionId:

string

param detectorVersionId:

[REQUIRED]

The detector version ID.

rtype:

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.

UpdateDetectorVersion (new) Link ¶

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

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'
        },
    ]
)
type detectorId:

string

param detectorId:

[REQUIRED]

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

type detectorVersionId:

string

param detectorVersionId:

[REQUIRED]

The detector version ID.

type externalModelEndpoints:

list

param externalModelEndpoints:

[REQUIRED]

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

  • (string) --

type rules:

list

param rules:

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

type description:

string

param description:

The detector version description.

type modelVersions:

list

param modelVersions:

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.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateDetectorVersion (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

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'
        },
    ]
)
type detectorId:

string

param detectorId:

[REQUIRED]

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

type description:

string

param description:

The description of the detector version.

type externalModelEndpoints:

list

param externalModelEndpoints:

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

  • (string) --

type rules:

list

param rules:

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

type modelVersions:

list

param modelVersions:

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.

rtype:

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.

CreateVariable (new) Link ¶

Creates a variable.

See also: AWS API Documentation

Request Syntax

client.create_variable(
    name='string',
    dataType='STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
    dataSource='EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
    defaultValue='string',
    description='string',
    variableType='string'
)
type name:

string

param name:

[REQUIRED]

The name of the variable.

type dataType:

string

param dataType:

[REQUIRED]

The data type.

type dataSource:

string

param dataSource:

[REQUIRED]

The source of the data.

type defaultValue:

string

param defaultValue:

[REQUIRED]

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

type description:

string

param description:

The description.

type variableType:

string

param variableType:

The variable type.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

GetModels (new) Link ¶

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

client.get_models(
    modelType='ONLINE_FRAUD_INSIGHTS',
    modelId='string',
    nextToken='string',
    maxResults=123
)
type modelType:

string

param modelType:

The model type.

type modelId:

string

param modelId:

The model ID.

type nextToken:

string

param nextToken:

The next token for the request.

type maxResults:

integer

param maxResults:

The maximum results to return for the request.

rtype:

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.

GetPrediction (new) Link ¶

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

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

string

param detectorId:

[REQUIRED]

The detector ID.

type detectorVersionId:

string

param detectorVersionId:

The detector version ID.

type eventId:

string

param eventId:

[REQUIRED]

The unique ID used to identify the event.

type eventAttributes:

dict

param eventAttributes:

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) --

type externalModelEndpointDataBlobs:

dict

param externalModelEndpointDataBlobs:

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.

rtype:

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) --

GetModelVersion (new) Link ¶

Gets a model version.

See also: AWS API Documentation

Request Syntax

client.get_model_version(
    modelId='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    modelVersionNumber='string'
)
type modelId:

string

param modelId:

[REQUIRED]

The model ID.

type modelType:

string

param modelType:

[REQUIRED]

The model type.

type modelVersionNumber:

string

param modelVersionNumber:

[REQUIRED]

The model version.

rtype:

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.

GetDetectors (new) Link ¶

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

client.get_detectors(
    detectorId='string',
    nextToken='string',
    maxResults=123
)
type detectorId:

string

param detectorId:

The detector ID.

type nextToken:

string

param nextToken:

The next token for the subsequent request.

type maxResults:

integer

param maxResults:

The maximum number of objects to return for the request.

rtype:

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.

GetRules (new) Link ¶

Gets all rules available for the specified detector.

See also: AWS API Documentation

Request Syntax

client.get_rules(
    ruleId='string',
    detectorId='string',
    ruleVersion='string',
    nextToken='string',
    maxResults=123
)
type ruleId:

string

param ruleId:

The rule ID.

type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type ruleVersion:

string

param ruleVersion:

The rule version.

type nextToken:

string

param nextToken:

The next page token.

type maxResults:

integer

param maxResults:

The maximum number of rules to return for the request.

rtype:

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.

BatchGetVariable (new) Link ¶

Gets a batch of variables.

See also: AWS API Documentation

Request Syntax

client.batch_get_variable(
    names=[
        'string',
    ]
)
type names:

list

param names:

[REQUIRED]

The list of variable names to get.

  • (string) --

rtype:

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.

GetOutcomes (new) Link ¶

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

client.get_outcomes(
    name='string',
    nextToken='string',
    maxResults=123
)
type name:

string

param name:

The name of the outcome or outcomes to get.

type nextToken:

string

param nextToken:

The next page token for the request.

type maxResults:

integer

param maxResults:

The maximum number of objects to return for the request.

rtype:

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.

UpdateRuleMetadata (new) Link ¶

Updates a rule's metadata.

See also: AWS API Documentation

Request Syntax

client.update_rule_metadata(
    rule={
        'detectorId': 'string',
        'ruleId': 'string',
        'ruleVersion': 'string'
    },
    description='string'
)
type rule:

dict

param rule:

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

type description:

string

param description:

[REQUIRED]

The rule description.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UpdateDetectorVersionMetadata (new) Link ¶

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

client.update_detector_version_metadata(
    detectorId='string',
    detectorVersionId='string',
    description='string'
)
type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type detectorVersionId:

string

param detectorVersionId:

[REQUIRED]

The detector version ID.

type description:

string

param description:

[REQUIRED]

The description.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

GetVariables (new) Link ¶

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

client.get_variables(
    name='string',
    nextToken='string',
    maxResults=123
)
type name:

string

param name:

The name of the variable.

type nextToken:

string

param nextToken:

The next page token of the get variable request.

type maxResults:

integer

param maxResults:

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

rtype:

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.

UpdateDetectorVersionStatus (new) Link ¶

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

client.update_detector_version_status(
    detectorId='string',
    detectorVersionId='string',
    status='DRAFT'|'ACTIVE'|'INACTIVE'
)
type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type detectorVersionId:

string

param detectorVersionId:

[REQUIRED]

The detector version ID.

type status:

string

param status:

[REQUIRED]

The new status.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

PutOutcome (new) Link ¶

Creates or updates an outcome.

See also: AWS API Documentation

Request Syntax

client.put_outcome(
    name='string',
    description='string'
)
type name:

string

param name:

[REQUIRED]

The name of the outcome.

type description:

string

param description:

The outcome description.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UpdateModelVersion (new) Link ¶

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

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'
)
type modelId:

string

param modelId:

[REQUIRED]

The model ID.

type modelType:

string

param modelType:

[REQUIRED]

The model type.

type modelVersionNumber:

string

param modelVersionNumber:

[REQUIRED]

The model version.

type description:

string

param description:

[REQUIRED]

The model description.

type status:

string

param status:

[REQUIRED]

The new model status.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeModelVersions (new) Link ¶

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

client.describe_model_versions(
    modelId='string',
    modelVersionNumber='string',
    modelType='ONLINE_FRAUD_INSIGHTS',
    nextToken='string',
    maxResults=123
)
type modelId:

string

param modelId:

The model ID.

type modelVersionNumber:

string

param modelVersionNumber:

The model version.

type modelType:

string

param modelType:

The model type.

type nextToken:

string

param nextToken:

The next token from the previous results.

type maxResults:

integer

param maxResults:

The maximum number of results to return.

rtype:

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.

DeleteEvent (new) Link ¶

Deletes the specified event.

See also: AWS API Documentation

Request Syntax

client.delete_event(
    eventId='string'
)
type eventId:

string

param eventId:

[REQUIRED]

The ID of the event to delete.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

PutDetector (new) Link ¶

Creates or updates a detector.

See also: AWS API Documentation

Request Syntax

client.put_detector(
    detectorId='string',
    description='string'
)
type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID.

type description:

string

param description:

The description of the detector.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateRule (new) Link ¶

Creates a rule for use with the specified detector.

See also: AWS API Documentation

Request Syntax

client.create_rule(
    ruleId='string',
    detectorId='string',
    description='string',
    expression='string',
    language='DETECTORPL',
    outcomes=[
        'string',
    ]
)
type ruleId:

string

param ruleId:

[REQUIRED]

The rule ID.

type detectorId:

string

param detectorId:

[REQUIRED]

The detector ID for the rule's parent detector.

type description:

string

param description:

The rule description.

type expression:

string

param expression:

[REQUIRED]

The rule expression.

type language:

string

param language:

[REQUIRED]

The language of the rule.

type outcomes:

list

param outcomes:

[REQUIRED]

The outcome or outcomes returned when the rule expression matches.

  • (string) --

rtype:

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.

UpdateVariable (new) Link ¶

Updates a variable.

See also: AWS API Documentation

Request Syntax

client.update_variable(
    name='string',
    defaultValue='string',
    description='string',
    variableType='string'
)
type name:

string

param name:

[REQUIRED]

The name of the variable.

type defaultValue:

string

param defaultValue:

The new default value of the variable.

type description:

string

param description:

The new description.

type variableType:

string

param variableType:

The variable type.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

PutModel (new) Link ¶

Creates or updates a model.

See also: AWS API Documentation

Request Syntax

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',
            ]
        }
    }
)
type modelId:

string

param modelId:

[REQUIRED]

The model ID.

type modelType:

string

param modelType:

[REQUIRED]

The model type.

type description:

string

param description:

The model description.

type trainingDataSource:

dict

param trainingDataSource:

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

type modelVariables:

list

param modelVariables:

[REQUIRED]

The model input variables.

  • (dict) --

    The model variable.>

    • name (string) -- [REQUIRED]

      The model variable's name.>

    • index (integer) --

      The model variable's index.>

type labelSchema:

dict

param labelSchema:

[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) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --