aws_sdk_elementalinference/operation/associate_feed/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_feed::_associate_feed_input::AssociateFeedInputBuilder;
3
4pub use crate::operation::associate_feed::_associate_feed_output::AssociateFeedOutputBuilder;
5
6impl crate::operation::associate_feed::builders::AssociateFeedInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::associate_feed::AssociateFeedOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::associate_feed::AssociateFeedError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.associate_feed();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `AssociateFeed`.
24///
25/// <p>Associates a resource with the feed. The resource provides the input that Elemental Inference needs in order to perform an Elemental Inference feature, such as cropping video. You always provide the resource by associating it with a feed. You can associate only one resource with each feed. With an association, a specific source media is claiming ownership of the feed.</p>
26/// <p>AssociateFeed is a PATCH operation, which means that you can include only parameters that you want to change. Parameters that you don't include will not be affected by the operation.</p>
27/// <p>Specifically:</p>
28/// <ul>
29/// <li>
30/// <p>You can add more outputs to the existing outputs. New outputs will be appended.</p></li>
31/// <li>
32/// <p>You can't modify an existing output (for example to change its name). Instead, use UpdateFeed.</p></li>
33/// <li>
34/// <p>You can't delete an existing output. Instead, use UpdateFeed.</p></li>
35/// </ul>
36/// <p>Also note that you can't change the feed name with AssociateFeed. Instead, use UpdateFeed.</p>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct AssociateFeedFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::associate_feed::builders::AssociateFeedInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::associate_feed::AssociateFeedOutput,
46 crate::operation::associate_feed::AssociateFeedError,
47 > for AssociateFeedFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::associate_feed::AssociateFeedOutput,
55 crate::operation::associate_feed::AssociateFeedError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl AssociateFeedFluentBuilder {
62 /// Creates a new `AssociateFeedFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the AssociateFeed as a reference.
71 pub fn as_input(&self) -> &crate::operation::associate_feed::builders::AssociateFeedInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::associate_feed::AssociateFeedOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::associate_feed::AssociateFeedError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::associate_feed::AssociateFeed::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::associate_feed::AssociateFeed::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::associate_feed::AssociateFeedOutput,
108 crate::operation::associate_feed::AssociateFeedError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// <p>The ID of the feed.</p>
123 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.id(input.into());
125 self
126 }
127 /// <p>The ID of the feed.</p>
128 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.inner = self.inner.set_id(input);
130 self
131 }
132 /// <p>The ID of the feed.</p>
133 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_id()
135 }
136 /// <p>An identifier for the resource. This name must not resemble an ARN.</p>
137 /// <p>The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia).</p>
138 pub fn associated_resource_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.inner = self.inner.associated_resource_name(input.into());
140 self
141 }
142 /// <p>An identifier for the resource. This name must not resemble an ARN.</p>
143 /// <p>The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia).</p>
144 pub fn set_associated_resource_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.inner = self.inner.set_associated_resource_name(input);
146 self
147 }
148 /// <p>An identifier for the resource. This name must not resemble an ARN.</p>
149 /// <p>The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia).</p>
150 pub fn get_associated_resource_name(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_associated_resource_name()
152 }
153 ///
154 /// Appends an item to `outputs`.
155 ///
156 /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
157 ///
158 /// <p>An array of one or more outputs that you want to add to this feed now, to supplement any outputs that you specified when you created or updated the feed.</p>
159 pub fn outputs(mut self, input: crate::types::CreateOutput) -> Self {
160 self.inner = self.inner.outputs(input);
161 self
162 }
163 /// <p>An array of one or more outputs that you want to add to this feed now, to supplement any outputs that you specified when you created or updated the feed.</p>
164 pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>) -> Self {
165 self.inner = self.inner.set_outputs(input);
166 self
167 }
168 /// <p>An array of one or more outputs that you want to add to this feed now, to supplement any outputs that you specified when you created or updated the feed.</p>
169 pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>> {
170 self.inner.get_outputs()
171 }
172 /// <p>Set to true if you want to do a dry run of the associate action.</p>
173 /// <p>Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request.</p>
174 pub fn dry_run(mut self, input: bool) -> Self {
175 self.inner = self.inner.dry_run(input);
176 self
177 }
178 /// <p>Set to true if you want to do a dry run of the associate action.</p>
179 /// <p>Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request.</p>
180 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
181 self.inner = self.inner.set_dry_run(input);
182 self
183 }
184 /// <p>Set to true if you want to do a dry run of the associate action.</p>
185 /// <p>Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request.</p>
186 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
187 self.inner.get_dry_run()
188 }
189}