AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a

Files changed:

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

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

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

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

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

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

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

@@ -1,1 +63,60 @@
   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 streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p>
          27  +
/// <p>The CLI doesn't support <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><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>
          30  +
/// <p>This operation requires permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
   34     31   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   35     32   
pub struct InvokeModelWithResponseStreamFluentBuilder {
   36     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   37     34   
    inner: crate::operation::invoke_model_with_response_stream::builders::InvokeModelWithResponseStreamInputBuilder,
   38     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   39     36   
}
   40     37   
impl
   41     38   
    crate::client::customize::internal::CustomizableSend<
   42     39   
        crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamOutput,
   43     40   
        crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError,
@@ -89,86 +239,224 @@
  109    106   
    }
  110    107   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  111    108   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  112    109   
        self
  113    110   
    }
  114    111   
  115    112   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  116    113   
        self.config_override = config_override;
  117    114   
        self
  118    115   
    }
  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>
         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>
  120    117   
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
  121    118   
        self.inner = self.inner.body(input);
  122    119   
        self
  123    120   
    }
  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>
         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>
  125    122   
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  126    123   
        self.inner = self.inner.set_body(input);
  127    124   
        self
  128    125   
    }
  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>
         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>
  130    127   
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  131    128   
        self.inner.get_body()
  132    129   
    }
  133         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         130  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  134    131   
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  135    132   
        self.inner = self.inner.content_type(input.into());
  136    133   
        self
  137    134   
    }
  138         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         135  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  139    136   
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  140    137   
        self.inner = self.inner.set_content_type(input);
  141    138   
        self
  142    139   
    }
  143         -
    /// <p>The MIME type of the input data in the request. You must specify <code>application/json</code>.</p>
         140  +
    /// <p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>
  144    141   
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
  145    142   
        self.inner.get_content_type()
  146    143   
    }
  147    144   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  148    145   
    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  149    146   
        self.inner = self.inner.accept(input.into());
  150    147   
        self
  151    148   
    }
  152    149   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  153    150   
    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  154    151   
        self.inner = self.inner.set_accept(input);
  155    152   
        self
  156    153   
    }
  157    154   
    /// <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
  158    155   
    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
  159    156   
        self.inner.get_accept()
  160    157   
    }
  161    158   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  162         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         159  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  163    160   
    /// <ul>
  164    161   
    /// <li>
  165    162   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  166    163   
    /// <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>
  169    164   
    /// <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    165   
    /// <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>
         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>
  174    167   
    /// </ul>
  175    168   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  176    169   
        self.inner = self.inner.model_id(input.into());
  177    170   
        self
  178    171   
    }
  179    172   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  180         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         173  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  181    174   
    /// <ul>
  182    175   
    /// <li>
  183    176   
    /// <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>
  184    177   
    /// <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>
  187    178   
    /// <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>
  188    179   
    /// <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>
         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>
  192    181   
    /// </ul>
  193    182   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  194    183   
        self.inner = self.inner.set_model_id(input);
  195    184   
        self
  196    185   
    }
  197    186   
    /// <p>The unique identifier of the model to invoke to run inference.</p>
  198         -
    /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
         187  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  199    188   
    /// <ul>
  200    189   
    /// <li>
  201    190   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  202    191   
    /// <li>
  203         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  204         -
    /// <li>
  205    192   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  206    193   
    /// <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>
         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>
  210    195   
    /// </ul>
  211    196   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  212    197   
        self.inner.get_model_id()
  213    198   
    }
  214    199   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
  215    200   
    pub fn trace(mut self, input: crate::types::Trace) -> Self {
  216    201   
        self.inner = self.inner.trace(input);
  217    202   
        self
  218    203   
    }
  219    204   
    /// <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
@@ -253,238 +297,268 @@
  273    258   
    }
  274    259   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  275    260   
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  276    261   
        self.inner = self.inner.set_guardrail_version(input);
  277    262   
        self
  278    263   
    }
  279    264   
    /// <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
  280    265   
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  281    266   
        self.inner.get_guardrail_version()
  282    267   
    }
  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         -
    }
  297    268   
}

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

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

@@ -1,0 +183,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::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

@@ -1,0 +96,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::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         -
}