aws_sdk_connectcampaignsv2/operation/create_campaign/
_create_campaign_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// The response for Create Campaign API
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateCampaignOutput {
7    /// Identifier representing a Campaign
8    pub id: ::std::option::Option<::std::string::String>,
9    /// The resource name of an Amazon Connect campaign.
10    pub arn: ::std::option::Option<::std::string::String>,
11    /// Tag map with key and value.
12    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
13    _request_id: Option<String>,
14}
15impl CreateCampaignOutput {
16    /// Identifier representing a Campaign
17    pub fn id(&self) -> ::std::option::Option<&str> {
18        self.id.as_deref()
19    }
20    /// The resource name of an Amazon Connect campaign.
21    pub fn arn(&self) -> ::std::option::Option<&str> {
22        self.arn.as_deref()
23    }
24    /// Tag map with key and value.
25    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26        self.tags.as_ref()
27    }
28}
29impl ::aws_types::request_id::RequestId for CreateCampaignOutput {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl CreateCampaignOutput {
35    /// Creates a new builder-style object to manufacture [`CreateCampaignOutput`](crate::operation::create_campaign::CreateCampaignOutput).
36    pub fn builder() -> crate::operation::create_campaign::builders::CreateCampaignOutputBuilder {
37        crate::operation::create_campaign::builders::CreateCampaignOutputBuilder::default()
38    }
39}
40
41/// A builder for [`CreateCampaignOutput`](crate::operation::create_campaign::CreateCampaignOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CreateCampaignOutputBuilder {
45    pub(crate) id: ::std::option::Option<::std::string::String>,
46    pub(crate) arn: ::std::option::Option<::std::string::String>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48    _request_id: Option<String>,
49}
50impl CreateCampaignOutputBuilder {
51    /// Identifier representing a Campaign
52    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// Identifier representing a Campaign
57    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.id = input;
59        self
60    }
61    /// Identifier representing a Campaign
62    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.id
64    }
65    /// The resource name of an Amazon Connect campaign.
66    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.arn = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// The resource name of an Amazon Connect campaign.
71    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.arn = input;
73        self
74    }
75    /// The resource name of an Amazon Connect campaign.
76    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
77        &self.arn
78    }
79    /// Adds a key-value pair to `tags`.
80    ///
81    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
82    ///
83    /// Tag map with key and value.
84    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
85        let mut hash_map = self.tags.unwrap_or_default();
86        hash_map.insert(k.into(), v.into());
87        self.tags = ::std::option::Option::Some(hash_map);
88        self
89    }
90    /// Tag map with key and value.
91    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
92        self.tags = input;
93        self
94    }
95    /// Tag map with key and value.
96    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
97        &self.tags
98    }
99    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
100        self._request_id = Some(request_id.into());
101        self
102    }
103
104    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
105        self._request_id = request_id;
106        self
107    }
108    /// Consumes the builder and constructs a [`CreateCampaignOutput`](crate::operation::create_campaign::CreateCampaignOutput).
109    pub fn build(self) -> crate::operation::create_campaign::CreateCampaignOutput {
110        crate::operation::create_campaign::CreateCampaignOutput {
111            id: self.id,
112            arn: self.arn,
113            tags: self.tags,
114            _request_id: self._request_id,
115        }
116    }
117}