Skip to content

update_acl async

update_acl(
    acl_name: String,
    *,
    config_overrides: Optional[AsyncMemoryDBClientConfig] = None,
    user_names_to_add: Optional[UserNameListInput] = None,
    user_names_to_remove: Optional[UserNameListInput] = None,
) -> UpdateACLResponse

Changes the list of users that belong to the Access Control List.

Parameters:

  • acl_name (String) –

    The name of the Access Control List.

  • user_names_to_add (Optional[UserNameListInput], default: None ) –

    The list of users to add to the Access Control List.

  • user_names_to_remove (Optional[UserNameListInput], default: None ) –

    The list of users to remove from the Access Control List.

Raises:

Source code in docs_src/capo_memorydb/_services/async_memory_db.py
async def update_acl(
    self,
    acl_name: "capo_memorydb.types.string.String",
    *,
    config_overrides: Optional[AsyncMemoryDBClientConfig] = None,
    user_names_to_add: Optional[
        "capo_memorydb.types.user_name_list_input.UserNameListInput"
    ] = None,
    user_names_to_remove: Optional[
        "capo_memorydb.types.user_name_list_input.UserNameListInput"
    ] = None,
) -> "capo_memorydb.types.update_acl_response.UpdateACLResponse":
    """<p>Changes the list of users that belong to the Access Control List.</p>

    Args:
        acl_name: <p>The name of the Access Control List.</p>
        user_names_to_add: <p>The list of users to add to the Access Control List.</p>
        user_names_to_remove: <p>The list of users to remove from the Access Control List.</p>

    Raises:
        capo_memorydb.errors.acl_not_found_fault.ACLNotFoundFault: <p>The specified ACL does not exist.</p>
        capo_memorydb.errors.default_user_required.DefaultUserRequired: <p>A default user is required and must be specified.</p>
        capo_memorydb.errors.duplicate_user_name_fault.DuplicateUserNameFault: <p>A user with the specified name already exists.</p>
        capo_memorydb.errors.invalid_acl_state_fault.InvalidACLStateFault: <p>The ACL is not in a valid state for the requested operation.</p>
        capo_memorydb.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>The specified parameter combination is not valid.</p>
        capo_memorydb.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The specified parameter value is not valid.</p>
        capo_memorydb.errors.user_not_found_fault.UserNotFoundFault: <p>The specified user does not exist.</p>
        capo_memorydb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_memorydb.types.update_acl_request.UpdateACLRequest]",
    ) -> AsyncOperationResponse[
        "capo_memorydb.types.update_acl_response.UpdateACLResponse"
    ]:
        import capo_memorydb._operations.amazon_memory_db.update_acl

        (
            output,
            http_response,
        ) = await capo_memorydb._operations.amazon_memory_db.update_acl.async_update_acl(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateACL")
    )
    input_: capo_memorydb.types.update_acl_request.UpdateACLRequest = {
        "acl_name": acl_name
    }
    if user_names_to_add is not None:
        input_["user_names_to_add"] = user_names_to_add
    if user_names_to_remove is not None:
        input_["user_names_to_remove"] = user_names_to_remove

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