Skip to content

update_channel_namespace async

update_channel_namespace(
    api_id: String,
    name: Namespace,
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
    subscribe_auth_modes: Optional[AuthModes] = None,
    publish_auth_modes: Optional[AuthModes] = None,
    code_handlers: Optional[Code] = None,
    handler_configs: Optional[HandlerConfigs] = None,
) -> UpdateChannelNamespaceResponse

Updates a ChannelNamespace associated with an Api.

Parameters:

  • api_id (String) –

    The Api ID.

  • name (Namespace) –

    The name of the ChannelNamespace.

  • subscribe_auth_modes (Optional[AuthModes], default: None ) –

    The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Api authorization configuration.

  • publish_auth_modes (Optional[AuthModes], default: None ) –

    The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Api authorization configuration.

  • code_handlers (Optional[Code], default: None ) –

    The event handler functions that run custom business logic to process published events and subscribe requests.

  • handler_configs (Optional[HandlerConfigs], default: None ) –

    The configuration for the OnPublish and OnSubscribe handlers.

Raises:

  • AccessDeniedException –

    You don't have access to perform this operation on this resource.

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.

  • ConcurrentModificationException –

    Another modification is in progress at this time and it must complete before you can make your change.

  • InternalFailureException –

    An internal AppSync error occurred. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource, and then try again.

  • UnauthorizedException –

    You aren't authorized to perform this operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appsync/_services/async_app_sync.py
async def update_channel_namespace(
    self,
    api_id: "capo_appsync.types.string.String",
    name: "capo_appsync.types.namespace.Namespace",
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
    subscribe_auth_modes: Optional[
        "capo_appsync.types.auth_modes.AuthModes"
    ] = None,
    publish_auth_modes: Optional["capo_appsync.types.auth_modes.AuthModes"] = None,
    code_handlers: Optional["capo_appsync.types.code.Code"] = None,
    handler_configs: Optional[
        "capo_appsync.types.handler_configs.HandlerConfigs"
    ] = None,
) -> "capo_appsync.types.update_channel_namespace_response.UpdateChannelNamespaceResponse":
    """<p>Updates a <code>ChannelNamespace</code> associated with an <code>Api</code>.</p>

    Args:
        api_id: <p>The <code>Api</code> ID.</p>
        name: <p>The name of the <code>ChannelNamespace</code>.</p>
        subscribe_auth_modes: <p>The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
        publish_auth_modes: <p>The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
        code_handlers: <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
        handler_configs: <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>

    Raises:
        capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
        capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
        capo_appsync.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Another modification is in progress at this time and it must complete before you can make your change.</p>
        capo_appsync.errors.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</p>
        capo_appsync.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
        capo_appsync.errors.unauthorized_exception.UnauthorizedException: <p>You aren't authorized to perform this operation.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appsync.types.update_channel_namespace_request.UpdateChannelNamespaceRequest]",
    ) -> AsyncOperationResponse[
        "capo_appsync.types.update_channel_namespace_response.UpdateChannelNamespaceResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.update_channel_namespace

        (
            output,
            http_response,
        ) = await capo_appsync._operations.aws_deepdish_control_plane_service.update_channel_namespace.async_update_channel_namespace(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateChannelNamespace")
    )
    input_: capo_appsync.types.update_channel_namespace_request.UpdateChannelNamespaceRequest = {
        "api_id": api_id,
        "name": name,
    }
    if subscribe_auth_modes is not None:
        input_["subscribe_auth_modes"] = subscribe_auth_modes
    if publish_auth_modes is not None:
        input_["publish_auth_modes"] = publish_auth_modes
    if code_handlers is not None:
        input_["code_handlers"] = code_handlers
    if handler_configs is not None:
        input_["handler_configs"] = handler_configs

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