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>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. For example, the smart crop feature uses this role to read graphics-compositing templates from your Amazon S3 bucket. You specify one access role for each feed.</p>
9    pub access_role_arn: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
12    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateFeedInput {
16    /// <p>A user-friendly name for this feed.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. For example, the smart crop feature uses this role to read graphics-compositing templates from your Amazon S3 bucket. You specify one access role for each feed.</p>
21    pub fn access_role_arn(&self) -> ::std::option::Option<&str> {
22        self.access_role_arn.as_deref()
23    }
24    /// <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>
25    ///
26    /// 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()`.
27    pub fn outputs(&self) -> &[crate::types::CreateOutput] {
28        self.outputs.as_deref().unwrap_or_default()
29    }
30    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
31    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
32        self.tags.as_ref()
33    }
34}
35impl CreateFeedInput {
36    /// Creates a new builder-style object to manufacture [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
37    pub fn builder() -> crate::operation::create_feed::builders::CreateFeedInputBuilder {
38        crate::operation::create_feed::builders::CreateFeedInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateFeedInputBuilder {
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) access_role_arn: ::std::option::Option<::std::string::String>,
48    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
49    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
50}
51impl CreateFeedInputBuilder {
52    /// <p>A user-friendly name for this feed.</p>
53    /// This field is required.
54    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>A user-friendly name for this feed.</p>
59    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.name = input;
61        self
62    }
63    /// <p>A user-friendly name for this feed.</p>
64    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.name
66    }
67    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. For example, the smart crop feature uses this role to read graphics-compositing templates from your Amazon S3 bucket. You specify one access role for each feed.</p>
68    pub fn access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.access_role_arn = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. For example, the smart crop feature uses this role to read graphics-compositing templates from your Amazon S3 bucket. You specify one access role for each feed.</p>
73    pub fn set_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.access_role_arn = input;
75        self
76    }
77    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. For example, the smart crop feature uses this role to read graphics-compositing templates from your Amazon S3 bucket. You specify one access role for each feed.</p>
78    pub fn get_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
79        &self.access_role_arn
80    }
81    /// Appends an item to `outputs`.
82    ///
83    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
84    ///
85    /// <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>
86    pub fn outputs(mut self, input: crate::types::CreateOutput) -> Self {
87        let mut v = self.outputs.unwrap_or_default();
88        v.push(input);
89        self.outputs = ::std::option::Option::Some(v);
90        self
91    }
92    /// <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>
93    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>) -> Self {
94        self.outputs = input;
95        self
96    }
97    /// <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>
98    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>> {
99        &self.outputs
100    }
101    /// Adds a key-value pair to `tags`.
102    ///
103    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
104    ///
105    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
106    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
107        let mut hash_map = self.tags.unwrap_or_default();
108        hash_map.insert(k.into(), v.into());
109        self.tags = ::std::option::Option::Some(hash_map);
110        self
111    }
112    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
113    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
114        self.tags = input;
115        self
116    }
117    /// <p>Optional tags. You can also add tags later, using TagResource.</p>
118    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
119        &self.tags
120    }
121    /// Consumes the builder and constructs a [`CreateFeedInput`](crate::operation::create_feed::CreateFeedInput).
122    pub fn build(self) -> ::std::result::Result<crate::operation::create_feed::CreateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
123        ::std::result::Result::Ok(crate::operation::create_feed::CreateFeedInput {
124            name: self.name,
125            access_role_arn: self.access_role_arn,
126            outputs: self.outputs,
127            tags: self.tags,
128        })
129    }
130}