aws_sdk_shield/operation/describe_protection/
_describe_protection_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 DescribeProtectionInput {
6    /// <p>The unique identifier (ID) for the <code>Protection</code> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
7    pub protection_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
9    pub resource_arn: ::std::option::Option<::std::string::String>,
10}
11impl DescribeProtectionInput {
12    /// <p>The unique identifier (ID) for the <code>Protection</code> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
13    pub fn protection_id(&self) -> ::std::option::Option<&str> {
14        self.protection_id.as_deref()
15    }
16    /// <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
17    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
18        self.resource_arn.as_deref()
19    }
20}
21impl DescribeProtectionInput {
22    /// Creates a new builder-style object to manufacture [`DescribeProtectionInput`](crate::operation::describe_protection::DescribeProtectionInput).
23    pub fn builder() -> crate::operation::describe_protection::builders::DescribeProtectionInputBuilder {
24        crate::operation::describe_protection::builders::DescribeProtectionInputBuilder::default()
25    }
26}
27
28/// A builder for [`DescribeProtectionInput`](crate::operation::describe_protection::DescribeProtectionInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DescribeProtectionInputBuilder {
32    pub(crate) protection_id: ::std::option::Option<::std::string::String>,
33    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
34}
35impl DescribeProtectionInputBuilder {
36    /// <p>The unique identifier (ID) for the <code>Protection</code> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
37    pub fn protection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
38        self.protection_id = ::std::option::Option::Some(input.into());
39        self
40    }
41    /// <p>The unique identifier (ID) for the <code>Protection</code> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
42    pub fn set_protection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
43        self.protection_id = input;
44        self
45    }
46    /// <p>The unique identifier (ID) for the <code>Protection</code> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
47    pub fn get_protection_id(&self) -> &::std::option::Option<::std::string::String> {
48        &self.protection_id
49    }
50    /// <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
51    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.resource_arn = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
56    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.resource_arn = input;
58        self
59    }
60    /// <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
61    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
62        &self.resource_arn
63    }
64    /// Consumes the builder and constructs a [`DescribeProtectionInput`](crate::operation::describe_protection::DescribeProtectionInput).
65    pub fn build(
66        self,
67    ) -> ::std::result::Result<crate::operation::describe_protection::DescribeProtectionInput, ::aws_smithy_types::error::operation::BuildError> {
68        ::std::result::Result::Ok(crate::operation::describe_protection::DescribeProtectionInput {
69            protection_id: self.protection_id,
70            resource_arn: self.resource_arn,
71        })
72    }
73}