aws_sdk_bedrock/operation/create_provisioned_model_throughput/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_provisioned_model_throughput::_create_provisioned_model_throughput_output::CreateProvisionedModelThroughputOutputBuilder;
3
4pub use crate::operation::create_provisioned_model_throughput::_create_provisioned_model_throughput_input::CreateProvisionedModelThroughputInputBuilder;
5
6impl crate::operation::create_provisioned_model_throughput::builders::CreateProvisionedModelThroughputInputBuilder {
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_provisioned_model_throughput::CreateProvisionedModelThroughputOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_provisioned_model_throughput();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateProvisionedModelThroughput`.
24///
25/// <p>Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify. For pricing details, see <a href="http://aws.amazon.com/bedrock/pricing/">Amazon Bedrock Pricing</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateProvisionedModelThroughputFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_provisioned_model_throughput::builders::CreateProvisionedModelThroughputInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputOutput,
35        crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputError,
36    > for CreateProvisionedModelThroughputFluentBuilder
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_provisioned_model_throughput::CreateProvisionedModelThroughputOutput,
44            crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateProvisionedModelThroughputFluentBuilder {
51    /// Creates a new `CreateProvisionedModelThroughputFluentBuilder`.
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 CreateProvisionedModelThroughput as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_provisioned_model_throughput::builders::CreateProvisionedModelThroughputInputBuilder {
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_provisioned_model_throughput::CreateProvisionedModelThroughputOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputError,
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_provisioned_model_throughput::CreateProvisionedModelThroughput::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughput::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_provisioned_model_throughput::CreateProvisionedModelThroughputOutput,
97        crate::operation::create_provisioned_model_throughput::CreateProvisionedModelThroughputError,
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>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the Amazon S3 User Guide.</p>
112    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.client_request_token(input.into());
114        self
115    }
116    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the Amazon S3 User Guide.</p>
117    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_client_request_token(input);
119        self
120    }
121    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the Amazon S3 User Guide.</p>
122    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_client_request_token()
124    }
125    /// <p>Number of model units to allocate. A model unit delivers a specific throughput level for the specified model. The throughput level of a model unit specifies the total number of input and output tokens that it can process and generate within a span of one minute. By default, your account has no model units for purchasing Provisioned Throughputs with commitment. You must first visit the <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase">Amazon Web Services support center</a> to request MUs.</p>
126    /// <p>For model unit quotas, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas">Provisioned Throughput quotas</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
127    /// <p>For more information about what an MU specifies, contact your Amazon Web Services account manager.</p>
128    pub fn model_units(mut self, input: i32) -> Self {
129        self.inner = self.inner.model_units(input);
130        self
131    }
132    /// <p>Number of model units to allocate. A model unit delivers a specific throughput level for the specified model. The throughput level of a model unit specifies the total number of input and output tokens that it can process and generate within a span of one minute. By default, your account has no model units for purchasing Provisioned Throughputs with commitment. You must first visit the <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase">Amazon Web Services support center</a> to request MUs.</p>
133    /// <p>For model unit quotas, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas">Provisioned Throughput quotas</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
134    /// <p>For more information about what an MU specifies, contact your Amazon Web Services account manager.</p>
135    pub fn set_model_units(mut self, input: ::std::option::Option<i32>) -> Self {
136        self.inner = self.inner.set_model_units(input);
137        self
138    }
139    /// <p>Number of model units to allocate. A model unit delivers a specific throughput level for the specified model. The throughput level of a model unit specifies the total number of input and output tokens that it can process and generate within a span of one minute. By default, your account has no model units for purchasing Provisioned Throughputs with commitment. You must first visit the <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase">Amazon Web Services support center</a> to request MUs.</p>
140    /// <p>For model unit quotas, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas">Provisioned Throughput quotas</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
141    /// <p>For more information about what an MU specifies, contact your Amazon Web Services account manager.</p>
142    pub fn get_model_units(&self) -> &::std::option::Option<i32> {
143        self.inner.get_model_units()
144    }
145    /// <p>The name for this Provisioned Throughput.</p>
146    pub fn provisioned_model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.provisioned_model_name(input.into());
148        self
149    }
150    /// <p>The name for this Provisioned Throughput.</p>
151    pub fn set_provisioned_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_provisioned_model_name(input);
153        self
154    }
155    /// <p>The name for this Provisioned Throughput.</p>
156    pub fn get_provisioned_model_name(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_provisioned_model_name()
158    }
159    /// <p>The Amazon Resource Name (ARN) or name of the model to associate with this Provisioned Throughput. For a list of models for which you can purchase Provisioned Throughput, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models">Amazon Bedrock model IDs for purchasing Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
160    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.model_id(input.into());
162        self
163    }
164    /// <p>The Amazon Resource Name (ARN) or name of the model to associate with this Provisioned Throughput. For a list of models for which you can purchase Provisioned Throughput, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models">Amazon Bedrock model IDs for purchasing Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
165    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_model_id(input);
167        self
168    }
169    /// <p>The Amazon Resource Name (ARN) or name of the model to associate with this Provisioned Throughput. For a list of models for which you can purchase Provisioned Throughput, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models">Amazon Bedrock model IDs for purchasing Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
170    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_model_id()
172    }
173    /// <p>The commitment duration requested for the Provisioned Throughput. Billing occurs hourly and is discounted for longer commitment terms. To request a no-commit Provisioned Throughput, omit this field.</p>
174    /// <p>Custom models support all levels of commitment. To see which base models support no commitment, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html">Supported regions and models for Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a></p>
175    pub fn commitment_duration(mut self, input: crate::types::CommitmentDuration) -> Self {
176        self.inner = self.inner.commitment_duration(input);
177        self
178    }
179    /// <p>The commitment duration requested for the Provisioned Throughput. Billing occurs hourly and is discounted for longer commitment terms. To request a no-commit Provisioned Throughput, omit this field.</p>
180    /// <p>Custom models support all levels of commitment. To see which base models support no commitment, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html">Supported regions and models for Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a></p>
181    pub fn set_commitment_duration(mut self, input: ::std::option::Option<crate::types::CommitmentDuration>) -> Self {
182        self.inner = self.inner.set_commitment_duration(input);
183        self
184    }
185    /// <p>The commitment duration requested for the Provisioned Throughput. Billing occurs hourly and is discounted for longer commitment terms. To request a no-commit Provisioned Throughput, omit this field.</p>
186    /// <p>Custom models support all levels of commitment. To see which base models support no commitment, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html">Supported regions and models for Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a></p>
187    pub fn get_commitment_duration(&self) -> &::std::option::Option<crate::types::CommitmentDuration> {
188        self.inner.get_commitment_duration()
189    }
190    ///
191    /// Appends an item to `tags`.
192    ///
193    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
194    ///
195    /// <p>Tags to associate with this Provisioned Throughput.</p>
196    pub fn tags(mut self, input: crate::types::Tag) -> Self {
197        self.inner = self.inner.tags(input);
198        self
199    }
200    /// <p>Tags to associate with this Provisioned Throughput.</p>
201    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
202        self.inner = self.inner.set_tags(input);
203        self
204    }
205    /// <p>Tags to associate with this Provisioned Throughput.</p>
206    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
207        self.inner.get_tags()
208    }
209}