aws-sdk-appconfigcloudextension 1.0.0

AWS SDK for AWS AppConfig Cloud Extension
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// The input of GetFlag.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetFlagInput {
    /// The name or ID of the AWS AppConfig application.
    pub application: ::std::option::Option<::std::string::String>,
    /// The name or ID of the AWS AppConfig environment the configuration is deployed to.
    pub environment: ::std::option::Option<::std::string::String>,
    /// The name or ID of the feature flag configuration profile.
    pub configuration: ::std::option::Option<::std::string::String>,
    /// The key of the flag to return.
    pub flag: ::std::option::Option<::std::string::String>,
    /// The request context that the flag's variant rules are evaluated against.
    pub context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetFlagInput {
    /// The name or ID of the AWS AppConfig application.
    pub fn application(&self) -> ::std::option::Option<&str> {
        self.application.as_deref()
    }
    /// The name or ID of the AWS AppConfig environment the configuration is deployed to.
    pub fn environment(&self) -> ::std::option::Option<&str> {
        self.environment.as_deref()
    }
    /// The name or ID of the feature flag configuration profile.
    pub fn configuration(&self) -> ::std::option::Option<&str> {
        self.configuration.as_deref()
    }
    /// The key of the flag to return.
    pub fn flag(&self) -> ::std::option::Option<&str> {
        self.flag.as_deref()
    }
    /// The request context that the flag's variant rules are evaluated against.
    pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.context.as_ref()
    }
}
impl GetFlagInput {
    /// Creates a new builder-style object to manufacture [`GetFlagInput`](crate::operation::get_flag::GetFlagInput).
    pub fn builder() -> crate::operation::get_flag::builders::GetFlagInputBuilder {
        crate::operation::get_flag::builders::GetFlagInputBuilder::default()
    }
}

/// A builder for [`GetFlagInput`](crate::operation::get_flag::GetFlagInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFlagInputBuilder {
    pub(crate) application: ::std::option::Option<::std::string::String>,
    pub(crate) environment: ::std::option::Option<::std::string::String>,
    pub(crate) configuration: ::std::option::Option<::std::string::String>,
    pub(crate) flag: ::std::option::Option<::std::string::String>,
    pub(crate) context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetFlagInputBuilder {
    /// The name or ID of the AWS AppConfig application.
    /// This field is required.
    pub fn application(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application = ::std::option::Option::Some(input.into());
        self
    }
    /// The name or ID of the AWS AppConfig application.
    pub fn set_application(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application = input;
        self
    }
    /// The name or ID of the AWS AppConfig application.
    pub fn get_application(&self) -> &::std::option::Option<::std::string::String> {
        &self.application
    }
    /// The name or ID of the AWS AppConfig environment the configuration is deployed to.
    /// This field is required.
    pub fn environment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment = ::std::option::Option::Some(input.into());
        self
    }
    /// The name or ID of the AWS AppConfig environment the configuration is deployed to.
    pub fn set_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment = input;
        self
    }
    /// The name or ID of the AWS AppConfig environment the configuration is deployed to.
    pub fn get_environment(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment
    }
    /// The name or ID of the feature flag configuration profile.
    /// This field is required.
    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.configuration = ::std::option::Option::Some(input.into());
        self
    }
    /// The name or ID of the feature flag configuration profile.
    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.configuration = input;
        self
    }
    /// The name or ID of the feature flag configuration profile.
    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
        &self.configuration
    }
    /// The key of the flag to return.
    /// This field is required.
    pub fn flag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.flag = ::std::option::Option::Some(input.into());
        self
    }
    /// The key of the flag to return.
    pub fn set_flag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.flag = input;
        self
    }
    /// The key of the flag to return.
    pub fn get_flag(&self) -> &::std::option::Option<::std::string::String> {
        &self.flag
    }
    /// Adds a key-value pair to `context`.
    ///
    /// To override the contents of this collection use [`set_context`](Self::set_context).
    ///
    /// The request context that the flag's variant rules are evaluated against.
    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.context.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.context = ::std::option::Option::Some(hash_map);
        self
    }
    /// The request context that the flag's variant rules are evaluated against.
    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.context = input;
        self
    }
    /// The request context that the flag's variant rules are evaluated against.
    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.context
    }
    /// Consumes the builder and constructs a [`GetFlagInput`](crate::operation::get_flag::GetFlagInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::get_flag::GetFlagInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_flag::GetFlagInput {
            application: self.application,
            environment: self.environment,
            configuration: self.configuration,
            flag: self.flag,
            context: self.context,
        })
    }
}