aws_sdk_elementalinference/operation/associate_feed/_associate_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 AssociateFeedInput {
6 /// <p>The ID of the feed.</p>
7 pub id: ::std::option::Option<::std::string::String>,
8 /// <p>An identifier for the resource. If the resource is from an AWS service, this identifier must be the full ARN of that resource. Otherwise, the identifier is a name that you assign and that is appropriate for the application that owns the resource. This name must not resemble an ARN.</p>
9 pub associated_resource_name: ::std::option::Option<::std::string::String>,
10 /// <p>The outputs to add to this feed. You must specify at least one output. You can later use the UpdateFeed action to change the list of outputs.</p>
11 pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
12 /// <p>Set to true if you want to do a dry run of the associate action.</p>
13 pub dry_run: ::std::option::Option<bool>,
14}
15impl AssociateFeedInput {
16 /// <p>The ID of the feed.</p>
17 pub fn id(&self) -> ::std::option::Option<&str> {
18 self.id.as_deref()
19 }
20 /// <p>An identifier for the resource. If the resource is from an AWS service, this identifier must be the full ARN of that resource. Otherwise, the identifier is a name that you assign and that is appropriate for the application that owns the resource. This name must not resemble an ARN.</p>
21 pub fn associated_resource_name(&self) -> ::std::option::Option<&str> {
22 self.associated_resource_name.as_deref()
23 }
24 /// <p>The outputs to add to this feed. You must specify at least one output. You can later use the UpdateFeed action to change the list of outputs.</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>Set to true if you want to do a dry run of the associate action.</p>
31 pub fn dry_run(&self) -> ::std::option::Option<bool> {
32 self.dry_run
33 }
34}
35impl AssociateFeedInput {
36 /// Creates a new builder-style object to manufacture [`AssociateFeedInput`](crate::operation::associate_feed::AssociateFeedInput).
37 pub fn builder() -> crate::operation::associate_feed::builders::AssociateFeedInputBuilder {
38 crate::operation::associate_feed::builders::AssociateFeedInputBuilder::default()
39 }
40}
41
42/// A builder for [`AssociateFeedInput`](crate::operation::associate_feed::AssociateFeedInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct AssociateFeedInputBuilder {
46 pub(crate) id: ::std::option::Option<::std::string::String>,
47 pub(crate) associated_resource_name: ::std::option::Option<::std::string::String>,
48 pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
49 pub(crate) dry_run: ::std::option::Option<bool>,
50}
51impl AssociateFeedInputBuilder {
52 /// <p>The ID of the feed.</p>
53 /// This field is required.
54 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.id = ::std::option::Option::Some(input.into());
56 self
57 }
58 /// <p>The ID of the feed.</p>
59 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.id = input;
61 self
62 }
63 /// <p>The ID of the feed.</p>
64 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
65 &self.id
66 }
67 /// <p>An identifier for the resource. If the resource is from an AWS service, this identifier must be the full ARN of that resource. Otherwise, the identifier is a name that you assign and that is appropriate for the application that owns the resource. This name must not resemble an ARN.</p>
68 /// This field is required.
69 pub fn associated_resource_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.associated_resource_name = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>An identifier for the resource. If the resource is from an AWS service, this identifier must be the full ARN of that resource. Otherwise, the identifier is a name that you assign and that is appropriate for the application that owns the resource. This name must not resemble an ARN.</p>
74 pub fn set_associated_resource_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.associated_resource_name = input;
76 self
77 }
78 /// <p>An identifier for the resource. If the resource is from an AWS service, this identifier must be the full ARN of that resource. Otherwise, the identifier is a name that you assign and that is appropriate for the application that owns the resource. This name must not resemble an ARN.</p>
79 pub fn get_associated_resource_name(&self) -> &::std::option::Option<::std::string::String> {
80 &self.associated_resource_name
81 }
82 /// Appends an item to `outputs`.
83 ///
84 /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
85 ///
86 /// <p>The outputs to add to this feed. You must specify at least one output. You can later use the UpdateFeed action to change the list of outputs.</p>
87 pub fn outputs(mut self, input: crate::types::CreateOutput) -> Self {
88 let mut v = self.outputs.unwrap_or_default();
89 v.push(input);
90 self.outputs = ::std::option::Option::Some(v);
91 self
92 }
93 /// <p>The outputs to add to this feed. You must specify at least one output. You can later use the UpdateFeed action to change the list of outputs.</p>
94 pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>) -> Self {
95 self.outputs = input;
96 self
97 }
98 /// <p>The outputs to add to this feed. You must specify at least one output. You can later use the UpdateFeed action to change the list of outputs.</p>
99 pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>> {
100 &self.outputs
101 }
102 /// <p>Set to true if you want to do a dry run of the associate action.</p>
103 pub fn dry_run(mut self, input: bool) -> Self {
104 self.dry_run = ::std::option::Option::Some(input);
105 self
106 }
107 /// <p>Set to true if you want to do a dry run of the associate action.</p>
108 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
109 self.dry_run = input;
110 self
111 }
112 /// <p>Set to true if you want to do a dry run of the associate action.</p>
113 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
114 &self.dry_run
115 }
116 /// Consumes the builder and constructs a [`AssociateFeedInput`](crate::operation::associate_feed::AssociateFeedInput).
117 pub fn build(
118 self,
119 ) -> ::std::result::Result<crate::operation::associate_feed::AssociateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
120 ::std::result::Result::Ok(crate::operation::associate_feed::AssociateFeedInput {
121 id: self.id,
122 associated_resource_name: self.associated_resource_name,
123 outputs: self.outputs,
124 dry_run: self.dry_run,
125 })
126 }
127}