aws-sdk-chatbot 1.91.0

AWS SDK for AWS Chatbot
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 CreateCustomActionInput {
    /// <p>The definition of the command to run when invoked as an alias or as an action button.</p>
    pub definition: ::std::option::Option<crate::types::CustomActionDefinition>,
    /// <p>The name used to invoke this action in a chat channel. For example, <code>@aws run my-alias</code>.</p>
    pub alias_name: ::std::option::Option<::std::string::String>,
    /// <p>Defines when this custom action button should be attached to a notification.</p>
    pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::CustomActionAttachment>>,
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
    /// <p>If you do not specify a client token, one is automatically generated by the SDK.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the custom action. This name is included in the Amazon Resource Name (ARN).</p>
    pub action_name: ::std::option::Option<::std::string::String>,
}
impl CreateCustomActionInput {
    /// <p>The definition of the command to run when invoked as an alias or as an action button.</p>
    pub fn definition(&self) -> ::std::option::Option<&crate::types::CustomActionDefinition> {
        self.definition.as_ref()
    }
    /// <p>The name used to invoke this action in a chat channel. For example, <code>@aws run my-alias</code>.</p>
    pub fn alias_name(&self) -> ::std::option::Option<&str> {
        self.alias_name.as_deref()
    }
    /// <p>Defines when this custom action button should be attached to a notification.</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 `.attachments.is_none()`.
    pub fn attachments(&self) -> &[crate::types::CustomActionAttachment] {
        self.attachments.as_deref().unwrap_or_default()
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
    /// <p>If you do not specify a client token, one is automatically generated by the SDK.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The name of the custom action. This name is included in the Amazon Resource Name (ARN).</p>
    pub fn action_name(&self) -> ::std::option::Option<&str> {
        self.action_name.as_deref()
    }
}
impl CreateCustomActionInput {
    /// Creates a new builder-style object to manufacture [`CreateCustomActionInput`](crate::operation::create_custom_action::CreateCustomActionInput).
    pub fn builder() -> crate::operation::create_custom_action::builders::CreateCustomActionInputBuilder {
        crate::operation::create_custom_action::builders::CreateCustomActionInputBuilder::default()
    }
}

/// A builder for [`CreateCustomActionInput`](crate::operation::create_custom_action::CreateCustomActionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCustomActionInputBuilder {
    pub(crate) definition: ::std::option::Option<crate::types::CustomActionDefinition>,
    pub(crate) alias_name: ::std::option::Option<::std::string::String>,
    pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::CustomActionAttachment>>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) action_name: ::std::option::Option<::std::string::String>,
}
impl CreateCustomActionInputBuilder {
    /// <p>The definition of the command to run when invoked as an alias or as an action button.</p>
    /// This field is required.
    pub fn definition(mut self, input: crate::types::CustomActionDefinition) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>The definition of the command to run when invoked as an alias or as an action button.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::CustomActionDefinition>) -> Self {
        self.definition = input;
        self
    }
    /// <p>The definition of the command to run when invoked as an alias or as an action button.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::CustomActionDefinition> {
        &self.definition
    }
    /// <p>The name used to invoke this action in a chat channel. For example, <code>@aws run my-alias</code>.</p>
    pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.alias_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name used to invoke this action in a chat channel. For example, <code>@aws run my-alias</code>.</p>
    pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.alias_name = input;
        self
    }
    /// <p>The name used to invoke this action in a chat channel. For example, <code>@aws run my-alias</code>.</p>
    pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.alias_name
    }
    /// Appends an item to `attachments`.
    ///
    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
    ///
    /// <p>Defines when this custom action button should be attached to a notification.</p>
    pub fn attachments(mut self, input: crate::types::CustomActionAttachment) -> Self {
        let mut v = self.attachments.unwrap_or_default();
        v.push(input);
        self.attachments = ::std::option::Option::Some(v);
        self
    }
    /// <p>Defines when this custom action button should be attached to a notification.</p>
    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomActionAttachment>>) -> Self {
        self.attachments = input;
        self
    }
    /// <p>Defines when this custom action button should be attached to a notification.</p>
    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomActionAttachment>> {
        &self.attachments
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
    /// <p>If you do not specify a client token, one is automatically generated by the SDK.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
    /// <p>If you do not specify a client token, one is automatically generated by the SDK.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
    /// <p>If you do not specify a client token, one is automatically generated by the SDK.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The name of the custom action. This name is included in the Amazon Resource Name (ARN).</p>
    /// This field is required.
    pub fn action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the custom action. This name is included in the Amazon Resource Name (ARN).</p>
    pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_name = input;
        self
    }
    /// <p>The name of the custom action. This name is included in the Amazon Resource Name (ARN).</p>
    pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_name
    }
    /// Consumes the builder and constructs a [`CreateCustomActionInput`](crate::operation::create_custom_action::CreateCustomActionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_custom_action::CreateCustomActionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_custom_action::CreateCustomActionInput {
            definition: self.definition,
            alias_name: self.alias_name,
            attachments: self.attachments,
            tags: self.tags,
            client_token: self.client_token,
            action_name: self.action_name,
        })
    }
}