aws_sdk_managedblockchain/operation/create_proposal/
_create_proposal_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 CreateProposalInput {
6    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
7    pub client_request_token: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the network for which the proposal is made.</p>
9    pub network_id: ::std::option::Option<::std::string::String>,
10    /// <p>The unique identifier of the member that is creating the proposal. This identifier is especially useful for identifying the member making the proposal when multiple members exist in a single Amazon Web Services account.</p>
11    pub member_id: ::std::option::Option<::std::string::String>,
12    /// <p>The type of actions proposed, such as inviting a member or removing a member. The types of <code>Actions</code> in a proposal are mutually exclusive. For example, a proposal with <code>Invitations</code> actions cannot also contain <code>Removals</code> actions.</p>
13    pub actions: ::std::option::Option<crate::types::ProposalActions>,
14    /// <p>A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. as member."</p>
15    pub description: ::std::option::Option<::std::string::String>,
16    /// <p>Tags to assign to the proposal.</p>
17    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
18    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
19    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20}
21impl CreateProposalInput {
22    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
23    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
24        self.client_request_token.as_deref()
25    }
26    /// <p>The unique identifier of the network for which the proposal is made.</p>
27    pub fn network_id(&self) -> ::std::option::Option<&str> {
28        self.network_id.as_deref()
29    }
30    /// <p>The unique identifier of the member that is creating the proposal. This identifier is especially useful for identifying the member making the proposal when multiple members exist in a single Amazon Web Services account.</p>
31    pub fn member_id(&self) -> ::std::option::Option<&str> {
32        self.member_id.as_deref()
33    }
34    /// <p>The type of actions proposed, such as inviting a member or removing a member. The types of <code>Actions</code> in a proposal are mutually exclusive. For example, a proposal with <code>Invitations</code> actions cannot also contain <code>Removals</code> actions.</p>
35    pub fn actions(&self) -> ::std::option::Option<&crate::types::ProposalActions> {
36        self.actions.as_ref()
37    }
38    /// <p>A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. as member."</p>
39    pub fn description(&self) -> ::std::option::Option<&str> {
40        self.description.as_deref()
41    }
42    /// <p>Tags to assign to the proposal.</p>
43    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
44    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
45    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
46        self.tags.as_ref()
47    }
48}
49impl CreateProposalInput {
50    /// Creates a new builder-style object to manufacture [`CreateProposalInput`](crate::operation::create_proposal::CreateProposalInput).
51    pub fn builder() -> crate::operation::create_proposal::builders::CreateProposalInputBuilder {
52        crate::operation::create_proposal::builders::CreateProposalInputBuilder::default()
53    }
54}
55
56/// A builder for [`CreateProposalInput`](crate::operation::create_proposal::CreateProposalInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateProposalInputBuilder {
60    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
61    pub(crate) network_id: ::std::option::Option<::std::string::String>,
62    pub(crate) member_id: ::std::option::Option<::std::string::String>,
63    pub(crate) actions: ::std::option::Option<crate::types::ProposalActions>,
64    pub(crate) description: ::std::option::Option<::std::string::String>,
65    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
66}
67impl CreateProposalInputBuilder {
68    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
69    /// This field is required.
70    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.client_request_token = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
75    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.client_request_token = input;
77        self
78    }
79    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
80    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
81        &self.client_request_token
82    }
83    /// <p>The unique identifier of the network for which the proposal is made.</p>
84    /// This field is required.
85    pub fn network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.network_id = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The unique identifier of the network for which the proposal is made.</p>
90    pub fn set_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.network_id = input;
92        self
93    }
94    /// <p>The unique identifier of the network for which the proposal is made.</p>
95    pub fn get_network_id(&self) -> &::std::option::Option<::std::string::String> {
96        &self.network_id
97    }
98    /// <p>The unique identifier of the member that is creating the proposal. This identifier is especially useful for identifying the member making the proposal when multiple members exist in a single Amazon Web Services account.</p>
99    /// This field is required.
100    pub fn member_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.member_id = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The unique identifier of the member that is creating the proposal. This identifier is especially useful for identifying the member making the proposal when multiple members exist in a single Amazon Web Services account.</p>
105    pub fn set_member_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.member_id = input;
107        self
108    }
109    /// <p>The unique identifier of the member that is creating the proposal. This identifier is especially useful for identifying the member making the proposal when multiple members exist in a single Amazon Web Services account.</p>
110    pub fn get_member_id(&self) -> &::std::option::Option<::std::string::String> {
111        &self.member_id
112    }
113    /// <p>The type of actions proposed, such as inviting a member or removing a member. The types of <code>Actions</code> in a proposal are mutually exclusive. For example, a proposal with <code>Invitations</code> actions cannot also contain <code>Removals</code> actions.</p>
114    /// This field is required.
115    pub fn actions(mut self, input: crate::types::ProposalActions) -> Self {
116        self.actions = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The type of actions proposed, such as inviting a member or removing a member. The types of <code>Actions</code> in a proposal are mutually exclusive. For example, a proposal with <code>Invitations</code> actions cannot also contain <code>Removals</code> actions.</p>
120    pub fn set_actions(mut self, input: ::std::option::Option<crate::types::ProposalActions>) -> Self {
121        self.actions = input;
122        self
123    }
124    /// <p>The type of actions proposed, such as inviting a member or removing a member. The types of <code>Actions</code> in a proposal are mutually exclusive. For example, a proposal with <code>Invitations</code> actions cannot also contain <code>Removals</code> actions.</p>
125    pub fn get_actions(&self) -> &::std::option::Option<crate::types::ProposalActions> {
126        &self.actions
127    }
128    /// <p>A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. as member."</p>
129    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.description = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. as member."</p>
134    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.description = input;
136        self
137    }
138    /// <p>A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. as member."</p>
139    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
140        &self.description
141    }
142    /// Adds a key-value pair to `tags`.
143    ///
144    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
145    ///
146    /// <p>Tags to assign to the proposal.</p>
147    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
148    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
149    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
150        let mut hash_map = self.tags.unwrap_or_default();
151        hash_map.insert(k.into(), v.into());
152        self.tags = ::std::option::Option::Some(hash_map);
153        self
154    }
155    /// <p>Tags to assign to the proposal.</p>
156    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
157    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
158    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
159        self.tags = input;
160        self
161    }
162    /// <p>Tags to assign to the proposal.</p>
163    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
164    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
165    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
166        &self.tags
167    }
168    /// Consumes the builder and constructs a [`CreateProposalInput`](crate::operation::create_proposal::CreateProposalInput).
169    pub fn build(
170        self,
171    ) -> ::std::result::Result<crate::operation::create_proposal::CreateProposalInput, ::aws_smithy_types::error::operation::BuildError> {
172        ::std::result::Result::Ok(crate::operation::create_proposal::CreateProposalInput {
173            client_request_token: self.client_request_token,
174            network_id: self.network_id,
175            member_id: self.member_id,
176            actions: self.actions,
177            description: self.description,
178            tags: self.tags,
179        })
180    }
181}