1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines a resource mapping.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ResourceMapping {
/// <p>Name of the resource that the resource is mapped to.</p>
pub resource_name: ::std::option::Option<::std::string::String>,
/// <p>The name of the CloudFormation stack this resource is mapped to.</p>
pub logical_stack_name: ::std::option::Option<::std::string::String>,
/// <p>The name of the application this resource is mapped to.</p>
pub app_registry_app_name: ::std::option::Option<::std::string::String>,
/// <p>Name of the resource group that the resource is mapped to.</p>
pub resource_group_name: ::std::option::Option<::std::string::String>,
/// <p>Specifies the type of resource mapping.</p>
/// <dl>
/// <dt>
/// AppRegistryApp
/// </dt>
/// <dd>
/// <p>The resource is mapped to another application. The name of the application is contained in the <code>appRegistryAppName</code> property.</p>
/// </dd>
/// <dt>
/// CfnStack
/// </dt>
/// <dd>
/// <p>The resource is mapped to a CloudFormation stack. The name of the CloudFormation stack is contained in the <code>logicalStackName</code> property.</p>
/// </dd>
/// <dt>
/// Resource
/// </dt>
/// <dd>
/// <p>The resource is mapped to another resource. The name of the resource is contained in the <code>resourceName</code> property.</p>
/// </dd>
/// <dt>
/// ResourceGroup
/// </dt>
/// <dd>
/// <p>The resource is mapped to Resource Groups. The name of the resource group is contained in the <code>resourceGroupName</code> property.</p>
/// </dd>
/// </dl>
pub mapping_type: crate::types::ResourceMappingType,
/// <p>Identifier of the physical resource.</p>
pub physical_resource_id: ::std::option::Option<crate::types::PhysicalResourceId>,
/// <p>The short name of the Terraform source.</p>
pub terraform_source_name: ::std::option::Option<::std::string::String>,
/// <p>Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.</p><note>
/// <p>This parameter accepts values in "eks-cluster/namespace" format.</p>
/// </note>
pub eks_source_name: ::std::option::Option<::std::string::String>,
}
impl ResourceMapping {
/// <p>Name of the resource that the resource is mapped to.</p>
pub fn resource_name(&self) -> ::std::option::Option<&str> {
self.resource_name.as_deref()
}
/// <p>The name of the CloudFormation stack this resource is mapped to.</p>
pub fn logical_stack_name(&self) -> ::std::option::Option<&str> {
self.logical_stack_name.as_deref()
}
/// <p>The name of the application this resource is mapped to.</p>
pub fn app_registry_app_name(&self) -> ::std::option::Option<&str> {
self.app_registry_app_name.as_deref()
}
/// <p>Name of the resource group that the resource is mapped to.</p>
pub fn resource_group_name(&self) -> ::std::option::Option<&str> {
self.resource_group_name.as_deref()
}
/// <p>Specifies the type of resource mapping.</p>
/// <dl>
/// <dt>
/// AppRegistryApp
/// </dt>
/// <dd>
/// <p>The resource is mapped to another application. The name of the application is contained in the <code>appRegistryAppName</code> property.</p>
/// </dd>
/// <dt>
/// CfnStack
/// </dt>
/// <dd>
/// <p>The resource is mapped to a CloudFormation stack. The name of the CloudFormation stack is contained in the <code>logicalStackName</code> property.</p>
/// </dd>
/// <dt>
/// Resource
/// </dt>
/// <dd>
/// <p>The resource is mapped to another resource. The name of the resource is contained in the <code>resourceName</code> property.</p>
/// </dd>
/// <dt>
/// ResourceGroup
/// </dt>
/// <dd>
/// <p>The resource is mapped to Resource Groups. The name of the resource group is contained in the <code>resourceGroupName</code> property.</p>
/// </dd>
/// </dl>
pub fn mapping_type(&self) -> &crate::types::ResourceMappingType {
&self.mapping_type
}
/// <p>Identifier of the physical resource.</p>
pub fn physical_resource_id(&self) -> ::std::option::Option<&crate::types::PhysicalResourceId> {
self.physical_resource_id.as_ref()
}
/// <p>The short name of the Terraform source.</p>
pub fn terraform_source_name(&self) -> ::std::option::Option<&str> {
self.terraform_source_name.as_deref()
}
/// <p>Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.</p><note>
/// <p>This parameter accepts values in "eks-cluster/namespace" format.</p>
/// </note>
pub fn eks_source_name(&self) -> ::std::option::Option<&str> {
self.eks_source_name.as_deref()
}
}
impl ResourceMapping {
/// Creates a new builder-style object to manufacture [`ResourceMapping`](crate::types::ResourceMapping).
pub fn builder() -> crate::types::builders::ResourceMappingBuilder {
crate::types::builders::ResourceMappingBuilder::default()
}
}
/// A builder for [`ResourceMapping`](crate::types::ResourceMapping).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ResourceMappingBuilder {
pub(crate) resource_name: ::std::option::Option<::std::string::String>,
pub(crate) logical_stack_name: ::std::option::Option<::std::string::String>,
pub(crate) app_registry_app_name: ::std::option::Option<::std::string::String>,
pub(crate) resource_group_name: ::std::option::Option<::std::string::String>,
pub(crate) mapping_type: ::std::option::Option<crate::types::ResourceMappingType>,
pub(crate) physical_resource_id: ::std::option::Option<crate::types::PhysicalResourceId>,
pub(crate) terraform_source_name: ::std::option::Option<::std::string::String>,
pub(crate) eks_source_name: ::std::option::Option<::std::string::String>,
}
impl ResourceMappingBuilder {
/// <p>Name of the resource that the resource is mapped to.</p>
pub fn resource_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_name = ::std::option::Option::Some(input.into());
self
}
/// <p>Name of the resource that the resource is mapped to.</p>
pub fn set_resource_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_name = input;
self
}
/// <p>Name of the resource that the resource is mapped to.</p>
pub fn get_resource_name(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_name
}
/// <p>The name of the CloudFormation stack this resource is mapped to.</p>
pub fn logical_stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.logical_stack_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the CloudFormation stack this resource is mapped to.</p>
pub fn set_logical_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.logical_stack_name = input;
self
}
/// <p>The name of the CloudFormation stack this resource is mapped to.</p>
pub fn get_logical_stack_name(&self) -> &::std::option::Option<::std::string::String> {
&self.logical_stack_name
}
/// <p>The name of the application this resource is mapped to.</p>
pub fn app_registry_app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_registry_app_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the application this resource is mapped to.</p>
pub fn set_app_registry_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_registry_app_name = input;
self
}
/// <p>The name of the application this resource is mapped to.</p>
pub fn get_app_registry_app_name(&self) -> &::std::option::Option<::std::string::String> {
&self.app_registry_app_name
}
/// <p>Name of the resource group that the resource is mapped to.</p>
pub fn resource_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_group_name = ::std::option::Option::Some(input.into());
self
}
/// <p>Name of the resource group that the resource is mapped to.</p>
pub fn set_resource_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_group_name = input;
self
}
/// <p>Name of the resource group that the resource is mapped to.</p>
pub fn get_resource_group_name(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_group_name
}
/// <p>Specifies the type of resource mapping.</p>
/// <dl>
/// <dt>
/// AppRegistryApp
/// </dt>
/// <dd>
/// <p>The resource is mapped to another application. The name of the application is contained in the <code>appRegistryAppName</code> property.</p>
/// </dd>
/// <dt>
/// CfnStack
/// </dt>
/// <dd>
/// <p>The resource is mapped to a CloudFormation stack. The name of the CloudFormation stack is contained in the <code>logicalStackName</code> property.</p>
/// </dd>
/// <dt>
/// Resource
/// </dt>
/// <dd>
/// <p>The resource is mapped to another resource. The name of the resource is contained in the <code>resourceName</code> property.</p>
/// </dd>
/// <dt>
/// ResourceGroup
/// </dt>
/// <dd>
/// <p>The resource is mapped to Resource Groups. The name of the resource group is contained in the <code>resourceGroupName</code> property.</p>
/// </dd>
/// </dl>
/// This field is required.
pub fn mapping_type(mut self, input: crate::types::ResourceMappingType) -> Self {
self.mapping_type = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the type of resource mapping.</p>
/// <dl>
/// <dt>
/// AppRegistryApp
/// </dt>
/// <dd>
/// <p>The resource is mapped to another application. The name of the application is contained in the <code>appRegistryAppName</code> property.</p>
/// </dd>
/// <dt>
/// CfnStack
/// </dt>
/// <dd>
/// <p>The resource is mapped to a CloudFormation stack. The name of the CloudFormation stack is contained in the <code>logicalStackName</code> property.</p>
/// </dd>
/// <dt>
/// Resource
/// </dt>
/// <dd>
/// <p>The resource is mapped to another resource. The name of the resource is contained in the <code>resourceName</code> property.</p>
/// </dd>
/// <dt>
/// ResourceGroup
/// </dt>
/// <dd>
/// <p>The resource is mapped to Resource Groups. The name of the resource group is contained in the <code>resourceGroupName</code> property.</p>
/// </dd>
/// </dl>
pub fn set_mapping_type(mut self, input: ::std::option::Option<crate::types::ResourceMappingType>) -> Self {
self.mapping_type = input;
self
}
/// <p>Specifies the type of resource mapping.</p>
/// <dl>
/// <dt>
/// AppRegistryApp
/// </dt>
/// <dd>
/// <p>The resource is mapped to another application. The name of the application is contained in the <code>appRegistryAppName</code> property.</p>
/// </dd>
/// <dt>
/// CfnStack
/// </dt>
/// <dd>
/// <p>The resource is mapped to a CloudFormation stack. The name of the CloudFormation stack is contained in the <code>logicalStackName</code> property.</p>
/// </dd>
/// <dt>
/// Resource
/// </dt>
/// <dd>
/// <p>The resource is mapped to another resource. The name of the resource is contained in the <code>resourceName</code> property.</p>
/// </dd>
/// <dt>
/// ResourceGroup
/// </dt>
/// <dd>
/// <p>The resource is mapped to Resource Groups. The name of the resource group is contained in the <code>resourceGroupName</code> property.</p>
/// </dd>
/// </dl>
pub fn get_mapping_type(&self) -> &::std::option::Option<crate::types::ResourceMappingType> {
&self.mapping_type
}
/// <p>Identifier of the physical resource.</p>
/// This field is required.
pub fn physical_resource_id(mut self, input: crate::types::PhysicalResourceId) -> Self {
self.physical_resource_id = ::std::option::Option::Some(input);
self
}
/// <p>Identifier of the physical resource.</p>
pub fn set_physical_resource_id(mut self, input: ::std::option::Option<crate::types::PhysicalResourceId>) -> Self {
self.physical_resource_id = input;
self
}
/// <p>Identifier of the physical resource.</p>
pub fn get_physical_resource_id(&self) -> &::std::option::Option<crate::types::PhysicalResourceId> {
&self.physical_resource_id
}
/// <p>The short name of the Terraform source.</p>
pub fn terraform_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.terraform_source_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The short name of the Terraform source.</p>
pub fn set_terraform_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.terraform_source_name = input;
self
}
/// <p>The short name of the Terraform source.</p>
pub fn get_terraform_source_name(&self) -> &::std::option::Option<::std::string::String> {
&self.terraform_source_name
}
/// <p>Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.</p><note>
/// <p>This parameter accepts values in "eks-cluster/namespace" format.</p>
/// </note>
pub fn eks_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.eks_source_name = ::std::option::Option::Some(input.into());
self
}
/// <p>Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.</p><note>
/// <p>This parameter accepts values in "eks-cluster/namespace" format.</p>
/// </note>
pub fn set_eks_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.eks_source_name = input;
self
}
/// <p>Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.</p><note>
/// <p>This parameter accepts values in "eks-cluster/namespace" format.</p>
/// </note>
pub fn get_eks_source_name(&self) -> &::std::option::Option<::std::string::String> {
&self.eks_source_name
}
/// Consumes the builder and constructs a [`ResourceMapping`](crate::types::ResourceMapping).
/// This method will fail if any of the following fields are not set:
/// - [`mapping_type`](crate::types::builders::ResourceMappingBuilder::mapping_type)
pub fn build(self) -> ::std::result::Result<crate::types::ResourceMapping, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::ResourceMapping {
resource_name: self.resource_name,
logical_stack_name: self.logical_stack_name,
app_registry_app_name: self.app_registry_app_name,
resource_group_name: self.resource_group_name,
mapping_type: self.mapping_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"mapping_type",
"mapping_type was not specified but it is required when building ResourceMapping",
)
})?,
physical_resource_id: self.physical_resource_id,
terraform_source_name: self.terraform_source_name,
eks_source_name: self.eks_source_name,
})
}
}