aws-sdk-appsync 1.111.0

AWS SDK for AWS AppSync
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateChannelNamespaceInput {
    /// <p>The <code>Api</code> ID.</p>
    pub api_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the <code>ChannelNamespace</code>.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <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>
    pub subscribe_auth_modes: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>,
    /// <p>The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
    pub publish_auth_modes: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>,
    /// <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
    pub code_handlers: ::std::option::Option<::std::string::String>,
    /// <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
    pub handler_configs: ::std::option::Option<crate::types::HandlerConfigs>,
}
impl UpdateChannelNamespaceInput {
    /// <p>The <code>Api</code> ID.</p>
    pub fn api_id(&self) -> ::std::option::Option<&str> {
        self.api_id.as_deref()
    }
    /// <p>The name of the <code>ChannelNamespace</code>.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subscribe_auth_modes.is_none()`.
    pub fn subscribe_auth_modes(&self) -> &[crate::types::AuthMode] {
        self.subscribe_auth_modes.as_deref().unwrap_or_default()
    }
    /// <p>The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.publish_auth_modes.is_none()`.
    pub fn publish_auth_modes(&self) -> &[crate::types::AuthMode] {
        self.publish_auth_modes.as_deref().unwrap_or_default()
    }
    /// <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
    pub fn code_handlers(&self) -> ::std::option::Option<&str> {
        self.code_handlers.as_deref()
    }
    /// <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
    pub fn handler_configs(&self) -> ::std::option::Option<&crate::types::HandlerConfigs> {
        self.handler_configs.as_ref()
    }
}
impl UpdateChannelNamespaceInput {
    /// Creates a new builder-style object to manufacture [`UpdateChannelNamespaceInput`](crate::operation::update_channel_namespace::UpdateChannelNamespaceInput).
    pub fn builder() -> crate::operation::update_channel_namespace::builders::UpdateChannelNamespaceInputBuilder {
        crate::operation::update_channel_namespace::builders::UpdateChannelNamespaceInputBuilder::default()
    }
}

/// A builder for [`UpdateChannelNamespaceInput`](crate::operation::update_channel_namespace::UpdateChannelNamespaceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateChannelNamespaceInputBuilder {
    pub(crate) api_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) subscribe_auth_modes: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>,
    pub(crate) publish_auth_modes: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>,
    pub(crate) code_handlers: ::std::option::Option<::std::string::String>,
    pub(crate) handler_configs: ::std::option::Option<crate::types::HandlerConfigs>,
}
impl UpdateChannelNamespaceInputBuilder {
    /// <p>The <code>Api</code> ID.</p>
    /// This field is required.
    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.api_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <code>Api</code> ID.</p>
    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.api_id = input;
        self
    }
    /// <p>The <code>Api</code> ID.</p>
    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.api_id
    }
    /// <p>The name of the <code>ChannelNamespace</code>.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the <code>ChannelNamespace</code>.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the <code>ChannelNamespace</code>.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `subscribe_auth_modes`.
    ///
    /// To override the contents of this collection use [`set_subscribe_auth_modes`](Self::set_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>
    pub fn subscribe_auth_modes(mut self, input: crate::types::AuthMode) -> Self {
        let mut v = self.subscribe_auth_modes.unwrap_or_default();
        v.push(input);
        self.subscribe_auth_modes = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_subscribe_auth_modes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>) -> Self {
        self.subscribe_auth_modes = input;
        self
    }
    /// <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>
    pub fn get_subscribe_auth_modes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AuthMode>> {
        &self.subscribe_auth_modes
    }
    /// Appends an item to `publish_auth_modes`.
    ///
    /// To override the contents of this collection use [`set_publish_auth_modes`](Self::set_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>
    pub fn publish_auth_modes(mut self, input: crate::types::AuthMode) -> Self {
        let mut v = self.publish_auth_modes.unwrap_or_default();
        v.push(input);
        self.publish_auth_modes = ::std::option::Option::Some(v);
        self
    }
    /// <p>The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
    pub fn set_publish_auth_modes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AuthMode>>) -> Self {
        self.publish_auth_modes = input;
        self
    }
    /// <p>The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default <code>Api</code> authorization configuration.</p>
    pub fn get_publish_auth_modes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AuthMode>> {
        &self.publish_auth_modes
    }
    /// <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
    pub fn code_handlers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.code_handlers = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
    pub fn set_code_handlers(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.code_handlers = input;
        self
    }
    /// <p>The event handler functions that run custom business logic to process published events and subscribe requests.</p>
    pub fn get_code_handlers(&self) -> &::std::option::Option<::std::string::String> {
        &self.code_handlers
    }
    /// <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
    pub fn handler_configs(mut self, input: crate::types::HandlerConfigs) -> Self {
        self.handler_configs = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
    pub fn set_handler_configs(mut self, input: ::std::option::Option<crate::types::HandlerConfigs>) -> Self {
        self.handler_configs = input;
        self
    }
    /// <p>The configuration for the <code>OnPublish</code> and <code>OnSubscribe</code> handlers.</p>
    pub fn get_handler_configs(&self) -> &::std::option::Option<crate::types::HandlerConfigs> {
        &self.handler_configs
    }
    /// Consumes the builder and constructs a [`UpdateChannelNamespaceInput`](crate::operation::update_channel_namespace::UpdateChannelNamespaceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_channel_namespace::UpdateChannelNamespaceInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_channel_namespace::UpdateChannelNamespaceInput {
            api_id: self.api_id,
            name: self.name,
            subscribe_auth_modes: self.subscribe_auth_modes,
            publish_auth_modes: self.publish_auth_modes,
            code_handlers: self.code_handlers,
            handler_configs: self.handler_configs,
        })
    }
}