Skip to main content

aws_sdk_elementalinference/operation/create_feed/
_create_feed_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 CreateFeedInput {
6    /// <p>A user-friendly name for this feed.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>An array of outputs for this feed. Each output represents a specific Elemental Inference feature. For example, there is one output type for the smart crop feature. You must specify at least one output, but you can later add outputs using AssociateFeed, or add, modify, and delete outputs using UpdateFeed.</p>
9    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
10    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateFeedInput {
14    /// <p>A user-friendly name for this feed.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>An array of outputs for this feed. Each output represents a specific Elemental Inference feature. For example, there is one output type for the smart crop feature. You must specify at least one output, but you can later add outputs using AssociateFeed, or add, modify, and delete outputs using UpdateFeed.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.outputs.is_none()`.
21    pub fn outputs(&self) -> &[crate::types::CreateOutput] {
22        self.outputs.as_deref().unwrap_or_default()
23    }
24    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
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 CreateFeedInput {
30    /// Creates a new builder-style object to manufacture [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
31    pub fn builder() -> crate::operation::create_feed::builders::CreateFeedInputBuilder {
32        crate::operation::create_feed::builders::CreateFeedInputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateFeedInputBuilder {
40    pub(crate) name: ::std::option::Option<::std::string::String>,
41    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
42    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
43}
44impl CreateFeedInputBuilder {
45    /// <p>A user-friendly name for this feed.</p>
46    /// This field is required.
47    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>A user-friendly name for this feed.</p>
52    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.name = input;
54        self
55    }
56    /// <p>A user-friendly name for this feed.</p>
57    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.name
59    }
60    /// Appends an item to `outputs`.
61    ///
62    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
63    ///
64    /// <p>An array of outputs for this feed. Each output represents a specific Elemental Inference feature. For example, there is one output type for the smart crop feature. You must specify at least one output, but you can later add outputs using AssociateFeed, or add, modify, and delete outputs using UpdateFeed.</p>
65    pub fn outputs(mut self, input: crate::types::CreateOutput) -> Self {
66        let mut v = self.outputs.unwrap_or_default();
67        v.push(input);
68        self.outputs = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>An array of outputs for this feed. Each output represents a specific Elemental Inference feature. For example, there is one output type for the smart crop feature. You must specify at least one output, but you can later add outputs using AssociateFeed, or add, modify, and delete outputs using UpdateFeed.</p>
72    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>) -> Self {
73        self.outputs = input;
74        self
75    }
76    /// <p>An array of outputs for this feed. Each output represents a specific Elemental Inference feature. For example, there is one output type for the smart crop feature. You must specify at least one output, but you can later add outputs using AssociateFeed, or add, modify, and delete outputs using UpdateFeed.</p>
77    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>> {
78        &self.outputs
79    }
80    /// Adds a key-value pair to `tags`.
81    ///
82    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
83    ///
84    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
85    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
86        let mut hash_map = self.tags.unwrap_or_default();
87        hash_map.insert(k.into(), v.into());
88        self.tags = ::std::option::Option::Some(hash_map);
89        self
90    }
91    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
92    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
93        self.tags = input;
94        self
95    }
96    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
97    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
98        &self.tags
99    }
100    /// Consumes the builder and constructs a [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
101    pub fn build(self) -> ::std::result::Result<crate::operation::create_feed::CreateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
102        ::std::result::Result::Ok(crate::operation::create_feed::CreateFeedInput {
103            name: self.name,
104            outputs: self.outputs,
105            tags: self.tags,
106        })
107    }
108}