Skip to main content

aws_sdk_config/types/
_resource_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Returns information about the resource being evaluated.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ResourceDetails {
7    /// <p>A unique resource ID for an evaluation.</p>
8    pub resource_id: ::std::string::String,
9    /// <p>The type of resource being evaluated.</p>
10    pub resource_type: ::std::string::String,
11    /// <p>The resource definition to be evaluated as per the resource configuration schema type.</p>
12    pub resource_configuration: ::std::string::String,
13    /// <p>The schema type of the resource configuration.</p><note>
14    /// <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a>, or <code>CFN_RESOURCE_SCHEMA</code>, in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p>
15    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p>
16    /// </note>
17    pub resource_configuration_schema_type: ::std::option::Option<crate::types::ResourceConfigurationSchemaType>,
18}
19impl ResourceDetails {
20    /// <p>A unique resource ID for an evaluation.</p>
21    pub fn resource_id(&self) -> &str {
22        use std::ops::Deref;
23        self.resource_id.deref()
24    }
25    /// <p>The type of resource being evaluated.</p>
26    pub fn resource_type(&self) -> &str {
27        use std::ops::Deref;
28        self.resource_type.deref()
29    }
30    /// <p>The resource definition to be evaluated as per the resource configuration schema type.</p>
31    pub fn resource_configuration(&self) -> &str {
32        use std::ops::Deref;
33        self.resource_configuration.deref()
34    }
35    /// <p>The schema type of the resource configuration.</p><note>
36    /// <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a>, or <code>CFN_RESOURCE_SCHEMA</code>, in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p>
37    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p>
38    /// </note>
39    pub fn resource_configuration_schema_type(&self) -> ::std::option::Option<&crate::types::ResourceConfigurationSchemaType> {
40        self.resource_configuration_schema_type.as_ref()
41    }
42}
43impl ResourceDetails {
44    /// Creates a new builder-style object to manufacture [`ResourceDetails`](crate::types::ResourceDetails).
45    pub fn builder() -> crate::types::builders::ResourceDetailsBuilder {
46        crate::types::builders::ResourceDetailsBuilder::default()
47    }
48}
49
50/// A builder for [`ResourceDetails`](crate::types::ResourceDetails).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct ResourceDetailsBuilder {
54    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
55    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
56    pub(crate) resource_configuration: ::std::option::Option<::std::string::String>,
57    pub(crate) resource_configuration_schema_type: ::std::option::Option<crate::types::ResourceConfigurationSchemaType>,
58}
59impl ResourceDetailsBuilder {
60    /// <p>A unique resource ID for an evaluation.</p>
61    /// This field is required.
62    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.resource_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>A unique resource ID for an evaluation.</p>
67    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.resource_id = input;
69        self
70    }
71    /// <p>A unique resource ID for an evaluation.</p>
72    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.resource_id
74    }
75    /// <p>The type of resource being evaluated.</p>
76    /// This field is required.
77    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.resource_type = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The type of resource being evaluated.</p>
82    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.resource_type = input;
84        self
85    }
86    /// <p>The type of resource being evaluated.</p>
87    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
88        &self.resource_type
89    }
90    /// <p>The resource definition to be evaluated as per the resource configuration schema type.</p>
91    /// This field is required.
92    pub fn resource_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.resource_configuration = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The resource definition to be evaluated as per the resource configuration schema type.</p>
97    pub fn set_resource_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.resource_configuration = input;
99        self
100    }
101    /// <p>The resource definition to be evaluated as per the resource configuration schema type.</p>
102    pub fn get_resource_configuration(&self) -> &::std::option::Option<::std::string::String> {
103        &self.resource_configuration
104    }
105    /// <p>The schema type of the resource configuration.</p><note>
106    /// <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a>, or <code>CFN_RESOURCE_SCHEMA</code>, in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p>
107    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p>
108    /// </note>
109    pub fn resource_configuration_schema_type(mut self, input: crate::types::ResourceConfigurationSchemaType) -> Self {
110        self.resource_configuration_schema_type = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The schema type of the resource configuration.</p><note>
114    /// <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a>, or <code>CFN_RESOURCE_SCHEMA</code>, in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p>
115    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p>
116    /// </note>
117    pub fn set_resource_configuration_schema_type(mut self, input: ::std::option::Option<crate::types::ResourceConfigurationSchemaType>) -> Self {
118        self.resource_configuration_schema_type = input;
119        self
120    }
121    /// <p>The schema type of the resource configuration.</p><note>
122    /// <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a>, or <code>CFN_RESOURCE_SCHEMA</code>, in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p>
123    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p>
124    /// </note>
125    pub fn get_resource_configuration_schema_type(&self) -> &::std::option::Option<crate::types::ResourceConfigurationSchemaType> {
126        &self.resource_configuration_schema_type
127    }
128    /// Consumes the builder and constructs a [`ResourceDetails`](crate::types::ResourceDetails).
129    /// This method will fail if any of the following fields are not set:
130    /// - [`resource_id`](crate::types::builders::ResourceDetailsBuilder::resource_id)
131    /// - [`resource_type`](crate::types::builders::ResourceDetailsBuilder::resource_type)
132    /// - [`resource_configuration`](crate::types::builders::ResourceDetailsBuilder::resource_configuration)
133    pub fn build(self) -> ::std::result::Result<crate::types::ResourceDetails, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::types::ResourceDetails {
135            resource_id: self.resource_id.ok_or_else(|| {
136                ::aws_smithy_types::error::operation::BuildError::missing_field(
137                    "resource_id",
138                    "resource_id was not specified but it is required when building ResourceDetails",
139                )
140            })?,
141            resource_type: self.resource_type.ok_or_else(|| {
142                ::aws_smithy_types::error::operation::BuildError::missing_field(
143                    "resource_type",
144                    "resource_type was not specified but it is required when building ResourceDetails",
145                )
146            })?,
147            resource_configuration: self.resource_configuration.ok_or_else(|| {
148                ::aws_smithy_types::error::operation::BuildError::missing_field(
149                    "resource_configuration",
150                    "resource_configuration was not specified but it is required when building ResourceDetails",
151                )
152            })?,
153            resource_configuration_schema_type: self.resource_configuration_schema_type,
154        })
155    }
156}