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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateOpsMetadataInput {
/// <p>A resource ID for a new Application Manager application.</p>
pub resource_id: ::std::option::Option<::std::string::String>,
/// <p>Metadata for a new Application Manager application. </p>
pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
/// <p>Optional metadata that you assign to a resource. You can specify a maximum of five tags for an OpsMetadata object. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsMetadata object to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:</p>
/// <ul>
/// <li> <p> <code>Key=Environment,Value=Production</code> </p> </li>
/// <li> <p> <code>Key=Region,Value=us-east-2</code> </p> </li>
/// </ul>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateOpsMetadataInput {
/// <p>A resource ID for a new Application Manager application.</p>
pub fn resource_id(&self) -> ::std::option::Option<&str> {
self.resource_id.as_deref()
}
/// <p>Metadata for a new Application Manager application. </p>
pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>> {
self.metadata.as_ref()
}
/// <p>Optional metadata that you assign to a resource. You can specify a maximum of five tags for an OpsMetadata object. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsMetadata object to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:</p>
/// <ul>
/// <li> <p> <code>Key=Environment,Value=Production</code> </p> </li>
/// <li> <p> <code>Key=Region,Value=us-east-2</code> </p> </li>
/// </ul>
pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
}
impl CreateOpsMetadataInput {
/// Creates a new builder-style object to manufacture [`CreateOpsMetadataInput`](crate::operation::create_ops_metadata::CreateOpsMetadataInput).
pub fn builder() -> crate::operation::create_ops_metadata::builders::CreateOpsMetadataInputBuilder {
crate::operation::create_ops_metadata::builders::CreateOpsMetadataInputBuilder::default()
}
}
/// A builder for [`CreateOpsMetadataInput`](crate::operation::create_ops_metadata::CreateOpsMetadataInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateOpsMetadataInputBuilder {
pub(crate) resource_id: ::std::option::Option<::std::string::String>,
pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateOpsMetadataInputBuilder {
/// <p>A resource ID for a new Application Manager application.</p>
pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A resource ID for a new Application Manager application.</p>
pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_id = input;
self
}
/// <p>A resource ID for a new Application Manager application.</p>
pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_id
}
/// Adds a key-value pair to `metadata`.
///
/// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
///
/// <p>Metadata for a new Application Manager application. </p>
pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MetadataValue) -> Self {
let mut hash_map = self.metadata.unwrap_or_default();
hash_map.insert(k.into(), v);
self.metadata = ::std::option::Option::Some(hash_map);
self
}
/// <p>Metadata for a new Application Manager application. </p>
pub fn set_metadata(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
) -> Self {
self.metadata = input;
self
}
/// <p>Metadata for a new Application Manager application. </p>
pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>> {
&self.metadata
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>Optional metadata that you assign to a resource. You can specify a maximum of five tags for an OpsMetadata object. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsMetadata object to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:</p>
/// <ul>
/// <li> <p> <code>Key=Environment,Value=Production</code> </p> </li>
/// <li> <p> <code>Key=Region,Value=us-east-2</code> </p> </li>
/// </ul>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>Optional metadata that you assign to a resource. You can specify a maximum of five tags for an OpsMetadata object. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsMetadata object to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:</p>
/// <ul>
/// <li> <p> <code>Key=Environment,Value=Production</code> </p> </li>
/// <li> <p> <code>Key=Region,Value=us-east-2</code> </p> </li>
/// </ul>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>Optional metadata that you assign to a resource. You can specify a maximum of five tags for an OpsMetadata object. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsMetadata object to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:</p>
/// <ul>
/// <li> <p> <code>Key=Environment,Value=Production</code> </p> </li>
/// <li> <p> <code>Key=Region,Value=us-east-2</code> </p> </li>
/// </ul>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreateOpsMetadataInput`](crate::operation::create_ops_metadata::CreateOpsMetadataInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_ops_metadata::CreateOpsMetadataInput, ::aws_smithy_http::operation::error::BuildError> {
::std::result::Result::Ok(crate::operation::create_ops_metadata::CreateOpsMetadataInput {
resource_id: self.resource_id,
metadata: self.metadata,
tags: self.tags,
})
}
}