aws_sdk_partnercentralchannel/operation/create_relationship/
_create_relationship_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 CreateRelationshipInput {
6    /// <p>The catalog identifier for the relationship.</p>
7    pub catalog: ::std::option::Option<::std::string::String>,
8    /// <p>The type of association for the relationship (e.g., reseller, distributor).</p>
9    pub association_type: ::std::option::Option<crate::types::AssociationType>,
10    /// <p>The identifier of the program management account for this relationship.</p>
11    pub program_management_account_identifier: ::std::option::Option<::std::string::String>,
12    /// <p>The AWS account ID to associate in this relationship.</p>
13    pub associated_account_id: ::std::option::Option<::std::string::String>,
14    /// <p>A human-readable name for the relationship.</p>
15    pub display_name: ::std::option::Option<::std::string::String>,
16    /// <p>The resale account model for the relationship.</p>
17    pub resale_account_model: ::std::option::Option<crate::types::ResaleAccountModel>,
18    /// <p>The business sector for the relationship.</p>
19    pub sector: ::std::option::Option<crate::types::Sector>,
20    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
21    pub client_token: ::std::option::Option<::std::string::String>,
22    /// <p>Key-value pairs to associate with the relationship.</p>
23    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
24    /// <p>The support plan requested for this relationship.</p>
25    pub requested_support_plan: ::std::option::Option<crate::types::SupportPlan>,
26}
27impl CreateRelationshipInput {
28    /// <p>The catalog identifier for the relationship.</p>
29    pub fn catalog(&self) -> ::std::option::Option<&str> {
30        self.catalog.as_deref()
31    }
32    /// <p>The type of association for the relationship (e.g., reseller, distributor).</p>
33    pub fn association_type(&self) -> ::std::option::Option<&crate::types::AssociationType> {
34        self.association_type.as_ref()
35    }
36    /// <p>The identifier of the program management account for this relationship.</p>
37    pub fn program_management_account_identifier(&self) -> ::std::option::Option<&str> {
38        self.program_management_account_identifier.as_deref()
39    }
40    /// <p>The AWS account ID to associate in this relationship.</p>
41    pub fn associated_account_id(&self) -> ::std::option::Option<&str> {
42        self.associated_account_id.as_deref()
43    }
44    /// <p>A human-readable name for the relationship.</p>
45    pub fn display_name(&self) -> ::std::option::Option<&str> {
46        self.display_name.as_deref()
47    }
48    /// <p>The resale account model for the relationship.</p>
49    pub fn resale_account_model(&self) -> ::std::option::Option<&crate::types::ResaleAccountModel> {
50        self.resale_account_model.as_ref()
51    }
52    /// <p>The business sector for the relationship.</p>
53    pub fn sector(&self) -> ::std::option::Option<&crate::types::Sector> {
54        self.sector.as_ref()
55    }
56    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
57    pub fn client_token(&self) -> ::std::option::Option<&str> {
58        self.client_token.as_deref()
59    }
60    /// <p>Key-value pairs to associate with the relationship.</p>
61    ///
62    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
63    pub fn tags(&self) -> &[crate::types::Tag] {
64        self.tags.as_deref().unwrap_or_default()
65    }
66    /// <p>The support plan requested for this relationship.</p>
67    pub fn requested_support_plan(&self) -> ::std::option::Option<&crate::types::SupportPlan> {
68        self.requested_support_plan.as_ref()
69    }
70}
71impl CreateRelationshipInput {
72    /// Creates a new builder-style object to manufacture [`CreateRelationshipInput`](crate::operation::create_relationship::CreateRelationshipInput).
73    pub fn builder() -> crate::operation::create_relationship::builders::CreateRelationshipInputBuilder {
74        crate::operation::create_relationship::builders::CreateRelationshipInputBuilder::default()
75    }
76}
77
78/// A builder for [`CreateRelationshipInput`](crate::operation::create_relationship::CreateRelationshipInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct CreateRelationshipInputBuilder {
82    pub(crate) catalog: ::std::option::Option<::std::string::String>,
83    pub(crate) association_type: ::std::option::Option<crate::types::AssociationType>,
84    pub(crate) program_management_account_identifier: ::std::option::Option<::std::string::String>,
85    pub(crate) associated_account_id: ::std::option::Option<::std::string::String>,
86    pub(crate) display_name: ::std::option::Option<::std::string::String>,
87    pub(crate) resale_account_model: ::std::option::Option<crate::types::ResaleAccountModel>,
88    pub(crate) sector: ::std::option::Option<crate::types::Sector>,
89    pub(crate) client_token: ::std::option::Option<::std::string::String>,
90    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
91    pub(crate) requested_support_plan: ::std::option::Option<crate::types::SupportPlan>,
92}
93impl CreateRelationshipInputBuilder {
94    /// <p>The catalog identifier for the relationship.</p>
95    /// This field is required.
96    pub fn catalog(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.catalog = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The catalog identifier for the relationship.</p>
101    pub fn set_catalog(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.catalog = input;
103        self
104    }
105    /// <p>The catalog identifier for the relationship.</p>
106    pub fn get_catalog(&self) -> &::std::option::Option<::std::string::String> {
107        &self.catalog
108    }
109    /// <p>The type of association for the relationship (e.g., reseller, distributor).</p>
110    /// This field is required.
111    pub fn association_type(mut self, input: crate::types::AssociationType) -> Self {
112        self.association_type = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>The type of association for the relationship (e.g., reseller, distributor).</p>
116    pub fn set_association_type(mut self, input: ::std::option::Option<crate::types::AssociationType>) -> Self {
117        self.association_type = input;
118        self
119    }
120    /// <p>The type of association for the relationship (e.g., reseller, distributor).</p>
121    pub fn get_association_type(&self) -> &::std::option::Option<crate::types::AssociationType> {
122        &self.association_type
123    }
124    /// <p>The identifier of the program management account for this relationship.</p>
125    /// This field is required.
126    pub fn program_management_account_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.program_management_account_identifier = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The identifier of the program management account for this relationship.</p>
131    pub fn set_program_management_account_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.program_management_account_identifier = input;
133        self
134    }
135    /// <p>The identifier of the program management account for this relationship.</p>
136    pub fn get_program_management_account_identifier(&self) -> &::std::option::Option<::std::string::String> {
137        &self.program_management_account_identifier
138    }
139    /// <p>The AWS account ID to associate in this relationship.</p>
140    /// This field is required.
141    pub fn associated_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.associated_account_id = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// <p>The AWS account ID to associate in this relationship.</p>
146    pub fn set_associated_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.associated_account_id = input;
148        self
149    }
150    /// <p>The AWS account ID to associate in this relationship.</p>
151    pub fn get_associated_account_id(&self) -> &::std::option::Option<::std::string::String> {
152        &self.associated_account_id
153    }
154    /// <p>A human-readable name for the relationship.</p>
155    /// This field is required.
156    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.display_name = ::std::option::Option::Some(input.into());
158        self
159    }
160    /// <p>A human-readable name for the relationship.</p>
161    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.display_name = input;
163        self
164    }
165    /// <p>A human-readable name for the relationship.</p>
166    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
167        &self.display_name
168    }
169    /// <p>The resale account model for the relationship.</p>
170    pub fn resale_account_model(mut self, input: crate::types::ResaleAccountModel) -> Self {
171        self.resale_account_model = ::std::option::Option::Some(input);
172        self
173    }
174    /// <p>The resale account model for the relationship.</p>
175    pub fn set_resale_account_model(mut self, input: ::std::option::Option<crate::types::ResaleAccountModel>) -> Self {
176        self.resale_account_model = input;
177        self
178    }
179    /// <p>The resale account model for the relationship.</p>
180    pub fn get_resale_account_model(&self) -> &::std::option::Option<crate::types::ResaleAccountModel> {
181        &self.resale_account_model
182    }
183    /// <p>The business sector for the relationship.</p>
184    /// This field is required.
185    pub fn sector(mut self, input: crate::types::Sector) -> Self {
186        self.sector = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>The business sector for the relationship.</p>
190    pub fn set_sector(mut self, input: ::std::option::Option<crate::types::Sector>) -> Self {
191        self.sector = input;
192        self
193    }
194    /// <p>The business sector for the relationship.</p>
195    pub fn get_sector(&self) -> &::std::option::Option<crate::types::Sector> {
196        &self.sector
197    }
198    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
199    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.client_token = ::std::option::Option::Some(input.into());
201        self
202    }
203    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
204    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.client_token = input;
206        self
207    }
208    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
209    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
210        &self.client_token
211    }
212    /// Appends an item to `tags`.
213    ///
214    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
215    ///
216    /// <p>Key-value pairs to associate with the relationship.</p>
217    pub fn tags(mut self, input: crate::types::Tag) -> Self {
218        let mut v = self.tags.unwrap_or_default();
219        v.push(input);
220        self.tags = ::std::option::Option::Some(v);
221        self
222    }
223    /// <p>Key-value pairs to associate with the relationship.</p>
224    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
225        self.tags = input;
226        self
227    }
228    /// <p>Key-value pairs to associate with the relationship.</p>
229    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
230        &self.tags
231    }
232    /// <p>The support plan requested for this relationship.</p>
233    pub fn requested_support_plan(mut self, input: crate::types::SupportPlan) -> Self {
234        self.requested_support_plan = ::std::option::Option::Some(input);
235        self
236    }
237    /// <p>The support plan requested for this relationship.</p>
238    pub fn set_requested_support_plan(mut self, input: ::std::option::Option<crate::types::SupportPlan>) -> Self {
239        self.requested_support_plan = input;
240        self
241    }
242    /// <p>The support plan requested for this relationship.</p>
243    pub fn get_requested_support_plan(&self) -> &::std::option::Option<crate::types::SupportPlan> {
244        &self.requested_support_plan
245    }
246    /// Consumes the builder and constructs a [`CreateRelationshipInput`](crate::operation::create_relationship::CreateRelationshipInput).
247    pub fn build(
248        self,
249    ) -> ::std::result::Result<crate::operation::create_relationship::CreateRelationshipInput, ::aws_smithy_types::error::operation::BuildError> {
250        ::std::result::Result::Ok(crate::operation::create_relationship::CreateRelationshipInput {
251            catalog: self.catalog,
252            association_type: self.association_type,
253            program_management_account_identifier: self.program_management_account_identifier,
254            associated_account_id: self.associated_account_id,
255            display_name: self.display_name,
256            resale_account_model: self.resale_account_model,
257            sector: self.sector,
258            client_token: self.client_token,
259            tags: self.tags,
260            requested_support_plan: self.requested_support_plan,
261        })
262    }
263}