Skip to main content

aws_sdk_ram/operation/associate_resource_share/
_associate_resource_share_output.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 AssociateResourceShareOutput {
6    /// <p>An array of objects that contain information about the associations.</p>
7    pub resource_share_associations: ::std::option::Option<::std::vec::Vec<crate::types::ResourceShareAssociation>>,
8    /// <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl AssociateResourceShareOutput {
13    /// <p>An array of objects that contain information about the associations.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_share_associations.is_none()`.
16    pub fn resource_share_associations(&self) -> &[crate::types::ResourceShareAssociation] {
17        self.resource_share_associations.as_deref().unwrap_or_default()
18    }
19    /// <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
20    pub fn client_token(&self) -> ::std::option::Option<&str> {
21        self.client_token.as_deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for AssociateResourceShareOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl AssociateResourceShareOutput {
30    /// Creates a new builder-style object to manufacture [`AssociateResourceShareOutput`](crate::operation::associate_resource_share::AssociateResourceShareOutput).
31    pub fn builder() -> crate::operation::associate_resource_share::builders::AssociateResourceShareOutputBuilder {
32        crate::operation::associate_resource_share::builders::AssociateResourceShareOutputBuilder::default()
33    }
34}
35
36/// A builder for [`AssociateResourceShareOutput`](crate::operation::associate_resource_share::AssociateResourceShareOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct AssociateResourceShareOutputBuilder {
40    pub(crate) resource_share_associations: ::std::option::Option<::std::vec::Vec<crate::types::ResourceShareAssociation>>,
41    pub(crate) client_token: ::std::option::Option<::std::string::String>,
42    _request_id: Option<String>,
43}
44impl AssociateResourceShareOutputBuilder {
45    /// Appends an item to `resource_share_associations`.
46    ///
47    /// To override the contents of this collection use [`set_resource_share_associations`](Self::set_resource_share_associations).
48    ///
49    /// <p>An array of objects that contain information about the associations.</p>
50    pub fn resource_share_associations(mut self, input: crate::types::ResourceShareAssociation) -> Self {
51        let mut v = self.resource_share_associations.unwrap_or_default();
52        v.push(input);
53        self.resource_share_associations = ::std::option::Option::Some(v);
54        self
55    }
56    /// <p>An array of objects that contain information about the associations.</p>
57    pub fn set_resource_share_associations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceShareAssociation>>) -> Self {
58        self.resource_share_associations = input;
59        self
60    }
61    /// <p>An array of objects that contain information about the associations.</p>
62    pub fn get_resource_share_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceShareAssociation>> {
63        &self.resource_share_associations
64    }
65    /// <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
66    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.client_token = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
71    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.client_token = input;
73        self
74    }
75    /// <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
76    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
77        &self.client_token
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`AssociateResourceShareOutput`](crate::operation::associate_resource_share::AssociateResourceShareOutput).
89    pub fn build(self) -> crate::operation::associate_resource_share::AssociateResourceShareOutput {
90        crate::operation::associate_resource_share::AssociateResourceShareOutput {
91            resource_share_associations: self.resource_share_associations,
92            client_token: self.client_token,
93            _request_id: self._request_id,
94        }
95    }
96}