aws_sdk_detective/operation/create_graph/
_create_graph_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 CreateGraphInput {
6    /// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
7    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
8}
9impl CreateGraphInput {
10    /// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
11    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
12        self.tags.as_ref()
13    }
14}
15impl CreateGraphInput {
16    /// Creates a new builder-style object to manufacture [`CreateGraphInput`](crate::operation::create_graph::CreateGraphInput).
17    pub fn builder() -> crate::operation::create_graph::builders::CreateGraphInputBuilder {
18        crate::operation::create_graph::builders::CreateGraphInputBuilder::default()
19    }
20}
21
22/// A builder for [`CreateGraphInput`](crate::operation::create_graph::CreateGraphInput).
23#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
24#[non_exhaustive]
25pub struct CreateGraphInputBuilder {
26    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27}
28impl CreateGraphInputBuilder {
29    /// Adds a key-value pair to `tags`.
30    ///
31    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
32    ///
33    /// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
34    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
35        let mut hash_map = self.tags.unwrap_or_default();
36        hash_map.insert(k.into(), v.into());
37        self.tags = ::std::option::Option::Some(hash_map);
38        self
39    }
40    /// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
41    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
42        self.tags = input;
43        self
44    }
45    /// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
46    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
47        &self.tags
48    }
49    /// Consumes the builder and constructs a [`CreateGraphInput`](crate::operation::create_graph::CreateGraphInput).
50    pub fn build(self) -> ::std::result::Result<crate::operation::create_graph::CreateGraphInput, ::aws_smithy_types::error::operation::BuildError> {
51        ::std::result::Result::Ok(crate::operation::create_graph::CreateGraphInput { tags: self.tags })
52    }
53}