2020/07/20 - Amazon Fraud Detector - 16 new24 updated api methods
Changes Update frauddetector client to latest version
Deletes the rule. You cannot delete a rule if it is used by an ACTIVE or INACTIVE detector version.
See also: AWS API Documentation
Request Syntax
client.delete_rule( rule={ 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' } )
dict
[REQUIRED]
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.
dict
Response Syntax
{}
Response Structure
(dict) --
Updates the status of a model version.
You can perform the following status updates:
Change the TRAINING_COMPLETE status to ACTIVE.
Change ACTIVE``to ``INACTIVE.
See also: AWS API Documentation
Request Syntax
client.update_model_version_status( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', modelVersionNumber='string', status='TRAINING_IN_PROGRESS'|'TRAINING_COMPLETE'|'ACTIVATE_REQUESTED'|'ACTIVATE_IN_PROGRESS'|'ACTIVE'|'INACTIVATE_IN_PROGRESS'|'INACTIVE'|'DELETE_REQUESTED'|'DELETE_IN_PROGRESS'|'ERROR' )
string
[REQUIRED]
The model ID of the model version to update.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The model version number.
string
[REQUIRED]
The model version status.
dict
Response Syntax
{}
Response Structure
(dict) --
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_event_prediction( detectorId='string', detectorVersionId='string', eventId='string', eventTypeName='string', entities=[ { 'entityType': 'string', 'entityId': 'string' }, ], eventTimestamp='string', eventVariables={ 'string': 'string' }, externalModelEndpointDataBlobs={ 'string': { 'byteBuffer': b'bytes', 'contentType': 'string' } } )
string
[REQUIRED]
The detector ID.
string
The detector version ID.
string
[REQUIRED]
The unique ID used to identify the event.
string
[REQUIRED]
The event type associated with the detector specified for the prediction.
list
[REQUIRED]
The entity type (associated with the detector's event type) and specific entity ID representing who performed the event. If an entity id is not available, use "UNKNOWN."
(dict) --
The entity details.
entityType (string) --
The entity type.
entityId (string) --
The entity ID. If you do not know the entityId, you can pass unknown, which is areserved string literal.
string
[REQUIRED]
Timestamp that defines when the event under evaluation occurred.
dict
[REQUIRED]
Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.
(string) --
(string) --
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.
dict
Response Syntax
{ 'modelScores': [ { 'modelVersion': { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, 'scores': { 'string': ... } }, ], 'ruleResults': [ { 'ruleId': 'string', 'outcomes': [ 'string', ] }, ] }
Response Structure
(dict) --
modelScores (list) --
The model scores. Amazon Fraud Detector generates model scores between 0 and 1000, where 0 is low fraud risk and 1000 is high fraud risk. Model scores are directly related to the false positive rate (FPR). For example, a score of 600 corresponds to an estimated 10% false positive rate whereas a score of 900 corresponds to an estimated 2% false positive rate.
(dict) --
The fraud prediction scores.
modelVersion (dict) --
The model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
scores (dict) --
The model's fraud prediction scores.
(string) --
(float) --
ruleResults (list) --
The results.
(dict) --
The rule results.
ruleId (string) --
The rule ID that was matched, based on the rule execution mode.
outcomes (list) --
The outcomes of the matched rule, based on the rule execution mode.
(string) --
Specifies the Key Management Service (KMS) customer master key (CMK) to be used to encrypt content in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.put_kms_encryption_key( kmsEncryptionKeyArn='string' )
string
[REQUIRED]
The KMS encryption key ARN.
dict
Response Syntax
{}
Response Structure
(dict) --
Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.
See also: AWS API Documentation
Request Syntax
client.put_event_type( name='string', description='string', eventVariables=[ 'string', ], labels=[ 'string', ], entityTypes=[ 'string', ], tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name.
string
The description of the event type.
list
[REQUIRED]
The event type variables.
(string) --
list
The event type labels.
(string) --
list
[REQUIRED]
The entity type for the event type. Example entity types: customer, merchant, account.
(string) --
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
Creates a model using the specified model type.
See also: AWS API Documentation
Request Syntax
client.create_model( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', description='string', eventTypeName='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
The model description.
string
[REQUIRED]
The name of the event type.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
Updates a model. You can update the description attribute using this action.
See also: AWS API Documentation
Request Syntax
client.update_model( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', description='string' )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
The new model description.
dict
Response Syntax
{}
Response Structure
(dict) --
Gets all event types or a specific event type if name is provided. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEventTypesResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_event_types( name='string', nextToken='string', maxResults=123 )
string
The name.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'eventTypes': [ { 'name': 'string', 'description': 'string', 'eventVariables': [ 'string', ], 'labels': [ 'string', ], 'entityTypes': [ 'string', ], 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
eventTypes (list) --
An array of event types.
(dict) --
The event type details.
name (string) --
The event type name.
description (string) --
The event type description.
eventVariables (list) --
The event type event variables.
(string) --
labels (list) --
The event type labels.
(string) --
entityTypes (list) --
The event type entity types.
(string) --
lastUpdatedTime (string) --
Timestamp of when the event type was last updated.
createdTime (string) --
Timestamp of when the event type was created.
arn (string) --
The entity type ARN.
nextToken (string) --
The next page token.
Gets the encryption key if a Key Management Service (KMS) customer master key (CMK) has been specified to be used to encrypt content in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.get_kms_encryption_key()
dict
Response Syntax
{ 'kmsKey': { 'kmsEncryptionKeyArn': 'string' } }
Response Structure
(dict) --
kmsKey (dict) --
The KMS encryption key.
kmsEncryptionKeyArn (string) --
The encryption key ARN.
Assigns tags to a resource.
See also: AWS API Documentation
Request Syntax
client.tag_resource( resourceARN='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The resource ARN.
list
[REQUIRED]
The tags to assign to the resource.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
Gets all labels or a specific label if name is provided. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 50 records per page. If you provide a maxResults, the value must be between 10 and 50. To get the next page results, provide the pagination token from the GetGetLabelsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_labels( name='string', nextToken='string', maxResults=123 )
string
The name of the label or labels to get.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'labels': [ { 'name': 'string', 'description': 'string', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
labels (list) --
An array of labels.
(dict) --
The label details.
name (string) --
The label name.
description (string) --
The label description.
lastUpdatedTime (string) --
Timestamp of when the label was last updated.
createdTime (string) --
Timestamp of when the event type was created.
arn (string) --
The label ARN.
nextToken (string) --
The next page token.
Lists all tags associated with the resource. This is a paginated API. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.list_tags_for_resource( resourceARN='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The ARN that specifies the resource whose tags you want to list.
string
The next token from the previous results.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
tags (list) --
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) --
A tag key.
value (string) --
A value assigned to a tag key.
nextToken (string) --
The next token for subsequent requests.
Creates or updates an entity type. An entity represents who is performing the event. As part of a fraud prediction, you pass the entity ID to indicate the specific entity who performed the event. An entity type classifies the entity. Example classifications include customer, merchant, or account.
See also: AWS API Documentation
Request Syntax
client.put_entity_type( name='string', description='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name of the entity type.
string
The description.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
Gets all entity types or a specific entity type if a name is specified. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEntityTypesResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_entity_types( name='string', nextToken='string', maxResults=123 )
string
The name.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'entityTypes': [ { 'name': 'string', 'description': 'string', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
entityTypes (list) --
An array of entity types.
(dict) --
The entity type details.
name (string) --
The entity type name.
description (string) --
The entity type description.
lastUpdatedTime (string) --
Timestamp of when the entity type was last updated.
createdTime (string) --
Timestamp of when the entity type was created.
arn (string) --
The entity type ARN.
nextToken (string) --
The next page token.
Creates or updates label. A label classifies an event as fraudulent or legitimate. Labels are associated with event types and used to train supervised machine learning models in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.put_label( name='string', description='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The label name.
string
The label description.
list
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
Removes tags from a resource.
See also: AWS API Documentation
Request Syntax
client.untag_resource( resourceARN='string', tagKeys=[ 'string', ] )
string
[REQUIRED]
The ARN of the resource from which to remove the tag.
list
[REQUIRED]
The resource ARN.
(string) --
dict
Response Syntax
{}
Response Structure
(dict) --
{'tags': [{'key': 'string', 'value': 'string'}]}
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' }, ], tags=[ { 'key': 'string', 'value': 'string' }, ] )
list
[REQUIRED]
The list of variables for the batch create variable request.
(dict) --
A variable in the list of variables for the batch create variable request.
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 type of the variable.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT | SHIPPING_ZIP | USERAGENT
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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.
{'variables': {'arn': 'string'}}
Gets a batch of variables.
See also: AWS API Documentation
Request Syntax
client.batch_get_variable( names=[ 'string', ] )
list
[REQUIRED]
The list of variable names to get.
(string) --
dict
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', 'arn': '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.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT | SHIPPING_ZIP | USERAGENT
lastUpdatedTime (string) --
The time when variable was last updated.
createdTime (string) --
The time when the variable was created.
arn (string) --
The ARN of the variable.
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.
{'modelVersions': {'arn': 'string'}, 'tags': [{'key': 'string', 'value': 'string'}]}
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', 'arn': 'string' }, ], ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The ID of the detector under which you want to create a new version.
string
The description of the detector version.
list
The Amazon Sagemaker model endpoints to include in the detector version.
(string) --
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.
list
The model versions to include in the detector version.
(dict) --
The model version.
modelId (string) -- [REQUIRED]
The model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version number.
arn (string) --
The model version ARN.
string
The rule execution mode for the rules included in the detector version.
You can define and edit the rule mode at the detector version level, when it is in draft status.
If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules.
The default behavior is FIRST_MATCHED.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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.
{'externalEventsDetail': {'dataAccessRoleArn': 'string', 'dataLocation': 'string'}, 'tags': [{'key': 'string', 'value': 'string'}], 'trainingDataSchema': {'labelSchema': {'labelMapper': {'string': ['string']}}, 'modelVariables': ['string']}, 'trainingDataSource': 'EXTERNAL_EVENTS'}
Creates a version of the model using the specified model type and model id.
See also: AWS API Documentation
Request Syntax
client.create_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', trainingDataSource='EXTERNAL_EVENTS', trainingDataSchema={ 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] } } }, externalEventsDetail={ 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The training data source location in Amazon S3.
dict
[REQUIRED]
The training data schema.
modelVariables (list) -- [REQUIRED]
The training data schema variables.
(string) --
labelSchema (dict) -- [REQUIRED]
The label schema.
labelMapper (dict) -- [REQUIRED]
The label mapper maps the Amazon Fraud Detector supported model classification labels ( FRAUD, LEGIT) to the appropriate event type 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 label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
dict
Details for the external events data used for model version training. Required if trainingDataSource is EXTERNAL_EVENTS.
dataLocation (string) -- [REQUIRED]
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) -- [REQUIRED]
The ARN of the role that provides Amazon Fraud Detector access to the data location.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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 model version number of the model version created.
status (string) --
The model version status.
{'tags': [{'key': 'string', 'value': 'string'}]}
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', ], tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The rule ID.
string
[REQUIRED]
The detector ID for the rule's parent detector.
string
The rule description.
string
[REQUIRED]
The rule expression.
string
[REQUIRED]
The language of the rule.
list
[REQUIRED]
The outcome or outcomes returned when the rule expression matches.
(string) --
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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.
{'tags': [{'key': 'string', 'value': 'string'}]}
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', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name of the variable.
string
[REQUIRED]
The data type.
string
[REQUIRED]
The source of the data.
string
[REQUIRED]
The default value for the variable when no value is received.
string
The description.
string
The variable type.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT | SHIPPING_ZIP | USERAGENT
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'eventTypeName': 'string'}
Deletes the specified event.
See also: AWS API Documentation
Request Syntax
client.delete_event( eventId='string', eventTypeName='string' )
string
[REQUIRED]
The ID of the event to delete.
string
[REQUIRED]
The name of the event type.
dict
Response Syntax
{}
Response Structure
(dict) --
{'arn': 'string'}
Gets all versions for a specified detector.
See also: AWS API Documentation
Request Syntax
client.describe_detector( detectorId='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The detector ID.
string
The next token from the previous response.
integer
The maximum number of results to return for the request.
dict
Response Syntax
{ 'detectorId': 'string', 'detectorVersionSummaries': [ { 'detectorVersionId': 'string', 'status': 'DRAFT'|'ACTIVE'|'INACTIVE', 'description': 'string', 'lastUpdatedTime': 'string' }, ], 'nextToken': 'string', 'arn': '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.
arn (string) --
The detector ARN.
{'modelVersionDetails': {'arn': 'string', 'externalEventsDetail': {'dataAccessRoleArn': 'string', 'dataLocation': 'string'}, 'trainingDataSchema': {'labelSchema': {'labelMapper': {'string': ['string']}}, 'modelVariables': ['string']}, 'trainingResult': {'dataValidationMetrics': {'fieldLevelMessages': [{'content': 'string', 'fieldName': 'string', 'identifier': 'string', 'title': 'string', 'type': 'string'}], 'fileLevelMessages': [{'content': 'string', 'title': 'string', 'type': 'string'}]}, 'trainingMetrics': {'auc': 'float', 'metricDataPoints': [{'fpr': 'float', 'precision': 'float', 'threshold': 'float', 'tpr': 'float'}]}}}}
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 )
string
The model ID.
string
The model version number.
string
The model type.
string
The next token from the previous results.
integer
The maximum number of results to return.
dict
Response Syntax
{ 'modelVersionDetails': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'status': 'string', 'trainingDataSource': 'EXTERNAL_EVENTS', 'trainingDataSchema': { 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] } } }, 'externalEventsDetail': { 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, 'trainingResult': { 'dataValidationMetrics': { 'fileLevelMessages': [ { 'title': 'string', 'content': 'string', 'type': 'string' }, ], 'fieldLevelMessages': [ { 'fieldName': 'string', 'identifier': 'string', 'title': 'string', 'content': 'string', 'type': 'string' }, ] }, 'trainingMetrics': { 'auc': ..., 'metricDataPoints': [ { 'fpr': ..., 'precision': ..., 'tpr': ..., 'threshold': ... }, ] } }, 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
modelVersionDetails (list) --
The model version details.
(dict) --
The details of the model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
status (string) --
The status of the model version.
trainingDataSource (string) --
The model version training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
(string) --
labelSchema (dict) --
The label schema.
labelMapper (dict) --
The label mapper maps the Amazon Fraud Detector supported model classification labels ( FRAUD, LEGIT) to the appropriate event type 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 label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
externalEventsDetail (dict) --
The event details.
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
trainingResult (dict) --
The training results.
dataValidationMetrics (dict) --
The validation metrics.
fileLevelMessages (list) --
The file-specific model training validation messages.
(dict) --
The message details.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
fieldLevelMessages (list) --
The field-specific model training validation messages.
(dict) --
The message details.
fieldName (string) --
The field name.
identifier (string) --
The message ID.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
trainingMetrics (dict) --
The training metric details.
auc (float) --
The area under the curve. This summarizes true positive rate (TPR) and false positive rate (FPR) across all possible model score thresholds. A model with no predictive power has an AUC of 0.5, whereas a perfect model has a score of 1.0.
metricDataPoints (list) --
The data points details.
(dict) --
Model performance metrics data points.
fpr (float) --
The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.
precision (float) --
The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.
tpr (float) --
The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.
threshold (float) --
The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.
lastUpdatedTime (string) --
The timestamp when the model was last updated.
createdTime (string) --
The timestamp when the model was created.
arn (string) --
The model version ARN.
nextToken (string) --
The next token.
{'arn': 'string', 'modelVersions': {'arn': 'string'}}
Gets a particular detector version.
See also: AWS API Documentation
Request Syntax
client.get_detector_version( detectorId='string', detectorVersionId='string' )
string
[REQUIRED]
The detector ID.
string
[REQUIRED]
The detector version ID.
dict
Response Syntax
{ 'detectorId': 'string', 'detectorVersionId': 'string', 'description': 'string', 'externalModelEndpoints': [ 'string', ], 'modelVersions': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, ], 'rules': [ { 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' }, ], 'status': 'DRAFT'|'ACTIVE'|'INACTIVE', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'ruleExecutionMode': 'ALL_MATCHED'|'FIRST_MATCHED', 'arn': '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 model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
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.
ruleExecutionMode (string) --
The execution mode of the rule in the dectector
FIRST_MATCHED indicates that Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
ALL_MATCHED indicates that Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.
arn (string) --
The detector version ARN.
{'detectors': {'arn': 'string', 'eventTypeName': 'string'}}
Gets all detectors or a single detector if a detectorId is specified. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetDetectorsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_detectors( detectorId='string', nextToken='string', maxResults=123 )
string
The detector ID.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'detectors': [ { 'detectorId': 'string', 'description': 'string', 'eventTypeName': 'string', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
detectors (list) --
The detectors.
(dict) --
The detector.
detectorId (string) --
The detector ID.
description (string) --
The detector description.
eventTypeName (string) --
The name of the event type.
lastUpdatedTime (string) --
Timestamp of when the detector was last updated.
createdTime (string) --
Timestamp of when the detector was created.
arn (string) --
The detector ARN.
nextToken (string) --
The next page token.
{'externalModels': {'arn': 'string', 'eventTypeName': 'string', 'inputConfiguration': {'useEventVariables': 'boolean'}}}
Gets the details for one or more Amazon SageMaker models that have been imported into the service. This is a paginated API. If you provide a null maxResults, this actions retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetExternalModelsResult as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_external_models( modelEndpoint='string', nextToken='string', maxResults=123 )
string
The Amazon SageMaker model endpoint.
string
The next page token for the request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'externalModels': [ { 'modelEndpoint': 'string', 'eventTypeName': 'string', 'modelSource': 'SAGEMAKER', 'role': { 'arn': 'string', 'name': 'string' }, 'inputConfiguration': { 'format': 'TEXT_CSV'|'APPLICATION_JSON', 'useEventVariables': 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', 'arn': '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.
eventTypeName (string) --
The event type names.
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.
useEventVariables (boolean) --
The event variables.
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.
arn (string) --
The model ARN.
nextToken (string) --
The next page token to be used in subsequent requests.
{'arn': 'string', 'externalEventsDetail': {'dataAccessRoleArn': 'string', 'dataLocation': 'string'}, 'trainingDataSchema': {'labelSchema': {'labelMapper': {'string': ['string']}}, 'modelVariables': ['string']}, 'trainingDataSource': 'EXTERNAL_EVENTS'}
Gets the details of the specified model version.
See also: AWS API Documentation
Request Syntax
client.get_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', modelVersionNumber='string' )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The model version number.
dict
Response Syntax
{ 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'trainingDataSource': 'EXTERNAL_EVENTS', 'trainingDataSchema': { 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] } } }, 'externalEventsDetail': { 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, 'status': 'string', 'arn': 'string' }
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
trainingDataSource (string) --
The training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
(string) --
labelSchema (dict) --
The label schema.
labelMapper (dict) --
The label mapper maps the Amazon Fraud Detector supported model classification labels ( FRAUD, LEGIT) to the appropriate event type 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 label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
externalEventsDetail (dict) --
The event details.
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
status (string) --
The model version status.
arn (string) --
The model version ARN.
{'models': {'arn': 'string', 'eventTypeName': 'string'}}
Gets one or more models. Gets all models for the AWS account if no model type and no model id provided. Gets all models for the AWS account and model type, if the model type is specified but model id is not provided. Gets a specific model if (model type, model id) tuple is specified.
This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 1 and 10. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_models( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', nextToken='string', maxResults=123 )
string
The model ID.
string
The model type.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'nextToken': 'string', 'models': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'description': 'string', 'eventTypeName': 'string', 'createdTime': 'string', 'lastUpdatedTime': 'string', 'arn': 'string' }, ] }
Response Structure
(dict) --
nextToken (string) --
The next page token to be used in subsequent requests.
models (list) --
The array of models.
(dict) --
The model.
modelId (string) --
The model ID.
modelType (string) --
The model type.
description (string) --
The model description.
eventTypeName (string) --
The name of the event type.
createdTime (string) --
Timestamp of when the model was created.
lastUpdatedTime (string) --
Timestamp of last time the model was updated.
arn (string) --
The ARN of the model.
{'outcomes': {'arn': 'string'}}
Gets one or more outcomes. This is a paginated API. If you provide a null maxResults, this actions retrieves a maximum of 100 records per page. If you provide a maxResults, the value must be between 50 and 100. To get the next page results, provide the pagination token from the GetOutcomesResult as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_outcomes( name='string', nextToken='string', maxResults=123 )
string
The name of the outcome or outcomes to get.
string
The next page token for the request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'outcomes': [ { 'name': 'string', 'description': 'string', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': '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.
arn (string) --
The outcome ARN.
nextToken (string) --
The next page token for subsequent requests.
{'modelScores': {'modelVersion': {'arn': 'string'}}}
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' } } )
string
[REQUIRED]
The detector ID.
string
The detector version ID.
string
[REQUIRED]
The unique ID used to identify the event.
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) --
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.
dict
Response Syntax
{ 'outcomes': [ 'string', ], 'modelScores': [ { 'modelVersion': { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, 'scores': { 'string': ... } }, ], 'ruleResults': [ { 'ruleId': 'string', 'outcomes': [ '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 model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
scores (dict) --
The model's fraud prediction scores.
(string) --
(float) --
ruleResults (list) --
The rule results in the prediction.
(dict) --
The rule results.
ruleId (string) --
The rule ID that was matched, based on the rule execution mode.
outcomes (list) --
The outcomes of the matched rule, based on the rule execution mode.
(string) --
{'ruleDetails': {'arn': 'string'}}
Get all rules for a detector (paginated) if ruleId and ruleVersion are not specified. Gets all rules for the detector and the ruleId if present (paginated). Gets a specific rule if both the ruleId and the ruleVersion are specified.
This is a paginated API. Providing null maxResults results in retrieving maximum of 100 records per page. If you provide maxResults the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetRulesResult as part of your request. Null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_rules( ruleId='string', detectorId='string', ruleVersion='string', nextToken='string', maxResults=123 )
string
The rule ID.
string
[REQUIRED]
The detector ID.
string
The rule version.
string
The next page token.
integer
The maximum number of rules to return for the request.
dict
Response Syntax
{ 'ruleDetails': [ { 'ruleId': 'string', 'description': 'string', 'detectorId': 'string', 'ruleVersion': 'string', 'expression': 'string', 'language': 'DETECTORPL', 'outcomes': [ 'string', ], 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': '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.
arn (string) --
The rule ARN.
nextToken (string) --
The next page token to be used in subsequent requests.
{'variables': {'arn': 'string'}}
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 )
string
The name of the variable.
string
The next page token of the get variable request.
integer
The max size per page determined for the get variable request.
dict
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', 'arn': '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.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT | SHIPPING_ZIP | USERAGENT
lastUpdatedTime (string) --
The time when variable was last updated.
createdTime (string) --
The time when the variable was created.
arn (string) --
The ARN of the variable.
nextToken (string) --
The next page token to be used in subsequent requests.
{'eventTypeName': 'string', 'tags': [{'key': 'string', 'value': 'string'}]}
Creates or updates a detector.
See also: AWS API Documentation
Request Syntax
client.put_detector( detectorId='string', description='string', eventTypeName='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The detector ID.
string
The description of the detector.
string
[REQUIRED]
The name of the event type.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'eventTypeName': 'string', 'inputConfiguration': {'useEventVariables': 'boolean'}, 'tags': [{'key': 'string', 'value': 'string'}]}
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', eventTypeName='string', modelSource='SAGEMAKER', role={ 'arn': 'string', 'name': 'string' }, inputConfiguration={ 'format': 'TEXT_CSV'|'APPLICATION_JSON', 'useEventVariables': True|False, 'jsonInputTemplate': 'string', 'csvInputTemplate': 'string' }, outputConfiguration={ 'format': 'TEXT_CSV'|'APPLICATION_JSONLINES', 'jsonKeyToVariableMap': { 'string': 'string' }, 'csvIndexToVariableMap': { 'string': 'string' } }, modelEndpointStatus='ASSOCIATED'|'DISSOCIATED', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model endpoints name.
string
The event type name.
string
[REQUIRED]
The source of the model.
dict
[REQUIRED]
The IAM role used to invoke the model endpoint.
arn (string) -- [REQUIRED]
The role ARN.
name (string) -- [REQUIRED]
The role name.
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.
useEventVariables (boolean) -- [REQUIRED]
The event variables.
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.
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) --
string
[REQUIRED]
The model endpoint’s status in Amazon Fraud Detector.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'tags': [{'key': 'string', 'value': 'string'}]}
Creates or updates an outcome.
See also: AWS API Documentation
Request Syntax
client.put_outcome( name='string', description='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name of the outcome.
string
The outcome description.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelVersions': {'arn': 'string'}}
Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.
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', 'arn': 'string' }, ], ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED' )
string
[REQUIRED]
The parent detector ID for the detector version you want to update.
string
[REQUIRED]
The detector version ID.
list
[REQUIRED]
The Amazon SageMaker model endpoints to include in the detector version.
(string) --
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.
string
The detector version description.
list
The model versions to include in the detector version.
(dict) --
The model version.
modelId (string) -- [REQUIRED]
The model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version number.
arn (string) --
The model version ARN.
string
The rule execution mode to add to the detector.
If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.
The default behavior is FIRST_MATCHED.
dict
Response Syntax
{}
Response Structure
(dict) --
{'externalEventsDetail': {'dataAccessRoleArn': 'string', 'dataLocation': 'string'}, 'majorVersionNumber': 'string', 'tags': [{'key': 'string', 'value': 'string'}]}Response
{'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'status': 'string'}
Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03.
See also: AWS API Documentation
Request Syntax
client.update_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS', majorVersionNumber='string', externalEventsDetail={ 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The major version number.
dict
The event details.
dataLocation (string) -- [REQUIRED]
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) -- [REQUIRED]
The ARN of the role that provides Amazon Fraud Detector access to the data location.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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 model version number of the model version updated.
status (string) --
The status of the updated model version.
{'tags': [{'key': 'string', 'value': 'string'}]}
Updates a rule version resulting in a new rule version. Updates a rule version resulting in a new rule version (version 1, 2, 3 ...).
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', ], tags=[ { 'key': 'string', 'value': 'string' }, ] )
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.
string
The description.
string
[REQUIRED]
The rule expression.
string
[REQUIRED]
The language.
list
[REQUIRED]
The outcomes.
(string) --
list
The tags to assign to the rule version.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
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.