aws_sdk_iotanalytics/operation/create_pipeline/_create_pipeline_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 CreatePipelineInput {
6 /// <p>The name of the pipeline.</p>
7 pub pipeline_name: ::std::option::Option<::std::string::String>,
8 /// <p>A list of <code>PipelineActivity</code> objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data.</p>
9 /// <p>The list can be 2-25 <code>PipelineActivity</code> objects and must contain both a <code>channel</code> and a <code>datastore</code> activity. Each entry in the list must contain only one activity. For example:</p>
10 /// <p><code>pipelineActivities = \[ { "channel": { ... } }, { "lambda": { ... } }, ... \]</code></p>
11 pub pipeline_activities: ::std::option::Option<::std::vec::Vec<crate::types::PipelineActivity>>,
12 /// <p>Metadata which can be used to manage the pipeline.</p>
13 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreatePipelineInput {
16 /// <p>The name of the pipeline.</p>
17 pub fn pipeline_name(&self) -> ::std::option::Option<&str> {
18 self.pipeline_name.as_deref()
19 }
20 /// <p>A list of <code>PipelineActivity</code> objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data.</p>
21 /// <p>The list can be 2-25 <code>PipelineActivity</code> objects and must contain both a <code>channel</code> and a <code>datastore</code> activity. Each entry in the list must contain only one activity. For example:</p>
22 /// <p><code>pipelineActivities = \[ { "channel": { ... } }, { "lambda": { ... } }, ... \]</code></p>
23 ///
24 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.pipeline_activities.is_none()`.
25 pub fn pipeline_activities(&self) -> &[crate::types::PipelineActivity] {
26 self.pipeline_activities.as_deref().unwrap_or_default()
27 }
28 /// <p>Metadata which can be used to manage the pipeline.</p>
29 ///
30 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
31 pub fn tags(&self) -> &[crate::types::Tag] {
32 self.tags.as_deref().unwrap_or_default()
33 }
34}
35impl CreatePipelineInput {
36 /// Creates a new builder-style object to manufacture [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
37 pub fn builder() -> crate::operation::create_pipeline::builders::CreatePipelineInputBuilder {
38 crate::operation::create_pipeline::builders::CreatePipelineInputBuilder::default()
39 }
40}
41
42/// A builder for [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreatePipelineInputBuilder {
46 pub(crate) pipeline_name: ::std::option::Option<::std::string::String>,
47 pub(crate) pipeline_activities: ::std::option::Option<::std::vec::Vec<crate::types::PipelineActivity>>,
48 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
49}
50impl CreatePipelineInputBuilder {
51 /// <p>The name of the pipeline.</p>
52 /// This field is required.
53 pub fn pipeline_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54 self.pipeline_name = ::std::option::Option::Some(input.into());
55 self
56 }
57 /// <p>The name of the pipeline.</p>
58 pub fn set_pipeline_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59 self.pipeline_name = input;
60 self
61 }
62 /// <p>The name of the pipeline.</p>
63 pub fn get_pipeline_name(&self) -> &::std::option::Option<::std::string::String> {
64 &self.pipeline_name
65 }
66 /// Appends an item to `pipeline_activities`.
67 ///
68 /// To override the contents of this collection use [`set_pipeline_activities`](Self::set_pipeline_activities).
69 ///
70 /// <p>A list of <code>PipelineActivity</code> objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data.</p>
71 /// <p>The list can be 2-25 <code>PipelineActivity</code> objects and must contain both a <code>channel</code> and a <code>datastore</code> activity. Each entry in the list must contain only one activity. For example:</p>
72 /// <p><code>pipelineActivities = \[ { "channel": { ... } }, { "lambda": { ... } }, ... \]</code></p>
73 pub fn pipeline_activities(mut self, input: crate::types::PipelineActivity) -> Self {
74 let mut v = self.pipeline_activities.unwrap_or_default();
75 v.push(input);
76 self.pipeline_activities = ::std::option::Option::Some(v);
77 self
78 }
79 /// <p>A list of <code>PipelineActivity</code> objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data.</p>
80 /// <p>The list can be 2-25 <code>PipelineActivity</code> objects and must contain both a <code>channel</code> and a <code>datastore</code> activity. Each entry in the list must contain only one activity. For example:</p>
81 /// <p><code>pipelineActivities = \[ { "channel": { ... } }, { "lambda": { ... } }, ... \]</code></p>
82 pub fn set_pipeline_activities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PipelineActivity>>) -> Self {
83 self.pipeline_activities = input;
84 self
85 }
86 /// <p>A list of <code>PipelineActivity</code> objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda unctions on messages for advanced processing; or performing mathematical transformations to normalize device data.</p>
87 /// <p>The list can be 2-25 <code>PipelineActivity</code> objects and must contain both a <code>channel</code> and a <code>datastore</code> activity. Each entry in the list must contain only one activity. For example:</p>
88 /// <p><code>pipelineActivities = \[ { "channel": { ... } }, { "lambda": { ... } }, ... \]</code></p>
89 pub fn get_pipeline_activities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PipelineActivity>> {
90 &self.pipeline_activities
91 }
92 /// Appends an item to `tags`.
93 ///
94 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
95 ///
96 /// <p>Metadata which can be used to manage the pipeline.</p>
97 pub fn tags(mut self, input: crate::types::Tag) -> Self {
98 let mut v = self.tags.unwrap_or_default();
99 v.push(input);
100 self.tags = ::std::option::Option::Some(v);
101 self
102 }
103 /// <p>Metadata which can be used to manage the pipeline.</p>
104 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
105 self.tags = input;
106 self
107 }
108 /// <p>Metadata which can be used to manage the pipeline.</p>
109 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
110 &self.tags
111 }
112 /// Consumes the builder and constructs a [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
113 pub fn build(
114 self,
115 ) -> ::std::result::Result<crate::operation::create_pipeline::CreatePipelineInput, ::aws_smithy_types::error::operation::BuildError> {
116 ::std::result::Result::Ok(crate::operation::create_pipeline::CreatePipelineInput {
117 pipeline_name: self.pipeline_name,
118 pipeline_activities: self.pipeline_activities,
119 tags: self.tags,
120 })
121 }
122}