Skip to content

batch_add_channel_role_to_accessors async

batch_add_channel_role_to_accessors(
    space_id: SpaceId,
    channel_id: ChannelId,
    accessor_ids: AccessorIdList,
    channel_role: ChannelRole,
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
) -> BatchAddChannelRoleToAccessorsOutput

Add role to multiple users or groups in a private re:Post channel.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the private re:Post.

  • channel_id (ChannelId) –

    The unique ID of the private re:Post channel.

  • accessor_ids (AccessorIdList) –

    The user or group identifiers to add the role to.

  • channel_role (ChannelRole) –

    The channel role to add to the users or groups.

Raises:

Examples:

BatchAddChannelRoleToAccessors

>>> await client.batch_add_channel_role_to_accessors(space_id='SP1234567890abcdefghijkl', channel_id='WS1234567890abcdefghijkl', accessor_ids=['12345678-1234-1234-1234-1234567890ab'], channel_role='MODERATOR')
Source code in docs_src/capo_repostspace/_services/async_repostspace.py
async def batch_add_channel_role_to_accessors(
    self,
    space_id: "capo_repostspace.types.space_id.SpaceId",
    channel_id: "capo_repostspace.types.channel_id.ChannelId",
    accessor_ids: "capo_repostspace.types.accessor_id_list.AccessorIdList",
    channel_role: "capo_repostspace.types.channel_role.ChannelRole",
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
) -> "capo_repostspace.types.batch_add_channel_role_to_accessors_output.BatchAddChannelRoleToAccessorsOutput":
    """<p>Add role to multiple users or groups in a private re:Post channel.</p>

    Args:
        space_id: <p>The unique ID of the private re:Post.</p>
        channel_id: <p>The unique ID of the private re:Post channel.</p>
        accessor_ids: <p>The user or group identifiers to add the role to.</p>
        channel_role: <p>The channel role to add to the users or groups.</p>

    Raises:
        capo_repostspace.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_repostspace.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_repostspace.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_repostspace.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_repostspace.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_repostspace.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        BatchAddChannelRoleToAccessors

        >>> await client.batch_add_channel_role_to_accessors(space_id='SP1234567890abcdefghijkl', channel_id='WS1234567890abcdefghijkl', accessor_ids=['12345678-1234-1234-1234-1234567890ab'], channel_role='MODERATOR')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_repostspace.types.batch_add_channel_role_to_accessors_input.BatchAddChannelRoleToAccessorsInput]",
    ) -> AsyncOperationResponse[
        "capo_repostspace.types.batch_add_channel_role_to_accessors_output.BatchAddChannelRoleToAccessorsOutput"
    ]:
        import capo_repostspace._operations.repost_space.batch_add_channel_role_to_accessors

        (
            output,
            http_response,
        ) = await capo_repostspace._operations.repost_space.batch_add_channel_role_to_accessors.async_batch_add_channel_role_to_accessors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchAddChannelRoleToAccessors")
    )
    input_: capo_repostspace.types.batch_add_channel_role_to_accessors_input.BatchAddChannelRoleToAccessorsInput = {
        "space_id": space_id,
        "channel_id": channel_id,
        "accessor_ids": accessor_ids,
        "channel_role": channel_role,
    }

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