Skip to content

get_models

get_models(
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    model_id: Optional[modelIdentifier] = None,
    model_type: Optional[ModelTypeEnum] = None,
    next_token: Optional[string] = None,
    max_results: Optional[modelsMaxPageSize] = None,
) -> GetModelsResult

Gets one or more models. Gets all models for the Amazon Web Services account if no model type and no model id provided. Gets all models for the Amazon Web Services 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.

Parameters:

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • InternalServerException –

    An exception indicating an internal server error.

  • ResourceNotFoundException –

    An exception indicating the specified resource was not found.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_frauddetector/_services/fraud_detector.py
def get_models(
    self,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    model_id: Optional[
        "capo_frauddetector.types.model_identifier.modelIdentifier"
    ] = None,
    model_type: Optional[
        "capo_frauddetector.types.model_type_enum.ModelTypeEnum"
    ] = None,
    next_token: Optional["capo_frauddetector.types.string.string"] = None,
    max_results: Optional[
        "capo_frauddetector.types.models_max_page_size.modelsMaxPageSize"
    ] = None,
) -> "capo_frauddetector.types.get_models_result.GetModelsResult":
    """<p>Gets one or more models. Gets all models for the Amazon Web Services account if no model type and no model id provided. Gets all models for the Amazon Web Services 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. </p> <p>This is a paginated API. If you provide a null <code>maxResults</code>, this action retrieves a maximum of 10 records per page. If you provide a <code>maxResults</code>, 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.</p>

    Args:
        model_id: <p>The model ID.</p>
        model_type: <p>The model type.</p>
        next_token: <p>The next token for the subsequent request.</p>
        max_results: <p>The maximum number of objects to return for the request. </p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception indicating the specified resource was not found.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_frauddetector.types.get_models_request.GetModelsRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.get_models_result.GetModelsResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.get_models

        output, http_response = (
            capo_frauddetector._operations.aws_hawks_nest_service_facade.get_models.get_models(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetModels")
    )
    input_: capo_frauddetector.types.get_models_request.GetModelsRequest = {}
    if model_id is not None:
        input_["model_id"] = model_id
    if model_type is not None:
        input_["model_type"] = model_type
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output