Skip to content

update_folder async

update_folder(
    folder_id: ResourceIdType,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    name: Optional[ResourceNameType] = None,
    parent_folder_id: Optional[ResourceIdType] = None,
    resource_state: Optional[ResourceStateType] = None,
) -> None

Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.

Parameters:

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

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

  • folder_id (ResourceIdType) –

    The ID of the folder.

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

    The name of the folder.

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

    The ID of the parent folder.

  • resource_state (Optional[ResourceStateType], default: None ) –

    The resource state of the folder. Only ACTIVE and RECYCLED are accepted values from the API.

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def update_folder(
    self,
    folder_id: "capo_workdocs.types.resource_id_type.ResourceIdType",
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    name: Optional[
        "capo_workdocs.types.resource_name_type.ResourceNameType"
    ] = None,
    parent_folder_id: Optional[
        "capo_workdocs.types.resource_id_type.ResourceIdType"
    ] = None,
    resource_state: Optional[
        "capo_workdocs.types.resource_state_type.ResourceStateType"
    ] = None,
) -> None:
    """<p>Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        folder_id: <p>The ID of the folder.</p>
        name: <p>The name of the folder.</p>
        parent_folder_id: <p>The ID of the parent folder.</p>
        resource_state: <p>The resource state of the folder. Only ACTIVE and RECYCLED are accepted values from the API.</p>

    Raises:
        capo_workdocs.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The resource hierarchy is changing.</p>
        capo_workdocs.errors.conflicting_operation_exception.ConflictingOperationException: <p>Another operation is in progress on the resource that conflicts with the current operation.</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.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.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</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.update_folder_request.UpdateFolderRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_workdocs._operations.aws_gorilla_boy_service.update_folder

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

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

        return capo_workdocs.types.update_folder_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateFolder", redact_input=_redact_input),
    )
    input_: capo_workdocs.types.update_folder_request.UpdateFolderRequest = {
        "folder_id": folder_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if name is not None:
        input_["name"] = name
    if parent_folder_id is not None:
        input_["parent_folder_id"] = parent_folder_id
    if resource_state is not None:
        input_["resource_state"] = resource_state

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