AWS SDK

AWS SDK

rev. 5673a7a38b4a4a6973351c005d572863803729fe (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,161 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::invoke_model_with_bidirectional_stream::_invoke_model_with_bidirectional_stream_output::InvokeModelWithBidirectionalStreamOutputBuilder;
           3  +
           4  +
pub use crate::operation::invoke_model_with_bidirectional_stream::_invoke_model_with_bidirectional_stream_input::InvokeModelWithBidirectionalStreamInputBuilder;
           5  +
           6  +
impl crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder {
           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::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.invoke_model_with_bidirectional_stream();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `InvokeModelWithBidirectionalStream`.
          24  +
///
          25  +
/// <p>Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream. The response is returned in a stream that remains open for 8 minutes. A single session can contain multiple prompts and responses from the model. The prompts to the model are provided as audio files and the model's responses are spoken back to the user and transcribed.</p>
          26  +
/// <p>It is possible for users to interrupt the model's response with a new prompt, which will halt the response speech. The model will retain contextual awareness of the conversation while pivoting to respond to the new prompt.</p>
          27  +
#[derive(::std::fmt::Debug)]
          28  +
pub struct InvokeModelWithBidirectionalStreamFluentBuilder {
          29  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          30  +
    inner: crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder,
          31  +
    config_override: ::std::option::Option<crate::config::Builder>,
          32  +
}
          33  +
impl
          34  +
    crate::client::customize::internal::CustomizableSend<
          35  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          36  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          37  +
    > for InvokeModelWithBidirectionalStreamFluentBuilder
          38  +
{
          39  +
    fn send(
          40  +
        self,
          41  +
        config_override: crate::config::Builder,
          42  +
    ) -> crate::client::customize::internal::BoxFuture<
          43  +
        crate::client::customize::internal::SendResult<
          44  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          45  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          46  +
        >,
          47  +
    > {
          48  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          49  +
    }
          50  +
}
          51  +
impl InvokeModelWithBidirectionalStreamFluentBuilder {
          52  +
    /// Creates a new `InvokeModelWithBidirectionalStreamFluentBuilder`.
          53  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          54  +
        Self {
          55  +
            handle,
          56  +
            inner: ::std::default::Default::default(),
          57  +
            config_override: ::std::option::Option::None,
          58  +
        }
          59  +
    }
          60  +
    /// Access the InvokeModelWithBidirectionalStream as a reference.
          61  +
    pub fn as_input(&self) -> &crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder {
          62  +
        &self.inner
          63  +
    }
          64  +
    /// Sends the request and returns the response.
          65  +
    ///
          66  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          67  +
    /// can be matched against.
          68  +
    ///
          69  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          70  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          71  +
    /// set when configuring the client.
          72  +
    pub async fn send(
          73  +
        self,
          74  +
    ) -> ::std::result::Result<
          75  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          76  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          77  +
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          78  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          79  +
        >,
          80  +
    > {
          81  +
        let input = self
          82  +
            .inner
          83  +
            .build()
          84  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          85  +
        let runtime_plugins = crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStream::operation_runtime_plugins(
          86  +
            self.handle.runtime_plugins.clone(),
          87  +
            &self.handle.conf,
          88  +
            self.config_override,
          89  +
        );
          90  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStream::orchestrate(&runtime_plugins, input).await
          91  +
    }
          92  +
          93  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          94  +
    pub fn customize(
          95  +
        self,
          96  +
    ) -> crate::client::customize::CustomizableOperation<
          97  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamOutput,
          98  +
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
          99  +
        Self,
         100  +
    > {
         101  +
        crate::client::customize::CustomizableOperation::new(self)
         102  +
    }
         103  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         104  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         105  +
        self
         106  +
    }
         107  +
         108  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         109  +
        self.config_override = config_override;
         110  +
        self
         111  +
    }
         112  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
         113  +
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         114  +
        self.inner = self.inner.model_id(input.into());
         115  +
        self
         116  +
    }
         117  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
         118  +
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.set_model_id(input);
         120  +
        self
         121  +
    }
         122  +
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
         123  +
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
         124  +
        self.inner.get_model_id()
         125  +
    }
         126  +
    /// <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>
         127  +
    pub fn body(
         128  +
        mut self,
         129  +
        input: ::aws_smithy_http::event_stream::EventStreamSender<
         130  +
            crate::types::InvokeModelWithBidirectionalStreamInput,
         131  +
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
         132  +
        >,
         133  +
    ) -> Self {
         134  +
        self.inner = self.inner.body(input);
         135  +
        self
         136  +
    }
         137  +
    /// <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>
         138  +
    pub fn set_body(
         139  +
        mut self,
         140  +
        input: ::std::option::Option<
         141  +
            ::aws_smithy_http::event_stream::EventStreamSender<
         142  +
                crate::types::InvokeModelWithBidirectionalStreamInput,
         143  +
                crate::types::error::InvokeModelWithBidirectionalStreamInputError,
         144  +
            >,
         145  +
        >,
         146  +
    ) -> Self {
         147  +
        self.inner = self.inner.set_body(input);
         148  +
        self
         149  +
    }
         150  +
    /// <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>
         151  +
    pub fn get_body(
         152  +
        &self,
         153  +
    ) -> &::std::option::Option<
         154  +
        ::aws_smithy_http::event_stream::EventStreamSender<
         155  +
            crate::types::InvokeModelWithBidirectionalStreamInput,
         156  +
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
         157  +
        >,
         158  +
    > {
         159  +
        self.inner.get_body()
         160  +
    }
         161  +
}

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

@@ -264,264 +483,496 @@
  284    284   
  285    285   
// The get_* functions below are generated from JMESPath expressions in the
  286    286   
// operationContextParams trait. They target the operation's input shape.
  287    287   
  288    288   
/// Error type for the `InvokeModelWithResponseStreamError` operation.
  289    289   
#[non_exhaustive]
  290    290   
#[derive(::std::fmt::Debug)]
  291    291   
pub enum InvokeModelWithResponseStreamError {
  292    292   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
  293    293   
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
  294         -
    /// <p>The request is denied because of missing access permissions.</p>
         294  +
    /// <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>
  295    295   
    AccessDeniedException(crate::types::error::AccessDeniedException),
  296         -
    /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
         296  +
    /// <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>
  297    297   
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
  298         -
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
         298  +
    /// <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>
  299    299   
    ThrottlingException(crate::types::error::ThrottlingException),
  300         -
    /// <p>An internal server error occurred. Retry your request.</p>
         300  +
    /// <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>
         301  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
         302  +
    /// <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>
  301    303   
    InternalServerException(crate::types::error::InternalServerException),
  302    304   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
  303    305   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
  304         -
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
         306  +
    /// <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>
  305    307   
    ValidationException(crate::types::error::ValidationException),
  306         -
    /// <p>The model specified in the request is not ready to serve inference requests.</p>
         308  +
    /// <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>
  307    309   
    ModelNotReadyException(crate::types::error::ModelNotReadyException),
  308    310   
    /// <p>The request failed due to an error while processing the model.</p>
  309    311   
    ModelErrorException(crate::types::error::ModelErrorException),
  310         -
    /// <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
         312  +
    /// <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>
  311    313   
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
  312    314   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  313    315   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  314    316   
    variable wildcard pattern and check `.code()`:
  315    317   
     \
  316    318   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  317    319   
     \
  318    320   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithResponseStreamError) for what information is available for the error.")]
  319    321   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  320    322   
}
  321    323   
impl InvokeModelWithResponseStreamError {
  322    324   
    /// Creates the `InvokeModelWithResponseStreamError::Unhandled` variant from any error type.
  323    325   
    pub fn unhandled(
  324    326   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  325    327   
    ) -> Self {
  326    328   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  327    329   
            source: err.into(),
  328    330   
            meta: ::std::default::Default::default(),
  329    331   
        })
  330    332   
    }
  331    333   
  332    334   
    /// Creates the `InvokeModelWithResponseStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  333    335   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  334    336   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  335    337   
            source: err.clone().into(),
  336    338   
            meta: err,
  337    339   
        })
  338    340   
    }
  339    341   
    ///
  340    342   
    /// Returns error metadata, which includes the error code, message,
  341    343   
    /// request ID, and potentially additional information.
  342    344   
    ///
  343    345   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  344    346   
        match self {
  345    347   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  346    348   
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  347    349   
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  348    350   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         351  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  349    352   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  350    353   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  351    354   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  352    355   
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  353    356   
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  354    357   
            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  355    358   
            Self::Unhandled(e) => &e.meta,
  356    359   
        }
  357    360   
    }
  358    361   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ModelTimeoutException`.
  359    362   
    pub fn is_model_timeout_exception(&self) -> bool {
  360    363   
        matches!(self, Self::ModelTimeoutException(_))
  361    364   
    }
  362    365   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::AccessDeniedException`.
  363    366   
    pub fn is_access_denied_exception(&self) -> bool {
  364    367   
        matches!(self, Self::AccessDeniedException(_))
  365    368   
    }
  366    369   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ResourceNotFoundException`.
  367    370   
    pub fn is_resource_not_found_exception(&self) -> bool {
  368    371   
        matches!(self, Self::ResourceNotFoundException(_))
  369    372   
    }
  370    373   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ThrottlingException`.
  371    374   
    pub fn is_throttling_exception(&self) -> bool {
  372    375   
        matches!(self, Self::ThrottlingException(_))
  373    376   
    }
         377  +
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ServiceUnavailableException`.
         378  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         379  +
        matches!(self, Self::ServiceUnavailableException(_))
         380  +
    }
  374    381   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::InternalServerException`.
  375    382   
    pub fn is_internal_server_exception(&self) -> bool {
  376    383   
        matches!(self, Self::InternalServerException(_))
  377    384   
    }
  378    385   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ModelStreamErrorException`.
  379    386   
    pub fn is_model_stream_error_exception(&self) -> bool {
  380    387   
        matches!(self, Self::ModelStreamErrorException(_))
  381    388   
    }
  382    389   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ValidationException`.
  383    390   
    pub fn is_validation_exception(&self) -> bool {
  384    391   
        matches!(self, Self::ValidationException(_))
  385    392   
    }
  386    393   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ModelNotReadyException`.
  387    394   
    pub fn is_model_not_ready_exception(&self) -> bool {
  388    395   
        matches!(self, Self::ModelNotReadyException(_))
  389    396   
    }
  390    397   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ModelErrorException`.
  391    398   
    pub fn is_model_error_exception(&self) -> bool {
  392    399   
        matches!(self, Self::ModelErrorException(_))
  393    400   
    }
  394    401   
    /// Returns `true` if the error kind is `InvokeModelWithResponseStreamError::ServiceQuotaExceededException`.
  395    402   
    pub fn is_service_quota_exceeded_exception(&self) -> bool {
  396    403   
        matches!(self, Self::ServiceQuotaExceededException(_))
  397    404   
    }
  398    405   
}
  399    406   
impl ::std::error::Error for InvokeModelWithResponseStreamError {
  400    407   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  401    408   
        match self {
  402    409   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  403    410   
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  404    411   
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
  405    412   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         413  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  406    414   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  407    415   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  408    416   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  409    417   
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
  410    418   
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
  411    419   
            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
  412    420   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  413    421   
        }
  414    422   
    }
  415    423   
}
  416    424   
impl ::std::fmt::Display for InvokeModelWithResponseStreamError {
  417    425   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  418    426   
        match self {
  419    427   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  420    428   
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  421    429   
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
  422    430   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         431  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  423    432   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  424    433   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  425    434   
            Self::ValidationException(_inner) => _inner.fmt(f),
  426    435   
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
  427    436   
            Self::ModelErrorException(_inner) => _inner.fmt(f),
  428    437   
            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
  429    438   
            Self::Unhandled(_inner) => {
  430    439   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  431    440   
                    write!(f, "unhandled error ({code})")
  432    441   
                } else {
  433    442   
                    f.write_str("unhandled error")
  434    443   
                }
  435    444   
            }
  436    445   
        }
  437    446   
    }
  438    447   
}
  439    448   
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithResponseStreamError {
  440    449   
    fn code(&self) -> ::std::option::Option<&str> {
  441    450   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  442    451   
    }
  443    452   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  444         -
        ::std::option::Option::None
         453  +
        match self {
         454  +
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
         455  +
            _ => ::std::option::Option::None,
         456  +
        }
  445    457   
    }
  446    458   
}
  447    459   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithResponseStreamError {
  448    460   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  449    461   
        match self {
  450    462   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  451    463   
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  452    464   
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  453    465   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         466  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  454    467   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  455    468   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  456    469   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  457    470   
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  458    471   
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  459    472   
            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  460    473   
            Self::Unhandled(_inner) => &_inner.meta,
  461    474   
        }
  462    475   
    }
  463    476   
}

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

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

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

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

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

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

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

@@ -0,1 +0,444 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `ListAsyncInvokes`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct ListAsyncInvokes;
           6  +
impl ListAsyncInvokes {
           7  +
    /// Creates a new `ListAsyncInvokes`
           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::list_async_invokes::ListAsyncInvokesInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::list_async_invokes::ListAsyncInvokesOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::list_async_invokes::ListAsyncInvokesError,
          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::list_async_invokes::ListAsyncInvokesError>()
          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::list_async_invokes::ListAsyncInvokesOutput>()
          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::list_async_invokes::ListAsyncInvokesInput,
          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("Bedrock Runtime", "ListAsyncInvokes", input, runtime_plugins, stop_point)
          55  +
            // Create a parent span for the entire operation. Includes a random, internal-only,
          56  +
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          57  +
            .instrument(::tracing::debug_span!(
          58  +
                "Bedrock Runtime.ListAsyncInvokes",
          59  +
                "rpc.service" = "Bedrock Runtime",
          60  +
                "rpc.method" = "ListAsyncInvokes",
          61  +
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          62  +
                "rpc.system" = "aws-api",
          63  +
            ))
          64  +
            .await
          65  +
    }
          66  +
          67  +
    pub(crate) fn operation_runtime_plugins(
          68  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          69  +
        client_config: &crate::config::Config,
          70  +
        config_override: ::std::option::Option<crate::config::Builder>,
          71  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          72  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          73  +
          74  +
        if let ::std::option::Option::Some(config_override) = config_override {
          75  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          76  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          77  +
            }
          78  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          79  +
                config_override,
          80  +
                client_config.config.clone(),
          81  +
                &client_config.runtime_components,
          82  +
            ));
          83  +
        }
          84  +
        runtime_plugins
          85  +
    }
          86  +
}
          87  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListAsyncInvokes {
          88  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          89  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListAsyncInvokes");
          90  +
          91  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          92  +
            ListAsyncInvokesRequestSerializer,
          93  +
        ));
          94  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
          95  +
            ListAsyncInvokesResponseDeserializer,
          96  +
        ));
          97  +
          98  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
          99  +
            crate::config::auth::Params::builder()
         100  +
                .operation_name("ListAsyncInvokes")
         101  +
                .build()
         102  +
                .expect("required fields set"),
         103  +
        ));
         104  +
         105  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
         106  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         107  +
            "ListAsyncInvokes",
         108  +
            "Bedrock Runtime",
         109  +
        ));
         110  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         111  +
        signing_options.double_uri_encode = true;
         112  +
        signing_options.content_sha256_header = false;
         113  +
        signing_options.normalize_uri_path = true;
         114  +
        signing_options.payload_override = None;
         115  +
         116  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         117  +
            signing_options,
         118  +
            ..::std::default::Default::default()
         119  +
        });
         120  +
         121  +
        ::std::option::Option::Some(cfg.freeze())
         122  +
    }
         123  +
         124  +
    fn runtime_components(
         125  +
        &self,
         126  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         127  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         128  +
        #[allow(unused_mut)]
         129  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListAsyncInvokes")
         130  +
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
         131  +
            .with_interceptor(ListAsyncInvokesEndpointParamsInterceptor)
         132  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         133  +
                crate::operation::list_async_invokes::ListAsyncInvokesError,
         134  +
            >::new())
         135  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         136  +
                crate::operation::list_async_invokes::ListAsyncInvokesError,
         137  +
            >::new())
         138  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         139  +
                crate::operation::list_async_invokes::ListAsyncInvokesError,
         140  +
            >::new());
         141  +
         142  +
        ::std::borrow::Cow::Owned(rcb)
         143  +
    }
         144  +
}
         145  +
         146  +
#[derive(Debug)]
         147  +
struct ListAsyncInvokesResponseDeserializer;
         148  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListAsyncInvokesResponseDeserializer {
         149  +
    fn deserialize_nonstreaming(
         150  +
        &self,
         151  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         152  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         153  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         154  +
        let headers = response.headers();
         155  +
        let body = response.body().bytes().expect("body loaded");
         156  +
        #[allow(unused_mut)]
         157  +
        let mut force_error = false;
         158  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         159  +
        let parse_result = if !success && status != 200 || force_error {
         160  +
            crate::protocol_serde::shape_list_async_invokes::de_list_async_invokes_http_error(status, headers, body)
         161  +
        } else {
         162  +
            crate::protocol_serde::shape_list_async_invokes::de_list_async_invokes_http_response(status, headers, body)
         163  +
        };
         164  +
        crate::protocol_serde::type_erase_result(parse_result)
         165  +
    }
         166  +
}
         167  +
#[derive(Debug)]
         168  +
struct ListAsyncInvokesRequestSerializer;
         169  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListAsyncInvokesRequestSerializer {
         170  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         171  +
    fn serialize_input(
         172  +
        &self,
         173  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         174  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         175  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         176  +
        let input = input
         177  +
            .downcast::<crate::operation::list_async_invokes::ListAsyncInvokesInput>()
         178  +
            .expect("correct type");
         179  +
        let _header_serialization_settings = _cfg
         180  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         181  +
            .cloned()
         182  +
            .unwrap_or_default();
         183  +
        let mut request_builder = {
         184  +
            fn uri_base(
         185  +
                _input: &crate::operation::list_async_invokes::ListAsyncInvokesInput,
         186  +
                output: &mut ::std::string::String,
         187  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         188  +
                use ::std::fmt::Write as _;
         189  +
                ::std::write!(output, "/async-invoke").expect("formatting should succeed");
         190  +
                ::std::result::Result::Ok(())
         191  +
            }
         192  +
            fn uri_query(
         193  +
                _input: &crate::operation::list_async_invokes::ListAsyncInvokesInput,
         194  +
                mut output: &mut ::std::string::String,
         195  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         196  +
                let mut query = ::aws_smithy_http::query::Writer::new(output);
         197  +
                if let ::std::option::Option::Some(inner_1) = &_input.submit_time_after {
         198  +
                    {
         199  +
                        query.push_kv(
         200  +
                            "submitTimeAfter",
         201  +
                            &::aws_smithy_http::query::fmt_timestamp(inner_1, ::aws_smithy_types::date_time::Format::DateTime)?,
         202  +
                        );
         203  +
                    }
         204  +
                }
         205  +
                if let ::std::option::Option::Some(inner_2) = &_input.submit_time_before {
         206  +
                    {
         207  +
                        query.push_kv(
         208  +
                            "submitTimeBefore",
         209  +
                            &::aws_smithy_http::query::fmt_timestamp(inner_2, ::aws_smithy_types::date_time::Format::DateTime)?,
         210  +
                        );
         211  +
                    }
         212  +
                }
         213  +
                if let ::std::option::Option::Some(inner_3) = &_input.status_equals {
         214  +
                    {
         215  +
                        query.push_kv("statusEquals", &::aws_smithy_http::query::fmt_string(inner_3));
         216  +
                    }
         217  +
                }
         218  +
                if let ::std::option::Option::Some(inner_4) = &_input.max_results {
         219  +
                    {
         220  +
                        query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
         221  +
                    }
         222  +
                }
         223  +
                if let ::std::option::Option::Some(inner_5) = &_input.next_token {
         224  +
                    {
         225  +
                        query.push_kv("nextToken", &::aws_smithy_http::query::fmt_string(inner_5));
         226  +
                    }
         227  +
                }
         228  +
                if let ::std::option::Option::Some(inner_6) = &_input.sort_by {
         229  +
                    {
         230  +
                        query.push_kv("sortBy", &::aws_smithy_http::query::fmt_string(inner_6));
         231  +
                    }
         232  +
                }
         233  +
                if let ::std::option::Option::Some(inner_7) = &_input.sort_order {
         234  +
                    {
         235  +
                        query.push_kv("sortOrder", &::aws_smithy_http::query::fmt_string(inner_7));
         236  +
                    }
         237  +
                }
         238  +
                ::std::result::Result::Ok(())
         239  +
            }
         240  +
            #[allow(clippy::unnecessary_wraps)]
         241  +
            fn update_http_builder(
         242  +
                input: &crate::operation::list_async_invokes::ListAsyncInvokesInput,
         243  +
                builder: ::http::request::Builder,
         244  +
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         245  +
                let mut uri = ::std::string::String::new();
         246  +
                uri_base(input, &mut uri)?;
         247  +
                uri_query(input, &mut uri)?;
         248  +
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         249  +
            }
         250  +
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         251  +
            builder
         252  +
        };
         253  +
        let body = ::aws_smithy_types::body::SdkBody::from("");
         254  +
         255  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         256  +
    }
         257  +
}
         258  +
#[derive(Debug)]
         259  +
struct ListAsyncInvokesEndpointParamsInterceptor;
         260  +
         261  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListAsyncInvokesEndpointParamsInterceptor {
         262  +
    fn name(&self) -> &'static str {
         263  +
        "ListAsyncInvokesEndpointParamsInterceptor"
         264  +
    }
         265  +
         266  +
    fn read_before_execution(
         267  +
        &self,
         268  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         269  +
            '_,
         270  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         271  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         272  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         273  +
        >,
         274  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         275  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         276  +
        let _input = context
         277  +
            .input()
         278  +
            .downcast_ref::<ListAsyncInvokesInput>()
         279  +
            .ok_or("failed to downcast to ListAsyncInvokesInput")?;
         280  +
         281  +
        let params = crate::config::endpoint::Params::builder()
         282  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         283  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         284  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         285  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         286  +
            .build()
         287  +
            .map_err(|err| {
         288  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         289  +
            })?;
         290  +
        cfg.interceptor_state()
         291  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         292  +
        ::std::result::Result::Ok(())
         293  +
    }
         294  +
}
         295  +
         296  +
// The get_* functions below are generated from JMESPath expressions in the
         297  +
// operationContextParams trait. They target the operation's input shape.
         298  +
         299  +
/// Error type for the `ListAsyncInvokesError` operation.
         300  +
#[non_exhaustive]
         301  +
#[derive(::std::fmt::Debug)]
         302  +
pub enum ListAsyncInvokesError {
         303  +
    /// <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>
         304  +
    AccessDeniedException(crate::types::error::AccessDeniedException),
         305  +
    /// <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>
         306  +
    InternalServerException(crate::types::error::InternalServerException),
         307  +
    /// <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>
         308  +
    ThrottlingException(crate::types::error::ThrottlingException),
         309  +
    /// <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>
         310  +
    ValidationException(crate::types::error::ValidationException),
         311  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         312  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         313  +
    variable wildcard pattern and check `.code()`:
         314  +
     \
         315  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         316  +
     \
         317  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListAsyncInvokesError) for what information is available for the error.")]
         318  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         319  +
}
         320  +
impl ListAsyncInvokesError {
         321  +
    /// Creates the `ListAsyncInvokesError::Unhandled` variant from any error type.
         322  +
    pub fn unhandled(
         323  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         324  +
    ) -> Self {
         325  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         326  +
            source: err.into(),
         327  +
            meta: ::std::default::Default::default(),
         328  +
        })
         329  +
    }
         330  +
         331  +
    /// Creates the `ListAsyncInvokesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         332  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         333  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         334  +
            source: err.clone().into(),
         335  +
            meta: err,
         336  +
        })
         337  +
    }
         338  +
    ///
         339  +
    /// Returns error metadata, which includes the error code, message,
         340  +
    /// request ID, and potentially additional information.
         341  +
    ///
         342  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         343  +
        match self {
         344  +
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         345  +
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         346  +
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         347  +
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         348  +
            Self::Unhandled(e) => &e.meta,
         349  +
        }
         350  +
    }
         351  +
    /// Returns `true` if the error kind is `ListAsyncInvokesError::AccessDeniedException`.
         352  +
    pub fn is_access_denied_exception(&self) -> bool {
         353  +
        matches!(self, Self::AccessDeniedException(_))
         354  +
    }
         355  +
    /// Returns `true` if the error kind is `ListAsyncInvokesError::InternalServerException`.
         356  +
    pub fn is_internal_server_exception(&self) -> bool {
         357  +
        matches!(self, Self::InternalServerException(_))
         358  +
    }
         359  +
    /// Returns `true` if the error kind is `ListAsyncInvokesError::ThrottlingException`.
         360  +
    pub fn is_throttling_exception(&self) -> bool {
         361  +
        matches!(self, Self::ThrottlingException(_))
         362  +
    }
         363  +
    /// Returns `true` if the error kind is `ListAsyncInvokesError::ValidationException`.
         364  +
    pub fn is_validation_exception(&self) -> bool {
         365  +
        matches!(self, Self::ValidationException(_))
         366  +
    }
         367  +
}
         368  +
impl ::std::error::Error for ListAsyncInvokesError {
         369  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         370  +
        match self {
         371  +
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
         372  +
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
         373  +
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         374  +
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
         375  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         376  +
        }
         377  +
    }
         378  +
}
         379  +
impl ::std::fmt::Display for ListAsyncInvokesError {
         380  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         381  +
        match self {
         382  +
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
         383  +
            Self::InternalServerException(_inner) => _inner.fmt(f),
         384  +
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         385  +
            Self::ValidationException(_inner) => _inner.fmt(f),
         386  +
            Self::Unhandled(_inner) => {
         387  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         388  +
                    write!(f, "unhandled error ({code})")
         389  +
                } else {
         390  +
                    f.write_str("unhandled error")
         391  +
                }
         392  +
            }
         393  +
        }
         394  +
    }
         395  +
}
         396  +
impl ::aws_smithy_types::retry::ProvideErrorKind for ListAsyncInvokesError {
         397  +
    fn code(&self) -> ::std::option::Option<&str> {
         398  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         399  +
    }
         400  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         401  +
        ::std::option::Option::None
         402  +
    }
         403  +
}
         404  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListAsyncInvokesError {
         405  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         406  +
        match self {
         407  +
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         408  +
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         409  +
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         410  +
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         411  +
            Self::Unhandled(_inner) => &_inner.meta,
         412  +
        }
         413  +
    }
         414  +
}
         415  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListAsyncInvokesError {
         416  +
    fn create_unhandled_error(
         417  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         418  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         419  +
    ) -> Self {
         420  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         421  +
            source,
         422  +
            meta: meta.unwrap_or_default(),
         423  +
        })
         424  +
    }
         425  +
}
         426  +
impl ::aws_types::request_id::RequestId for crate::operation::list_async_invokes::ListAsyncInvokesError {
         427  +
    fn request_id(&self) -> Option<&str> {
         428  +
        self.meta().request_id()
         429  +
    }
         430  +
}
         431  +
         432  +
pub use crate::operation::list_async_invokes::_list_async_invokes_output::ListAsyncInvokesOutput;
         433  +
         434  +
pub use crate::operation::list_async_invokes::_list_async_invokes_input::ListAsyncInvokesInput;
         435  +
         436  +
mod _list_async_invokes_input;
         437  +
         438  +
mod _list_async_invokes_output;
         439  +
         440  +
/// Builders
         441  +
pub mod builders;
         442  +
         443  +
/// Paginator for this operation
         444  +
pub mod paginator;

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

@@ -0,1 +0,183 @@
           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::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ListAsyncInvokesInput {
           6  +
    /// <p>Include invocations submitted after this time.</p>
           7  +
    pub submit_time_after: ::std::option::Option<::aws_smithy_types::DateTime>,
           8  +
    /// <p>Include invocations submitted before this time.</p>
           9  +
    pub submit_time_before: ::std::option::Option<::aws_smithy_types::DateTime>,
          10  +
    /// <p>Filter invocations by status.</p>
          11  +
    pub status_equals: ::std::option::Option<crate::types::AsyncInvokeStatus>,
          12  +
    /// <p>The maximum number of invocations to return in one page of results.</p>
          13  +
    pub max_results: ::std::option::Option<i32>,
          14  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          15  +
    pub next_token: ::std::option::Option<::std::string::String>,
          16  +
    /// <p>How to sort the response.</p>
          17  +
    pub sort_by: ::std::option::Option<crate::types::SortAsyncInvocationBy>,
          18  +
    /// <p>The sorting order for the response.</p>
          19  +
    pub sort_order: ::std::option::Option<crate::types::SortOrder>,
          20  +
}
          21  +
impl ListAsyncInvokesInput {
          22  +
    /// <p>Include invocations submitted after this time.</p>
          23  +
    pub fn submit_time_after(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          24  +
        self.submit_time_after.as_ref()
          25  +
    }
          26  +
    /// <p>Include invocations submitted before this time.</p>
          27  +
    pub fn submit_time_before(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          28  +
        self.submit_time_before.as_ref()
          29  +
    }
          30  +
    /// <p>Filter invocations by status.</p>
          31  +
    pub fn status_equals(&self) -> ::std::option::Option<&crate::types::AsyncInvokeStatus> {
          32  +
        self.status_equals.as_ref()
          33  +
    }
          34  +
    /// <p>The maximum number of invocations to return in one page of results.</p>
          35  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          36  +
        self.max_results
          37  +
    }
          38  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          39  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          40  +
        self.next_token.as_deref()
          41  +
    }
          42  +
    /// <p>How to sort the response.</p>
          43  +
    pub fn sort_by(&self) -> ::std::option::Option<&crate::types::SortAsyncInvocationBy> {
          44  +
        self.sort_by.as_ref()
          45  +
    }
          46  +
    /// <p>The sorting order for the response.</p>
          47  +
    pub fn sort_order(&self) -> ::std::option::Option<&crate::types::SortOrder> {
          48  +
        self.sort_order.as_ref()
          49  +
    }
          50  +
}
          51  +
impl ListAsyncInvokesInput {
          52  +
    /// Creates a new builder-style object to manufacture [`ListAsyncInvokesInput`](crate::operation::list_async_invokes::ListAsyncInvokesInput).
          53  +
    pub fn builder() -> crate::operation::list_async_invokes::builders::ListAsyncInvokesInputBuilder {
          54  +
        crate::operation::list_async_invokes::builders::ListAsyncInvokesInputBuilder::default()
          55  +
    }
          56  +
}
          57  +
          58  +
/// A builder for [`ListAsyncInvokesInput`](crate::operation::list_async_invokes::ListAsyncInvokesInput).
          59  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          60  +
#[non_exhaustive]
          61  +
pub struct ListAsyncInvokesInputBuilder {
          62  +
    pub(crate) submit_time_after: ::std::option::Option<::aws_smithy_types::DateTime>,
          63  +
    pub(crate) submit_time_before: ::std::option::Option<::aws_smithy_types::DateTime>,
          64  +
    pub(crate) status_equals: ::std::option::Option<crate::types::AsyncInvokeStatus>,
          65  +
    pub(crate) max_results: ::std::option::Option<i32>,
          66  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
          67  +
    pub(crate) sort_by: ::std::option::Option<crate::types::SortAsyncInvocationBy>,
          68  +
    pub(crate) sort_order: ::std::option::Option<crate::types::SortOrder>,
          69  +
}
          70  +
impl ListAsyncInvokesInputBuilder {
          71  +
    /// <p>Include invocations submitted after this time.</p>
          72  +
    pub fn submit_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
          73  +
        self.submit_time_after = ::std::option::Option::Some(input);
          74  +
        self
          75  +
    }
          76  +
    /// <p>Include invocations submitted after this time.</p>
          77  +
    pub fn set_submit_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
          78  +
        self.submit_time_after = input;
          79  +
        self
          80  +
    }
          81  +
    /// <p>Include invocations submitted after this time.</p>
          82  +
    pub fn get_submit_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
          83  +
        &self.submit_time_after
          84  +
    }
          85  +
    /// <p>Include invocations submitted before this time.</p>
          86  +
    pub fn submit_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
          87  +
        self.submit_time_before = ::std::option::Option::Some(input);
          88  +
        self
          89  +
    }
          90  +
    /// <p>Include invocations submitted before this time.</p>
          91  +
    pub fn set_submit_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
          92  +
        self.submit_time_before = input;
          93  +
        self
          94  +
    }
          95  +
    /// <p>Include invocations submitted before this time.</p>
          96  +
    pub fn get_submit_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
          97  +
        &self.submit_time_before
          98  +
    }
          99  +
    /// <p>Filter invocations by status.</p>
         100  +
    pub fn status_equals(mut self, input: crate::types::AsyncInvokeStatus) -> Self {
         101  +
        self.status_equals = ::std::option::Option::Some(input);
         102  +
        self
         103  +
    }
         104  +
    /// <p>Filter invocations by status.</p>
         105  +
    pub fn set_status_equals(mut self, input: ::std::option::Option<crate::types::AsyncInvokeStatus>) -> Self {
         106  +
        self.status_equals = input;
         107  +
        self
         108  +
    }
         109  +
    /// <p>Filter invocations by status.</p>
         110  +
    pub fn get_status_equals(&self) -> &::std::option::Option<crate::types::AsyncInvokeStatus> {
         111  +
        &self.status_equals
         112  +
    }
         113  +
    /// <p>The maximum number of invocations to return in one page of results.</p>
         114  +
    pub fn max_results(mut self, input: i32) -> Self {
         115  +
        self.max_results = ::std::option::Option::Some(input);
         116  +
        self
         117  +
    }
         118  +
    /// <p>The maximum number of invocations to return in one page of results.</p>
         119  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         120  +
        self.max_results = input;
         121  +
        self
         122  +
    }
         123  +
    /// <p>The maximum number of invocations to return in one page of results.</p>
         124  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         125  +
        &self.max_results
         126  +
    }
         127  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
         128  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         129  +
        self.next_token = ::std::option::Option::Some(input.into());
         130  +
        self
         131  +
    }
         132  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
         133  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         134  +
        self.next_token = input;
         135  +
        self
         136  +
    }
         137  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
         138  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         139  +
        &self.next_token
         140  +
    }
         141  +
    /// <p>How to sort the response.</p>
         142  +
    pub fn sort_by(mut self, input: crate::types::SortAsyncInvocationBy) -> Self {
         143  +
        self.sort_by = ::std::option::Option::Some(input);
         144  +
        self
         145  +
    }
         146  +
    /// <p>How to sort the response.</p>
         147  +
    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::SortAsyncInvocationBy>) -> Self {
         148  +
        self.sort_by = input;
         149  +
        self
         150  +
    }
         151  +
    /// <p>How to sort the response.</p>
         152  +
    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::SortAsyncInvocationBy> {
         153  +
        &self.sort_by
         154  +
    }
         155  +
    /// <p>The sorting order for the response.</p>
         156  +
    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
         157  +
        self.sort_order = ::std::option::Option::Some(input);
         158  +
        self
         159  +
    }
         160  +
    /// <p>The sorting order for the response.</p>
         161  +
    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
         162  +
        self.sort_order = input;
         163  +
        self
         164  +
    }
         165  +
    /// <p>The sorting order for the response.</p>
         166  +
    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
         167  +
        &self.sort_order
         168  +
    }
         169  +
    /// Consumes the builder and constructs a [`ListAsyncInvokesInput`](crate::operation::list_async_invokes::ListAsyncInvokesInput).
         170  +
    pub fn build(
         171  +
        self,
         172  +
    ) -> ::std::result::Result<crate::operation::list_async_invokes::ListAsyncInvokesInput, ::aws_smithy_types::error::operation::BuildError> {
         173  +
        ::std::result::Result::Ok(crate::operation::list_async_invokes::ListAsyncInvokesInput {
         174  +
            submit_time_after: self.submit_time_after,
         175  +
            submit_time_before: self.submit_time_before,
         176  +
            status_equals: self.status_equals,
         177  +
            max_results: self.max_results,
         178  +
            next_token: self.next_token,
         179  +
            sort_by: self.sort_by,
         180  +
            sort_order: self.sort_order,
         181  +
        })
         182  +
    }
         183  +
}

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

@@ -0,1 +0,96 @@
           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::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ListAsyncInvokesOutput {
           6  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
           7  +
    pub next_token: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>A list of invocation summaries.</p>
           9  +
    pub async_invoke_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AsyncInvokeSummary>>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl ListAsyncInvokesOutput {
          13  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          14  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          15  +
        self.next_token.as_deref()
          16  +
    }
          17  +
    /// <p>A list of invocation summaries.</p>
          18  +
    ///
          19  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.async_invoke_summaries.is_none()`.
          20  +
    pub fn async_invoke_summaries(&self) -> &[crate::types::AsyncInvokeSummary] {
          21  +
        self.async_invoke_summaries.as_deref().unwrap_or_default()
          22  +
    }
          23  +
}
          24  +
impl ::aws_types::request_id::RequestId for ListAsyncInvokesOutput {
          25  +
    fn request_id(&self) -> Option<&str> {
          26  +
        self._request_id.as_deref()
          27  +
    }
          28  +
}
          29  +
impl ListAsyncInvokesOutput {
          30  +
    /// Creates a new builder-style object to manufacture [`ListAsyncInvokesOutput`](crate::operation::list_async_invokes::ListAsyncInvokesOutput).
          31  +
    pub fn builder() -> crate::operation::list_async_invokes::builders::ListAsyncInvokesOutputBuilder {
          32  +
        crate::operation::list_async_invokes::builders::ListAsyncInvokesOutputBuilder::default()
          33  +
    }
          34  +
}
          35  +
          36  +
/// A builder for [`ListAsyncInvokesOutput`](crate::operation::list_async_invokes::ListAsyncInvokesOutput).
          37  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          38  +
#[non_exhaustive]
          39  +
pub struct ListAsyncInvokesOutputBuilder {
          40  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
          41  +
    pub(crate) async_invoke_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AsyncInvokeSummary>>,
          42  +
    _request_id: Option<String>,
          43  +
}
          44  +
impl ListAsyncInvokesOutputBuilder {
          45  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          46  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          47  +
        self.next_token = ::std::option::Option::Some(input.into());
          48  +
        self
          49  +
    }
          50  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          51  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          52  +
        self.next_token = input;
          53  +
        self
          54  +
    }
          55  +
    /// <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
          56  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
          57  +
        &self.next_token
          58  +
    }
          59  +
    /// Appends an item to `async_invoke_summaries`.
          60  +
    ///
          61  +
    /// To override the contents of this collection use [`set_async_invoke_summaries`](Self::set_async_invoke_summaries).
          62  +
    ///
          63  +
    /// <p>A list of invocation summaries.</p>
          64  +
    pub fn async_invoke_summaries(mut self, input: crate::types::AsyncInvokeSummary) -> Self {
          65  +
        let mut v = self.async_invoke_summaries.unwrap_or_default();
          66  +
        v.push(input);
          67  +
        self.async_invoke_summaries = ::std::option::Option::Some(v);
          68  +
        self
          69  +
    }
          70  +
    /// <p>A list of invocation summaries.</p>
          71  +
    pub fn set_async_invoke_summaries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AsyncInvokeSummary>>) -> Self {
          72  +
        self.async_invoke_summaries = input;
          73  +
        self
          74  +
    }
          75  +
    /// <p>A list of invocation summaries.</p>
          76  +
    pub fn get_async_invoke_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AsyncInvokeSummary>> {
          77  +
        &self.async_invoke_summaries
          78  +
    }
          79  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
          80  +
        self._request_id = Some(request_id.into());
          81  +
        self
          82  +
    }
          83  +
          84  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
          85  +
        self._request_id = request_id;
          86  +
        self
          87  +
    }
          88  +
    /// Consumes the builder and constructs a [`ListAsyncInvokesOutput`](crate::operation::list_async_invokes::ListAsyncInvokesOutput).
          89  +
    pub fn build(self) -> crate::operation::list_async_invokes::ListAsyncInvokesOutput {
          90  +
        crate::operation::list_async_invokes::ListAsyncInvokesOutput {
          91  +
            next_token: self.next_token,
          92  +
            async_invoke_summaries: self.async_invoke_summaries,
          93  +
            _request_id: self._request_id,
          94  +
        }
          95  +
    }
          96  +
}