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 SubscribeToDatasetRequest.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SubscribeToDatasetInput {
    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</p>
    pub identity_pool_id: ::std::option::Option<::std::string::String>,
    /// <p>Unique ID for this identity.</p>
    pub identity_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the dataset to subcribe to.</p>
    pub dataset_name: ::std::option::Option<::std::string::String>,
    /// <p>The unique ID generated for this device by Cognito.</p>
    pub device_id: ::std::option::Option<::std::string::String>,
}
impl SubscribeToDatasetInput {
    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</p>
    pub fn identity_pool_id(&self) -> ::std::option::Option<&str> {
        self.identity_pool_id.as_deref()
    }
    /// <p>Unique ID for this identity.</p>
    pub fn identity_id(&self) -> ::std::option::Option<&str> {
        self.identity_id.as_deref()
    }
    /// <p>The name of the dataset to subcribe to.</p>
    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
        self.dataset_name.as_deref()
    }
    /// <p>The unique ID generated for this device by Cognito.</p>
    pub fn device_id(&self) -> ::std::option::Option<&str> {
        self.device_id.as_deref()
    }
}
impl SubscribeToDatasetInput {
    /// Creates a new builder-style object to manufacture [`SubscribeToDatasetInput`](crate::operation::subscribe_to_dataset::SubscribeToDatasetInput).
    pub fn builder() -> crate::operation::subscribe_to_dataset::builders::SubscribeToDatasetInputBuilder {
        crate::operation::subscribe_to_dataset::builders::SubscribeToDatasetInputBuilder::default()
    }
}

/// A builder for [`SubscribeToDatasetInput`](crate::operation::subscribe_to_dataset::SubscribeToDatasetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubscribeToDatasetInputBuilder {
    pub(crate) identity_pool_id: ::std::option::Option<::std::string::String>,
    pub(crate) identity_id: ::std::option::Option<::std::string::String>,
    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
    pub(crate) device_id: ::std::option::Option<::std::string::String>,
}
impl SubscribeToDatasetInputBuilder {
    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</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>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</p>
    pub fn set_identity_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_pool_id = input;
        self
    }
    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</p>
    pub fn get_identity_pool_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_pool_id
    }
    /// <p>Unique ID for this identity.</p>
    /// This field is required.
    pub fn identity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identity_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Unique ID for this identity.</p>
    pub fn set_identity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_id = input;
        self
    }
    /// <p>Unique ID for this identity.</p>
    pub fn get_identity_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_id
    }
    /// <p>The name of the dataset to subcribe to.</p>
    /// This field is required.
    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.dataset_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the dataset to subcribe to.</p>
    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dataset_name = input;
        self
    }
    /// <p>The name of the dataset to subcribe to.</p>
    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.dataset_name
    }
    /// <p>The unique ID generated for this device by Cognito.</p>
    /// This field is required.
    pub fn device_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.device_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID generated for this device by Cognito.</p>
    pub fn set_device_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.device_id = input;
        self
    }
    /// <p>The unique ID generated for this device by Cognito.</p>
    pub fn get_device_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.device_id
    }
    /// Consumes the builder and constructs a [`SubscribeToDatasetInput`](crate::operation::subscribe_to_dataset::SubscribeToDatasetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::subscribe_to_dataset::SubscribeToDatasetInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::subscribe_to_dataset::SubscribeToDatasetInput {
            identity_pool_id: self.identity_pool_id,
            identity_id: self.identity_id,
            dataset_name: self.dataset_name,
            device_id: self.device_id,
        })
    }
}