Skip to content

initiate_document_version_upload async

initiate_document_version_upload(
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    id: Optional[ResourceIdType] = None,
    name: Optional[ResourceNameType] = None,
    content_created_timestamp: Optional[TimestampType] = None,
    content_modified_timestamp: Optional[TimestampType] = None,
    content_type: Optional[DocumentContentType] = None,
    document_size_in_bytes: Optional[SizeType] = None,
    parent_folder_id: Optional[ResourceIdType] = None,
) -> InitiateDocumentVersionUploadResponse

Creates a new document object and version object.

The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call UpdateDocumentVersion.

To cancel the document upload, call AbortDocumentVersionUpload.

Parameters:

  • authentication_token (Optional[AuthenticationHeaderType], default: None ) –

    Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

  • id (Optional[ResourceIdType], default: None ) –

    The ID of the document.

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

    The name of the document.

  • content_created_timestamp (Optional[TimestampType], default: None ) –

    The timestamp when the content of the document was originally created.

  • content_modified_timestamp (Optional[TimestampType], default: None ) –

    The timestamp when the content of the document was modified.

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

    The content type of the document.

  • document_size_in_bytes (Optional[SizeType], default: None ) –

    The size of the document, in bytes.

  • parent_folder_id (Optional[ResourceIdType], default: None ) –

    The ID of the parent folder.

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def initiate_document_version_upload(
    self,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    id: Optional["capo_workdocs.types.resource_id_type.ResourceIdType"] = None,
    name: Optional[
        "capo_workdocs.types.resource_name_type.ResourceNameType"
    ] = None,
    content_created_timestamp: Optional[
        "capo_workdocs.types.timestamp_type.TimestampType"
    ] = None,
    content_modified_timestamp: Optional[
        "capo_workdocs.types.timestamp_type.TimestampType"
    ] = None,
    content_type: Optional[
        "capo_workdocs.types.document_content_type.DocumentContentType"
    ] = None,
    document_size_in_bytes: Optional[
        "capo_workdocs.types.size_type.SizeType"
    ] = None,
    parent_folder_id: Optional[
        "capo_workdocs.types.resource_id_type.ResourceIdType"
    ] = None,
) -> "capo_workdocs.types.initiate_document_version_upload_response.InitiateDocumentVersionUploadResponse":
    """<p>Creates a new document object and version object.</p> <p>The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call <a>UpdateDocumentVersion</a>.</p> <p>To cancel the document upload, call <a>AbortDocumentVersionUpload</a>.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        id: <p>The ID of the document.</p>
        name: <p>The name of the document.</p>
        content_created_timestamp: <p>The timestamp when the content of the document was originally created.</p>
        content_modified_timestamp: <p>The timestamp when the content of the document was modified.</p>
        content_type: <p>The content type of the document.</p>
        document_size_in_bytes: <p>The size of the document, in bytes.</p>
        parent_folder_id: <p>The ID of the parent folder.</p>

    Raises:
        capo_workdocs.errors.draft_upload_out_of_sync_exception.DraftUploadOutOfSyncException: <p>This exception is thrown when a valid checkout ID is not presented on document version upload calls for a document that has been checked out from Web client.</p>
        capo_workdocs.errors.entity_already_exists_exception.EntityAlreadyExistsException: <p>The resource already exists.</p>
        capo_workdocs.errors.entity_not_exists_exception.EntityNotExistsException: <p>The resource does not exist.</p>
        capo_workdocs.errors.failed_dependency_exception.FailedDependencyException: <p>The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.</p>
        capo_workdocs.errors.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.invalid_password_exception.InvalidPasswordException: <p>The password is invalid.</p>
        capo_workdocs.errors.limit_exceeded_exception.LimitExceededException: <p>The maximum of 100,000 files and folders under the parent folder has been exceeded.</p>
        capo_workdocs.errors.prohibited_state_exception.ProhibitedStateException: <p>The specified document version is not in the INITIALIZED state.</p>
        capo_workdocs.errors.resource_already_checked_out_exception.ResourceAlreadyCheckedOutException: <p>The resource is already checked out.</p>
        capo_workdocs.errors.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</p>
        capo_workdocs.errors.storage_limit_exceeded_exception.StorageLimitExceededException: <p>The storage limit has been exceeded.</p>
        capo_workdocs.errors.storage_limit_will_exceed_exception.StorageLimitWillExceedException: <p>The storage limit will be exceeded.</p>
        capo_workdocs.errors.unauthorized_operation_exception.UnauthorizedOperationException: <p>The operation is not permitted.</p>
        capo_workdocs.errors.unauthorized_resource_access_exception.UnauthorizedResourceAccessException: <p>The caller does not have access to perform the action on the resource.</p>
        capo_workdocs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workdocs.types.initiate_document_version_upload_request.InitiateDocumentVersionUploadRequest]",
    ) -> AsyncOperationResponse[
        "capo_workdocs.types.initiate_document_version_upload_response.InitiateDocumentVersionUploadResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.initiate_document_version_upload

        (
            output,
            http_response,
        ) = await capo_workdocs._operations.aws_gorilla_boy_service.initiate_document_version_upload.async_initiate_document_version_upload(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workdocs.types.initiate_document_version_upload_request.InitiateDocumentVersionUploadRequest",
    ) -> dict[str, Any]:
        import capo_workdocs.types.initiate_document_version_upload_request

        return capo_workdocs.types.initiate_document_version_upload_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_workdocs.types.initiate_document_version_upload_response.InitiateDocumentVersionUploadResponse",
    ) -> dict[str, Any]:
        import capo_workdocs.types.initiate_document_version_upload_response

        return capo_workdocs.types.initiate_document_version_upload_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "InitiateDocumentVersionUpload",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_workdocs.types.initiate_document_version_upload_request.InitiateDocumentVersionUploadRequest = {}
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if id is not None:
        input_["id"] = id
    if name is not None:
        input_["name"] = name
    if content_created_timestamp is not None:
        input_["content_created_timestamp"] = content_created_timestamp
    if content_modified_timestamp is not None:
        input_["content_modified_timestamp"] = content_modified_timestamp
    if content_type is not None:
        input_["content_type"] = content_type
    if document_size_in_bytes is not None:
        input_["document_size_in_bytes"] = document_size_in_bytes
    if parent_folder_id is not None:
        input_["parent_folder_id"] = parent_folder_id

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