aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
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 CreateOmniDashboardInput {
    /// The unique ID of the space to create the dashboard in.
    pub space_id: ::std::option::Option<::std::string::String>,
    /// A name that identifies the dashboard.
    pub name: ::std::option::Option<::std::string::String>,
    /// The dashboard definition, as a JSON document. Maximum 1 MiB.
    pub body: ::std::option::Option<::std::string::String>,
    /// An optional description of the dashboard.
    pub description: ::std::option::Option<::std::string::String>,
    /// The tags to associate with the dashboard.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateOmniDashboardInput {
    /// The unique ID of the space to create the dashboard in.
    pub fn space_id(&self) -> ::std::option::Option<&str> {
        self.space_id.as_deref()
    }
    /// A name that identifies the dashboard.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The dashboard definition, as a JSON document. Maximum 1 MiB.
    pub fn body(&self) -> ::std::option::Option<&str> {
        self.body.as_deref()
    }
    /// An optional description of the dashboard.
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// The tags to associate with the dashboard.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateOmniDashboardInput {
    /// Creates a new builder-style object to manufacture [`CreateOmniDashboardInput`](crate::operation::create_omni_dashboard::CreateOmniDashboardInput).
    pub fn builder() -> crate::operation::create_omni_dashboard::builders::CreateOmniDashboardInputBuilder {
        crate::operation::create_omni_dashboard::builders::CreateOmniDashboardInputBuilder::default()
    }
}

/// A builder for [`CreateOmniDashboardInput`](crate::operation::create_omni_dashboard::CreateOmniDashboardInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateOmniDashboardInputBuilder {
    pub(crate) space_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) body: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateOmniDashboardInputBuilder {
    /// The unique ID of the space to create the dashboard in.
    /// This field is required.
    pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique ID of the space to create the dashboard in.
    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.space_id = input;
        self
    }
    /// The unique ID of the space to create the dashboard in.
    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_id
    }
    /// A name that identifies the dashboard.
    /// 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
    }
    /// A name that identifies the dashboard.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// A name that identifies the dashboard.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The dashboard definition, as a JSON document. Maximum 1 MiB.
    /// This field is required.
    pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.body = ::std::option::Option::Some(input.into());
        self
    }
    /// The dashboard definition, as a JSON document. Maximum 1 MiB.
    pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.body = input;
        self
    }
    /// The dashboard definition, as a JSON document. Maximum 1 MiB.
    pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
        &self.body
    }
    /// An optional description of the dashboard.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// An optional description of the dashboard.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// An optional description of the dashboard.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// The tags to associate with the dashboard.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// The tags to associate with the dashboard.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// The tags to associate with the dashboard.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    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
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateOmniDashboardInput`](crate::operation::create_omni_dashboard::CreateOmniDashboardInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_omni_dashboard::CreateOmniDashboardInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_omni_dashboard::CreateOmniDashboardInput {
            space_id: self.space_id,
            name: self.name,
            body: self.body,
            description: self.description,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}