aws_sdk_lambda/operation/get_policy/_get_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 GetPolicyInput {
6 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
7 /// <p class="title"><b>Name formats</b></p>
8 /// <ul>
9 /// <li>
10 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
11 /// <li>
12 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
13 /// <li>
14 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
15 /// </ul>
16 /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
17 pub function_name: ::std::option::Option<::std::string::String>,
18 /// <p>Specify a version or alias to get the policy for that resource.</p>
19 pub qualifier: ::std::option::Option<::std::string::String>,
20}
21impl GetPolicyInput {
22 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
23 /// <p class="title"><b>Name formats</b></p>
24 /// <ul>
25 /// <li>
26 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
27 /// <li>
28 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
29 /// <li>
30 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
31 /// </ul>
32 /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
33 pub fn function_name(&self) -> ::std::option::Option<&str> {
34 self.function_name.as_deref()
35 }
36 /// <p>Specify a version or alias to get the policy for that resource.</p>
37 pub fn qualifier(&self) -> ::std::option::Option<&str> {
38 self.qualifier.as_deref()
39 }
40}
41impl GetPolicyInput {
42 /// Creates a new builder-style object to manufacture [`GetPolicyInput`](crate::operation::get_policy::GetPolicyInput).
43 pub fn builder() -> crate::operation::get_policy::builders::GetPolicyInputBuilder {
44 crate::operation::get_policy::builders::GetPolicyInputBuilder::default()
45 }
46}
47
48/// A builder for [`GetPolicyInput`](crate::operation::get_policy::GetPolicyInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetPolicyInputBuilder {
52 pub(crate) function_name: ::std::option::Option<::std::string::String>,
53 pub(crate) qualifier: ::std::option::Option<::std::string::String>,
54}
55impl GetPolicyInputBuilder {
56 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
57 /// <p class="title"><b>Name formats</b></p>
58 /// <ul>
59 /// <li>
60 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
61 /// <li>
62 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
63 /// <li>
64 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
65 /// </ul>
66 /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
67 /// This field is required.
68 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.function_name = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
73 /// <p class="title"><b>Name formats</b></p>
74 /// <ul>
75 /// <li>
76 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
77 /// <li>
78 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
79 /// <li>
80 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
81 /// </ul>
82 /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
83 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.function_name = input;
85 self
86 }
87 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
88 /// <p class="title"><b>Name formats</b></p>
89 /// <ul>
90 /// <li>
91 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
92 /// <li>
93 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
94 /// <li>
95 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
96 /// </ul>
97 /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
98 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
99 &self.function_name
100 }
101 /// <p>Specify a version or alias to get the policy for that resource.</p>
102 pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.qualifier = ::std::option::Option::Some(input.into());
104 self
105 }
106 /// <p>Specify a version or alias to get the policy for that resource.</p>
107 pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.qualifier = input;
109 self
110 }
111 /// <p>Specify a version or alias to get the policy for that resource.</p>
112 pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
113 &self.qualifier
114 }
115 /// Consumes the builder and constructs a [`GetPolicyInput`](crate::operation::get_policy::GetPolicyInput).
116 pub fn build(self) -> ::std::result::Result<crate::operation::get_policy::GetPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
117 ::std::result::Result::Ok(crate::operation::get_policy::GetPolicyInput {
118 function_name: self.function_name,
119 qualifier: self.qualifier,
120 })
121 }
122}