aws_sdk_ram/operation/get_permission/
_get_permission_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 GetPermissionInput {
6    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <code>ListPermissions</code> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
7    pub permission_arn: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p>
9    /// <p>To see the list of available versions, use <code>ListPermissionVersions</code>.</p>
10    pub permission_version: ::std::option::Option<i32>,
11}
12impl GetPermissionInput {
13    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <code>ListPermissions</code> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
14    pub fn permission_arn(&self) -> ::std::option::Option<&str> {
15        self.permission_arn.as_deref()
16    }
17    /// <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p>
18    /// <p>To see the list of available versions, use <code>ListPermissionVersions</code>.</p>
19    pub fn permission_version(&self) -> ::std::option::Option<i32> {
20        self.permission_version
21    }
22}
23impl GetPermissionInput {
24    /// Creates a new builder-style object to manufacture [`GetPermissionInput`](crate::operation::get_permission::GetPermissionInput).
25    pub fn builder() -> crate::operation::get_permission::builders::GetPermissionInputBuilder {
26        crate::operation::get_permission::builders::GetPermissionInputBuilder::default()
27    }
28}
29
30/// A builder for [`GetPermissionInput`](crate::operation::get_permission::GetPermissionInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct GetPermissionInputBuilder {
34    pub(crate) permission_arn: ::std::option::Option<::std::string::String>,
35    pub(crate) permission_version: ::std::option::Option<i32>,
36}
37impl GetPermissionInputBuilder {
38    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <code>ListPermissions</code> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
39    /// This field is required.
40    pub fn permission_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.permission_arn = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <code>ListPermissions</code> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
45    pub fn set_permission_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.permission_arn = input;
47        self
48    }
49    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <code>ListPermissions</code> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
50    pub fn get_permission_arn(&self) -> &::std::option::Option<::std::string::String> {
51        &self.permission_arn
52    }
53    /// <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p>
54    /// <p>To see the list of available versions, use <code>ListPermissionVersions</code>.</p>
55    pub fn permission_version(mut self, input: i32) -> Self {
56        self.permission_version = ::std::option::Option::Some(input);
57        self
58    }
59    /// <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p>
60    /// <p>To see the list of available versions, use <code>ListPermissionVersions</code>.</p>
61    pub fn set_permission_version(mut self, input: ::std::option::Option<i32>) -> Self {
62        self.permission_version = input;
63        self
64    }
65    /// <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p>
66    /// <p>To see the list of available versions, use <code>ListPermissionVersions</code>.</p>
67    pub fn get_permission_version(&self) -> &::std::option::Option<i32> {
68        &self.permission_version
69    }
70    /// Consumes the builder and constructs a [`GetPermissionInput`](crate::operation::get_permission::GetPermissionInput).
71    pub fn build(
72        self,
73    ) -> ::std::result::Result<crate::operation::get_permission::GetPermissionInput, ::aws_smithy_types::error::operation::BuildError> {
74        ::std::result::Result::Ok(crate::operation::get_permission::GetPermissionInput {
75            permission_arn: self.permission_arn,
76            permission_version: self.permission_version,
77        })
78    }
79}