AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a

Files changed:

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

@@ -1,0 +125,0 @@
    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 +468,455 @@
  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 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>
         270  +
    /// <p>The request is denied because of missing access permissions.</p>
  271    271   
    AccessDeniedException(crate::types::error::AccessDeniedException),
  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>
         272  +
    /// <p>An internal server error occurred. Retry your request.</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. 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>
         276  +
    /// <p>The model specified in the request is not ready to serve inference requests.</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. 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>
         280  +
    /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
  281    281   
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
  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>
         282  +
    /// <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
  283    283   
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
  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>
         284  +
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
  287    285   
    ThrottlingException(crate::types::error::ThrottlingException),
  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>
         286  +
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
  289    287   
    ValidationException(crate::types::error::ValidationException),
  290    288   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  291    289   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  292    290   
    variable wildcard pattern and check `.code()`:
  293    291   
     \
  294    292   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  295    293   
     \
  296    294   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelError) for what information is available for the error.")]
  297    295   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  298    296   
}
  299    297   
impl InvokeModelError {
  300    298   
    /// Creates the `InvokeModelError::Unhandled` variant from any error type.
  301    299   
    pub fn unhandled(
  302    300   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  303    301   
    ) -> Self {
  304    302   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  305    303   
            source: err.into(),
  306    304   
            meta: ::std::default::Default::default(),
  307    305   
        })
  308    306   
    }
  309    307   
  310    308   
    /// Creates the `InvokeModelError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  311    309   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  312    310   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  313    311   
            source: err.clone().into(),
  314    312   
            meta: err,
  315    313   
        })
  316    314   
    }
  317    315   
    ///
  318    316   
    /// Returns error metadata, which includes the error code, message,
  319    317   
    /// request ID, and potentially additional information.
  320    318   
    ///
  321    319   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  322    320   
        match self {
  323    321   
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  324    322   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  325    323   
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  326    324   
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  327    325   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  328    326   
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  329    327   
            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  330         -
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  331    328   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  332    329   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  333    330   
            Self::Unhandled(e) => &e.meta,
  334    331   
        }
  335    332   
    }
  336    333   
    /// Returns `true` if the error kind is `InvokeModelError::AccessDeniedException`.
  337    334   
    pub fn is_access_denied_exception(&self) -> bool {
  338    335   
        matches!(self, Self::AccessDeniedException(_))
  339    336   
    }
  340    337   
    /// Returns `true` if the error kind is `InvokeModelError::InternalServerException`.
  341    338   
    pub fn is_internal_server_exception(&self) -> bool {
  342    339   
        matches!(self, Self::InternalServerException(_))
  343    340   
    }
  344    341   
    /// Returns `true` if the error kind is `InvokeModelError::ModelErrorException`.
  345    342   
    pub fn is_model_error_exception(&self) -> bool {
  346    343   
        matches!(self, Self::ModelErrorException(_))
  347    344   
    }
  348    345   
    /// Returns `true` if the error kind is `InvokeModelError::ModelNotReadyException`.
  349    346   
    pub fn is_model_not_ready_exception(&self) -> bool {
  350    347   
        matches!(self, Self::ModelNotReadyException(_))
  351    348   
    }
  352    349   
    /// Returns `true` if the error kind is `InvokeModelError::ModelTimeoutException`.
  353    350   
    pub fn is_model_timeout_exception(&self) -> bool {
  354    351   
        matches!(self, Self::ModelTimeoutException(_))
  355    352   
    }
  356    353   
    /// Returns `true` if the error kind is `InvokeModelError::ResourceNotFoundException`.
  357    354   
    pub fn is_resource_not_found_exception(&self) -> bool {
  358    355   
        matches!(self, Self::ResourceNotFoundException(_))
  359    356   
    }
  360    357   
    /// Returns `true` if the error kind is `InvokeModelError::ServiceQuotaExceededException`.
  361    358   
    pub fn is_service_quota_exceeded_exception(&self) -> bool {
  362    359   
        matches!(self, Self::ServiceQuotaExceededException(_))
  363    360   
    }
  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         -
    }
  368    361   
    /// Returns `true` if the error kind is `InvokeModelError::ThrottlingException`.
  369    362   
    pub fn is_throttling_exception(&self) -> bool {
  370    363   
        matches!(self, Self::ThrottlingException(_))
  371    364   
    }
  372    365   
    /// Returns `true` if the error kind is `InvokeModelError::ValidationException`.
  373    366   
    pub fn is_validation_exception(&self) -> bool {
  374    367   
        matches!(self, Self::ValidationException(_))
  375    368   
    }
  376    369   
}
  377    370   
impl ::std::error::Error for InvokeModelError {
  378    371   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  379    372   
        match self {
  380    373   
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  381    374   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  382    375   
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
  383    376   
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
  384    377   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  385    378   
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
  386    379   
            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
  387         -
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  388    380   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  389    381   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  390    382   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  391    383   
        }
  392    384   
    }
  393    385   
}
  394    386   
impl ::std::fmt::Display for InvokeModelError {
  395    387   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  396    388   
        match self {
  397    389   
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  398    390   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  399    391   
            Self::ModelErrorException(_inner) => _inner.fmt(f),
  400    392   
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
  401    393   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  402    394   
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
  403    395   
            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
  404         -
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  405    396   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  406    397   
            Self::ValidationException(_inner) => _inner.fmt(f),
  407    398   
            Self::Unhandled(_inner) => {
  408    399   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  409    400   
                    write!(f, "unhandled error ({code})")
  410    401   
                } else {
  411    402   
                    f.write_str("unhandled error")
  412    403   
                }
  413    404   
            }
  414    405   
        }
  415    406   
    }
  416    407   
}
  417    408   
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelError {
  418    409   
    fn code(&self) -> ::std::option::Option<&str> {
  419    410   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  420    411   
    }
  421    412   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  422         -
        match self {
  423         -
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
  424         -
            _ => ::std::option::Option::None,
  425         -
        }
         413  +
        ::std::option::Option::None
  426    414   
    }
  427    415   
}
  428    416   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelError {
  429    417   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  430    418   
        match self {
  431    419   
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  432    420   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  433    421   
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  434    422   
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  435    423   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  436    424   
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  437    425   
            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  438         -
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  439    426   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  440    427   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  441    428   
            Self::Unhandled(_inner) => &_inner.meta,
  442    429   
        }
  443    430   
    }
  444    431   
}
  445    432   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelError {
  446    433   
    fn create_unhandled_error(
  447    434   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  448    435   
        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 +257,230 @@
    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. 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>
           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>
    7      7   
    pub body: ::std::option::Option<::aws_smithy_types::Blob>,
    8         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
           8  +
    /// <p>The MIME type of the input data in the request. The default value is <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 or throughput that you use:</p>
          13  +
    /// <p>The <code>modelId</code> to provide depends on the type of model 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>
   20     18   
    /// <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>
   21     19   
    /// <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>
          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>
   25     21   
    /// </ul>
   26     22   
    pub model_id: ::std::option::Option<::std::string::String>,
   27     23   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
   28     24   
    pub trace: ::std::option::Option<crate::types::Trace>,
   29     25   
    /// <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>
   30     26   
    /// <p>An error will be thrown in the following situations.</p>
   31     27   
    /// <ul>
   32     28   
    /// <li>
   33     29   
    /// <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p></li>
   34     30   
    /// <li>
   35     31   
    /// <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p></li>
   36     32   
    /// <li>
   37     33   
    /// <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p></li>
   38     34   
    /// </ul>
   39     35   
    pub guardrail_identifier: ::std::option::Option<::std::string::String>,
   40     36   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
   41     37   
    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>,
   44     38   
}
   45     39   
impl InvokeModelInput {
   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>
          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>
   47     41   
    pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
   48     42   
        self.body.as_ref()
   49     43   
    }
   50         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
          44  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
   51     45   
    pub fn content_type(&self) -> ::std::option::Option<&str> {
   52     46   
        self.content_type.as_deref()
   53     47   
    }
   54     48   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
   55     49   
    pub fn accept(&self) -> ::std::option::Option<&str> {
   56     50   
        self.accept.as_deref()
   57     51   
    }
   58     52   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
   59         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
          53  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
   60     54   
    /// <ul>
   61     55   
    /// <li>
   62     56   
    /// <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>
   63     57   
    /// <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>
   66     58   
    /// <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>
   67     59   
    /// <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>
          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>
   71     61   
    /// </ul>
   72     62   
    pub fn model_id(&self) -> ::std::option::Option<&str> {
   73     63   
        self.model_id.as_deref()
   74     64   
    }
   75     65   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
   76     66   
    pub fn trace(&self) -> ::std::option::Option<&crate::types::Trace> {
   77     67   
        self.trace.as_ref()
   78     68   
    }
   79     69   
    /// <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>
   80     70   
    /// <p>An error will be thrown in the following situations.</p>
   81     71   
    /// <ul>
   82     72   
    /// <li>
   83     73   
    /// <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p></li>
   84     74   
    /// <li>
   85     75   
    /// <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p></li>
   86     76   
    /// <li>
   87     77   
    /// <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p></li>
   88     78   
    /// </ul>
   89     79   
    pub fn guardrail_identifier(&self) -> ::std::option::Option<&str> {
   90     80   
        self.guardrail_identifier.as_deref()
   91     81   
    }
   92     82   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
   93     83   
    pub fn guardrail_version(&self) -> ::std::option::Option<&str> {
   94     84   
        self.guardrail_version.as_deref()
   95     85   
    }
   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         -
    }
  100     86   
}
  101     87   
impl ::std::fmt::Debug for InvokeModelInput {
  102     88   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  103     89   
        let mut formatter = f.debug_struct("InvokeModelInput");
  104     90   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
  105     91   
        formatter.field("content_type", &self.content_type);
  106     92   
        formatter.field("accept", &self.accept);
  107     93   
        formatter.field("model_id", &self.model_id);
  108     94   
        formatter.field("trace", &self.trace);
  109     95   
        formatter.field("guardrail_identifier", &self.guardrail_identifier);
  110     96   
        formatter.field("guardrail_version", &self.guardrail_version);
  111         -
        formatter.field("performance_config_latency", &self.performance_config_latency);
  112     97   
        formatter.finish()
  113     98   
    }
  114     99   
}
  115    100   
impl InvokeModelInput {
  116    101   
    /// Creates a new builder-style object to manufacture [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  117    102   
    pub fn builder() -> crate::operation::invoke_model::builders::InvokeModelInputBuilder {
  118    103   
        crate::operation::invoke_model::builders::InvokeModelInputBuilder::default()
  119    104   
    }
  120    105   
}
  121    106   
  122    107   
/// A builder for [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  123    108   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  124    109   
#[non_exhaustive]
  125    110   
pub struct InvokeModelInputBuilder {
  126    111   
    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
  127    112   
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
  128    113   
    pub(crate) accept: ::std::option::Option<::std::string::String>,
  129    114   
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
  130    115   
    pub(crate) trace: ::std::option::Option<crate::types::Trace>,
  131    116   
    pub(crate) guardrail_identifier: ::std::option::Option<::std::string::String>,
  132    117   
    pub(crate) guardrail_version: ::std::option::Option<::std::string::String>,
  133         -
    pub(crate) performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
  134    118   
}
  135    119   
impl InvokeModelInputBuilder {
  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>
         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.
  137    122   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
  138    123   
        self.body = ::std::option::Option::Some(input);
  139    124   
        self
  140    125   
    }
  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>
         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>
  142    127   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  143    128   
        self.body = input;
  144    129   
        self
  145    130   
    }
  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>
         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>
  147    132   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  148    133   
        &self.body
  149    134   
    }
  150         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         135  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  151    136   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  152    137   
        self.content_type = ::std::option::Option::Some(input.into());
  153    138   
        self
  154    139   
    }
  155         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         140  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  156    141   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  157    142   
        self.content_type = input;
  158    143   
        self
  159    144   
    }
  160         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         145  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  161    146   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
  162    147   
        &self.content_type
  163    148   
    }
  164    149   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  165    150   
    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  166    151   
        self.accept = ::std::option::Option::Some(input.into());
  167    152   
        self
  168    153   
    }
  169    154   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  170    155   
    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  171    156   
        self.accept = input;
  172    157   
        self
  173    158   
    }
  174    159   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  175    160   
    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
  176    161   
        &self.accept
  177    162   
    }
  178    163   
    /// <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 or throughput that you use:</p>
         164  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  180    165   
    /// <ul>
  181    166   
    /// <li>
  182    167   
    /// <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    168   
    /// <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>
  186    169   
    /// <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>
  187    170   
    /// <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>
         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>
  191    172   
    /// </ul>
  192    173   
    /// This field is required.
  193    174   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  194    175   
        self.model_id = ::std::option::Option::Some(input.into());
  195    176   
        self
  196    177   
    }
  197    178   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  198         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         179  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  199    180   
    /// <ul>
  200    181   
    /// <li>
  201    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>
  202    183   
    /// <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>
  205    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>
  206    185   
    /// <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>
         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>
  210    187   
    /// </ul>
  211    188   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  212    189   
        self.model_id = input;
  213    190   
        self
  214    191   
    }
  215    192   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  216         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         193  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  217    194   
    /// <ul>
  218    195   
    /// <li>
  219    196   
    /// <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>
  220    197   
    /// <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>
  223    198   
    /// <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>
  224    199   
    /// <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>
         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>
  228    201   
    /// </ul>
  229    202   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  230    203   
        &self.model_id
  231    204   
    }
  232    205   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
  233    206   
    pub fn trace(mut self, input: crate::types::Trace) -> Self {
  234    207   
        self.trace = ::std::option::Option::Some(input);
  235    208   
        self
  236    209   
    }
  237    210   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
@@ -271,244 +342,299 @@
  291    264   
    }
  292    265   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  293    266   
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  294    267   
        self.guardrail_version = input;
  295    268   
        self
  296    269   
    }
  297    270   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  298    271   
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  299    272   
        &self.guardrail_version
  300    273   
    }
  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         -
    }
  315    274   
    /// Consumes the builder and constructs a [`InvokeModelInput`](crate::operation::invoke_model::InvokeModelInput).
  316    275   
    pub fn build(self) -> ::std::result::Result<crate::operation::invoke_model::InvokeModelInput, ::aws_smithy_types::error::operation::BuildError> {
  317    276   
        ::std::result::Result::Ok(crate::operation::invoke_model::InvokeModelInput {
  318    277   
            body: self.body,
  319    278   
            content_type: self.content_type,
  320    279   
            accept: self.accept,
  321    280   
            model_id: self.model_id,
  322    281   
            trace: self.trace,
  323    282   
            guardrail_identifier: self.guardrail_identifier,
  324    283   
            guardrail_version: self.guardrail_version,
  325         -
            performance_config_latency: self.performance_config_latency,
  326    284   
        })
  327    285   
    }
  328    286   
}
  329    287   
impl ::std::fmt::Debug for InvokeModelInputBuilder {
  330    288   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  331    289   
        let mut formatter = f.debug_struct("InvokeModelInputBuilder");
  332    290   
        formatter.field("body", &"*** Sensitive Data Redacted ***");
  333    291   
        formatter.field("content_type", &self.content_type);
  334    292   
        formatter.field("accept", &self.accept);
  335    293   
        formatter.field("model_id", &self.model_id);
  336    294   
        formatter.field("trace", &self.trace);
  337    295   
        formatter.field("guardrail_identifier", &self.guardrail_identifier);
  338    296   
        formatter.field("guardrail_version", &self.guardrail_version);
  339         -
        formatter.field("performance_config_latency", &self.performance_config_latency);
  340    297   
        formatter.finish()
  341    298   
    }
  342    299   
}

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

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

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

@@ -1,1 +60,57 @@
   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><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>
          27  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p>
   31     28   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   32     29   
pub struct InvokeModelFluentBuilder {
   33     30   
    handle: ::std::sync::Arc<crate::client::Handle>,
   34     31   
    inner: crate::operation::invoke_model::builders::InvokeModelInputBuilder,
   35     32   
    config_override: ::std::option::Option<crate::config::Builder>,
   36     33   
}
   37     34   
impl
   38     35   
    crate::client::customize::internal::CustomizableSend<
   39     36   
        crate::operation::invoke_model::InvokeModelOutput,
   40     37   
        crate::operation::invoke_model::InvokeModelError,
@@ -86,83 +236,221 @@
  106    103   
    }
  107    104   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  108    105   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  109    106   
        self
  110    107   
    }
  111    108   
  112    109   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  113    110   
        self.config_override = config_override;
  114    111   
        self
  115    112   
    }
  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>
         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>
  117    114   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
  118    115   
        self.inner = self.inner.body(input);
  119    116   
        self
  120    117   
    }
  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>
         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>
  122    119   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  123    120   
        self.inner = self.inner.set_body(input);
  124    121   
        self
  125    122   
    }
  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>
         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>
  127    124   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  128    125   
        self.inner.get_body()
  129    126   
    }
  130         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         127  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  131    128   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  132    129   
        self.inner = self.inner.content_type(input.into());
  133    130   
        self
  134    131   
    }
  135         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         132  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  136    133   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  137    134   
        self.inner = self.inner.set_content_type(input);
  138    135   
        self
  139    136   
    }
  140         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         137  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  141    138   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
  142    139   
        self.inner.get_content_type()
  143    140   
    }
  144    141   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  145    142   
    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  146    143   
        self.inner = self.inner.accept(input.into());
  147    144   
        self
  148    145   
    }
  149    146   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  150    147   
    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  151    148   
        self.inner = self.inner.set_accept(input);
  152    149   
        self
  153    150   
    }
  154    151   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  155    152   
    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
  156    153   
        self.inner.get_accept()
  157    154   
    }
  158    155   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  159         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         156  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  160    157   
    /// <ul>
  161    158   
    /// <li>
  162    159   
    /// <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>
  163    160   
    /// <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>
  166    161   
    /// <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>
  167    162   
    /// <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>
         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>
  171    164   
    /// </ul>
  172    165   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  173    166   
        self.inner = self.inner.model_id(input.into());
  174    167   
        self
  175    168   
    }
  176    169   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  177         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         170  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  178    171   
    /// <ul>
  179    172   
    /// <li>
  180    173   
    /// <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>
  181    174   
    /// <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>
  184    175   
    /// <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    176   
    /// <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>
         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>
  189    178   
    /// </ul>
  190    179   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  191    180   
        self.inner = self.inner.set_model_id(input);
  192    181   
        self
  193    182   
    }
  194    183   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  195         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         184  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  196    185   
    /// <ul>
  197    186   
    /// <li>
  198    187   
    /// <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>
  199    188   
    /// <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>
  202    189   
    /// <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>
  203    190   
    /// <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>
         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>
  207    192   
    /// </ul>
  208    193   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  209    194   
        self.inner.get_model_id()
  210    195   
    }
  211    196   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
  212    197   
    pub fn trace(mut self, input: crate::types::Trace) -> Self {
  213    198   
        self.inner = self.inner.trace(input);
  214    199   
        self
  215    200   
    }
  216    201   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
@@ -250,235 +294,265 @@
  270    255   
    }
  271    256   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  272    257   
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  273    258   
        self.inner = self.inner.set_guardrail_version(input);
  274    259   
        self
  275    260   
    }
  276    261   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  277    262   
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  278    263   
        self.inner.get_guardrail_version()
  279    264   
    }
  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         -
    }
  294    265   
}

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

@@ -1,0 +509,0 @@
    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

@@ -1,0 +121,0 @@
    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

@@ -1,0 +115,0 @@
    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         -
}