aws-sdk-ram 1.103.0

AWS SDK for AWS Resource Access Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetResourceSharesInput {
    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of individual resource shares that you want information about.</p>
    pub resource_share_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Specifies that you want to retrieve details of only those resource shares that have this status.</p>
    pub resource_share_status: ::std::option::Option<crate::types::ResourceShareStatus>,
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the following:</p>
    /// <ul>
    /// <li>
    /// <p><b> <code>SELF</code> </b> – resource shares that your account shares with other accounts</p></li>
    /// <li>
    /// <p><b> <code>OTHER-ACCOUNTS</code> </b> – resource shares that other accounts share with your account</p></li>
    /// </ul>
    pub resource_owner: ::std::option::Option<crate::types::ResourceOwner>,
    /// <p>Specifies the name of an individual resource share that you want to retrieve details about.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.</p>
    pub tag_filters: ::std::option::Option<::std::vec::Vec<crate::types::TagFilter>>,
    /// <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>Specifies that you want to retrieve details of only those resource shares that use the managed permission with this <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>.</p>
    pub permission_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.</p>
    pub permission_version: ::std::option::Option<i32>,
}
impl GetResourceSharesInput {
    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of individual resource shares that you want information about.</p>
    ///
    /// 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_arns.is_none()`.
    pub fn resource_share_arns(&self) -> &[::std::string::String] {
        self.resource_share_arns.as_deref().unwrap_or_default()
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that have this status.</p>
    pub fn resource_share_status(&self) -> ::std::option::Option<&crate::types::ResourceShareStatus> {
        self.resource_share_status.as_ref()
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the following:</p>
    /// <ul>
    /// <li>
    /// <p><b> <code>SELF</code> </b> – resource shares that your account shares with other accounts</p></li>
    /// <li>
    /// <p><b> <code>OTHER-ACCOUNTS</code> </b> – resource shares that other accounts share with your account</p></li>
    /// </ul>
    pub fn resource_owner(&self) -> ::std::option::Option<&crate::types::ResourceOwner> {
        self.resource_owner.as_ref()
    }
    /// <p>Specifies the name of an individual resource share that you want to retrieve details about.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_filters.is_none()`.
    pub fn tag_filters(&self) -> &[crate::types::TagFilter] {
        self.tag_filters.as_deref().unwrap_or_default()
    }
    /// <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that use the managed permission with this <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>.</p>
    pub fn permission_arn(&self) -> ::std::option::Option<&str> {
        self.permission_arn.as_deref()
    }
    /// <p>Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.</p>
    pub fn permission_version(&self) -> ::std::option::Option<i32> {
        self.permission_version
    }
}
impl GetResourceSharesInput {
    /// Creates a new builder-style object to manufacture [`GetResourceSharesInput`](crate::operation::get_resource_shares::GetResourceSharesInput).
    pub fn builder() -> crate::operation::get_resource_shares::builders::GetResourceSharesInputBuilder {
        crate::operation::get_resource_shares::builders::GetResourceSharesInputBuilder::default()
    }
}

/// A builder for [`GetResourceSharesInput`](crate::operation::get_resource_shares::GetResourceSharesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetResourceSharesInputBuilder {
    pub(crate) resource_share_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) resource_share_status: ::std::option::Option<crate::types::ResourceShareStatus>,
    pub(crate) resource_owner: ::std::option::Option<crate::types::ResourceOwner>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) tag_filters: ::std::option::Option<::std::vec::Vec<crate::types::TagFilter>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) permission_arn: ::std::option::Option<::std::string::String>,
    pub(crate) permission_version: ::std::option::Option<i32>,
}
impl GetResourceSharesInputBuilder {
    /// Appends an item to `resource_share_arns`.
    ///
    /// To override the contents of this collection use [`set_resource_share_arns`](Self::set_resource_share_arns).
    ///
    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of individual resource shares that you want information about.</p>
    pub fn resource_share_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.resource_share_arns.unwrap_or_default();
        v.push(input.into());
        self.resource_share_arns = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of individual resource shares that you want information about.</p>
    pub fn set_resource_share_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.resource_share_arns = input;
        self
    }
    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of individual resource shares that you want information about.</p>
    pub fn get_resource_share_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.resource_share_arns
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that have this status.</p>
    pub fn resource_share_status(mut self, input: crate::types::ResourceShareStatus) -> Self {
        self.resource_share_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that have this status.</p>
    pub fn set_resource_share_status(mut self, input: ::std::option::Option<crate::types::ResourceShareStatus>) -> Self {
        self.resource_share_status = input;
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that have this status.</p>
    pub fn get_resource_share_status(&self) -> &::std::option::Option<crate::types::ResourceShareStatus> {
        &self.resource_share_status
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the following:</p>
    /// <ul>
    /// <li>
    /// <p><b> <code>SELF</code> </b> – resource shares that your account shares with other accounts</p></li>
    /// <li>
    /// <p><b> <code>OTHER-ACCOUNTS</code> </b> – resource shares that other accounts share with your account</p></li>
    /// </ul>
    /// This field is required.
    pub fn resource_owner(mut self, input: crate::types::ResourceOwner) -> Self {
        self.resource_owner = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the following:</p>
    /// <ul>
    /// <li>
    /// <p><b> <code>SELF</code> </b> – resource shares that your account shares with other accounts</p></li>
    /// <li>
    /// <p><b> <code>OTHER-ACCOUNTS</code> </b> – resource shares that other accounts share with your account</p></li>
    /// </ul>
    pub fn set_resource_owner(mut self, input: ::std::option::Option<crate::types::ResourceOwner>) -> Self {
        self.resource_owner = input;
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the following:</p>
    /// <ul>
    /// <li>
    /// <p><b> <code>SELF</code> </b> – resource shares that your account shares with other accounts</p></li>
    /// <li>
    /// <p><b> <code>OTHER-ACCOUNTS</code> </b> – resource shares that other accounts share with your account</p></li>
    /// </ul>
    pub fn get_resource_owner(&self) -> &::std::option::Option<crate::types::ResourceOwner> {
        &self.resource_owner
    }
    /// <p>Specifies the name of an individual resource share that you want to retrieve details about.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the name of an individual resource share that you want to retrieve details about.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>Specifies the name of an individual resource share that you want to retrieve details about.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `tag_filters`.
    ///
    /// To override the contents of this collection use [`set_tag_filters`](Self::set_tag_filters).
    ///
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.</p>
    pub fn tag_filters(mut self, input: crate::types::TagFilter) -> Self {
        let mut v = self.tag_filters.unwrap_or_default();
        v.push(input);
        self.tag_filters = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.</p>
    pub fn set_tag_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagFilter>>) -> Self {
        self.tag_filters = input;
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.</p>
    pub fn get_tag_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagFilter>> {
        &self.tag_filters
    }
    /// <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that use the managed permission with this <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>.</p>
    pub fn permission_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.permission_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that use the managed permission with this <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>.</p>
    pub fn set_permission_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.permission_arn = input;
        self
    }
    /// <p>Specifies that you want to retrieve details of only those resource shares that use the managed permission with this <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>.</p>
    pub fn get_permission_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.permission_arn
    }
    /// <p>Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.</p>
    pub fn permission_version(mut self, input: i32) -> Self {
        self.permission_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.</p>
    pub fn set_permission_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.permission_version = input;
        self
    }
    /// <p>Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.</p>
    pub fn get_permission_version(&self) -> &::std::option::Option<i32> {
        &self.permission_version
    }
    /// Consumes the builder and constructs a [`GetResourceSharesInput`](crate::operation::get_resource_shares::GetResourceSharesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_resource_shares::GetResourceSharesInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_resource_shares::GetResourceSharesInput {
            resource_share_arns: self.resource_share_arns,
            resource_share_status: self.resource_share_status,
            resource_owner: self.resource_owner,
            name: self.name,
            tag_filters: self.tag_filters,
            next_token: self.next_token,
            max_results: self.max_results,
            permission_arn: self.permission_arn,
            permission_version: self.permission_version,
        })
    }
}