aws_sdk_mediapackage/operation/create_channel/
_create_channel_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateChannelInput {
7 pub description: ::std::option::Option<::std::string::String>,
9 pub id: ::std::option::Option<::std::string::String>,
11 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
13}
14impl CreateChannelInput {
15 pub fn description(&self) -> ::std::option::Option<&str> {
17 self.description.as_deref()
18 }
19 pub fn id(&self) -> ::std::option::Option<&str> {
21 self.id.as_deref()
22 }
23 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
25 self.tags.as_ref()
26 }
27}
28impl CreateChannelInput {
29 pub fn builder() -> crate::operation::create_channel::builders::CreateChannelInputBuilder {
31 crate::operation::create_channel::builders::CreateChannelInputBuilder::default()
32 }
33}
34
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CreateChannelInputBuilder {
39 pub(crate) description: ::std::option::Option<::std::string::String>,
40 pub(crate) id: ::std::option::Option<::std::string::String>,
41 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
42}
43impl CreateChannelInputBuilder {
44 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.description = ::std::option::Option::Some(input.into());
47 self
48 }
49 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.description = input;
52 self
53 }
54 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
56 &self.description
57 }
58 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.id = ::std::option::Option::Some(input.into());
62 self
63 }
64 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.id = input;
67 self
68 }
69 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
71 &self.id
72 }
73 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
79 let mut hash_map = self.tags.unwrap_or_default();
80 hash_map.insert(k.into(), v.into());
81 self.tags = ::std::option::Option::Some(hash_map);
82 self
83 }
84 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
86 self.tags = input;
87 self
88 }
89 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91 &self.tags
92 }
93 pub fn build(
95 self,
96 ) -> ::std::result::Result<crate::operation::create_channel::CreateChannelInput, ::aws_smithy_types::error::operation::BuildError> {
97 ::std::result::Result::Ok(crate::operation::create_channel::CreateChannelInput {
98 description: self.description,
99 id: self.id,
100 tags: self.tags,
101 })
102 }
103}