Skip to content

update_upload async

update_upload(
    arn: AmazonResourceName,
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    name: Optional[Name] = None,
    content_type: Optional[ContentType] = None,
    edit_content: Optional[Boolean] = None,
) -> UpdateUploadResult

Updates an uploaded test spec.

Parameters:

  • arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the uploaded test spec.

  • name (Optional[Name], default: None ) –

    The upload's test spec file name. The name must not contain any forward slashes (/). The test spec file name must end with the .yaml or .yml file extension.

  • content_type (Optional[ContentType], default: None ) –

    The upload's content type (for example, application/x-yaml).

  • edit_content (Optional[Boolean], default: None ) –

    Set to true if the YAML file has changed and must be updated. Otherwise, set to false.

Raises:

Source code in docs_src/capo_device_farm/_services/async_device_farm.py
async def update_upload(
    self,
    arn: "capo_device_farm.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    name: Optional["capo_device_farm.types.name.Name"] = None,
    content_type: Optional[
        "capo_device_farm.types.content_type.ContentType"
    ] = None,
    edit_content: Optional["capo_device_farm.types.boolean.Boolean"] = None,
) -> "capo_device_farm.types.update_upload_result.UpdateUploadResult":
    """<p>Updates an uploaded test spec.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the uploaded test spec.</p>
        name: <p>The upload's test spec file name. The name must not contain any forward slashes (/). The test spec file name must end with the <code>.yaml</code> or <code>.yml</code> file extension.</p>
        content_type: <p>The upload's content type (for example, <code>application/x-yaml</code>).</p>
        edit_content: <p>Set to true if the YAML file has changed and must be updated. Otherwise, set to false.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_device_farm.types.update_upload_request.UpdateUploadRequest]",
    ) -> AsyncOperationResponse[
        "capo_device_farm.types.update_upload_result.UpdateUploadResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.update_upload

        (
            output,
            http_response,
        ) = await capo_device_farm._operations.device_farm_20150623.update_upload.async_update_upload(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_device_farm.types.update_upload_result.UpdateUploadResult",
    ) -> dict[str, Any]:
        import capo_device_farm.types.update_upload_result

        return capo_device_farm.types.update_upload_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateUpload", redact_output=_redact_output),
    )
    input_: capo_device_farm.types.update_upload_request.UpdateUploadRequest = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if content_type is not None:
        input_["content_type"] = content_type
    if edit_content is not None:
        input_["edit_content"] = edit_content

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output