Skip to content

list_artifacts

list_artifacts(
    arn: AmazonResourceName,
    type: ArtifactCategory,
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListArtifactsResult

Gets information about artifacts.

Parameters:

  • arn (AmazonResourceName) –

    The run, job, suite, or test ARN.

  • type (ArtifactCategory) –

    The artifacts' type.

    Allowed values include:

    • FILE

    • LOG

    • SCREENSHOT

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

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Raises:

Examples:

To list artifacts for a resource The following example lists screenshot artifacts for a specific run.

>>> client.list_artifacts(arn='arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456', type='SCREENSHOT')
Source code in docs_src/capo_device_farm/_services/device_farm.py
def list_artifacts(
    self,
    arn: "capo_device_farm.types.amazon_resource_name.AmazonResourceName",
    type: "capo_device_farm.types.artifact_category.ArtifactCategory",
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
    next_token: Optional[
        "capo_device_farm.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_device_farm.types.list_artifacts_result.ListArtifactsResult":
    """<p>Gets information about artifacts.</p>

    Args:
        arn: <p>The run, job, suite, or test ARN.</p>
        type: <p>The artifacts' type.</p> <p>Allowed values include:</p> <ul> <li> <p>FILE</p> </li> <li> <p>LOG</p> </li> <li> <p>SCREENSHOT</p> </li> </ul>
        next_token: <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.limit_exceeded_exception.LimitExceededException: <p>A limit was exceeded.</p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.service_account_exception.ServiceAccountException: <p>There was a problem with the service account.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list artifacts for a resource
        The following example lists screenshot artifacts for a specific run.

        >>> client.list_artifacts(arn='arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456', type='SCREENSHOT')
    """

    def _handler(
        req: "OperationRequest[capo_device_farm.types.list_artifacts_request.ListArtifactsRequest]",
    ) -> OperationResponse[
        "capo_device_farm.types.list_artifacts_result.ListArtifactsResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.list_artifacts

        output, http_response = (
            capo_device_farm._operations.device_farm_20150623.list_artifacts.list_artifacts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListArtifacts")
    )
    input_: capo_device_farm.types.list_artifacts_request.ListArtifactsRequest = {
        "arn": arn,
        "type": type,
    }
    if next_token is not None:
        input_["next_token"] = next_token

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