Skip to main content

aws_sdk_cloudtrail/operation/get_resource_policy/
_get_resource_policy_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 GetResourcePolicyInput {
6    /// <p>The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p>
7    /// <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code></p>
8    /// <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code></p>
9    /// <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code></p>
10    pub resource_arn: ::std::option::Option<::std::string::String>,
11}
12impl GetResourcePolicyInput {
13    /// <p>The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p>
14    /// <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code></p>
15    /// <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code></p>
16    /// <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code></p>
17    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
18        self.resource_arn.as_deref()
19    }
20}
21impl GetResourcePolicyInput {
22    /// Creates a new builder-style object to manufacture [`GetResourcePolicyInput`](crate::operation::get_resource_policy::GetResourcePolicyInput).
23    pub fn builder() -> crate::operation::get_resource_policy::builders::GetResourcePolicyInputBuilder {
24        crate::operation::get_resource_policy::builders::GetResourcePolicyInputBuilder::default()
25    }
26}
27
28/// A builder for [`GetResourcePolicyInput`](crate::operation::get_resource_policy::GetResourcePolicyInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct GetResourcePolicyInputBuilder {
32    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
33}
34impl GetResourcePolicyInputBuilder {
35    /// <p>The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p>
36    /// <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code></p>
37    /// <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code></p>
38    /// <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code></p>
39    /// This field is required.
40    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.resource_arn = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p>
45    /// <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code></p>
46    /// <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code></p>
47    /// <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code></p>
48    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
49        self.resource_arn = input;
50        self
51    }
52    /// <p>The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p>
53    /// <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code></p>
54    /// <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code></p>
55    /// <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code></p>
56    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
57        &self.resource_arn
58    }
59    /// Consumes the builder and constructs a [`GetResourcePolicyInput`](crate::operation::get_resource_policy::GetResourcePolicyInput).
60    pub fn build(
61        self,
62    ) -> ::std::result::Result<crate::operation::get_resource_policy::GetResourcePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
63        ::std::result::Result::Ok(crate::operation::get_resource_policy::GetResourcePolicyInput {
64            resource_arn: self.resource_arn,
65        })
66    }
67}