Skip to content

list_jobs

list_jobs(
    *,
    config_overrides: Optional[EndUserMessagingClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    status: Optional[JobStatus] = None,
    brand_profile_id: Optional[BrandProfileIdOrArn] = None,
    operation_type: Optional[JobOperationType] = None,
) -> ListJobsOutput

Retrieves a paginated list of the asynchronous jobs in your account. You can filter the results by status, brand profile, or operation type.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return per page.

  • next_token (Optional[NextToken], default: None ) –

    The token to retrieve the next page of results. This value is returned when more results are available, and is null when there are no more results to return.

  • status (Optional[JobStatus], default: None ) –

    Filters the results to jobs that have the specified status.

  • brand_profile_id (Optional[BrandProfileIdOrArn], default: None ) –

    Filters the results to jobs for the specified brand profile.

  • operation_type (Optional[JobOperationType], default: None ) –

    Filters the results to jobs of the specified operation type.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • InternalServerException –

    An unexpected error occurred during the processing of the request.

  • ThrottlingException –

    The request was denied because it exceeded the allowed request rate.

  • ValidationException –

    A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.

  • UnknownServiceError –

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

Examples:

List async jobs

>>> client.list_jobs(max_results=10, status='SUCCESS')
Source code in docs_src/capo_endusermessaging/_services/end_user_messaging.py
def list_jobs(
    self,
    *,
    config_overrides: Optional[EndUserMessagingClientConfig] = None,
    max_results: Optional[
        "capo_endusermessaging.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_endusermessaging.types.next_token.NextToken"] = None,
    status: Optional["capo_endusermessaging.types.job_status.JobStatus"] = None,
    brand_profile_id: Optional[
        "capo_endusermessaging.types.brand_profile_id_or_arn.BrandProfileIdOrArn"
    ] = None,
    operation_type: Optional[
        "capo_endusermessaging.types.job_operation_type.JobOperationType"
    ] = None,
) -> "capo_endusermessaging.types.list_jobs_output.ListJobsOutput":
    """<p>Retrieves a paginated list of the asynchronous jobs in your account. You can filter the results by status, brand profile, or operation type.</p>

    Args:
        max_results: <p>The maximum number of results to return per page.</p>
        next_token: <p>The token to retrieve the next page of results. This value is returned when more results are available, and is null when there are no more results to return.</p>
        status: <p>Filters the results to jobs that have the specified status.</p>
        brand_profile_id: <p>Filters the results to jobs for the specified brand profile.</p>
        operation_type: <p>Filters the results to jobs of the specified operation type.</p>

    Raises:
        capo_endusermessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_endusermessaging.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_endusermessaging.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed request rate.</p>
        capo_endusermessaging.errors.validation_exception.ValidationException: A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
        capo_endusermessaging.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List async jobs

        >>> client.list_jobs(max_results=10, status='SUCCESS')
    """

    def _handler(
        req: "OperationRequest[capo_endusermessaging.types.list_jobs_input.ListJobsInput]",
    ) -> OperationResponse[
        "capo_endusermessaging.types.list_jobs_output.ListJobsOutput"
    ]:
        import capo_endusermessaging._operations.end_user_messaging.list_jobs

        output, http_response = (
            capo_endusermessaging._operations.end_user_messaging.list_jobs.list_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListJobs")
    )
    input_: capo_endusermessaging.types.list_jobs_input.ListJobsInput = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if status is not None:
        input_["status"] = status
    if brand_profile_id is not None:
        input_["brand_profile_id"] = brand_profile_id
    if operation_type is not None:
        input_["operation_type"] = operation_type

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