aws_sdk_mediapackage/operation/create_channel/
_create_channel_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// A new Channel configuration.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateChannelInput {
7    /// A short text description of the Channel.
8    pub description: ::std::option::Option<::std::string::String>,
9    /// The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.
10    pub id: ::std::option::Option<::std::string::String>,
11    /// A collection of tags associated with a resource
12    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
13}
14impl CreateChannelInput {
15    /// A short text description of the Channel.
16    pub fn description(&self) -> ::std::option::Option<&str> {
17        self.description.as_deref()
18    }
19    /// The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.
20    pub fn id(&self) -> ::std::option::Option<&str> {
21        self.id.as_deref()
22    }
23    /// A collection of tags associated with a resource
24    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    /// Creates a new builder-style object to manufacture [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
30    pub fn builder() -> crate::operation::create_channel::builders::CreateChannelInputBuilder {
31        crate::operation::create_channel::builders::CreateChannelInputBuilder::default()
32    }
33}
34
35/// A builder for [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
36#[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    /// A short text description of the Channel.
45    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    /// A short text description of the Channel.
50    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.description = input;
52        self
53    }
54    /// A short text description of the Channel.
55    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
56        &self.description
57    }
58    /// The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.
59    /// This field is required.
60    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    /// The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.
65    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.id = input;
67        self
68    }
69    /// The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.
70    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.id
72    }
73    /// Adds a key-value pair to `tags`.
74    ///
75    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
76    ///
77    /// A collection of tags associated with a resource
78    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    /// A collection of tags associated with a resource
85    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    /// A collection of tags associated with a resource
90    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91        &self.tags
92    }
93    /// Consumes the builder and constructs a [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
94    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}