aws-sdk-cognitosync 1.99.0

AWS SDK for Amazon Cognito Sync
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A request to configure Cognito Events"</p>"
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SetCognitoEventsInput {
    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
    pub identity_pool_id: ::std::option::Option<::std::string::String>,
    /// <p>The events to configure</p>
    pub events: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl SetCognitoEventsInput {
    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
    pub fn identity_pool_id(&self) -> ::std::option::Option<&str> {
        self.identity_pool_id.as_deref()
    }
    /// <p>The events to configure</p>
    pub fn events(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.events.as_ref()
    }
}
impl SetCognitoEventsInput {
    /// Creates a new builder-style object to manufacture [`SetCognitoEventsInput`](crate::operation::set_cognito_events::SetCognitoEventsInput).
    pub fn builder() -> crate::operation::set_cognito_events::builders::SetCognitoEventsInputBuilder {
        crate::operation::set_cognito_events::builders::SetCognitoEventsInputBuilder::default()
    }
}

/// A builder for [`SetCognitoEventsInput`](crate::operation::set_cognito_events::SetCognitoEventsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SetCognitoEventsInputBuilder {
    pub(crate) identity_pool_id: ::std::option::Option<::std::string::String>,
    pub(crate) events: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl SetCognitoEventsInputBuilder {
    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
    /// This field is required.
    pub fn identity_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identity_pool_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
    pub fn set_identity_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_pool_id = input;
        self
    }
    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
    pub fn get_identity_pool_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_pool_id
    }
    /// Adds a key-value pair to `events`.
    ///
    /// To override the contents of this collection use [`set_events`](Self::set_events).
    ///
    /// <p>The events to configure</p>
    pub fn events(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.events.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.events = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The events to configure</p>
    pub fn set_events(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.events = input;
        self
    }
    /// <p>The events to configure</p>
    pub fn get_events(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.events
    }
    /// Consumes the builder and constructs a [`SetCognitoEventsInput`](crate::operation::set_cognito_events::SetCognitoEventsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::set_cognito_events::SetCognitoEventsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::set_cognito_events::SetCognitoEventsInput {
            identity_pool_id: self.identity_pool_id,
            events: self.events,
        })
    }
}