aws-sdk-wickr 1.3.0

AWS SDK for AWS Wickr Admin API
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a single network-level configuration setting with its name, value, and data type. Settings control network-wide behaviors and features.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Setting {
    /// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
    pub option_name: ::std::string::String,
    /// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
    pub value: ::std::string::String,
    /// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
    pub r#type: ::std::string::String,
}
impl Setting {
    /// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
    pub fn option_name(&self) -> &str {
        use std::ops::Deref;
        self.option_name.deref()
    }
    /// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
    pub fn value(&self) -> &str {
        use std::ops::Deref;
        self.value.deref()
    }
    /// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
    pub fn r#type(&self) -> &str {
        use std::ops::Deref;
        self.r#type.deref()
    }
}
impl Setting {
    /// Creates a new builder-style object to manufacture [`Setting`](crate::types::Setting).
    pub fn builder() -> crate::types::builders::SettingBuilder {
        crate::types::builders::SettingBuilder::default()
    }
}

/// A builder for [`Setting`](crate::types::Setting).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SettingBuilder {
    pub(crate) option_name: ::std::option::Option<::std::string::String>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<::std::string::String>,
}
impl SettingBuilder {
    /// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
    /// This field is required.
    pub fn option_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
    pub fn set_option_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_name = input;
        self
    }
    /// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
    pub fn get_option_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_name
    }
    /// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
    /// This field is required.
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
    /// This field is required.
    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.r#type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Setting`](crate::types::Setting).
    /// This method will fail if any of the following fields are not set:
    /// - [`option_name`](crate::types::builders::SettingBuilder::option_name)
    /// - [`value`](crate::types::builders::SettingBuilder::value)
    /// - [`r#type`](crate::types::builders::SettingBuilder::type)
    pub fn build(self) -> ::std::result::Result<crate::types::Setting, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Setting {
            option_name: self.option_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "option_name",
                    "option_name was not specified but it is required when building Setting",
                )
            })?,
            value: self.value.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "value",
                    "value was not specified but it is required when building Setting",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building Setting",
                )
            })?,
        })
    }
}