aws-frauddetector-entitytype/src/aws_frauddetector_entitytype/helpers/api_helpers.py [167:268]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@api_call_with_debug_logs
def call_put_label(
    frauddetector_client,
    label_name: str,
    label_tags: List[dict] = None,
    label_description: str = None,
):
    """
    This method calls put_label with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param label_name: name of the label
    :param label_tags: tags to attach to the label (default is None)
    :param label_description: description of the label (default is None)
    :return: API response from frauddetector_client
    """
    args = {"name": label_name, "tags": label_tags, "description": label_description}
    args = validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_label(**args)


@api_call_with_debug_logs
def call_put_entity_type(
    frauddetector_client,
    entity_type_name: str,
    entity_type_tags: List[dict] = None,
    entity_type_description: str = None,
):
    """
    This method calls put_entity_type with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param entity_type_name: name of the entity type
    :param entity_type_tags: tags to attach to the entity type (default is None)
    :param entity_type_description: description of the entity type (default is None)
    :return: API response from frauddetector_client
    """
    args = {
        "name": entity_type_name,
        "tags": entity_type_tags,
        "description": entity_type_description,
    }
    args = validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_entity_type(**args)


@api_call_with_debug_logs
def call_put_event_type(
    frauddetector_client,
    event_type_name: str,
    entity_type_names: List[str],
    event_variable_names: List[str],
    label_names: List[str] = None,
    event_type_tags: List[dict] = None,
    event_type_description: str = None,
):
    """
    This method calls put_event_type with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param event_type_name: name of the event type
    :param entity_type_names: entity types to attach to the event type
    :param event_variable_names: event variables associated with the event type
    :param label_names: labels to associate with the event type
    :param event_type_tags: tags to attach to the event type (default is None)
    :param event_type_description: description of the event type (default is None)
    :return: API response from frauddetector_client
    """
    args = {
        "name": event_type_name,
        "tags": event_type_tags,
        "entityTypes": entity_type_names,
        "eventVariables": event_variable_names,
        "labels": label_names,
        "description": event_type_description,
    }
    validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_event_type(**args)


# Create APIs


@api_call_with_debug_logs
def call_create_variable(
    frauddetector_client,
    variable_name: str,
    variable_data_source: str,
    variable_data_type: str,
    variable_default_value: str,
    variable_description: str = None,
    variable_type: str = None,
    variable_tags: List[dict] = None,
):
    args = {
        "name": variable_name,
        "dataSource": variable_data_source,
        "dataType": variable_data_type,
        "defaultValue": variable_default_value,
        "description": variable_description,
        "variableType": variable_type,
        "tags": variable_tags,
    }
    validation_helpers.remove_none_arguments(args)
    return frauddetector_client.create_variable(**args)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-frauddetector-eventtype/src/aws_frauddetector_eventtype/helpers/api_helpers.py [116:217]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@api_call_with_debug_logs
def call_put_label(
    frauddetector_client,
    label_name: str,
    label_tags: List[dict] = None,
    label_description: str = None,
):
    """
    This method calls put_label with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param label_name: name of the label
    :param label_tags: tags to attach to the label (default is None)
    :param label_description: description of the label (default is None)
    :return: API response from frauddetector_client
    """
    args = {"name": label_name, "tags": label_tags, "description": label_description}
    args = validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_label(**args)


@api_call_with_debug_logs
def call_put_entity_type(
    frauddetector_client,
    entity_type_name: str,
    entity_type_tags: List[dict] = None,
    entity_type_description: str = None,
):
    """
    This method calls put_entity_type with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param entity_type_name: name of the entity type
    :param entity_type_tags: tags to attach to the entity type (default is None)
    :param entity_type_description: description of the entity type (default is None)
    :return: API response from frauddetector_client
    """
    args = {
        "name": entity_type_name,
        "tags": entity_type_tags,
        "description": entity_type_description,
    }
    args = validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_entity_type(**args)


@api_call_with_debug_logs
def call_put_event_type(
    frauddetector_client,
    event_type_name: str,
    entity_type_names: List[str],
    event_variable_names: List[str],
    label_names: List[str] = None,
    event_type_tags: List[dict] = None,
    event_type_description: str = None,
):
    """
    This method calls put_event_type with the given client and the given arguments.
    :param frauddetector_client: afd client to use to make the call
    :param event_type_name: name of the event type
    :param entity_type_names: entity types to attach to the event type
    :param event_variable_names: event variables associated with the event type
    :param label_names: labels to associate with the event type
    :param event_type_tags: tags to attach to the event type (default is None)
    :param event_type_description: description of the event type (default is None)
    :return: API response from frauddetector_client
    """
    args = {
        "name": event_type_name,
        "tags": event_type_tags,
        "entityTypes": entity_type_names,
        "eventVariables": event_variable_names,
        "labels": label_names,
        "description": event_type_description,
    }
    validation_helpers.remove_none_arguments(args)
    return frauddetector_client.put_event_type(**args)


# Create APIs


@api_call_with_debug_logs
def call_create_variable(
    frauddetector_client,
    variable_name: str,
    variable_data_source: str,
    variable_data_type: str,
    variable_default_value: str,
    variable_description: str = None,
    variable_type: str = None,
    variable_tags: List[dict] = None,
):
    args = {
        "name": variable_name,
        "dataSource": variable_data_source,
        "dataType": variable_data_type,
        "defaultValue": variable_default_value,
        "description": variable_description,
        "variableType": variable_type,
        "tags": variable_tags,
    }
    validation_helpers.remove_none_arguments(args)
    return frauddetector_client.create_variable(**args)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



