Skip to main content

aws_sdk_sagemaker/types/
_channel_specification.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Defines a named input source, called a channel, to be used by an algorithm.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ChannelSpecification {
7    /// <p>The name of the channel.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A brief description of the channel.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>Indicates whether the channel is required by the algorithm.</p>
12    pub is_required: ::std::option::Option<bool>,
13    /// <p>The supported MIME types for the data.</p>
14    pub supported_content_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>The allowed compression types, if data compression is used.</p>
16    pub supported_compression_types: ::std::option::Option<::std::vec::Vec<crate::types::CompressionType>>,
17    /// <p>The allowed input mode, either FILE or PIPE.</p>
18    /// <p>In FILE mode, Amazon SageMaker copies the data from the input source onto the local Amazon Elastic Block Store (Amazon EBS) volumes before starting your training algorithm. This is the most commonly used input mode.</p>
19    /// <p>In PIPE mode, Amazon SageMaker streams input data from the source directly to your algorithm without using the EBS volume.</p>
20    pub supported_input_modes: ::std::option::Option<::std::vec::Vec<crate::types::TrainingInputMode>>,
21}
22impl ChannelSpecification {
23    /// <p>The name of the channel.</p>
24    pub fn name(&self) -> ::std::option::Option<&str> {
25        self.name.as_deref()
26    }
27    /// <p>A brief description of the channel.</p>
28    pub fn description(&self) -> ::std::option::Option<&str> {
29        self.description.as_deref()
30    }
31    /// <p>Indicates whether the channel is required by the algorithm.</p>
32    pub fn is_required(&self) -> ::std::option::Option<bool> {
33        self.is_required
34    }
35    /// <p>The supported MIME types for the data.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_content_types.is_none()`.
38    pub fn supported_content_types(&self) -> &[::std::string::String] {
39        self.supported_content_types.as_deref().unwrap_or_default()
40    }
41    /// <p>The allowed compression types, if data compression is used.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_compression_types.is_none()`.
44    pub fn supported_compression_types(&self) -> &[crate::types::CompressionType] {
45        self.supported_compression_types.as_deref().unwrap_or_default()
46    }
47    /// <p>The allowed input mode, either FILE or PIPE.</p>
48    /// <p>In FILE mode, Amazon SageMaker copies the data from the input source onto the local Amazon Elastic Block Store (Amazon EBS) volumes before starting your training algorithm. This is the most commonly used input mode.</p>
49    /// <p>In PIPE mode, Amazon SageMaker streams input data from the source directly to your algorithm without using the EBS volume.</p>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_input_modes.is_none()`.
52    pub fn supported_input_modes(&self) -> &[crate::types::TrainingInputMode] {
53        self.supported_input_modes.as_deref().unwrap_or_default()
54    }
55}
56impl ChannelSpecification {
57    /// Creates a new builder-style object to manufacture [`ChannelSpecification`](crate::types::ChannelSpecification).
58    pub fn builder() -> crate::types::builders::ChannelSpecificationBuilder {
59        crate::types::builders::ChannelSpecificationBuilder::default()
60    }
61}
62
63/// A builder for [`ChannelSpecification`](crate::types::ChannelSpecification).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct ChannelSpecificationBuilder {
67    pub(crate) name: ::std::option::Option<::std::string::String>,
68    pub(crate) description: ::std::option::Option<::std::string::String>,
69    pub(crate) is_required: ::std::option::Option<bool>,
70    pub(crate) supported_content_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71    pub(crate) supported_compression_types: ::std::option::Option<::std::vec::Vec<crate::types::CompressionType>>,
72    pub(crate) supported_input_modes: ::std::option::Option<::std::vec::Vec<crate::types::TrainingInputMode>>,
73}
74impl ChannelSpecificationBuilder {
75    /// <p>The name of the channel.</p>
76    /// This field is required.
77    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.name = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The name of the channel.</p>
82    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.name = input;
84        self
85    }
86    /// <p>The name of the channel.</p>
87    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
88        &self.name
89    }
90    /// <p>A brief description of the channel.</p>
91    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.description = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>A brief description of the channel.</p>
96    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.description = input;
98        self
99    }
100    /// <p>A brief description of the channel.</p>
101    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
102        &self.description
103    }
104    /// <p>Indicates whether the channel is required by the algorithm.</p>
105    pub fn is_required(mut self, input: bool) -> Self {
106        self.is_required = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>Indicates whether the channel is required by the algorithm.</p>
110    pub fn set_is_required(mut self, input: ::std::option::Option<bool>) -> Self {
111        self.is_required = input;
112        self
113    }
114    /// <p>Indicates whether the channel is required by the algorithm.</p>
115    pub fn get_is_required(&self) -> &::std::option::Option<bool> {
116        &self.is_required
117    }
118    /// Appends an item to `supported_content_types`.
119    ///
120    /// To override the contents of this collection use [`set_supported_content_types`](Self::set_supported_content_types).
121    ///
122    /// <p>The supported MIME types for the data.</p>
123    pub fn supported_content_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        let mut v = self.supported_content_types.unwrap_or_default();
125        v.push(input.into());
126        self.supported_content_types = ::std::option::Option::Some(v);
127        self
128    }
129    /// <p>The supported MIME types for the data.</p>
130    pub fn set_supported_content_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
131        self.supported_content_types = input;
132        self
133    }
134    /// <p>The supported MIME types for the data.</p>
135    pub fn get_supported_content_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
136        &self.supported_content_types
137    }
138    /// Appends an item to `supported_compression_types`.
139    ///
140    /// To override the contents of this collection use [`set_supported_compression_types`](Self::set_supported_compression_types).
141    ///
142    /// <p>The allowed compression types, if data compression is used.</p>
143    pub fn supported_compression_types(mut self, input: crate::types::CompressionType) -> Self {
144        let mut v = self.supported_compression_types.unwrap_or_default();
145        v.push(input);
146        self.supported_compression_types = ::std::option::Option::Some(v);
147        self
148    }
149    /// <p>The allowed compression types, if data compression is used.</p>
150    pub fn set_supported_compression_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CompressionType>>) -> Self {
151        self.supported_compression_types = input;
152        self
153    }
154    /// <p>The allowed compression types, if data compression is used.</p>
155    pub fn get_supported_compression_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CompressionType>> {
156        &self.supported_compression_types
157    }
158    /// Appends an item to `supported_input_modes`.
159    ///
160    /// To override the contents of this collection use [`set_supported_input_modes`](Self::set_supported_input_modes).
161    ///
162    /// <p>The allowed input mode, either FILE or PIPE.</p>
163    /// <p>In FILE mode, Amazon SageMaker copies the data from the input source onto the local Amazon Elastic Block Store (Amazon EBS) volumes before starting your training algorithm. This is the most commonly used input mode.</p>
164    /// <p>In PIPE mode, Amazon SageMaker streams input data from the source directly to your algorithm without using the EBS volume.</p>
165    pub fn supported_input_modes(mut self, input: crate::types::TrainingInputMode) -> Self {
166        let mut v = self.supported_input_modes.unwrap_or_default();
167        v.push(input);
168        self.supported_input_modes = ::std::option::Option::Some(v);
169        self
170    }
171    /// <p>The allowed input mode, either FILE or PIPE.</p>
172    /// <p>In FILE mode, Amazon SageMaker copies the data from the input source onto the local Amazon Elastic Block Store (Amazon EBS) volumes before starting your training algorithm. This is the most commonly used input mode.</p>
173    /// <p>In PIPE mode, Amazon SageMaker streams input data from the source directly to your algorithm without using the EBS volume.</p>
174    pub fn set_supported_input_modes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TrainingInputMode>>) -> Self {
175        self.supported_input_modes = input;
176        self
177    }
178    /// <p>The allowed input mode, either FILE or PIPE.</p>
179    /// <p>In FILE mode, Amazon SageMaker copies the data from the input source onto the local Amazon Elastic Block Store (Amazon EBS) volumes before starting your training algorithm. This is the most commonly used input mode.</p>
180    /// <p>In PIPE mode, Amazon SageMaker streams input data from the source directly to your algorithm without using the EBS volume.</p>
181    pub fn get_supported_input_modes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TrainingInputMode>> {
182        &self.supported_input_modes
183    }
184    /// Consumes the builder and constructs a [`ChannelSpecification`](crate::types::ChannelSpecification).
185    pub fn build(self) -> crate::types::ChannelSpecification {
186        crate::types::ChannelSpecification {
187            name: self.name,
188            description: self.description,
189            is_required: self.is_required,
190            supported_content_types: self.supported_content_types,
191            supported_compression_types: self.supported_compression_types,
192            supported_input_modes: self.supported_input_modes,
193        }
194    }
195}