AWS SDK

AWS SDK

rev. db10d8b7d1ddffb641e5651cb5b4c7c7d63bda6a

Files changed:

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/get_async_invoke/builders.rs

@@ -0,1 +0,125 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::get_async_invoke::_get_async_invoke_output::GetAsyncInvokeOutputBuilder;
           3  +
           4  +
pub use crate::operation::get_async_invoke::_get_async_invoke_input::GetAsyncInvokeInputBuilder;
           5  +
           6  +
impl crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder {
           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::get_async_invoke::GetAsyncInvokeOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_async_invoke::GetAsyncInvokeError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_async_invoke();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetAsyncInvoke`.
          24  +
///
          25  +
/// <p>Retrieve information about an asynchronous invocation.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct GetAsyncInvokeFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::get_async_invoke::GetAsyncInvokeOutput,
          35  +
        crate::operation::get_async_invoke::GetAsyncInvokeError,
          36  +
    > for GetAsyncInvokeFluentBuilder
          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::get_async_invoke::GetAsyncInvokeOutput,
          44  +
            crate::operation::get_async_invoke::GetAsyncInvokeError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl GetAsyncInvokeFluentBuilder {
          51  +
    /// Creates a new `GetAsyncInvokeFluentBuilder`.
          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 GetAsyncInvoke as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder {
          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::get_async_invoke::GetAsyncInvokeOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::get_async_invoke::GetAsyncInvokeError,
          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::get_async_invoke::GetAsyncInvoke::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::get_async_invoke::GetAsyncInvoke::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::get_async_invoke::GetAsyncInvokeOutput,
          97  +
        crate::operation::get_async_invoke::GetAsyncInvokeError,
          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 invocation's ARN.</p>
         112  +
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.inner = self.inner.invocation_arn(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>The invocation's ARN.</p>
         117  +
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.inner = self.inner.set_invocation_arn(input);
         119  +
        self
         120  +
    }
         121  +
    /// <p>The invocation's ARN.</p>
         122  +
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        self.inner.get_invocation_arn()
         124  +
    }
         125  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model.rs

@@ -240,240 +455,468 @@
  260    260   
    }
  261    261   
}
  262    262   
  263    263   
// The get_* functions below are generated from JMESPath expressions in the
  264    264   
// operationContextParams trait. They target the operation's input shape.
  265    265   
  266    266   
/// Error type for the `InvokeModelError` operation.
  267    267   
#[non_exhaustive]
  268    268   
#[derive(::std::fmt::Debug)]
  269    269   
pub enum InvokeModelError {
  270         -
    /// <p>The request is denied because of missing access permissions.</p>
         270  +
    /// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
  271    271   
    AccessDeniedException(crate::types::error::AccessDeniedException),
  272         -
    /// <p>An internal server error occurred. Retry your request.</p>
         272  +
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
  273    273   
    InternalServerException(crate::types::error::InternalServerException),
  274    274   
    /// <p>The request failed due to an error while processing the model.</p>
  275    275   
    ModelErrorException(crate::types::error::ModelErrorException),
  276         -
    /// <p>The model specified in the request is not ready to serve inference requests.</p>
         276  +
    /// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
  277    277   
    ModelNotReadyException(crate::types::error::ModelNotReadyException),
  278    278   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
  279    279   
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
  280         -
    /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
         280  +
    /// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
  281    281   
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
  282         -
    /// <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
         282  +
    /// <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
  283    283   
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
  284         -
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
         284  +
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
         285  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
         286  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
  285    287   
    ThrottlingException(crate::types::error::ThrottlingException),
  286         -
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
         288  +
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
  287    289   
    ValidationException(crate::types::error::ValidationException),
  288    290   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  289    291   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  290    292   
    variable wildcard pattern and check `.code()`:
  291    293   
     \
  292    294   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  293    295   
     \
  294    296   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelError) for what information is available for the error.")]
  295    297   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  296    298   
}
  297    299   
impl InvokeModelError {
  298    300   
    /// Creates the `InvokeModelError::Unhandled` variant from any error type.
  299    301   
    pub fn unhandled(
  300    302   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  301    303   
    ) -> Self {
  302    304   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  303    305   
            source: err.into(),
  304    306   
            meta: ::std::default::Default::default(),
  305    307   
        })
  306    308   
    }
  307    309   
  308    310   
    /// Creates the `InvokeModelError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  309    311   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  310    312   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  311    313   
            source: err.clone().into(),
  312    314   
            meta: err,
  313    315   
        })
  314    316   
    }
  315    317   
    ///
  316    318   
    /// Returns error metadata, which includes the error code, message,
  317    319   
    /// request ID, and potentially additional information.
  318    320   
    ///
  319    321   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  320    322   
        match self {
  321    323   
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  322    324   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  323    325   
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  324    326   
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  325    327   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  326    328   
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  327    329   
            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         330  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  328    331   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  329    332   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  330    333   
            Self::Unhandled(e) => &e.meta,
  331    334   
        }
  332    335   
    }
  333    336   
    /// Returns `true` if the error kind is `InvokeModelError::AccessDeniedException`.
  334    337   
    pub fn is_access_denied_exception(&self) -> bool {
  335    338   
        matches!(self, Self::AccessDeniedException(_))
  336    339   
    }
  337    340   
    /// Returns `true` if the error kind is `InvokeModelError::InternalServerException`.
  338    341   
    pub fn is_internal_server_exception(&self) -> bool {
  339    342   
        matches!(self, Self::InternalServerException(_))
  340    343   
    }
  341    344   
    /// Returns `true` if the error kind is `InvokeModelError::ModelErrorException`.
  342    345   
    pub fn is_model_error_exception(&self) -> bool {
  343    346   
        matches!(self, Self::ModelErrorException(_))
  344    347   
    }
  345    348   
    /// Returns `true` if the error kind is `InvokeModelError::ModelNotReadyException`.
  346    349   
    pub fn is_model_not_ready_exception(&self) -> bool {
  347    350   
        matches!(self, Self::ModelNotReadyException(_))
  348    351   
    }
  349    352   
    /// Returns `true` if the error kind is `InvokeModelError::ModelTimeoutException`.
  350    353   
    pub fn is_model_timeout_exception(&self) -> bool {
  351    354   
        matches!(self, Self::ModelTimeoutException(_))
  352    355   
    }
  353    356   
    /// Returns `true` if the error kind is `InvokeModelError::ResourceNotFoundException`.
  354    357   
    pub fn is_resource_not_found_exception(&self) -> bool {
  355    358   
        matches!(self, Self::ResourceNotFoundException(_))
  356    359   
    }
  357    360   
    /// Returns `true` if the error kind is `InvokeModelError::ServiceQuotaExceededException`.
  358    361   
    pub fn is_service_quota_exceeded_exception(&self) -> bool {
  359    362   
        matches!(self, Self::ServiceQuotaExceededException(_))
  360    363   
    }
         364  +
    /// Returns `true` if the error kind is `InvokeModelError::ServiceUnavailableException`.
         365  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         366  +
        matches!(self, Self::ServiceUnavailableException(_))
         367  +
    }
  361    368   
    /// Returns `true` if the error kind is `InvokeModelError::ThrottlingException`.
  362    369   
    pub fn is_throttling_exception(&self) -> bool {
  363    370   
        matches!(self, Self::ThrottlingException(_))
  364    371   
    }
  365    372   
    /// Returns `true` if the error kind is `InvokeModelError::ValidationException`.
  366    373   
    pub fn is_validation_exception(&self) -> bool {
  367    374   
        matches!(self, Self::ValidationException(_))
  368    375   
    }
  369    376   
}
  370    377   
impl ::std::error::Error for InvokeModelError {
  371    378   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  372    379   
        match self {
  373    380   
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  374    381   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  375    382   
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
  376    383   
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
  377    384   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  378    385   
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
  379    386   
            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
         387  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  380    388   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  381    389   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  382    390   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  383    391   
        }
  384    392   
    }
  385    393   
}
  386    394   
impl ::std::fmt::Display for InvokeModelError {
  387    395   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  388    396   
        match self {
  389    397   
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  390    398   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  391    399   
            Self::ModelErrorException(_inner) => _inner.fmt(f),
  392    400   
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
  393    401   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  394    402   
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
  395    403   
            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
         404  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  396    405   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  397    406   
            Self::ValidationException(_inner) => _inner.fmt(f),
  398    407   
            Self::Unhandled(_inner) => {
  399    408   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  400    409   
                    write!(f, "unhandled error ({code})")
  401    410   
                } else {
  402    411   
                    f.write_str("unhandled error")
  403    412   
                }
  404    413   
            }
  405    414   
        }
  406    415   
    }
  407    416   
}
  408    417   
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelError {
  409    418   
    fn code(&self) -> ::std::option::Option<&str> {
  410    419   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  411    420   
    }
  412    421   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  413         -
        ::std::option::Option::None
         422  +
        match self {
         423  +
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
         424  +
            _ => ::std::option::Option::None,
         425  +
        }
  414    426   
    }
  415    427   
}
  416    428   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelError {
  417    429   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  418    430   
        match self {
  419    431   
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  420    432   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  421    433   
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  422    434   
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  423    435   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  424    436   
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  425    437   
            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         438  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  426    439   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  427    440   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  428    441   
            Self::Unhandled(_inner) => &_inner.meta,
  429    442   
        }
  430    443   
    }
  431    444   
}
  432    445   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelError {
  433    446   
    fn create_unhandled_error(
  434    447   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  435    448   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model/_invoke_model_input.rs

@@ -1,1 +230,257 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    5      5   
pub struct InvokeModelInput {
    6         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
           6  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    7      7   
    pub body: ::std::option::Option<::aws_smithy_types::Blob>,
    8         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
           8  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
    9      9   
    pub content_type: ::std::option::Option<::std::string::String>,
   10     10   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
   11     11   
    pub accept: ::std::option::Option<::std::string::String>,
   12     12   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
   13         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
          13  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
   14     14   
    /// <ul>
   15     15   
    /// <li>
   16     16   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
   17     17   
    /// <li>
          18  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
          19  +
    /// <li>
   18     20   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
   19     21   
    /// <li>
   20         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
          22  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
          23  +
    /// <li>
          24  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
   21     25   
    /// </ul>
   22     26   
    pub model_id: ::std::option::Option<::std::string::String>,
   23     27   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
   24     28   
    pub trace: ::std::option::Option<crate::types::Trace>,
   25     29   
    /// <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied to the invocation.</p>
   26     30   
    /// <p>An error will be thrown in the following situations.</p>
   27     31   
    /// <ul>
   28     32   
    /// <li>
   29     33   
    /// <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p></li>
   30     34   
    /// <li>
   31     35   
    /// <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p></li>
   32     36   
    /// <li>
   33     37   
    /// <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p></li>
   34     38   
    /// </ul>
   35     39   
    pub guardrail_identifier: ::std::option::Option<::std::string::String>,
   36     40   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
   37     41   
    pub guardrail_version: ::std::option::Option<::std::string::String>,
          42  +
    /// <p>Model performance settings for the request.</p>
          43  +
    pub performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
   38     44   
}
   39     45   
impl InvokeModelInput {
   40         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          46  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
   41     47   
    pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
   42     48   
        self.body.as_ref()
   43     49   
    }
   44         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
          50  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
   45     51   
    pub fn content_type(&self) -> ::std::option::Option<&str> {
   46     52   
        self.content_type.as_deref()
   47     53   
    }
   48     54   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
   49     55   
    pub fn accept(&self) -> ::std::option::Option<&str> {
   50     56   
        self.accept.as_deref()
   51     57   
    }
   52     58   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
   53         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
          59  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
   54     60   
    /// <ul>
   55     61   
    /// <li>
   56     62   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
   57     63   
    /// <li>
          64  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
          65  +
    /// <li>
   58     66   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
   59     67   
    /// <li>
   60         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
          68  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
          69  +
    /// <li>
          70  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
   61     71   
    /// </ul>
   62     72   
    pub fn model_id(&self) -> ::std::option::Option<&str> {
   63     73   
        self.model_id.as_deref()
   64     74   
    }
   65     75   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
   66     76   
    pub fn trace(&self) -> ::std::option::Option<&crate::types::Trace> {
   67     77   
        self.trace.as_ref()
   68     78   
    }
   69     79   
    /// <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied to the invocation.</p>
   70     80   
    /// <p>An error will be thrown in the following situations.</p>
   71     81   
    /// <ul>
   72     82   
    /// <li>
   73     83   
    /// <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p></li>
   74     84   
    /// <li>
   75     85   
    /// <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p></li>
   76     86   
    /// <li>
   77     87   
    /// <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p></li>
   78     88   
    /// </ul>
   79     89   
    pub fn guardrail_identifier(&self) -> ::std::option::Option<&str> {
   80     90   
        self.guardrail_identifier.as_deref()
   81     91   
    }
   82     92   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
   83     93   
    pub fn guardrail_version(&self) -> ::std::option::Option<&str> {
   84     94   
        self.guardrail_version.as_deref()
   85     95   
    }
          96  +
    /// <p>Model performance settings for the request.</p>
          97  +
    pub fn performance_config_latency(&self) -> ::std::option::Option<&crate::types::PerformanceConfigLatency> {
          98  +
        self.performance_config_latency.as_ref()
          99  +
    }
   86    100   
}
   87    101   
impl ::std::fmt::Debug for InvokeModelInput {
   88    102   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   89    103   
        let mut formatter = f.debug_struct("InvokeModelInput");
   90    104   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
   91    105   
        formatter.field("content_type", &self.content_type);
   92    106   
        formatter.field("accept", &self.accept);
   93    107   
        formatter.field("model_id", &self.model_id);
   94    108   
        formatter.field("trace", &self.trace);
   95    109   
        formatter.field("guardrail_identifier", &self.guardrail_identifier);
   96    110   
        formatter.field("guardrail_version", &self.guardrail_version);
         111  +
        formatter.field("performance_config_latency", &self.performance_config_latency);
   97    112   
        formatter.finish()
   98    113   
    }
   99    114   
}
  100    115   
impl InvokeModelInput {
  101    116   
    /// Creates a new builder-style object to manufacture [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  102    117   
    pub fn builder() -> crate::operation::invoke_model::builders::InvokeModelInputBuilder {
  103    118   
        crate::operation::invoke_model::builders::InvokeModelInputBuilder::default()
  104    119   
    }
  105    120   
}
  106    121   
  107    122   
/// A builder for [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  108    123   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  109    124   
#[non_exhaustive]
  110    125   
pub struct InvokeModelInputBuilder {
  111    126   
    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
  112    127   
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
  113    128   
    pub(crate) accept: ::std::option::Option<::std::string::String>,
  114    129   
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
  115    130   
    pub(crate) trace: ::std::option::Option<crate::types::Trace>,
  116    131   
    pub(crate) guardrail_identifier: ::std::option::Option<::std::string::String>,
  117    132   
    pub(crate) guardrail_version: ::std::option::Option<::std::string::String>,
         133  +
    pub(crate) performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
  118    134   
}
  119    135   
impl InvokeModelInputBuilder {
  120         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  121         -
    /// This field is required.
         136  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  122    137   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
  123    138   
        self.body = ::std::option::Option::Some(input);
  124    139   
        self
  125    140   
    }
  126         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
         141  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  127    142   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  128    143   
        self.body = input;
  129    144   
        self
  130    145   
    }
  131         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
         146  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  132    147   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  133    148   
        &self.body
  134    149   
    }
  135         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         150  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  136    151   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  137    152   
        self.content_type = ::std::option::Option::Some(input.into());
  138    153   
        self
  139    154   
    }
  140         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         155  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  141    156   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  142    157   
        self.content_type = input;
  143    158   
        self
  144    159   
    }
  145         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         160  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  146    161   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
  147    162   
        &self.content_type
  148    163   
    }
  149    164   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  150    165   
    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  151    166   
        self.accept = ::std::option::Option::Some(input.into());
  152    167   
        self
  153    168   
    }
  154    169   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  155    170   
    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  156    171   
        self.accept = input;
  157    172   
        self
  158    173   
    }
  159    174   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  160    175   
    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
  161    176   
        &self.accept
  162    177   
    }
  163    178   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  164         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         179  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  165    180   
    /// <ul>
  166    181   
    /// <li>
  167    182   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  168    183   
    /// <li>
         184  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         185  +
    /// <li>
  169    186   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  170    187   
    /// <li>
  171         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         188  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         189  +
    /// <li>
         190  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  172    191   
    /// </ul>
  173    192   
    /// This field is required.
  174    193   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  175    194   
        self.model_id = ::std::option::Option::Some(input.into());
  176    195   
        self
  177    196   
    }
  178    197   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  179         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         198  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  180    199   
    /// <ul>
  181    200   
    /// <li>
  182    201   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  183    202   
    /// <li>
         203  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         204  +
    /// <li>
  184    205   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  185    206   
    /// <li>
  186         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         207  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         208  +
    /// <li>
         209  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  187    210   
    /// </ul>
  188    211   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  189    212   
        self.model_id = input;
  190    213   
        self
  191    214   
    }
  192    215   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  193         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         216  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  194    217   
    /// <ul>
  195    218   
    /// <li>
  196    219   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  197    220   
    /// <li>
         221  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         222  +
    /// <li>
  198    223   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  199    224   
    /// <li>
  200         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         225  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         226  +
    /// <li>
         227  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  201    228   
    /// </ul>
  202    229   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  203    230   
        &self.model_id
  204    231   
    }
  205    232   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
  206    233   
    pub fn trace(mut self, input: crate::types::Trace) -> Self {
  207    234   
        self.trace = ::std::option::Option::Some(input);
  208    235   
        self
  209    236   
    }
  210    237   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
@@ -244,271 +299,342 @@
  264    291   
    }
  265    292   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  266    293   
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  267    294   
        self.guardrail_version = input;
  268    295   
        self
  269    296   
    }
  270    297   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  271    298   
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  272    299   
        &self.guardrail_version
  273    300   
    }
         301  +
    /// <p>Model performance settings for the request.</p>
         302  +
    pub fn performance_config_latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
         303  +
        self.performance_config_latency = ::std::option::Option::Some(input);
         304  +
        self
         305  +
    }
         306  +
    /// <p>Model performance settings for the request.</p>
         307  +
    pub fn set_performance_config_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
         308  +
        self.performance_config_latency = input;
         309  +
        self
         310  +
    }
         311  +
    /// <p>Model performance settings for the request.</p>
         312  +
    pub fn get_performance_config_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
         313  +
        &self.performance_config_latency
         314  +
    }
  274    315   
    /// Consumes the builder and constructs a [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  275    316   
    pub fn build(self) -> ::std::result::Result<crate::operation::invoke_model::InvokeModelInput, ::aws_smithy_types::error::operation::BuildError> {
  276    317   
        ::std::result::Result::Ok(crate::operation::invoke_model::InvokeModelInput {
  277    318   
            body: self.body,
  278    319   
            content_type: self.content_type,
  279    320   
            accept: self.accept,
  280    321   
            model_id: self.model_id,
  281    322   
            trace: self.trace,
  282    323   
            guardrail_identifier: self.guardrail_identifier,
  283    324   
            guardrail_version: self.guardrail_version,
         325  +
            performance_config_latency: self.performance_config_latency,
  284    326   
        })
  285    327   
    }
  286    328   
}
  287    329   
impl ::std::fmt::Debug for InvokeModelInputBuilder {
  288    330   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  289    331   
        let mut formatter = f.debug_struct("InvokeModelInputBuilder");
  290    332   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
  291    333   
        formatter.field("content_type", &self.content_type);
  292    334   
        formatter.field("accept", &self.accept);
  293    335   
        formatter.field("model_id", &self.model_id);
  294    336   
        formatter.field("trace", &self.trace);
  295    337   
        formatter.field("guardrail_identifier", &self.guardrail_identifier);
  296    338   
        formatter.field("guardrail_version", &self.guardrail_version);
         339  +
        formatter.field("performance_config_latency", &self.performance_config_latency);
  297    340   
        formatter.finish()
  298    341   
    }
  299    342   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model/_invoke_model_output.rs

@@ -1,1 +122,146 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    5      5   
pub struct InvokeModelOutput {
    6      6   
    /// <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
    7      7   
    pub body: ::aws_smithy_types::Blob,
    8      8   
    /// <p>The MIME type of the inference result.</p>
    9      9   
    pub content_type: ::std::string::String,
          10  +
    /// <p>Model performance settings for the request.</p>
          11  +
    pub performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
   10     12   
    _request_id: Option<String>,
   11     13   
}
   12     14   
impl InvokeModelOutput {
   13     15   
    /// <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
   14     16   
    pub fn body(&self) -> &::aws_smithy_types::Blob {
   15     17   
        &self.body
   16     18   
    }
   17     19   
    /// <p>The MIME type of the inference result.</p>
   18     20   
    pub fn content_type(&self) -> &str {
   19     21   
        use std::ops::Deref;
   20     22   
        self.content_type.deref()
   21     23   
    }
          24  +
    /// <p>Model performance settings for the request.</p>
          25  +
    pub fn performance_config_latency(&self) -> ::std::option::Option<&crate::types::PerformanceConfigLatency> {
          26  +
        self.performance_config_latency.as_ref()
          27  +
    }
   22     28   
}
   23     29   
impl ::std::fmt::Debug for InvokeModelOutput {
   24     30   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   25     31   
        let mut formatter = f.debug_struct("InvokeModelOutput");
   26     32   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
   27     33   
        formatter.field("content_type", &self.content_type);
          34  +
        formatter.field("performance_config_latency", &self.performance_config_latency);
   28     35   
        formatter.field("_request_id", &self._request_id);
   29     36   
        formatter.finish()
   30     37   
    }
   31     38   
}
   32     39   
impl ::aws_types::request_id::RequestId for InvokeModelOutput {
   33     40   
    fn request_id(&self) -> Option<&str> {
   34     41   
        self._request_id.as_deref()
   35     42   
    }
   36     43   
}
   37     44   
impl InvokeModelOutput {
   38     45   
    /// Creates a new builder-style object to manufacture [`InvokeModelOutput`](crate::operation::invoke_model::InvokeModelOutput).
   39     46   
    pub fn builder() -> crate::operation::invoke_model::builders::InvokeModelOutputBuilder {
   40     47   
        crate::operation::invoke_model::builders::InvokeModelOutputBuilder::default()
   41     48   
    }
   42     49   
}
   43     50   
   44     51   
/// A builder for [`InvokeModelOutput`](crate::operation::invoke_model::InvokeModelOutput).
   45     52   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   46     53   
#[non_exhaustive]
   47     54   
pub struct InvokeModelOutputBuilder {
   48     55   
    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
   49     56   
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
          57  +
    pub(crate) performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
   50     58   
    _request_id: Option<String>,
   51     59   
}
   52     60   
impl InvokeModelOutputBuilder {
   53     61   
    /// <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
   54     62   
    /// This field is required.
   55     63   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
   56     64   
        self.body = ::std::option::Option::Some(input);
   57     65   
        self
   58     66   
    }
   59     67   
    /// <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
   60     68   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
   61     69   
        self.body = input;
   62     70   
        self
   63     71   
    }
   64     72   
    /// <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
   65     73   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
   66     74   
        &self.body
   67     75   
    }
   68     76   
    /// <p>The MIME type of the inference result.</p>
   69     77   
    /// This field is required.
   70     78   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   71     79   
        self.content_type = ::std::option::Option::Some(input.into());
   72     80   
        self
   73     81   
    }
   74     82   
    /// <p>The MIME type of the inference result.</p>
   75     83   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   76     84   
        self.content_type = input;
   77     85   
        self
   78     86   
    }
   79     87   
    /// <p>The MIME type of the inference result.</p>
   80     88   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
   81     89   
        &self.content_type
   82     90   
    }
          91  +
    /// <p>Model performance settings for the request.</p>
          92  +
    pub fn performance_config_latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
          93  +
        self.performance_config_latency = ::std::option::Option::Some(input);
          94  +
        self
          95  +
    }
          96  +
    /// <p>Model performance settings for the request.</p>
          97  +
    pub fn set_performance_config_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
          98  +
        self.performance_config_latency = input;
          99  +
        self
         100  +
    }
         101  +
    /// <p>Model performance settings for the request.</p>
         102  +
    pub fn get_performance_config_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
         103  +
        &self.performance_config_latency
         104  +
    }
   83    105   
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
   84    106   
        self._request_id = Some(request_id.into());
   85    107   
        self
   86    108   
    }
   87    109   
   88    110   
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
   89    111   
        self._request_id = request_id;
   90    112   
        self
   91    113   
    }
   92    114   
    /// Consumes the builder and constructs a [`InvokeModelOutput`](crate::operation::invoke_model::InvokeModelOutput).
   93    115   
    /// This method will fail if any of the following fields are not set:
   94    116   
    /// - [`body`](crate::operation::invoke_model::builders::InvokeModelOutputBuilder::body)
   95    117   
    /// - [`content_type`](crate::operation::invoke_model::builders::InvokeModelOutputBuilder::content_type)
   96    118   
    pub fn build(self) -> ::std::result::Result<crate::operation::invoke_model::InvokeModelOutput, ::aws_smithy_types::error::operation::BuildError> {
   97    119   
        ::std::result::Result::Ok(crate::operation::invoke_model::InvokeModelOutput {
   98    120   
            body: self.body.ok_or_else(|| {
   99    121   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  100    122   
                    "body",
  101    123   
                    "body was not specified but it is required when building InvokeModelOutput",
  102    124   
                )
  103    125   
            })?,
  104    126   
            content_type: self.content_type.ok_or_else(|| {
  105    127   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  106    128   
                    "content_type",
  107    129   
                    "content_type was not specified but it is required when building InvokeModelOutput",
  108    130   
                )
  109    131   
            })?,
         132  +
            performance_config_latency: self.performance_config_latency,
  110    133   
            _request_id: self._request_id,
  111    134   
        })
  112    135   
    }
  113    136   
}
  114    137   
impl ::std::fmt::Debug for InvokeModelOutputBuilder {
  115    138   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  116    139   
        let mut formatter = f.debug_struct("InvokeModelOutputBuilder");
  117    140   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
  118    141   
        formatter.field("content_type", &self.content_type);
         142  +
        formatter.field("performance_config_latency", &self.performance_config_latency);
  119    143   
        formatter.field("_request_id", &self._request_id);
  120    144   
        formatter.finish()
  121    145   
    }
  122    146   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model/builders.rs

@@ -1,1 +57,60 @@
   17     17   
    > {
   18     18   
        let mut fluent_builder = client.invoke_model();
   19     19   
        fluent_builder.inner = self;
   20     20   
        fluent_builder.send().await
   21     21   
    }
   22     22   
}
   23     23   
/// Fluent builder constructing a request to `InvokeModel`.
   24     24   
///
   25     25   
/// <p>Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.</p>
   26     26   
/// <p>For example code, see <i>Invoke model code examples</i> in the <i>Amazon Bedrock User Guide</i>.</p>
   27         -
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p>
          27  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p><important>
          28  +
/// <p>To deny all inference access to resources that you specify in the modelId field, you need to deny access to the <code>bedrock:InvokeModel</code> and <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies access to the resource through the Converse API actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.</p>
          29  +
/// </important>
          30  +
/// <p>For troubleshooting some of the common errors you might encounter when using the <code>InvokeModel</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
   28     31   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   29     32   
pub struct InvokeModelFluentBuilder {
   30     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   31     34   
    inner: crate::operation::invoke_model::builders::InvokeModelInputBuilder,
   32     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   33     36   
}
   34     37   
impl
   35     38   
    crate::client::customize::internal::CustomizableSend<
   36     39   
        crate::operation::invoke_model::InvokeModelOutput,
   37     40   
        crate::operation::invoke_model::InvokeModelError,
@@ -83,86 +221,236 @@
  103    106   
    }
  104    107   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  105    108   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  106    109   
        self
  107    110   
    }
  108    111   
  109    112   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  110    113   
        self.config_override = config_override;
  111    114   
        self
  112    115   
    }
  113         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
         116  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  114    117   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
  115    118   
        self.inner = self.inner.body(input);
  116    119   
        self
  117    120   
    }
  118         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
         121  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  119    122   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  120    123   
        self.inner = self.inner.set_body(input);
  121    124   
        self
  122    125   
    }
  123         -
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
         126  +
    /// <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
  124    127   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  125    128   
        self.inner.get_body()
  126    129   
    }
  127         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         130  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  128    131   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  129    132   
        self.inner = self.inner.content_type(input.into());
  130    133   
        self
  131    134   
    }
  132         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         135  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  133    136   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  134    137   
        self.inner = self.inner.set_content_type(input);
  135    138   
        self
  136    139   
    }
  137         -
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
         140  +
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
  138    141   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
  139    142   
        self.inner.get_content_type()
  140    143   
    }
  141    144   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  142    145   
    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  143    146   
        self.inner = self.inner.accept(input.into());
  144    147   
        self
  145    148   
    }
  146    149   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  147    150   
    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  148    151   
        self.inner = self.inner.set_accept(input);
  149    152   
        self
  150    153   
    }
  151    154   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  152    155   
    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
  153    156   
        self.inner.get_accept()
  154    157   
    }
  155    158   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  156         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         159  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  157    160   
    /// <ul>
  158    161   
    /// <li>
  159    162   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  160    163   
    /// <li>
         164  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         165  +
    /// <li>
  161    166   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  162    167   
    /// <li>
  163         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         168  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         169  +
    /// <li>
         170  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  164    171   
    /// </ul>
  165    172   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  166    173   
        self.inner = self.inner.model_id(input.into());
  167    174   
        self
  168    175   
    }
  169    176   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  170         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         177  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  171    178   
    /// <ul>
  172    179   
    /// <li>
  173    180   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  174    181   
    /// <li>
         182  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         183  +
    /// <li>
  175    184   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  176    185   
    /// <li>
  177         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         186  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         187  +
    /// <li>
         188  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  178    189   
    /// </ul>
  179    190   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  180    191   
        self.inner = self.inner.set_model_id(input);
  181    192   
        self
  182    193   
    }
  183    194   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  184         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         195  +
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
  185    196   
    /// <ul>
  186    197   
    /// <li>
  187    198   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  188    199   
    /// <li>
         200  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         201  +
    /// <li>
  189    202   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  190    203   
    /// <li>
  191         -
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         204  +
    /// <p>If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
         205  +
    /// <li>
         206  +
    /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
  192    207   
    /// </ul>
  193    208   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  194    209   
        self.inner.get_model_id()
  195    210   
    }
  196    211   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
  197    212   
    pub fn trace(mut self, input: crate::types::Trace) -> Self {
  198    213   
        self.inner = self.inner.trace(input);
  199    214   
        self
  200    215   
    }
  201    216   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
@@ -235,250 +265,294 @@
  255    270   
    }
  256    271   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  257    272   
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  258    273   
        self.inner = self.inner.set_guardrail_version(input);
  259    274   
        self
  260    275   
    }
  261    276   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  262    277   
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  263    278   
        self.inner.get_guardrail_version()
  264    279   
    }
         280  +
    /// <p>Model performance settings for the request.</p>
         281  +
    pub fn performance_config_latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
         282  +
        self.inner = self.inner.performance_config_latency(input);
         283  +
        self
         284  +
    }
         285  +
    /// <p>Model performance settings for the request.</p>
         286  +
    pub fn set_performance_config_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
         287  +
        self.inner = self.inner.set_performance_config_latency(input);
         288  +
        self
         289  +
    }
         290  +
    /// <p>Model performance settings for the request.</p>
         291  +
    pub fn get_performance_config_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
         292  +
        self.inner.get_performance_config_latency()
         293  +
    }
  265    294   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model_with_bidirectional_stream.rs

@@ -0,1 +0,509 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `InvokeModelWithBidirectionalStream`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct InvokeModelWithBidirectionalStream;
           6  +
impl InvokeModelWithBidirectionalStream {
           7  +
    /// Creates a new `InvokeModelWithBidirectionalStream`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    pub(crate) async fn orchestrate(
          12  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          13  +
        input: crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          18  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          19  +
        >,
          20  +
    > {
          21  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          22  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          23  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          24  +
        >| {
          25  +
            err.map_service_error(|err| {
          26  +
                err.downcast::<crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError>()
          27  +
                    .expect("correct error type")
          28  +
            })
          29  +
        };
          30  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          31  +
            .await
          32  +
            .map_err(map_err)?;
          33  +
        let output = context.finalize().map_err(map_err)?;
          34  +
        ::std::result::Result::Ok(
          35  +
            output
          36  +
                .downcast::<crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput>()
          37  +
                .expect("correct output type"),
          38  +
        )
          39  +
    }
          40  +
          41  +
    pub(crate) async fn orchestrate_with_stop_point(
          42  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          43  +
        input: crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
          44  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          45  +
    ) -> ::std::result::Result<
          46  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          47  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          48  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          49  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          50  +
        >,
          51  +
    > {
          52  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          53  +
        use ::tracing::Instrument;
          54  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
          55  +
            "Bedrock Runtime",
          56  +
            "InvokeModelWithBidirectionalStream",
          57  +
            input,
          58  +
            runtime_plugins,
          59  +
            stop_point,
          60  +
        )
          61  +
        // Create a parent span for the entire operation. Includes a random, internal-only,
          62  +
        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          63  +
        .instrument(::tracing::debug_span!(
          64  +
            "Bedrock Runtime.InvokeModelWithBidirectionalStream",
          65  +
            "rpc.service" = "Bedrock Runtime",
          66  +
            "rpc.method" = "InvokeModelWithBidirectionalStream",
          67  +
            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          68  +
            "rpc.system" = "aws-api",
          69  +
        ))
          70  +
        .await
          71  +
    }
          72  +
          73  +
    pub(crate) fn operation_runtime_plugins(
          74  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          75  +
        client_config: &crate::config::Config,
          76  +
        config_override: ::std::option::Option<crate::config::Builder>,
          77  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          78  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          79  +
          80  +
        if let ::std::option::Option::Some(config_override) = config_override {
          81  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          82  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          83  +
            }
          84  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          85  +
                config_override,
          86  +
                client_config.config.clone(),
          87  +
                &client_config.runtime_components,
          88  +
            ));
          89  +
        }
          90  +
        runtime_plugins
          91  +
    }
          92  +
}
          93  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for InvokeModelWithBidirectionalStream {
          94  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          95  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("InvokeModelWithBidirectionalStream");
          96  +
          97  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          98  +
            InvokeModelWithBidirectionalStreamRequestSerializer,
          99  +
        ));
         100  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         101  +
            InvokeModelWithBidirectionalStreamResponseDeserializer,
         102  +
        ));
         103  +
         104  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         105  +
            crate::config::auth::Params::builder()
         106  +
                .operation_name("InvokeModelWithBidirectionalStream")
         107  +
                .build()
         108  +
                .expect("required fields set"),
         109  +
        ));
         110  +
         111  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
         112  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         113  +
            "InvokeModelWithBidirectionalStream",
         114  +
            "Bedrock Runtime",
         115  +
        ));
         116  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         117  +
        signing_options.double_uri_encode = true;
         118  +
        signing_options.content_sha256_header = false;
         119  +
        signing_options.normalize_uri_path = true;
         120  +
        signing_options.payload_override = Some(::aws_sigv4::http_request::SignableBody::Bytes(&[]));
         121  +
         122  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         123  +
            signing_options,
         124  +
            ..::std::default::Default::default()
         125  +
        });
         126  +
         127  +
        ::std::option::Option::Some(cfg.freeze())
         128  +
    }
         129  +
         130  +
    fn runtime_components(
         131  +
        &self,
         132  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         133  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         134  +
        #[allow(unused_mut)]
         135  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("InvokeModelWithBidirectionalStream")
         136  +
            .with_interceptor(InvokeModelWithBidirectionalStreamEndpointParamsInterceptor)
         137  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         138  +
                crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
         139  +
            >::new())
         140  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         141  +
                crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
         142  +
            >::new())
         143  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         144  +
                crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
         145  +
            >::new());
         146  +
         147  +
        ::std::borrow::Cow::Owned(rcb)
         148  +
    }
         149  +
}
         150  +
         151  +
#[derive(Debug)]
         152  +
struct InvokeModelWithBidirectionalStreamResponseDeserializer;
         153  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeModelWithBidirectionalStreamResponseDeserializer {
         154  +
    fn deserialize_streaming(
         155  +
        &self,
         156  +
        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         157  +
    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
         158  +
        #[allow(unused_mut)]
         159  +
        let mut force_error = false;
         160  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         161  +
         162  +
        // If this is an error, defer to the non-streaming parser
         163  +
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
         164  +
            return ::std::option::Option::None;
         165  +
        }
         166  +
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
         167  +
            crate::protocol_serde::shape_invoke_model_with_bidirectional_stream::de_invoke_model_with_bidirectional_stream_http_response(response),
         168  +
        ))
         169  +
    }
         170  +
         171  +
    fn deserialize_nonstreaming(
         172  +
        &self,
         173  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         174  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         175  +
        // For streaming operations, we only hit this case if its an error
         176  +
        let body = response.body().bytes().expect("body loaded");
         177  +
        crate::protocol_serde::type_erase_result(
         178  +
            crate::protocol_serde::shape_invoke_model_with_bidirectional_stream::de_invoke_model_with_bidirectional_stream_http_error(
         179  +
                response.status().as_u16(),
         180  +
                response.headers(),
         181  +
                body,
         182  +
            ),
         183  +
        )
         184  +
    }
         185  +
}
         186  +
#[derive(Debug)]
         187  +
struct InvokeModelWithBidirectionalStreamRequestSerializer;
         188  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeModelWithBidirectionalStreamRequestSerializer {
         189  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         190  +
    fn serialize_input(
         191  +
        &self,
         192  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         193  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         194  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         195  +
        let input = input
         196  +
            .downcast::<crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput>()
         197  +
            .expect("correct type");
         198  +
        let _header_serialization_settings = _cfg
         199  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         200  +
            .cloned()
         201  +
            .unwrap_or_default();
         202  +
        let mut request_builder = {
         203  +
            fn uri_base(
         204  +
                _input: &crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
         205  +
                output: &mut ::std::string::String,
         206  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         207  +
                use ::std::fmt::Write as _;
         208  +
                let input_1 = &_input.model_id;
         209  +
                let input_1 = input_1
         210  +
                    .as_ref()
         211  +
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("model_id", "cannot be empty or unset"))?;
         212  +
                let model_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
         213  +
                if model_id.is_empty() {
         214  +
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
         215  +
                        "model_id",
         216  +
                        "cannot be empty or unset",
         217  +
                    ));
         218  +
                }
         219  +
                ::std::write!(output, "/model/{modelId}/invoke-with-bidirectional-stream", modelId = model_id).expect("formatting should succeed");
         220  +
                ::std::result::Result::Ok(())
         221  +
            }
         222  +
            #[allow(clippy::unnecessary_wraps)]
         223  +
            fn update_http_builder(
         224  +
                input: &crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
         225  +
                builder: ::http::request::Builder,
         226  +
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         227  +
                let mut uri = ::std::string::String::new();
         228  +
                uri_base(input, &mut uri)?;
         229  +
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         230  +
            }
         231  +
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         232  +
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
         233  +
            builder
         234  +
        };
         235  +
        let body = ::aws_smithy_types::body::SdkBody::from({
         236  +
            let error_marshaller = crate::event_stream_serde::InvokeModelWithBidirectionalStreamInputErrorMarshaller::new();
         237  +
            let marshaller = crate::event_stream_serde::InvokeModelWithBidirectionalStreamInputMarshaller::new();
         238  +
            let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
         239  +
            _cfg.interceptor_state().store_put(signer_sender);
         240  +
            ::aws_smithy_types::body::SdkBody::from_body_0_4(::hyper::Body::wrap_stream(input.body.into_body_stream(
         241  +
                marshaller,
         242  +
                error_marshaller,
         243  +
                signer,
         244  +
            )))
         245  +
        });
         246  +
        if let Some(content_length) = body.content_length() {
         247  +
            let content_length = content_length.to_string();
         248  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         249  +
        }
         250  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         251  +
    }
         252  +
}
         253  +
#[derive(Debug)]
         254  +
struct InvokeModelWithBidirectionalStreamEndpointParamsInterceptor;
         255  +
         256  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeModelWithBidirectionalStreamEndpointParamsInterceptor {
         257  +
    fn name(&self) -> &'static str {
         258  +
        "InvokeModelWithBidirectionalStreamEndpointParamsInterceptor"
         259  +
    }
         260  +
         261  +
    fn read_before_execution(
         262  +
        &self,
         263  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         264  +
            '_,
         265  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         266  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         267  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         268  +
        >,
         269  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         270  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         271  +
        let _input = context
         272  +
            .input()
         273  +
            .downcast_ref::<InvokeModelWithBidirectionalStreamInput>()
         274  +
            .ok_or("failed to downcast to InvokeModelWithBidirectionalStreamInput")?;
         275  +
         276  +
        let params = crate::config::endpoint::Params::builder()
         277  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         278  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         279  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         280  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         281  +
            .build()
         282  +
            .map_err(|err| {
         283  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         284  +
            })?;
         285  +
        cfg.interceptor_state()
         286  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         287  +
        ::std::result::Result::Ok(())
         288  +
    }
         289  +
}
         290  +
         291  +
// The get_* functions below are generated from JMESPath expressions in the
         292  +
// operationContextParams trait. They target the operation's input shape.
         293  +
         294  +
/// Error type for the `InvokeModelWithBidirectionalStreamError` operation.
         295  +
#[non_exhaustive]
         296  +
#[derive(::std::fmt::Debug)]
         297  +
pub enum InvokeModelWithBidirectionalStreamError {
         298  +
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
         299  +
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
         300  +
    /// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
         301  +
    AccessDeniedException(crate::types::error::AccessDeniedException),
         302  +
    /// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
         303  +
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
         304  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
         305  +
    ThrottlingException(crate::types::error::ThrottlingException),
         306  +
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
         307  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
         308  +
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
         309  +
    InternalServerException(crate::types::error::InternalServerException),
         310  +
    /// <p>An error occurred while streaming the response. Retry your request.</p>
         311  +
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
         312  +
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
         313  +
    ValidationException(crate::types::error::ValidationException),
         314  +
    /// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
         315  +
    ModelNotReadyException(crate::types::error::ModelNotReadyException),
         316  +
    /// <p>The request failed due to an error while processing the model.</p>
         317  +
    ModelErrorException(crate::types::error::ModelErrorException),
         318  +
    /// <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
         319  +
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
         320  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         321  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         322  +
    variable wildcard pattern and check `.code()`:
         323  +
     \
         324  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         325  +
     \
         326  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamError) for what information is available for the error.")]
         327  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         328  +
}
         329  +
impl InvokeModelWithBidirectionalStreamError {
         330  +
    /// Creates the `InvokeModelWithBidirectionalStreamError::Unhandled` variant from any error type.
         331  +
    pub fn unhandled(
         332  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         333  +
    ) -> Self {
         334  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         335  +
            source: err.into(),
         336  +
            meta: ::std::default::Default::default(),
         337  +
        })
         338  +
    }
         339  +
         340  +
    /// Creates the `InvokeModelWithBidirectionalStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         341  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         342  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         343  +
            source: err.clone().into(),
         344  +
            meta: err,
         345  +
        })
         346  +
    }
         347  +
    ///
         348  +
    /// Returns error metadata, which includes the error code, message,
         349  +
    /// request ID, and potentially additional information.
         350  +
    ///
         351  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         352  +
        match self {
         353  +
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         354  +
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         355  +
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         356  +
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         357  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         358  +
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         359  +
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         360  +
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         361  +
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         362  +
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         363  +
            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         364  +
            Self::Unhandled(e) => &e.meta,
         365  +
        }
         366  +
    }
         367  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ModelTimeoutException`.
         368  +
    pub fn is_model_timeout_exception(&self) -> bool {
         369  +
        matches!(self, Self::ModelTimeoutException(_))
         370  +
    }
         371  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::AccessDeniedException`.
         372  +
    pub fn is_access_denied_exception(&self) -> bool {
         373  +
        matches!(self, Self::AccessDeniedException(_))
         374  +
    }
         375  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ResourceNotFoundException`.
         376  +
    pub fn is_resource_not_found_exception(&self) -> bool {
         377  +
        matches!(self, Self::ResourceNotFoundException(_))
         378  +
    }
         379  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ThrottlingException`.
         380  +
    pub fn is_throttling_exception(&self) -> bool {
         381  +
        matches!(self, Self::ThrottlingException(_))
         382  +
    }
         383  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ServiceUnavailableException`.
         384  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         385  +
        matches!(self, Self::ServiceUnavailableException(_))
         386  +
    }
         387  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::InternalServerException`.
         388  +
    pub fn is_internal_server_exception(&self) -> bool {
         389  +
        matches!(self, Self::InternalServerException(_))
         390  +
    }
         391  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ModelStreamErrorException`.
         392  +
    pub fn is_model_stream_error_exception(&self) -> bool {
         393  +
        matches!(self, Self::ModelStreamErrorException(_))
         394  +
    }
         395  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ValidationException`.
         396  +
    pub fn is_validation_exception(&self) -> bool {
         397  +
        matches!(self, Self::ValidationException(_))
         398  +
    }
         399  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ModelNotReadyException`.
         400  +
    pub fn is_model_not_ready_exception(&self) -> bool {
         401  +
        matches!(self, Self::ModelNotReadyException(_))
         402  +
    }
         403  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ModelErrorException`.
         404  +
    pub fn is_model_error_exception(&self) -> bool {
         405  +
        matches!(self, Self::ModelErrorException(_))
         406  +
    }
         407  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamError::ServiceQuotaExceededException`.
         408  +
    pub fn is_service_quota_exceeded_exception(&self) -> bool {
         409  +
        matches!(self, Self::ServiceQuotaExceededException(_))
         410  +
    }
         411  +
}
         412  +
impl ::std::error::Error for InvokeModelWithBidirectionalStreamError {
         413  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         414  +
        match self {
         415  +
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
         416  +
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
         417  +
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
         418  +
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         419  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
         420  +
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
         421  +
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
         422  +
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
         423  +
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
         424  +
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
         425  +
            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
         426  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         427  +
        }
         428  +
    }
         429  +
}
         430  +
impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamError {
         431  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         432  +
        match self {
         433  +
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
         434  +
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
         435  +
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
         436  +
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         437  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
         438  +
            Self::InternalServerException(_inner) => _inner.fmt(f),
         439  +
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
         440  +
            Self::ValidationException(_inner) => _inner.fmt(f),
         441  +
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
         442  +
            Self::ModelErrorException(_inner) => _inner.fmt(f),
         443  +
            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
         444  +
            Self::Unhandled(_inner) => {
         445  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         446  +
                    write!(f, "unhandled error ({code})")
         447  +
                } else {
         448  +
                    f.write_str("unhandled error")
         449  +
                }
         450  +
            }
         451  +
        }
         452  +
    }
         453  +
}
         454  +
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamError {
         455  +
    fn code(&self) -> ::std::option::Option<&str> {
         456  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         457  +
    }
         458  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         459  +
        match self {
         460  +
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
         461  +
            _ => ::std::option::Option::None,
         462  +
        }
         463  +
    }
         464  +
}
         465  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamError {
         466  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         467  +
        match self {
         468  +
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         469  +
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         470  +
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         471  +
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         472  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         473  +
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         474  +
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         475  +
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         476  +
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         477  +
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         478  +
            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         479  +
            Self::Unhandled(_inner) => &_inner.meta,
         480  +
        }
         481  +
    }
         482  +
}
         483  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamError {
         484  +
    fn create_unhandled_error(
         485  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         486  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         487  +
    ) -> Self {
         488  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         489  +
            source,
         490  +
            meta: meta.unwrap_or_default(),
         491  +
        })
         492  +
    }
         493  +
}
         494  +
impl ::aws_types::request_id::RequestId for crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError {
         495  +
    fn request_id(&self) -> Option<&str> {
         496  +
        self.meta().request_id()
         497  +
    }
         498  +
}
         499  +
         500  +
pub use crate::operation::invoke_model_with_bidirectional_stream::_invoke_model_with_bidirectional_stream_output::InvokeModelWithBidirectionalStreamOutput;
         501  +
         502  +
pub use crate::operation::invoke_model_with_bidirectional_stream::_invoke_model_with_bidirectional_stream_input::InvokeModelWithBidirectionalStreamInput;
         503  +
         504  +
mod _invoke_model_with_bidirectional_stream_input;
         505  +
         506  +
mod _invoke_model_with_bidirectional_stream_output;
         507  +
         508  +
/// Builders
         509  +
pub mod builders;

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model_with_bidirectional_stream/_invoke_model_with_bidirectional_stream_input.rs

@@ -0,1 +0,121 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::fmt::Debug)]
           5  +
pub struct InvokeModelWithBidirectionalStreamInput {
           6  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
           7  +
    pub model_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
           9  +
    pub body: ::aws_smithy_http::event_stream::EventStreamSender<
          10  +
        crate::types::InvokeModelWithBidirectionalStreamInput,
          11  +
        crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          12  +
    >,
          13  +
}
          14  +
impl InvokeModelWithBidirectionalStreamInput {
          15  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
          16  +
    pub fn model_id(&self) -> ::std::option::Option<&str> {
          17  +
        self.model_id.as_deref()
          18  +
    }
          19  +
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          20  +
    pub fn body(
          21  +
        &self,
          22  +
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
          23  +
        crate::types::InvokeModelWithBidirectionalStreamInput,
          24  +
        crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          25  +
    > {
          26  +
        &self.body
          27  +
    }
          28  +
}
          29  +
impl InvokeModelWithBidirectionalStreamInput {
          30  +
    /// Creates a new builder-style object to manufacture [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
          31  +
    pub fn builder() -> crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder {
          32  +
        crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder::default()
          33  +
    }
          34  +
}
          35  +
          36  +
/// A builder for [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
          37  +
#[derive(::std::default::Default, ::std::fmt::Debug)]
          38  +
#[non_exhaustive]
          39  +
pub struct InvokeModelWithBidirectionalStreamInputBuilder {
          40  +
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
          41  +
    pub(crate) body: ::std::option::Option<
          42  +
        ::aws_smithy_http::event_stream::EventStreamSender<
          43  +
            crate::types::InvokeModelWithBidirectionalStreamInput,
          44  +
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          45  +
        >,
          46  +
    >,
          47  +
}
          48  +
impl InvokeModelWithBidirectionalStreamInputBuilder {
          49  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
          50  +
    /// This field is required.
          51  +
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          52  +
        self.model_id = ::std::option::Option::Some(input.into());
          53  +
        self
          54  +
    }
          55  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
          56  +
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          57  +
        self.model_id = input;
          58  +
        self
          59  +
    }
          60  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
          61  +
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
          62  +
        &self.model_id
          63  +
    }
          64  +
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          65  +
    /// This field is required.
          66  +
    pub fn body(
          67  +
        mut self,
          68  +
        input: ::aws_smithy_http::event_stream::EventStreamSender<
          69  +
            crate::types::InvokeModelWithBidirectionalStreamInput,
          70  +
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          71  +
        >,
          72  +
    ) -> Self {
          73  +
        self.body = ::std::option::Option::Some(input);
          74  +
        self
          75  +
    }
          76  +
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          77  +
    pub fn set_body(
          78  +
        mut self,
          79  +
        input: ::std::option::Option<
          80  +
            ::aws_smithy_http::event_stream::EventStreamSender<
          81  +
                crate::types::InvokeModelWithBidirectionalStreamInput,
          82  +
                crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          83  +
            >,
          84  +
        >,
          85  +
    ) -> Self {
          86  +
        self.body = input;
          87  +
        self
          88  +
    }
          89  +
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          90  +
    pub fn get_body(
          91  +
        &self,
          92  +
    ) -> &::std::option::Option<
          93  +
        ::aws_smithy_http::event_stream::EventStreamSender<
          94  +
            crate::types::InvokeModelWithBidirectionalStreamInput,
          95  +
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
          96  +
        >,
          97  +
    > {
          98  +
        &self.body
          99  +
    }
         100  +
    /// Consumes the builder and constructs a [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
         101  +
    /// This method will fail if any of the following fields are not set:
         102  +
    /// - [`body`](crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder::body)
         103  +
    pub fn build(
         104  +
        self,
         105  +
    ) -> ::std::result::Result<
         106  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
         107  +
        ::aws_smithy_types::error::operation::BuildError,
         108  +
    > {
         109  +
        ::std::result::Result::Ok(
         110  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput {
         111  +
                model_id: self.model_id,
         112  +
                body: self.body.ok_or_else(|| {
         113  +
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
         114  +
                        "body",
         115  +
                        "body was not specified but it is required when building InvokeModelWithBidirectionalStreamInput",
         116  +
                    )
         117  +
                })?,
         118  +
            },
         119  +
        )
         120  +
    }
         121  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/invoke_model_with_bidirectional_stream/_invoke_model_with_bidirectional_stream_output.rs

@@ -0,1 +0,115 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::fmt::Debug)]
           5  +
pub struct InvokeModelWithBidirectionalStreamOutput {
           6  +
    /// <p>Streaming response from the model in the format specified by the <code>BidirectionalOutputPayloadPart</code> header.</p>
           7  +
    pub body: crate::event_receiver::EventReceiver<
           8  +
        crate::types::InvokeModelWithBidirectionalStreamOutput,
           9  +
        crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          10  +
    >,
          11  +
    _request_id: Option<String>,
          12  +
}
          13  +
impl InvokeModelWithBidirectionalStreamOutput {
          14  +
    /// <p>Streaming response from the model in the format specified by the <code>BidirectionalOutputPayloadPart</code> header.</p>
          15  +
    pub fn body(
          16  +
        &self,
          17  +
    ) -> &crate::event_receiver::EventReceiver<
          18  +
        crate::types::InvokeModelWithBidirectionalStreamOutput,
          19  +
        crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          20  +
    > {
          21  +
        &self.body
          22  +
    }
          23  +
}
          24  +
impl ::aws_types::request_id::RequestId for InvokeModelWithBidirectionalStreamOutput {
          25  +
    fn request_id(&self) -> Option<&str> {
          26  +
        self._request_id.as_deref()
          27  +
    }
          28  +
}
          29  +
impl InvokeModelWithBidirectionalStreamOutput {
          30  +
    /// Creates a new builder-style object to manufacture [`InvokeModelWithBidirectionalStreamOutput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput).
          31  +
    pub fn builder() -> crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamOutputBuilder {
          32  +
        crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamOutputBuilder::default()
          33  +
    }
          34  +
}
          35  +
          36  +
/// A builder for [`InvokeModelWithBidirectionalStreamOutput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput).
          37  +
#[derive(::std::default::Default, ::std::fmt::Debug)]
          38  +
#[non_exhaustive]
          39  +
pub struct InvokeModelWithBidirectionalStreamOutputBuilder {
          40  +
    pub(crate) body: ::std::option::Option<
          41  +
        crate::event_receiver::EventReceiver<
          42  +
            crate::types::InvokeModelWithBidirectionalStreamOutput,
          43  +
            crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          44  +
        >,
          45  +
    >,
          46  +
    _request_id: Option<String>,
          47  +
}
          48  +
impl InvokeModelWithBidirectionalStreamOutputBuilder {
          49  +
    /// <p>Streaming response from the model in the format specified by the <code>BidirectionalOutputPayloadPart</code> header.</p>
          50  +
    /// This field is required.
          51  +
    pub fn body(
          52  +
        mut self,
          53  +
        input: crate::event_receiver::EventReceiver<
          54  +
            crate::types::InvokeModelWithBidirectionalStreamOutput,
          55  +
            crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          56  +
        >,
          57  +
    ) -> Self {
          58  +
        self.body = ::std::option::Option::Some(input);
          59  +
        self
          60  +
    }
          61  +
    /// <p>Streaming response from the model in the format specified by the <code>BidirectionalOutputPayloadPart</code> header.</p>
          62  +
    pub fn set_body(
          63  +
        mut self,
          64  +
        input: ::std::option::Option<
          65  +
            crate::event_receiver::EventReceiver<
          66  +
                crate::types::InvokeModelWithBidirectionalStreamOutput,
          67  +
                crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          68  +
            >,
          69  +
        >,
          70  +
    ) -> Self {
          71  +
        self.body = input;
          72  +
        self
          73  +
    }
          74  +
    /// <p>Streaming response from the model in the format specified by the <code>BidirectionalOutputPayloadPart</code> header.</p>
          75  +
    pub fn get_body(
          76  +
        &self,
          77  +
    ) -> &::std::option::Option<
          78  +
        crate::event_receiver::EventReceiver<
          79  +
            crate::types::InvokeModelWithBidirectionalStreamOutput,
          80  +
            crate::types::error::InvokeModelWithBidirectionalStreamOutputError,
          81  +
        >,
          82  +
    > {
          83  +
        &self.body
          84  +
    }
          85  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
          86  +
        self._request_id = Some(request_id.into());
          87  +
        self
          88  +
    }
          89  +
          90  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
          91  +
        self._request_id = request_id;
          92  +
        self
          93  +
    }
          94  +
    /// Consumes the builder and constructs a [`InvokeModelWithBidirectionalStreamOutput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput).
          95  +
    /// This method will fail if any of the following fields are not set:
          96  +
    /// - [`body`](crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamOutputBuilder::body)
          97  +
    pub fn build(
          98  +
        self,
          99  +
    ) -> ::std::result::Result<
         100  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
         101  +
        ::aws_smithy_types::error::operation::BuildError,
         102  +
    > {
         103  +
        ::std::result::Result::Ok(
         104  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput {
         105  +
                body: self.body.ok_or_else(|| {
         106  +
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
         107  +
                        "body",
         108  +
                        "body was not specified but it is required when building InvokeModelWithBidirectionalStreamOutput",
         109  +
                    )
         110  +
                })?,
         111  +
                _request_id: self._request_id,
         112  +
            },
         113  +
        )
         114  +
    }
         115  +
}