aws_sdk_dataexchange/operation/create_revision/
_create_revision_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRevisionInput {
6    /// <p>An optional comment about the revision.</p>
7    pub comment: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier for a data set.</p>
9    pub data_set_id: ::std::option::Option<::std::string::String>,
10    /// <p>A revision tag is an optional label that you can assign to a revision when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateRevisionInput {
14    /// <p>An optional comment about the revision.</p>
15    pub fn comment(&self) -> ::std::option::Option<&str> {
16        self.comment.as_deref()
17    }
18    /// <p>The unique identifier for a data set.</p>
19    pub fn data_set_id(&self) -> ::std::option::Option<&str> {
20        self.data_set_id.as_deref()
21    }
22    /// <p>A revision tag is an optional label that you can assign to a revision when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>
23    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24        self.tags.as_ref()
25    }
26}
27impl CreateRevisionInput {
28    /// Creates a new builder-style object to manufacture [`CreateRevisionInput`](crate::operation::create_revision::CreateRevisionInput).
29    pub fn builder() -> crate::operation::create_revision::builders::CreateRevisionInputBuilder {
30        crate::operation::create_revision::builders::CreateRevisionInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateRevisionInput`](crate::operation::create_revision::CreateRevisionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateRevisionInputBuilder {
38    pub(crate) comment: ::std::option::Option<::std::string::String>,
39    pub(crate) data_set_id: ::std::option::Option<::std::string::String>,
40    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl CreateRevisionInputBuilder {
43    /// <p>An optional comment about the revision.</p>
44    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.comment = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>An optional comment about the revision.</p>
49    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.comment = input;
51        self
52    }
53    /// <p>An optional comment about the revision.</p>
54    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
55        &self.comment
56    }
57    /// <p>The unique identifier for a data set.</p>
58    /// This field is required.
59    pub fn data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.data_set_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The unique identifier for a data set.</p>
64    pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.data_set_id = input;
66        self
67    }
68    /// <p>The unique identifier for a data set.</p>
69    pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.data_set_id
71    }
72    /// Adds a key-value pair to `tags`.
73    ///
74    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
75    ///
76    /// <p>A revision tag is an optional label that you can assign to a revision when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>
77    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
78        let mut hash_map = self.tags.unwrap_or_default();
79        hash_map.insert(k.into(), v.into());
80        self.tags = ::std::option::Option::Some(hash_map);
81        self
82    }
83    /// <p>A revision tag is an optional label that you can assign to a revision when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>
84    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
85        self.tags = input;
86        self
87    }
88    /// <p>A revision tag is an optional label that you can assign to a revision when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>
89    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
90        &self.tags
91    }
92    /// Consumes the builder and constructs a [`CreateRevisionInput`](crate::operation::create_revision::CreateRevisionInput).
93    pub fn build(
94        self,
95    ) -> ::std::result::Result<crate::operation::create_revision::CreateRevisionInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::create_revision::CreateRevisionInput {
97            comment: self.comment,
98            data_set_id: self.data_set_id,
99            tags: self.tags,
100        })
101    }
102}