aws_sdk_licensemanager/operation/create_license_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_license_version::_create_license_version_output::CreateLicenseVersionOutputBuilder;
3
4pub use crate::operation::create_license_version::_create_license_version_input::CreateLicenseVersionInputBuilder;
5
6impl crate::operation::create_license_version::builders::CreateLicenseVersionInputBuilder {
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_license_version::CreateLicenseVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_license_version::CreateLicenseVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_license_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLicenseVersion`.
24///
25/// <p>Creates a new version of the specified license.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateLicenseVersionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_license_version::builders::CreateLicenseVersionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_license_version::CreateLicenseVersionOutput,
35        crate::operation::create_license_version::CreateLicenseVersionError,
36    > for CreateLicenseVersionFluentBuilder
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_license_version::CreateLicenseVersionOutput,
44            crate::operation::create_license_version::CreateLicenseVersionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateLicenseVersionFluentBuilder {
51    /// Creates a new `CreateLicenseVersionFluentBuilder`.
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 CreateLicenseVersion as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_license_version::builders::CreateLicenseVersionInputBuilder {
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_license_version::CreateLicenseVersionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_license_version::CreateLicenseVersionError,
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_license_version::CreateLicenseVersion::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_license_version::CreateLicenseVersion::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_license_version::CreateLicenseVersionOutput,
97        crate::operation::create_license_version::CreateLicenseVersionError,
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>Amazon Resource Name (ARN) of the license.</p>
112    pub fn license_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.license_arn(input.into());
114        self
115    }
116    /// <p>Amazon Resource Name (ARN) of the license.</p>
117    pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_license_arn(input);
119        self
120    }
121    /// <p>Amazon Resource Name (ARN) of the license.</p>
122    pub fn get_license_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_license_arn()
124    }
125    /// <p>License name.</p>
126    pub fn license_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.license_name(input.into());
128        self
129    }
130    /// <p>License name.</p>
131    pub fn set_license_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_license_name(input);
133        self
134    }
135    /// <p>License name.</p>
136    pub fn get_license_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_license_name()
138    }
139    /// <p>Product name.</p>
140    pub fn product_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.product_name(input.into());
142        self
143    }
144    /// <p>Product name.</p>
145    pub fn set_product_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_product_name(input);
147        self
148    }
149    /// <p>Product name.</p>
150    pub fn get_product_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_product_name()
152    }
153    /// <p>License issuer.</p>
154    pub fn issuer(mut self, input: crate::types::Issuer) -> Self {
155        self.inner = self.inner.issuer(input);
156        self
157    }
158    /// <p>License issuer.</p>
159    pub fn set_issuer(mut self, input: ::std::option::Option<crate::types::Issuer>) -> Self {
160        self.inner = self.inner.set_issuer(input);
161        self
162    }
163    /// <p>License issuer.</p>
164    pub fn get_issuer(&self) -> &::std::option::Option<crate::types::Issuer> {
165        self.inner.get_issuer()
166    }
167    /// <p>Home Region of the license.</p>
168    pub fn home_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.home_region(input.into());
170        self
171    }
172    /// <p>Home Region of the license.</p>
173    pub fn set_home_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_home_region(input);
175        self
176    }
177    /// <p>Home Region of the license.</p>
178    pub fn get_home_region(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_home_region()
180    }
181    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
182    pub fn validity(mut self, input: crate::types::DatetimeRange) -> Self {
183        self.inner = self.inner.validity(input);
184        self
185    }
186    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
187    pub fn set_validity(mut self, input: ::std::option::Option<crate::types::DatetimeRange>) -> Self {
188        self.inner = self.inner.set_validity(input);
189        self
190    }
191    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
192    pub fn get_validity(&self) -> &::std::option::Option<crate::types::DatetimeRange> {
193        self.inner.get_validity()
194    }
195    ///
196    /// Appends an item to `LicenseMetadata`.
197    ///
198    /// To override the contents of this collection use [`set_license_metadata`](Self::set_license_metadata).
199    ///
200    /// <p>Information about the license.</p>
201    pub fn license_metadata(mut self, input: crate::types::Metadata) -> Self {
202        self.inner = self.inner.license_metadata(input);
203        self
204    }
205    /// <p>Information about the license.</p>
206    pub fn set_license_metadata(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>) -> Self {
207        self.inner = self.inner.set_license_metadata(input);
208        self
209    }
210    /// <p>Information about the license.</p>
211    pub fn get_license_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metadata>> {
212        self.inner.get_license_metadata()
213    }
214    ///
215    /// Appends an item to `Entitlements`.
216    ///
217    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
218    ///
219    /// <p>License entitlements.</p>
220    pub fn entitlements(mut self, input: crate::types::Entitlement) -> Self {
221        self.inner = self.inner.entitlements(input);
222        self
223    }
224    /// <p>License entitlements.</p>
225    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>) -> Self {
226        self.inner = self.inner.set_entitlements(input);
227        self
228    }
229    /// <p>License entitlements.</p>
230    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Entitlement>> {
231        self.inner.get_entitlements()
232    }
233    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
234    pub fn consumption_configuration(mut self, input: crate::types::ConsumptionConfiguration) -> Self {
235        self.inner = self.inner.consumption_configuration(input);
236        self
237    }
238    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
239    pub fn set_consumption_configuration(mut self, input: ::std::option::Option<crate::types::ConsumptionConfiguration>) -> Self {
240        self.inner = self.inner.set_consumption_configuration(input);
241        self
242    }
243    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
244    pub fn get_consumption_configuration(&self) -> &::std::option::Option<crate::types::ConsumptionConfiguration> {
245        self.inner.get_consumption_configuration()
246    }
247    /// <p>License status.</p>
248    pub fn status(mut self, input: crate::types::LicenseStatus) -> Self {
249        self.inner = self.inner.status(input);
250        self
251    }
252    /// <p>License status.</p>
253    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LicenseStatus>) -> Self {
254        self.inner = self.inner.set_status(input);
255        self
256    }
257    /// <p>License status.</p>
258    pub fn get_status(&self) -> &::std::option::Option<crate::types::LicenseStatus> {
259        self.inner.get_status()
260    }
261    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
262    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.inner = self.inner.client_token(input.into());
264        self
265    }
266    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
267    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.inner = self.inner.set_client_token(input);
269        self
270    }
271    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
272    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
273        self.inner.get_client_token()
274    }
275    /// <p>Current version of the license.</p>
276    pub fn source_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
277        self.inner = self.inner.source_version(input.into());
278        self
279    }
280    /// <p>Current version of the license.</p>
281    pub fn set_source_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282        self.inner = self.inner.set_source_version(input);
283        self
284    }
285    /// <p>Current version of the license.</p>
286    pub fn get_source_version(&self) -> &::std::option::Option<::std::string::String> {
287        self.inner.get_source_version()
288    }
289}