aws_sdk_deadline/operation/create_monitor/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_monitor::_create_monitor_output::CreateMonitorOutputBuilder;
3
4pub use crate::operation::create_monitor::_create_monitor_input::CreateMonitorInputBuilder;
5
6impl crate::operation::create_monitor::builders::CreateMonitorInputBuilder {
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::create_monitor::CreateMonitorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_monitor::CreateMonitorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_monitor();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateMonitor`.
24///
25/// <p>Creates an Amazon Web Services Deadline Cloud monitor that you can use to view your farms, queues, and fleets. After you submit a job, you can track the progress of the tasks and steps that make up the job, and then download the job's results.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateMonitorFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_monitor::builders::CreateMonitorInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_monitor::CreateMonitorOutput,
35        crate::operation::create_monitor::CreateMonitorError,
36    > for CreateMonitorFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_monitor::CreateMonitorOutput,
44            crate::operation::create_monitor::CreateMonitorError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateMonitorFluentBuilder {
51    /// Creates a new `CreateMonitorFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateMonitor as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_monitor::builders::CreateMonitorInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_monitor::CreateMonitorOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_monitor::CreateMonitorError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_monitor::CreateMonitor::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_monitor::CreateMonitor::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_monitor::CreateMonitorOutput,
97        crate::operation::create_monitor::CreateMonitorError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
112    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.client_token(input.into());
114        self
115    }
116    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
117    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_client_token(input);
119        self
120    }
121    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
122    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_client_token()
124    }
125    /// <p>The name that you give the monitor that is displayed in the Deadline Cloud console.</p><important>
126    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
127    /// </important>
128    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.display_name(input.into());
130        self
131    }
132    /// <p>The name that you give the monitor that is displayed in the Deadline Cloud console.</p><important>
133    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
134    /// </important>
135    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_display_name(input);
137        self
138    }
139    /// <p>The name that you give the monitor that is displayed in the Deadline Cloud console.</p><important>
140    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
141    /// </important>
142    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_display_name()
144    }
145    /// <p>The Amazon Resource Name (ARN) of the IAM Identity Center instance that authenticates monitor users.</p>
146    pub fn identity_center_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.identity_center_instance_arn(input.into());
148        self
149    }
150    /// <p>The Amazon Resource Name (ARN) of the IAM Identity Center instance that authenticates monitor users.</p>
151    pub fn set_identity_center_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_identity_center_instance_arn(input);
153        self
154    }
155    /// <p>The Amazon Resource Name (ARN) of the IAM Identity Center instance that authenticates monitor users.</p>
156    pub fn get_identity_center_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_identity_center_instance_arn()
158    }
159    /// <p>The subdomain to use when creating the monitor URL. The full URL of the monitor is subdomain.Region.deadlinecloud.amazonaws.com.</p>
160    pub fn subdomain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.subdomain(input.into());
162        self
163    }
164    /// <p>The subdomain to use when creating the monitor URL. The full URL of the monitor is subdomain.Region.deadlinecloud.amazonaws.com.</p>
165    pub fn set_subdomain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_subdomain(input);
167        self
168    }
169    /// <p>The subdomain to use when creating the monitor URL. The full URL of the monitor is subdomain.Region.deadlinecloud.amazonaws.com.</p>
170    pub fn get_subdomain(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_subdomain()
172    }
173    /// <p>The Amazon Resource Name (ARN) of the IAM role that the monitor uses to connect to Deadline Cloud. Every user that signs in to the monitor using IAM Identity Center uses this role to access Deadline Cloud resources.</p>
174    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.inner = self.inner.role_arn(input.into());
176        self
177    }
178    /// <p>The Amazon Resource Name (ARN) of the IAM role that the monitor uses to connect to Deadline Cloud. Every user that signs in to the monitor using IAM Identity Center uses this role to access Deadline Cloud resources.</p>
179    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.inner = self.inner.set_role_arn(input);
181        self
182    }
183    /// <p>The Amazon Resource Name (ARN) of the IAM role that the monitor uses to connect to Deadline Cloud. Every user that signs in to the monitor using IAM Identity Center uses this role to access Deadline Cloud resources.</p>
184    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
185        self.inner.get_role_arn()
186    }
187    ///
188    /// Adds a key-value pair to `tags`.
189    ///
190    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
191    ///
192    /// <p>The tags to add to your monitor. Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
193    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.tags(k.into(), v.into());
195        self
196    }
197    /// <p>The tags to add to your monitor. Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
198    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
199        self.inner = self.inner.set_tags(input);
200        self
201    }
202    /// <p>The tags to add to your monitor. Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
203    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
204        self.inner.get_tags()
205    }
206}