// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_inference_profile::_create_inference_profile_output::CreateInferenceProfileOutputBuilder;
pub use crate::operation::create_inference_profile::_create_inference_profile_input::CreateInferenceProfileInputBuilder;
impl crate::operation::create_inference_profile::builders::CreateInferenceProfileInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_inference_profile::CreateInferenceProfileOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_inference_profile::CreateInferenceProfileError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_inference_profile();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateInferenceProfile`.
///
/// <p>Creates an application inference profile to track metrics and costs when invoking a model. To create an application inference profile for a foundation model in one region, specify the ARN of the model in that region. To create an application inference profile for a foundation model across multiple regions, specify the ARN of the system-defined inference profile that contains the regions that you want to route requests to. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">Increase throughput and resilience with cross-region inference in Amazon Bedrock</a>. in the Amazon Bedrock User Guide.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateInferenceProfileFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_inference_profile::builders::CreateInferenceProfileInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_inference_profile::CreateInferenceProfileOutput,
crate::operation::create_inference_profile::CreateInferenceProfileError,
> for CreateInferenceProfileFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_inference_profile::CreateInferenceProfileOutput,
crate::operation::create_inference_profile::CreateInferenceProfileError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateInferenceProfileFluentBuilder {
/// Creates a new `CreateInferenceProfileFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateInferenceProfile as a reference.
pub fn as_input(&self) -> &crate::operation::create_inference_profile::builders::CreateInferenceProfileInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_inference_profile::CreateInferenceProfileOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_inference_profile::CreateInferenceProfileError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_inference_profile::CreateInferenceProfile::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_inference_profile::CreateInferenceProfile::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_inference_profile::CreateInferenceProfileOutput,
crate::operation::create_inference_profile::CreateInferenceProfileError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>A name for the inference profile.</p>
pub fn inference_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.inference_profile_name(input.into());
self
}
/// <p>A name for the inference profile.</p>
pub fn set_inference_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_inference_profile_name(input);
self
}
/// <p>A name for the inference profile.</p>
pub fn get_inference_profile_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_inference_profile_name()
}
/// <p>A description for the inference profile.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>A description for the inference profile.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
/// <p>A description for the inference profile.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_description()
}
/// <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>.</p>
pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_request_token(input.into());
self
}
/// <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>.</p>
pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_request_token(input);
self
}
/// <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>.</p>
pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_request_token()
}
/// <p>The foundation model or system-defined inference profile that the inference profile will track metrics and costs for.</p>
pub fn model_source(mut self, input: crate::types::InferenceProfileModelSource) -> Self {
self.inner = self.inner.model_source(input);
self
}
/// <p>The foundation model or system-defined inference profile that the inference profile will track metrics and costs for.</p>
pub fn set_model_source(mut self, input: ::std::option::Option<crate::types::InferenceProfileModelSource>) -> Self {
self.inner = self.inner.set_model_source(input);
self
}
/// <p>The foundation model or system-defined inference profile that the inference profile will track metrics and costs for.</p>
pub fn get_model_source(&self) -> &::std::option::Option<crate::types::InferenceProfileModelSource> {
self.inner.get_model_source()
}
///
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>An array of objects, each of which contains a tag and its value. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Tagging resources</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>An array of objects, each of which contains a tag and its value. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Tagging resources</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>An array of objects, each of which contains a tag and its value. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Tagging resources</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
self.inner.get_tags()
}
}