1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don't exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Dataset {
    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    pub identity_id: ::std::option::Option<::std::string::String>,
    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    pub dataset_name: ::std::option::Option<::std::string::String>,
    /// Date on which the dataset was created.
    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Date when the dataset was last modified.
    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// The device that made the last change to this dataset.
    pub last_modified_by: ::std::option::Option<::std::string::String>,
    /// Total size in bytes of the records in this dataset.
    pub data_storage: ::std::option::Option<i64>,
    /// Number of records in this dataset.
    pub num_records: ::std::option::Option<i64>,
}
impl Dataset {
    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    pub fn identity_id(&self) -> ::std::option::Option<&str> {
        self.identity_id.as_deref()
    }
    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
        self.dataset_name.as_deref()
    }
    /// Date on which the dataset was created.
    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_date.as_ref()
    }
    /// Date when the dataset was last modified.
    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_date.as_ref()
    }
    /// The device that made the last change to this dataset.
    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
        self.last_modified_by.as_deref()
    }
    /// Total size in bytes of the records in this dataset.
    pub fn data_storage(&self) -> ::std::option::Option<i64> {
        self.data_storage
    }
    /// Number of records in this dataset.
    pub fn num_records(&self) -> ::std::option::Option<i64> {
        self.num_records
    }
}
impl Dataset {
    /// Creates a new builder-style object to manufacture [`Dataset`](crate::types::Dataset).
    pub fn builder() -> crate::types::builders::DatasetBuilder {
        crate::types::builders::DatasetBuilder::default()
    }
}

/// A builder for [`Dataset`](crate::types::Dataset).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DatasetBuilder {
    pub(crate) identity_id: ::std::option::Option<::std::string::String>,
    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
    pub(crate) data_storage: ::std::option::Option<i64>,
    pub(crate) num_records: ::std::option::Option<i64>,
}
impl DatasetBuilder {
    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    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
    }
    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    pub fn set_identity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_id = input;
        self
    }
    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    pub fn get_identity_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_id
    }
    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    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
    }
    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dataset_name = input;
        self
    }
    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.dataset_name
    }
    /// Date on which the dataset was created.
    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_date = ::std::option::Option::Some(input);
        self
    }
    /// Date on which the dataset was created.
    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_date = input;
        self
    }
    /// Date on which the dataset was created.
    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_date
    }
    /// Date when the dataset was last modified.
    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_date = ::std::option::Option::Some(input);
        self
    }
    /// Date when the dataset was last modified.
    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_date = input;
        self
    }
    /// Date when the dataset was last modified.
    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_date
    }
    /// The device that made the last change to this dataset.
    pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_modified_by = ::std::option::Option::Some(input.into());
        self
    }
    /// The device that made the last change to this dataset.
    pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_modified_by = input;
        self
    }
    /// The device that made the last change to this dataset.
    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_modified_by
    }
    /// Total size in bytes of the records in this dataset.
    pub fn data_storage(mut self, input: i64) -> Self {
        self.data_storage = ::std::option::Option::Some(input);
        self
    }
    /// Total size in bytes of the records in this dataset.
    pub fn set_data_storage(mut self, input: ::std::option::Option<i64>) -> Self {
        self.data_storage = input;
        self
    }
    /// Total size in bytes of the records in this dataset.
    pub fn get_data_storage(&self) -> &::std::option::Option<i64> {
        &self.data_storage
    }
    /// Number of records in this dataset.
    pub fn num_records(mut self, input: i64) -> Self {
        self.num_records = ::std::option::Option::Some(input);
        self
    }
    /// Number of records in this dataset.
    pub fn set_num_records(mut self, input: ::std::option::Option<i64>) -> Self {
        self.num_records = input;
        self
    }
    /// Number of records in this dataset.
    pub fn get_num_records(&self) -> &::std::option::Option<i64> {
        &self.num_records
    }
    /// Consumes the builder and constructs a [`Dataset`](crate::types::Dataset).
    pub fn build(self) -> crate::types::Dataset {
        crate::types::Dataset {
            identity_id: self.identity_id,
            dataset_name: self.dataset_name,
            creation_date: self.creation_date,
            last_modified_date: self.last_modified_date,
            last_modified_by: self.last_modified_by,
            data_storage: self.data_storage,
            num_records: self.num_records,
        }
    }
}